-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW SKETCH]: 4A9A1-THROTTLE_CONTROLLER.ino #101
base: develop
Are you sure you want to change the base?
[NEW SKETCH]: 4A9A1-THROTTLE_CONTROLLER.ino #101
Conversation
This is including a 3rd part product. also the actual code for the MT6935 must be extracted, this is including the entire driver based of SimpleFOC into OH by these includes this basically pulls in all of SimpleFOC into the throttle code then doesn't use it. Joystick.setRxAxisRange(0, 2048); // Outboard Throttle Arm temp = outboardThrottle.readRawAngle21(); // read outboard hall sensor why are we using 11 bits of the MT6835 when its a 21bit HAL sensor (internally) code could be simpllied using and change to 16bit resolution **Can we please stop using arrays when basic calls would be clearer. ** we're defining REVERSE_EXT_LTS to handing a miswriting by the coder but don't do this for all switches missing documentation on protocol used to talk to the inner grip PCB. |
temp = outboardThrottle.readRawAngle21(); // read outboard hall sensor we read the 21bit value then map it to 11 bits??? why are we using 11 bits of the MT6835 when its a 21bit HAL sensor (internally) A: That was from lots of testing...but revisited. The Arduino map function was rolling over its mapped output values at 2,800. Don't know why since the map function was using longs. It should have more than enough headroom for these numbers. Re-wrote the map function for the Hall Sensors to use
A: Removed arrays, changed to just a series of reads and wire writes. The controller wire reads stayed in a while loop to facilitate stepping through the inner grip values. Added defines for the index values based on inner grip control name. Refactored to a switch statement on
A: Removed REVERSE_EXT_LTS logic.
A: added additional comments. Error checking added to a TODO. |
Thanks for the updates |
I sort of envisioned us creating a library (that may be useful to other projects) just for these hall sensors. Maybe that would consist of the cut-down simpleFOC code? (See #8 ) |
It would be nice to have our own small library for the hall sensors. But if I'm being honest, it is beyond me unless I start lifting code from Simple FOC. I've spent a lot of time playing with the various raw reads, mapped values, and final joystick values getting passed to Windows. It is not at all straightforward to trouble shoot which step is causing the challenges I saw. I also see slight numeric differences in values, not only between the throttles, but also from test to test with the same throttle arm. It will be interesting to have others share their results on the hall sensors. My hunch is there are going to be differences in sensor values between users. |
Yes, that's been my intent, no so much extracting their code but understanding to make our own. |
Do we want to hold on this until that little lib is complete? What sort of ETA could we expect on it @kbastronomics? |
Trying to fix the CI compile issue with for the SPI.h include on SimpleFOC.
This reverts commit a83a43c.
This reverts commit 819c123.
…//github.com/Arribe/OpenHornet-Software into feature-new_sketch-4A9A1-THROTTLE_CONTROLLER
This reverts commit cb70eba.
…mpleFOC" This reverts commit b3bd712.
Up to the group on what to do with it. Can't get it to compile on the CI. Though likely most people will download the files, install the libraries and then compile locally for an upload to their controller. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However we do it, unfortunately we will need it to pass CI, otherwise the entire repo will fail every CI check moving forward. CI is there to protect us and give us a little extra confidence in our software.
Failure Log:
4A9A1-THROTTLE_CONTROLLER.ino.cpp
MT6835.cpp
/home/runner/work/OpenHornet-Software/OpenHornet-Software/embedded/OH4_Left_Console/4A9A1-THROTTLE_CONTROLLER/build/4A9A1-THROTTLE_CONTROLLER.ino.cpp:93:10: fatal error: Wire.h: No such file or directory
93 | #include <Wire.h>
| ^~~~~~~~
compilation terminated.
make[1]: *** [/home/runner/work/OpenHornet-Software/OpenHornet-Software/include/makeEspArduino/makeEspArduino.mk:308: build/4A9A1-THROTTLE_CONTROLLER.ino.cpp.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /home/runner/work/OpenHornet-Software/OpenHornet-Software/libraries/Arduino-FOC-drivers/src/encoders/mt6835/MT6835.cpp:2:
/home/runner/work/OpenHornet-Software/OpenHornet-Software/libraries/Arduino-FOC-drivers/src/encoders/mt6835/./MT6835.h:8:10: fatal error: SPI.h: No such file or directory
8 | #include "SPI.h"
| ^~~~~~~
compilation terminated.
make[1]: *** [/home/runner/work/OpenHornet-Software/OpenHornet-Software/include/makeEspArduino/makeEspArduino.mk:307: build/MT6835.cpp.o] Error 1
make[1]: Leaving directory '/home/runner/work/OpenHornet-Software/OpenHornet-Software/embedded/OH4_Left_Console/4A9A1-THROTTLE_CONTROLLER'
make: *** [Makefile:11: OH4_Left_Console/4A9A1-THROTTLE_CONTROLLER/] Error 2
Error: Process completed with exit code 2.
ESP32 is failing to compile even though the Wire and SPI libraries are part of the base https://github.com/espressif/arduino-esp32 repository. I've added notes to Bug #102 with some testing I've done. |
CI still doesn't work.
ESP32 doesn’t compile via the CI/CD. Closing so someone else can fix it. |
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Closes #51
Dependencies
Type of change
Checklist:
How Has This Been Tested?
Description of Testing
Generally the throttle is working as a joystick in Windows and DCS when controls are mapped, like any other commercial throttle.
The solenoids are not turning off, and are always on. Even when a simple test code of always setting the signal pin to LOW.
Test Configuration