We have to do a regulation loop for an universal motor within a ST7. The motor is driven controlled by a PWM signal and for feedback we have a tacho signal.
Does anybody already have developed a PID-regulation SW (or something similar) in C-language which could be shared with us? Thanks a lot! Rolf
I have a draft of PI control routine write in C language but unfortunately the documentation regarding this routine is not yet available. I think it's better to wait for a full debug soft before to send this one to you. So at the beginning of next year, it could be possible for me to release this routine. If, in the meanwhile, I found another routine already tested and functioning I will let you know. Regards, Tanio
I have an idea about to implement PI controller closed loop regulation. I need the assembly code to implement.i hope it will use to implement the PID controller please send it to my address
houtput_32 = (wProportional_Term/PID_Struct->hKp_Divisor+ PID_Struct->wIntegral/PID_Struct->hKi_Divisor); #endif if (houtput_32 >= PID_Struct->hUpper_Limit_Output) { return(PID_Struct->hUpper_Limit_Output); } else if (houtput_32 < PID_Struct->hLower_Limit_Output) { return(PID_Struct->hLower_Limit_Output); } else { return((s16)(houtput_32)); } } with typedef struct { s16 hKp_Gain; u16 hKp_Divisor; s16 hKi_Gain; u16 hKi_Divisor; s16 hLower_Limit_Output; //Lower Limit for Output limitation s16 hUpper_Limit_Output; //Lower Limit for Output limitation s32 wLower_Limit_Integral; //Lower Limit for Integral term limitation s32 wUpper_Limit_Integral; //Lower Limit for Integral term limitation s32 wIntegral; // Actually used only if DIFFERENTIAL_TERM_ENABLED is enabled in //stm32f10x_MCconf.h s16 hKd_Gain; u16 hKd_Divisor; s32 wPreviousError; } PID_Struct_t; I let you find something smarter to avoid using 64 bit variable ;) Ciao, Billino