cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an error in the ST middleware pid_regulator.c, specifically PI_Controller() ?

BTrem.1
Senior II

The function PI_Controller() implements PI control but there seems to be an error in the final output with the wDischarge term. This term is calculated at the very output as the anticipated amount the output exceeds the output limit's. The intent is to reduce the integrator by this amount but the code does not account for the Ki divisor, pHandle->hKiDivisorPOW2. Without this the value applied to the integrator is too small.

1 REPLY 1
Laurent Ca...
Lead II

Dear @BTrem.1​ 

Welcome to the STM32 Community

Could you give more details to the STM32 Community about your setup -the material you use- ?

(HW and SW, CPU(s), tools and versions, board(s), motor(s) and so on)

And more especially did you use STM32 MC tools (such as MC_suite, STM32 MC Motor Profile, STM32 MC SDK, STM32 MC Workbench, and so on)?

Best regards

Laurent Ca...