Home Forums PID Control / Tuning Proportional control calculation

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • 2lostkiwis
    Participant
    Post count: 5

    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.

    [attachment=0:1w643liy]Screen Shot 2012-04-12 at 8.41.26 PM.png[/attachment:1w643liy]

    Brett
    Keymaster
    Post count: 101

    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.

    2lostkiwis
    Participant
    Post count: 5

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

    hairykiwi
    Participant
    Post count: 7

    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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.