Hello,
I have a project, I am trying to stabilize a platfrom with BLDC motor.
I use 19bits encoder and also IMU for stabilization.
My PWM frequency is 20kHz. LoopFOC is working at 10kHz and I don’t use motiondown_sample function.
I am gathering the IMU data as an angle and give it to Position loop as an input. IMU sample rate is 2500Hz.
I have a test bench. When I move platform in a certain speed and angle, I see the system reaction via Laser Pointer, so I can observe the system.
If I use default PID parameters, torque is too low and also motion reaction is not good. When I decrease the Velocity PID and increase position PID very high, I get much better performance. PID is below like:
Position PID:
P = 1400
I = 1400
D = 3.3
Ramp = 0
Limit= 0
LPF=0
Velocity PID:
P = 0.2
I =10
D =0
Ramp = 0
Limit= 0
LPF=0.01
I am trying to increase position PID higher to get better performance but when I do that, I see unstable control. Motor starts to shake and turn randomly at very high speed. When I increase speed loop, it’s same. Because cascade PID both affect so much.
First, I know this PID values are not normal but even that level, performance is not good. What should I do? I think it’s kind of bandwidth problem but I don’t know how can I solve it.
Any idea?
Dont know how you have setup your code, but while keeping the position pid smaller, try increasing the current_limit. If you have not setup phase_resistance, then increase .voltage_limit. Watch current consumption or at least overheating.
If you have set up phase resistance, then you must increase current_limit, which you can also do dynamically. If you are using the full motor commander interface in serial monitor, in angle control mode, try a command like “M0 30 50”, this will try to go/stay at a position of 0 rads, if needed go up to 30 rads per second, using a max current of 50a. Try it and see if it gives a better response that the default.