Go Down

### Topic: PID control of BLDC with heavy inertia load (Read 273 times)previous topic - next topic

#### mekanizumu

##### Apr 24, 2018, 10:14 am
The PID output can be positive and negative, and all simple PID code i can find just uses the sign of the PID output to determine the motor direction like this:
If output >= 0
dir = 1
else
dir = -1

then set the direction of the motor.

But if the motor is spinning fast with heavy load, changing direction like this could damage the motor. So a possible solution is to apply electric braking to the motor till it slow down considerably, then apply the direction change.

However, this type of behavior is totally different from the standard PID control model, so it's like being out of tune with the PID theory, and I'm left in the dark to tune those parameters.

#### PaulS

#1
##### Apr 24, 2018, 01:23 pm
Quote
I wonder isn't this a big problem worth talking about?
Personally, I don't think so.

You have some undefined setpoint that you are trying to make some undefined system meet, using some undefined measurement to determine how close you are to the target.

Some specifics are really in order.

The only time you need to switch the direction is when the actual value has one sign and the setpoint has the other sign. The direction does NOT necessarily refer to the direction of rotation of the motor.

Suppose that the setpoint is 3000 RPM, and the measured value is 3020 RPM. The error value will be -20, but that does NOT mean spin the motor 20 RPM the other way. It means slowing the motor down a little bit. If the measured value is 2980 RPM, the error value will be +20, which means speeding the motor up a little bit.

#2