News:

  • May 05, 2026, 02:28:35 PM

Login with username, password and session length

Author Topic: Do-More PID  (Read 14875 times)

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Do-More PID
« on: November 19, 2015, 09:27:21 AM »
I converted WINPLC program to Do-More, all went well except: The PID Gain setting was .75 in the WINPLC, but I had to reduce it to .0001 for Do-More to keep it from "slamming" output from 0 to 65535. This seems ridiculously small to me? PV is 16 bit (65535), I is .03 (kept the same from WINPLC to Do-More), no derivative, Output scaled to 65535. Sample rate is 100ms. Any ideas why gain must be set so low?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: Do-More PID
« Reply #1 on: November 19, 2015, 10:45:53 AM »
The PID.Output in Do-more is a percentage, 0.0 to 100.0.  Not sure what the Output of your WinPLC algorithm is.  Hence, make sure your scale of the PID.Output member is taking into account the Do-more PID algorithm's Output "units" to the raw analog output WY register.  The scaling may need to be different from what you had in your WinPLC.  If you were scaling the PID.Output range as 0.00-1.00 to full range of your analog, then your Gain would need to be off by a factor of 1/100th in order to cause the "same" change in the analog output.

If that's not it, make sure that your WinPLC scale of the analog to engineering units of SP and PV moved across "consistently" to what you are doing now in Do-more.

The units for the I term for Do-more is in Seconds.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: Do-More PID
« Reply #2 on: November 19, 2015, 03:45:26 PM »
It's a range thing. The scales all the way around are different. Can you autotune?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Re: Do-More PID
« Reply #3 on: November 20, 2015, 07:25:45 AM »
It's a range thing. The scales all the way around are different. Can you autotune?

No,can't autotune (at least I'm afraid to try), it's a wire rewind application, any large speed changes will break the wire. This is a spooler in a "follower mode". The spooler follows a ratio of the line speed signal, the PID PV is from a dancer, the PID output adds/subtracts from the line speed signal for the spooler speed. I divide the PID output before adding to line speed signal (typically by 10). So the PID output is basically a 10% trim.
Thinking maybe I need to scale PV from the 65535 to 100, and scale output to 65535, I was not scaling the PV at all.

I can make it work, just trying to understand the "ranges".
Thanks to all

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: Do-More PID
« Reply #4 on: November 20, 2015, 08:50:32 AM »
It's a range thing. The scales all the way around are different. Can you autotune?

No,can't autotune (at least I'm afraid to try), it's a wire rewind application, any large speed changes will break the wire. This is a spooler in a "follower mode". The spooler follows a ratio of the line speed signal, the PID PV is from a dancer, the PID output adds/subtracts from the line speed signal for the spooler speed. I divide the PID output before adding to line speed signal (typically by 10). So the PID output is basically a 10% trim.
Thinking maybe I need to scale PV from the 65535 to 100, and scale output to 65535, I was not scaling the PV at all.

I can make it work, just trying to understand the "ranges".
Thanks to all

That sounds correct. Not sure what the WinPLC's PID equation is, so even that might not be exactly what you hope, but that should be a big improvement.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: Do-More PID
« Reply #5 on: November 20, 2015, 09:05:46 AM »
The "Open Loop" tuning algorithm is not aggressive like the "Closed Loop" auto-tune.

If your process can handle this, put your PID instruction in manual mode, then set the .Output to a typical "mid-range" value and let your .PV settle out.  Then set your .SP equal to the current .PV .

Keeping the loop in manual mode, now try auto-tune, but choose the Open Loop tuning algorithm.  What this does is the PLC will bump your .Output by just 10% (this is configurable), then the PLC monitors how your process responds. 

I've attached a screen shot of the Open Loop algorithm from the Auto-Tune dialog from the PID1.dmd sample project.  It provides some configuration and more details on what I stated above.

The Sample Time highlighted is the tuning algorithm's sample period, not your PID loop's sample time.  The note recommends it to being 1/4th your loop's expected sample time, so I tweaked this one to be 25ms (since you stated you had 100ms in the WinPLC).

You can tweak the Output Bump and the Minimum PV Change.  The Minimum PV Change needs to be big enough such that actual process "signal" is analyzed vs. "noise", since the algorithm is analyzing the "shape" and specific data values of the response.

I am not trying to coerce you into trying auto-tune - I just wanted to present the "Open Loop" algorithm because it was developed for processes like yours that can NOT have the BANG-BANG behavior of the "Closed Loop" algorithm where the .Output goes from 0% to 100% then back to 0% then to 100% (it does this cycle 3 times).  Yikes  :o!

You understand your system much better than anyone else can, so definitely trust YOUR gut (not mine).

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Re: Do-More PID
« Reply #6 on: November 20, 2015, 10:10:48 AM »
Think I'll give the open loop autotune a try, being able to tweak the output and pv change is way cool. Have to wait till the machine is running again, could be a week. Thanks BOBO and Franji

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Do-More PID
« Reply #7 on: November 20, 2015, 12:39:35 PM »
What's the wire speed?  Somewhere in the 1000-3000fpm range?  Fast enough that your dancer accumulation doesn't buffer enough time to just treat the dancer as a pot without the PID?

