Proportional control calculation

Proportional control calculation

Postby 2lostkiwis » Thu Apr 12, 2012 8:57 am

Hi there,

I'm trying to tune the osPID to control a small electric jewelers furnace. Everything's going fine electrically, I can control the osPID using the front end. To start with I thought I would just implement a proportional only controller, I used the following settings:
kp=2.0, ki=0.0, kd=0.0

The strange thing, is that the output appears to be at 50% when the input is at the set point. I would have thought at this point the error term would have been zero, so that the output should also have been 0% not the 50% I was getting.

Does anyone have any ideas? I have attached a screen shot showing what I think it's the problem.

Kind regards,
Ian.

Screen Shot 2012-04-12 at 8.41.26 PM.png
Screen Shot 2012-04-12 at 8.41.26 PM.png (38.63 KiB) Viewed 3408 times
2lostkiwis
 
Posts: 5
Joined: Thu Apr 12, 2012 8:50 am

Re: Proportional control calculation

Postby Brett » Sun Apr 15, 2012 4:11 pm

Hi Ian, when the pid is turned on (Manual -> Automatic) the current value of the Output is remembered as the baseline value. moving forward all output corrections are based off this value. so in your trend, you started pid with an output of 50. when the input crosses setpoint the proportional term is indeed 0, as you expected, it's just being added to this starting value.

this is standard pid behavior, and it exists to allow for a "bumpless transfer" from manual to automatic.
User avatar
Brett
Site Admin
 
Posts: 101
Joined: Fri Mar 09, 2012 10:05 pm
Location: Boston

Re: Proportional control calculation

Postby 2lostkiwis » Mon Apr 16, 2012 12:14 am

Brett wrote:Hi Ian, when the pid is turned on (Manual -> Automatic) the current value of the Output is remembered as the baseline value. moving forward all output corrections are based off this value. so in your trend, you started pid with an output of 50. when the input crosses setpoint the proportional term is indeed 0, as you expected, it's just being added to this starting value.

this is standard pid behavior, and it exist to allow for a "bumpless transfer" from manual to automatic.


Many thanks Brett, you're totally correct. It's been a long time since I was at Uni so I was relying on the distant past in my mind. If I start with an output of 0% before switching to automatic everything is great.

Kind regards,
Ian.
2lostkiwis
 
Posts: 5
Joined: Thu Apr 12, 2012 8:50 am

Re: Proportional control calculation

Postby hairykiwi » Fri Jul 19, 2013 12:31 pm

Thank you both - now I think I understand why my osPID controlled coffee machine occasionally appears to go into meltdown mode.

While this 'meltdown mode' is a useful test of the over-temp thermostat in the coffee machine, it can definitely also result in an unsafe situation arising - especially if the coffee machine operator is my wife who doesn't care how it works, just as long as it works as expected - think scalding hot, steamy-water sputtering out after the operator has failed to check the input temperature is within the expected range...

Now, I can see why bumpless transfers are required for running profiles smoothly, but they clearly do nothing for helping create a nice espresso safely. If you agree with that, I'd be happy to have a go at hacking the firmware so that bumpless transfers are only available when running a profile.

As I'm currently using my osPId Controller for both coffee machine and reflow soldering duties, I think I might qualify as a suitable guinea pig :geek:

It would be useful to have a short discussion before I make any (potentially poorly thought out) changes though, so please do share your thoughts and ideas.
hairykiwi
 
Posts: 7
Joined: Sun Sep 23, 2012 3:45 pm


Return to PID Control / Tuning

Who is online

Users browsing this forum: No registered users and 1 guest

cron