I am having trouble getting my PID controller to be accurate over a range of values. My goal is to input a duty cycle for a PWM wave, which controls the speed of a fan rotor. The range of possible speeds should be 300RPM to 2700RPM.
Currently the PID controller is achieving accurate speeds when 800 to 1600 RPM is requested, but below those speeds the output is too high, and above those speeds the output is too low. I think this may be because the relationship between duty cycle and rotor speed is not entirely linear.
Here is our current PID equation: duty_cycle = [ speedset + control + 735] / 4300 Speedset is the requested speed, control is the PID control variable, and the constants are from the equation that we found to be mostly accurate for linking duty cycle with output speed (it is however a linear equation, and was not entirely accurate for extremely low and high data points).
The control variable is: control = 0.104*error + 0.104*previous_error + 0.13*next_error
This is my first time working with PID, so please correct me on anything I am doing wrong. Does anyone have any advice for how I might improve the accuracy of the system at very low and very high speeds?
-
\$\begingroup\$ What is your error signal? (what is it's definition: speed - speedset?) \$\endgroup\$Andrew Spott– Andrew Spott2016年09月15日 22:16:12 +00:00Commented Sep 15, 2016 at 22:16
-
\$\begingroup\$ Could you provide a control block diagram? Have you tried running it open loop with no load? \$\endgroup\$Voltage Spike– Voltage Spike ♦2016年09月15日 22:25:26 +00:00Commented Sep 15, 2016 at 22:25
-
\$\begingroup\$ error = requested speed - actual speed. I can draw up a code block diagram a bit later when I have time, at a group meeting right now. What do you mean with no load? Without the rotor? \$\endgroup\$The Impossible Squish– The Impossible Squish2016年09月15日 22:25:34 +00:00Commented Sep 15, 2016 at 22:25
-
\$\begingroup\$ Provide a block diagram with all the elements in your system \$\endgroup\$Voltage Spike– Voltage Spike ♦2016年09月15日 22:26:40 +00:00Commented Sep 15, 2016 at 22:26
-
\$\begingroup\$ I've added in the block diagram one of my group members created :) \$\endgroup\$The Impossible Squish– The Impossible Squish2016年09月15日 22:31:01 +00:00Commented Sep 15, 2016 at 22:31
1 Answer 1
Thanks for your help, everyone. I believe I have found and answer by simply adding a conditional that can identify different operating regions (low speed, medium speed and high speed) and uses a different PID equation for each. This has solved the problem.