-
Notifications
You must be signed in to change notification settings - Fork 5
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
I2C interfering with SimpleFOC ? #11
Comments
This function in
If i comment the last line
Don't understand how the hardware i2c can block the SimpleFOC. As you @Candas1 like that SimpleFOC::I2CCommander, will you test this soon ? I do not like that stupid non-oo code which will again increase the overall binary.. |
More respect please. Some of the people that worked on this might end up reading this. |
short answer: WWTDD (What would Tyler Durden do) I fear the stuttering again is a interrupt priority issue. But decreasing the I2C interrupt priorities has only little effect:
So i am not sure that the stuttering comes from the HallSensor callbacks not getting called immediately. Here some log data:
With the new NVIC priorities, the hall sensor times get equal spaced again:
But with heavy stuttering, these distance would also become ugly.
So getting nice time delays again might only show that the higher priority of my IrqMotor at least made the motor running smoother (less stuttering) again. But when i pull the usb cable from my notebook that powers the ESP32, the motor gets super smooth again :-/ Ideas welcome ! |
Okay i had the
Now my IrqMotor is again spinning nicely with I2c communication running :-) Next step is finding a future-proof I2c protocol and publish a demo arduino .ino file to spin the motors forward and backwards. |
Now ESP32 is controlling via I2C:
https://github.com/RoboDurden/Split_Hoverboard_SimpleFOC/blob/main/src/PilotI2c.cpp#L81 I have defined 3 structs for communication:
So there can be future commands to set the battery voltage or 2-value commands to set speed+steer Problem still is that when the ESP is restarted, Hoverboard must also restart otherwise the I2C communication hangs. I am going to continue this issue on my https://github.com/RoboDurden/Split_Hoverboard_SimpleFOC/issues Ideas welcome. |
No it has nothing to do with the robotic project. Now any developer can use my work and build whatever firmware he wants. I spent enough time supporting a firmware. The next version of SimpleFOC is supposed to go out any time soon. I want to include all the latest fixes when I deploy to the main branch. I haven't touched the GD32 branch in a while as it's only for the drivers, and I don't have feedback about the arduino-gd32 issues. If I add new features to Simplefoc, I will do it first on stm32, then only I will add it to the GD32 dev branch. |
Yes i am happy if you stay focused on the SimpleFOC libray ! Have you made some critical updates to the GD-Ardruino-Core that is not going to be merged ?
?? |
The only work pending there on the drivers is depending on the fixes from the arduino-gd32 project. |
The latest SimpleFOC changes were just released to their Master branch. I haven't updating this repository yet, I don't think anybody is using it. |
Great, thank you. |
Okay i added my I2C-Client code to my Split_Hoverboard_SimpleFOC and it runs :-)
But the motor now heavily stutters :-(
I guess the SimpleFOC::I2CCommander has not yet been tested with the GD32-Arduino Core ?
Will investigate the next days. @Candas1 if this does not interest you this might be an Issue for my repo and @robcazzaro might like to also contribute to the final step of making a user friendly hoverboard firmware.
https://github.com/RoboDurden/Split_Hoverboard_SimpleFOC/blob/main/include/Pilot.h
https://github.com/RoboDurden/Split_Hoverboard_SimpleFOC/blob/main/src/PilotI2c.cpp
main.cpp
The text was updated successfully, but these errors were encountered: