Skip to main content
BTrem.1
Senior
May 16, 2021
Question

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

  • May 16, 2021
  • 1 reply
  • 564 views

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.

This topic has been closed for replies.

1 reply

Laurent Ca...
Senior III
May 28, 2021

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...