cancel
Showing results for 
Search instead for 
Did you mean: 

PID PROBLEM IN CONTROLLER STM 32

deepak
Associate II
Posted on August 21, 2014 at 10:02

Hi,

i am facing problem for the PiD controller.

what parameter i have to use it for the positive & negative nos for calculation purpose.

Kindly look following code 

New_Duty_cycle_buck=(Previous_Duty_cycle_buck + Error_Duty_cycle_buck);

where ''Error_Duty_cycle_buck'' can be positive or negative.

it is for the updating a new duty cycle.

in declaration part,

double Error_Duty_cycle_buck=0;

 

i declare like this.

but my pid loop not working correctly.

pls help

Look forward to hearing you soon.

#stm32f4 #discovery
2 REPLIES 2
frankmeyer9
Associate II
Posted on August 21, 2014 at 16:50

New_Duty_cycle_buck=(Previous_Duty_cycle_buck + Error_Duty_cycle_buck);

 

That is more of a P controller algorithm with kP=1, and not PID.

...but my pid loop not working correctly.

 

Hard to judge, you did not present any 'pid loop' code.

Posted on August 21, 2014 at 18:54

Not very good at explaining problems. [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Problem%20in%20duty%20cycle&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=38]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FProblem%20in%20duty%20cycle&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=38

Do the math, print out the results to the console, and also try with PC based C code emulating the loop and the values you expect to read. Once you have modeled it correctly apply it to hardware, and the value read there.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..