CMSIS-DSP PID help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-03 6:05 PM - edited ‎2024-01-03 6:10 PM
I'm using the stm32f429 discovery, I made a PWM control and tested it with a potentiometer and it worked as expected with 1mhz. Now I need to do the temperature control, I'm using a MAX31865 with PT100 and heating a resistance with the PWM output (this part is working very well) now for the PID it's not working right, I'm using:
I made a video to show how the PID is behaving:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-04 4:53 AM
Hi.
I suspect that the controller is just not tuned correctly and there is wind-up condition happening.
Look up Integral windup and anti-windup techniques.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-05 2:30 PM
I did other tests but instead of the PWM value of 1000 for 4096
based on the test I did and because it blows the scale
The PidOut variable is a float, so the maximum value of the float is: 3.402823466 E + 38 and the minimum value will be -3.402823466 E + 38
When the setpoint temperature reaches the PidOut variable, it reaches a value much higher than 4096 (500x higher) because it is a float, then it starts to decrease the value but takes a while to reach below 4096
(it takes a long time to reach the duty value)
Video showing:
With this, there would be some way to edit the maximum and minimum value of PidOut = arm_pid_f32(&PID, pid_error); specifically the arm_pid_f32 function
With this, there would be some way to edit the maximum and minimum value of PidOut = arm_pid_f32(&PID, pid_error); specifically the arm_pid_f32 function
I can also use arm_pid_q31 and create a MAP (https://deepbluembedded.com/map-function-embedded-c/)
but I couldn't get arm_pid_q31 to work even transforming all values into int
