I just started testing SimpleFOC shield 2.03 with Arduino Due.
It works in velocity close loop mode but I have some issues:
There is an offset between target velocity and the actual RPM
I have hard time adjusting the PID
— It does control - keeping up ± 2 Hz on the hall sensors. I was expecting more stable RPM.
— I can not get the max RPM of the motor -
SimpleFOC shield 2.03
Motor: 4 pole pairs, 3 Hall sensors, 3.2ohm phase to phase, 12V power
Load: no load except a comparatively light encoder wheel
Code: I started it with the Velocity motion control sample and i modified it to enable the current sensing and to be able to change the target and PID parameters from the serial interface.
Nice! I’m interested to hear your thoughts!
But still I’d suggest you to make sure your velocity and angle control works well before using the current control.
Your low pass filter seems a bit too low in my opinion. I’d expect it to be in a range of 0.005-0.02s.
I’m having rouble understanding the difference in between different numbers in your post.
What are hertz? Is it rotation per second or interrupt per second?
Did you use your encoder for foc or just as an additional mesurement?
340 rad/sec is around 340rad/s*60/6.28= ~3300rpm.
Could you detail a bit more the data so we can dig into the problem better!
P.s. thanks for the example typo errors I’ll update the code for the next release
I followed the suggested steps - test the sensors, poles…, open loop and then velocity control.
I don’t understand yet how to use current control. Looking at the examples i added to the velocity control example:
current_sense.init(); // initialise the current sensing
current_sense.gain_b *= -1; // for SimpleFOCShield v2.01/v2.0.2
motor.linkCurrentSense(¤t_sense); // link the current sense to the motor
But i don’t understand how to use the following for velocity control:
motor.torque_controller = TorqueControlType::foc_current;
and the current PID settings.
The 2 test results were both with hall sensors as foc sensor.
The first group is using one of the hall sensor pins to check the frequency on the scope.
The second group is using an independent (on the motor shaft) 10 slots wheel optical sensor.
The Hz are the readings on the scope at different target velocities.
looks like i miscalculated the conversion. I must have been at max RPM of the motor. This explains why i could not ho higher - thanks!