sample code for PID controller

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

sample code for PID controller

跳至解决方案
6,941 次查看
koka
Contributor I
hello everyone.
i'm working on MC9S08QD2 8-bit and 8-pin microcontroller, so i have to implement PID control for output current in my application. so can anyone tell me how to calculate Kp,Ki and Kd values. and if anyone provide me the sample code for PID control, i wll be so much thankfull. and also if any application notes and reference for PID for this microcontroller is there , please send the link , i will download.

so if anyone know please send me as early as possible.
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
2,265 次查看
Kopone
Contributor IV

Hi,

 

there are plenty of application notes out there on how to implement PID compensation.

E.g. Freescale offers AN1215 for download. Get it here

For more, just use Google.

If you really want to calculate Kp, Ki, Kd, you need to get into control theory, set up the closed loop equation for your particular application (which implies having a suitable model of the response characteristic of each component), define your requirements for speed, accuracy and stability range of your control and then go from there.

You might be better off  by simply setting up a lab experiment and find suitable values by trial and error. Start with P (keep D and I set to zero first).

 

Regards,

 Sven

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,266 次查看
Kopone
Contributor IV

Hi,

 

there are plenty of application notes out there on how to implement PID compensation.

E.g. Freescale offers AN1215 for download. Get it here

For more, just use Google.

If you really want to calculate Kp, Ki, Kd, you need to get into control theory, set up the closed loop equation for your particular application (which implies having a suitable model of the response characteristic of each component), define your requirements for speed, accuracy and stability range of your control and then go from there.

You might be better off  by simply setting up a lab experiment and find suitable values by trial and error. Start with P (keep D and I set to zero first).

 

Regards,

 Sven

0 项奖励
回复
2,265 次查看
Thyristercontro
Contributor I

Hello Sir,

 

i am using MCF51CN128 microcontroller.

i want ot impliment PID controller using this microcontroller.

my feedback is current (DC) and using is current i vl control voltage. do you have any idea? please tell me

0 项奖励
回复