giovaniluigi
New Member
Hi everyone,
I'm trying to control a BLDC motor with 6-step commutation sequence.
The motor in question is a Maxon EC22 100W with 24:1 gearhead.
I'm using a PIC 18f2431 8bits MCU to control the bridge with PWM.
The goal is to keep continuous speed with heavy changes on load.
The performance is too bad even using a PID controller.
I actually have turned off the "D" controller, because it generates oscillations around setpoint.
The biggest problem is about deceleration when load is removed.
PWM duty stays high generating high speed.
PID is slow to react into this condition for example.
Here are my tests steps:
Start the motor and wait stable RPM.
When the system is stable, I insert a load.
The PWM is increased.
It takes about 2 seconds to stop increasing, then it is stable.
I keep the load and the system remains stable.
When I remove the load the motor starts to rotate in a very high speed due to the PWM duty.
The PI needs about 3 seconds to stabilize the speed again.
During this time, the PWM duty is slowly decreased till reach almost zero, then it increases back to the setpoint.
Well, probably you could say that I need to increase I constant or change the P constant.
The problem is that they seems to be in limit.
But system remains slow.
This is my PID:
error[0] = setSpeed - motorSpeed
integral = integral + error[0]
PID = Kp*error[0] + Ki*integral
I did some tricks to avoid floating point because I'm dealing with 8-bit MCU.
My constants are:
Kp = 5
Ki = 7
Now, for example, I can change Kp to 7.
Almost nothing changes.
Then I change Kp to 10.
The system becames unstable in all conditions.
Oscillations happens around setpoint even without load.
Ki = 7 makes the system take 3 seconds to stabilize.
Increasing Ki from 7 to 10 creates big overshoots.
The system also becomes unstable even without loads, having random overshoots around SP.
Also, it takes more time to reach SP.
Enabling "D"...
The system becomes slower and very unstable around SP.
Small overshoots happens in around SP.
But at least the BIG overshoots are reduced considerably.
The PID reference is the speed from hall sensors.
To reach a good performance system I think that current measurement should be used also.
I have used a shunt resistor to read current with A/D port.
The problem is that I don't know the best way to insert current measurement in PID speed controller. I have read documents in internet showing cascade loops. Where speed generates a current setpoint, then another loop corrects the system MV using current error. I didn't understood how to generate a current reference from speed controller. So if someone could help me to make this controller work better, I will apreciate.
Please!
Thank you in advance.
I'm trying to control a BLDC motor with 6-step commutation sequence.
The motor in question is a Maxon EC22 100W with 24:1 gearhead.
I'm using a PIC 18f2431 8bits MCU to control the bridge with PWM.
The goal is to keep continuous speed with heavy changes on load.
The performance is too bad even using a PID controller.
I actually have turned off the "D" controller, because it generates oscillations around setpoint.
The biggest problem is about deceleration when load is removed.
PWM duty stays high generating high speed.
PID is slow to react into this condition for example.
Here are my tests steps:
Start the motor and wait stable RPM.
When the system is stable, I insert a load.
The PWM is increased.
It takes about 2 seconds to stop increasing, then it is stable.
I keep the load and the system remains stable.
When I remove the load the motor starts to rotate in a very high speed due to the PWM duty.
The PI needs about 3 seconds to stabilize the speed again.
During this time, the PWM duty is slowly decreased till reach almost zero, then it increases back to the setpoint.
Well, probably you could say that I need to increase I constant or change the P constant.
The problem is that they seems to be in limit.
But system remains slow.
This is my PID:
error[0] = setSpeed - motorSpeed
integral = integral + error[0]
PID = Kp*error[0] + Ki*integral
I did some tricks to avoid floating point because I'm dealing with 8-bit MCU.
My constants are:
Kp = 5
Ki = 7
Now, for example, I can change Kp to 7.
Almost nothing changes.
Then I change Kp to 10.
The system becames unstable in all conditions.
Oscillations happens around setpoint even without load.
Ki = 7 makes the system take 3 seconds to stabilize.
Increasing Ki from 7 to 10 creates big overshoots.
The system also becomes unstable even without loads, having random overshoots around SP.
Also, it takes more time to reach SP.
Enabling "D"...
The system becomes slower and very unstable around SP.
Small overshoots happens in around SP.
But at least the BIG overshoots are reduced considerably.
The PID reference is the speed from hall sensors.
To reach a good performance system I think that current measurement should be used also.
I have used a shunt resistor to read current with A/D port.
The problem is that I don't know the best way to insert current measurement in PID speed controller. I have read documents in internet showing cascade loops. Where speed generates a current setpoint, then another loop corrects the system MV using current error. I didn't understood how to generate a current reference from speed controller. So if someone could help me to make this controller work better, I will apreciate.
Please!
Thank you in advance.