Maker Pro
Maker Pro

PID Corretion to PWM

Dave Benemerito

Sep 26, 2015
24
Joined
Sep 26, 2015
Messages
24
Hi!
I just got the concept and implementation of PID control loop. Right now, I'm having a problem how to turn PID corrections into PWM for ESC in a quadcopter. Thanks in advance for the awesome replies! :)
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
PID control correction usually requires the need for a processor of some kind and some kind of feedback device or method.
M,
 

Dave Benemerito

Sep 26, 2015
24
Joined
Sep 26, 2015
Messages
24
PID control correction usually requires the need for a processor of some kind and some kind of feedback device or method.
M,
Oh yeah.. But how can I turn these corrections into PWM that such ESC's can understand? Thanks.
 

Doug3004

Sep 5, 2014
119
Joined
Sep 5, 2014
Messages
119
Well,,,,, you already have an indirect control loop in a quadcopter because the flight controller gets rotation signals from the gyro chip, and then the flight controller adjusts the motor ESCs as necessary. Even if the ESCs were not totally accurate, any positional inaccuracy (caused by the ESC's) that the gyro chip could detect would be accounted for anyway.

By the by--RC-style servos don't really offer the ability to perform true feedback, since their angular detection signals are not available as outputs. A CNC-style servo is built quite different: it is [a motor] coupled to [a positional encoder], and at any time the microprocessor can request the motor's exact position. So you can program microprocessor code to react differently based on how far the CNC servo currently is from its desired position. Some RC flight controllers do allow you to adjust control parameters like these, but it's just a high/medium/low speed setting rather than an actual formula you get to use.

RC servos aren't real precise anyway, for two reasons.
1--they use an analog potentiometer for positional sensing, and-
2--they use PWM for positional control (or rotational speed, for a 360 servo) which only allows 255 different control level intervals at the most.

RC-style servos are made for RC toys and they work well for that, but due to their design limitations they're not really used for other CNC machinery.

~~~~~~~~~

And RC brushless motors (that have only 3 wires) don't work real well either,,,, compared to "industrial-style" BLDC brushless motors. RC-style brushless motors rely on motor winding feedback for speed regulation, and it works well enough for RC toys but it doesn't work real well for industrial use. They have trouble starting up at a consistent low speed, and many have trouble maintaining a consistent speed even when the throttle setting and the motor's load is stationary. Once again: they are cheap and light-weight and they work well enough for RC toys, but they're not technically perfect.

BLDC motors typically have at least 7 wires: 3 wires for the three motor windings, 3 wires for three hall sensors, and a common ground wire. Even a typical cheap China-made BLDC motor+controller will start very consistently at a very low speed, and will rotate at a very consistent speed no matter where you put it across its range, or how you load or unload it while it's running.
 
Top