In connector and strip lines (15-300fpm), I never used the dancer as a PV that I was trying to drive to a setpoint, I just used the position AS the speed signal.  Since you already know the line speed and just want to use the dancer as a trim, that approach might work for you, even at higher line speed.

The key to being able to use the simple approach is having enough accumulation so it can stabilize in time, which is obviously harder at 2000fpm than 150 (although wire is a mechanically a lot easier to accumulate a given length than wide strip, cause it's so much skinnier and agnostic about the bend direction).
« Last Edit: November 20, 2015, 01:33:43 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Do-More PID
« Reply #8 on: November 20, 2015, 12:41:58 PM »
Do you have an accumulator that's already there anyway for spool changes without stopping the line?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Re: Do-More PID
« Reply #9 on: November 23, 2015, 08:32:41 AM »
What's the wire speed?  Somewhere in the 1000-3000fpm range?  Fast enough that your dancer accumulation doesn't buffer enough time to just treat the dancer as a pot without the PID?

In connector and strip lines (15-300fpm), I never used the dancer as a PV that I was trying to drive to a setpoint, I just used the position AS the speed signal.  Since you already know the line speed and just want to use the dancer as a trim, that approach might work for you, even at higher line speed.

The key to being able to use the simple approach is having enough accumulation so it can stabilize in time, which is obviously harder at 2000fpm than 150 (although wire is a mechanically a lot easier to accumulate a given length than wide strip, cause it's so much skinnier and agnostic about the bend direction).

Speed anywhere from 600-3300FPM ( generally around a 1000FPM), no accumulation to speak of (maybe 4'), we must stop to change spools. I have used the method you described on our slow annealing lines. Thanks for the advise though.
« Last Edit: November 23, 2015, 09:17:51 AM by davidbgtx »

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Do-More PID
« Reply #10 on: November 23, 2015, 07:01:20 PM »
Yeah, 4' (0.0013 min or 0.078 sec) of accumulation is pretty slim.  I think the least I ever did was about a half second.  Course that was using it as 100% signal rather than 10% trim.  You might still pull it off if your spool drive has adequate torque (which it needs anyway).

See if you can talk them into an accumulator.  Wire accumulators don't take up much space, and it would solve this issue while at the same time allowing spool changes without stopping (or perhaps without even slowing) the line.  There might be process advantages.

What are you doing to the wire?  Cabling?  Plating?  If you're cabling, for example, there's less downside to running without an accumulator and more difficulty to make one (presuming you're changing all the strand spools at the same time.  Conversely, an accumulator is good for plating or other process-type line that don't like to stop, and since you'd probably only be doing one strand, not as difficult or expensive to build.
« Last Edit: November 23, 2015, 10:15:30 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Re: Do-More PID
« Reply #11 on: November 24, 2015, 09:13:52 AM »
Yeah, 4' (0.0013 min or 0.078 sec) of accumulation is pretty slim.  I think the least I ever did was about a half second.  Course that was using it as 100% signal rather than 10% trim.  You might still pull it off if your spool drive has adequate torque (which it needs anyway).

See if you can talk them into an accumulator.  Wire accumulators don't take up much space, and it would solve this issue while at the same time allowing spool changes without stopping (or perhaps without even slowing) the line.  There might be process advantages.

What are you doing to the wire?  Cabling?  Plating?  If you're cabling, for example, there's less downside to running without an accumulator and more difficulty to make one (presuming you're changing all the strand spools at the same time.  Conversely, an accumulator is good for plating or other process-type line that don't like to stop, and since you'd probably only be doing one strand, not as difficult or expensive to build.
Well, since there are 3 sheaves on top and 2 on bottom, so it would be closer to 8', still tight. I also change the basic following ratio whenever the dancer is above or below a set position for a set length of time, to make up for the build up/build down. Also have to deal with uneven wound spools. Learned a few tricks, from what I have to deal with in 20+ years (yes I'm close to being an old fart), never to old to learn a better way though. 

This is a multifunction payoff/rewind, single strand, for welding wire respooling (100-500 lb drums, 33-60 lb spools, redrawing, maybe even oscilated strip coils. It's a portable (barely) unit, it is loaded with anywhere from 100 to 1200 lb spools (use an ultrasonic sensor to calculate starting ratio, since there is no telling how full the spool will be. Generally takes about 10 minutes to change out a spool. Enough time and money, I could do a lot of improvements, but I was lucky to get the money to build this unit (replacing a old drag type payoff). 

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Do-More PID
« Reply #12 on: November 24, 2015, 12:05:13 PM »
Hmmm....if it's supposed to be portable, I see your point.  Accumulators get pretty tall (or wide if you lay them down), sometimes 10 or 15 feet or more.  I like the sliding ratio idea -- slick!
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.