I can't wrap my head around the current situation - do you have an idea? FOC with Hall Sensor, LRP Dynamic 8 1600kv Inrunner motor.
I have set KI and KD to zero for positional control and KP to the lowest value possible 0.001. With that the motor is not moving but its holding force is low. But as soon as I increase the values just a little, it start to vibrate significantly. With KD the expected high frequency movement, with KP a low frequency but high amplitude. And when I set KP and KI to 0.001 it holds fine but when turning the motor manually over 30° it starts to spin at max speed.
At the moment I am lost. How should positional control even work with a PID loop when the Hall Sensor resolution is so low?
From the Vesc Tool, how do I use
COMM_SET_POS
versus
COMM_SET_SERVO_POS
?
The first is the angle setting in the control box left bottom, isn't it? But how do I use the second?
Or in other words, would it work to send the RPM Speed of zero and then use the servo pos command to hold the position until a speed command is sent again? To simulate a solid handbrake?
The SET_SERVO_POS command is for setting the position of a PWM controlled RC servo with the servo_out firmware. The SET_POS command should work for holding a position as a handbrake.
Okay. But then I can't get the Positional PID to work, as said.
I assume I found the answer in the code: No encoder - no FOC position control. Makes sense.
https://github.com/vedderb/bldc/blob/master/mcpwm_foc.c