PID Theory and Practice Part 3, P,I,PI Control of Speed

preview_player
Показать описание
Overview of PID controllers starting with basic definitions through using PI / PD controllers for controlling a (simulated) DC motor

Part 1
Definitions, basic terms

Part 2
Simple DC motor model

Part 3
P, I, and PI control of motor velocity

Part 4
Practical considerations
Simple tuning rules

Part 5
PI, PD, and PID control of motor position

Psuedo Code for a PID controller - Typically only the P and I parts or P and D parts would be used.

Const F32 P_Gain = 1; // Gain for proportional controller
Const F32 I_Gain = .1; // Gain for integral controller
Const F32 D_Gain = .01 // Gain for derivative controller
Const F32 Filter_Const = .25 // Filter constant for filtering input to derivative controller
// minimum value = 0, maximum value = 1
F32 P_Control; // output of proportional controller
F32 I_Control; // output of integral controller
F32 D_Control; // output of integral controller
F32 Filter_Out; // output of filter
F32 Filter_Out_Prev // previous output of thefilter - use to get delta change
Const F32 Target_Value = 100; // target set point for controller
F32 Measured_Value; // measured plant output
F32 Error_Value; // difference between desired and measured plant output.
F32 PID_Out; // final controller output value
F32 Loop_Time // time for one control loop - could be a constant or a measured value

Measured_Value = input(); // get A/D reading -- convert units if necessary
Error_Value = Target_Value -- Measured_Value;

P_Control = P_Gain * Error_Value;

I_Control = I_Control + I_Gain * Error_Value * Loop_Time; // integrate error * gain*delta time
// If you leave out the loop time, you can adjust the gain value to somewhat compensate

Filter_Out_Prev = Filter_Out; // save previous value
Filter_Out = Filter_Const*Error_Value + (1-Filter_Constant)* Filter_Out;
// take a portion of the new input and a portion of the old value to average out over several samples
// simulate a first order exponential filter.
D_Control = D_Gain * (Filter_Out - Filter_Out_Previous) / Loop_Time; // derivative output based on filtered value

PID_Out = P_Control + I_Control + D_Control; // Final output
Рекомендации по теме
Комментарии
Автор

Where are the rest of the videos? These are very enlightening! Great job!

robbievalentine
Автор

How are you planning to control the induction motor?
Changing voltage usually has only a little effect on the speed - the speed is primarily a function of the AC frequency and the number of poles in the motor. Some induction motors are wired to let you select different numbers of poles to have a few specific speeds - otherwise you typically use a variable frequency source. The motor itself is pretty non-linear with the stable and unstable operating areas. I've never modeled one myself.

LightAndSportyGuy
Автор

Thank you for your sharing, quite useful for my project.

zk
Автор

According to the plot at 2:30 the applied step voltage is only 50V, while the target speed is 500RPM. Isnt the input signal supposed to be equal to the desired output?

bilalsarwari
Автор

hello sir, i working on my project to control the speed of induction motor with simple PID contorller only, please help me how make the transfer fuction of induction motor with pid controller

sukhvirmani
Автор

why does error x gain (kp) give you voltage?

piglink
Автор

plzz can u help me, t want PI with AC induction motor on simulink

bellamano