i’m still prototyping with the Flipsky mini FSESC 6.7 coupled with a Flipsky 6354 motor as discussed in my previous topic.
Right now i’ve successfully used the GenericSensor class in order to use a position sensor after a gearbox and i’ve modified the SimpleFOC library to separate the hall sensors (internally placed in the motor) that are used to the velocity loop to the generic sensor that i’m using only in the position control loop. So thank you @runger for the previous suggestions!
Now i’m coming back to the main issue of the controller, that is the “strange” sound of the motor and the spikes of the velocity control. By inspecting the graph of the speed and the motion of the motor, i figure it out that there was probably a problem in the hall sensor interrupt and that an incorrect speed was being reported to the speed control.
In fact, looking at the code, there are a few comments about the handling of false interrupts with some tricks. Then I remembered to have seen a similar problem in this forum and in particular this topic, I tried to substitute in particular the function HallSensor::getVelocity() posted by @Marc_O and in fact the difference is substantial as you can see from the following comparison:
With the modified HallSensor::getVelocity():
Just for reference, i’m using PlatformIO on VSCode and i’ve foud a very useful plugin to plot values coming from the serial that is teleplot that allow me to stay on the same enviroment.
So I wanted to ask you if the problem is known and if there is some workaround in the dev version.