News:

  • April 25, 2024, 04:58:28 PM

Login with username, password and session length

Author Topic: PID Loop Issue  (Read 29071 times)

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
PID Loop Issue
« on: December 19, 2016, 11:09:22 AM »
Ok, I'm sure there's something I'm doing wrong here. My project is a machine that folds and winds up film. There is a secondary nip that sets the speed of the machine behind the turret rewind. My PLC sets the nip to a speed and it runs a constant speed. The rewind I calculate a rough speed, and then trim it with a PID loop to keep a dancer at the setpoint. Currently I have the dancer set to 40 (40% of it's position. 0% is slack film, 100% is pulling way too hard). My PID loop is set to a scaled output of -175 to 175 (add or subtract up to 17.5 hz from the calculated output to the drive).

When I start up the machine, it runs great until about 600 ft on the roll (around 6.5" roll diameter. Then the dancer starts to creep around off the setpoint. It will then seem like it finally overcorrects and the dancer slams one way and then the over, and it kicks out the drives. If you start the machine back up, it runs smoothly, as if nothing happened. It does this in the same position ever time. I've checked my calculated roll diameter (I use the mil of the material and calculate size) versus my actual roll diameter, and they're almost spot on. So I know my calculated speed should be close (I know that I have to run a few percent faster than the secondary or you create no tension most of our machines are 10%).

Is there anything I don't have setup properly in my PID loop that would cause this? I currently have the Gain set to 0.25, the Reset to 2.500, and the Rate set to 0.500. My error looks something like this:




Mike Nash

  • Hero Member
  • *****
  • Posts: 636
Re: PID Loop Issue
« Reply #1 on: December 19, 2016, 02:04:12 PM »
I'm just throwing out some ideas here.

Ten samples per second seems a little slow.

Derivative is... evil unless you get lucky. (I have had to use it a few times with dancers, but center winders are difficult at best since it is a moving target.)

You are in a sweet spot at core, but as you build diameter your trim from the PID gets proportionally greater. I would suggest multiplying PID trim times core diameter divided by current diameter before adding it to your winder speed reference.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: PID Loop Issue
« Reply #2 on: December 19, 2016, 03:09:53 PM »
Then why does it run out after I stop it? Once I start the roll back up, it runs to the footage setpoint with no further issues. It's just at around 700 feet that there is an issue. I've set it at 2500ft on a roll, and it runs to 700, messes up. I hit stop. I hit start, and it will run to 2500 feet with no issue.

Mike Nash

  • Hero Member
  • *****
  • Posts: 636
Re: PID Loop Issue
« Reply #3 on: December 19, 2016, 03:38:29 PM »
So you didn't like my ideas?   :'(

I'm just guessing here unfortunately. The derivative is touchy so I would want to zero it out before chasing things further. It does look like an integral kind of period, slow swings but getting worse as it goes, with a long lag before responding. Upping the gain could help there, but that is where ratioing the trim with diameter helps - you can get more gain without it getting out of hand as the spindle slows due to diameter build. My gut feel is 700 feet is just a critical speed / resonance type of problem.

Can you force an oscillation to start at other diameters by manually upsetting the dancer position?

And just to throw it out, make sure you have no slop/backlash in the dancer to dancer position input device.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: PID Loop Issue
« Reply #4 on: December 19, 2016, 04:21:22 PM »
I like the idea of dividing the PID output by the current diameter.   Not sure what's special about this particular distance on the web, though.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: PID Loop Issue
« Reply #5 on: December 20, 2016, 07:14:00 AM »
So you didn't like my ideas?   :'(

I'm just guessing here unfortunately. The derivative is touchy so I would want to zero it out before chasing things further. It does look like an integral kind of period, slow swings but getting worse as it goes, with a long lag before responding. Upping the gain could help there, but that is where ratioing the trim with diameter helps - you can get more gain without it getting out of hand as the spindle slows due to diameter build. My gut feel is 700 feet is just a critical speed / resonance type of problem.

Can you force an oscillation to start at other diameters by manually upsetting the dancer position?

And just to throw it out, make sure you have no slop/backlash in the dancer to dancer position input device.

Not that I didn't like them, just curious as to why the problem is only at around 6.5-7" of diameter, and not continuing through a larger roll.  I upped my sample rate to 50ms, and started adjusting things to try to make it run. I had to turn my Rate up to 6.000 sec. I'm still playing with the settings, but I started the line slowly 25fpm (I've been testing at 350fpm, an average speed for us)and I noticed that my speed reference went ballistic. Turns out, I didn't consider limits on the speed reference. The trim was actually making the speed reference go below zero, which causes some issues. I've made logical tests that when it's < 0 to make it 0, and when it's above 60.0 to make it 60.0. That should take care of that issue.

One other thing, I should want to multiply by the current roll diameter and divide by the core diameter, right? I need more trim at the core, and less on a full roll, correct? It takes a much smaller adjustment at full diameter than it does at the core to make the same adjustment, or am I thinking about this backwards?

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: PID Loop Issue
« Reply #6 on: December 20, 2016, 07:44:03 AM »
No, divide by the current roll diameter so that the reference gets smaller as the roll gets bigger.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Mike Nash

  • Hero Member
  • *****
  • Posts: 636
Re: PID Loop Issue
« Reply #7 on: December 20, 2016, 07:57:12 AM »
It's probably cleanest to:

spindle ref = (line speed + PID trim) * (core dia / act dia)

At core the the multiplier is 1.0, at twice core diameter it is 0.5, etc.

Just be sure to use consistent units. Most drives with winder software routines will use % of full roll for units, so 5" core on 50" max is 10% for example. You should disable the PID trim, set the diameter to core and hold it there, then adjust the drive max speed to produce 100% surface speed at core with 100% line speed at your nip. This gives a repeatable starting point. If you were calculating diameter from line and spindle speeds, it is required. It is not as critical the way you are calculating.

Done this way, your profiled trim is automatically done.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: PID Loop Issue
« Reply #8 on: December 20, 2016, 10:03:19 AM »
No, divide by the current roll diameter so that the reference gets smaller as the roll gets bigger.

Yeah, I realized this after I posted. I hadn't had my coffee before thinking about math.  :-X

I hand tached the winder at 60.0 hz on a small core. It was 700 fpm. I worked backwards and calculated rpm from that. I send the speed to the drive in relation to rpm (calculating roll diameter gives me feet per revolution, and I can work from the set speed). I basically scaled the RPM from 0 to 720 to the output 0 to 60hz. My calculated speed (in rpm) goes in, my speed ref comes out. I disabled the PID, and I'm within about 2fpm of the secondary drive.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: PID Loop Issue
« Reply #9 on: December 20, 2016, 04:40:26 PM »
Well, I've got it working on a slow speed. It "works" at 150fpm. Any faster, and the dancer bottoms out and then either kicks out the drive by pulling too hard, or it slacks up and wraps the nip roller.

Is it possible that I want to let the rewind get closer to speed before kicking in the PID loop? I have it on from the start, and it's just a bit sluggish. Increasing the gain causes instability. Once it's stabilized at slow speed, I can take it to production speed (we're running at 400 fpm today), but it won't start with the drives set to ramp to that speed.

https://imgur.com/tra1Gb1
« Last Edit: December 20, 2016, 05:43:04 PM by Evilbeard »

Mike Nash

  • Hero Member
  • *****
  • Posts: 636
Re: PID Loop Issue
« Reply #10 on: December 20, 2016, 05:58:40 PM »
Hmm, you do have the winder drives accel and decel times set really low right? (Or rates really high, whichever your drives use.)

Like 0.5 seconds or less. If not, you will probably never get the PID in the PLC to control tightly because you won't be able to get a reasonable gain set due to overshoot.

I prefer to try to get as close to zero ramp time as the drive will allow and add a little analog input filtering if using analog and it has it.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: PID Loop Issue
« Reply #11 on: December 20, 2016, 06:39:48 PM »
Hmm, you do have the winder drives accel and decel times set really low right? (Or rates really high, whichever your drives use.)

Like 0.5 seconds or less. If not, you will probably never get the PID in the PLC to control tightly because you won't be able to get a reasonable gain set due to overshoot.

I prefer to try to get as close to zero ramp time as the drive will allow and add a little analog input filtering if using analog and it has it.

I think they're currently set to 5 seconds on the rewind and 10 seconds on the secondary. The issue is that the motor for the secondary nip is a 120Hz, 3600 RPM motor, the motors on the rewind are 60hz, 1800RPM motors. I tried to match them up as best I could so they would both have the same approximate ramp time to the setpoint (it's actually a little different due to mechanical setup, the rewind has a huge pulley to reduce speed).

I might play with making the PLC control the ramp of the drives and setting their accel and decal times to 0.5s. I'll just have the operator put in the setpoint they want, and have the PLC slowly speed the drives to the setpoint.

Mike Nash

  • Hero Member
  • *****
  • Posts: 636
Re: PID Loop Issue
« Reply #12 on: December 20, 2016, 06:45:20 PM »
That 5 second ramp is definitely a problem. That can only work typically with no integral and just let the dancer be happy wherever things settle out.

Are you using analog references or communications to the drives? If comms, what kind?

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: PID Loop Issue
« Reply #13 on: December 20, 2016, 09:30:27 PM »
Agreed.  You don't need to make any effort to ramp them at the same rate, because there's a system in place to make the winder follow the line.  And...if it needs to make a correction, it needs to be able to do so quick.  You might want to oversize the drive so you have plenty of current available.

I've also fed the dancer position directly to the following motor, so not trying to control dancer position per se, just synching the speeds of the two drives.  In essence, you end up with a P-only controller (In your case, you'd still need to divide by roll diameter, my follower axes were nips so I didn't need to worry about that) Now when I did this, I wasn't really trying to control tension, just synch the follower to the master; there really was no tension per se, just enough to take up slack and make sure the web didn't unthread itself.

Now you're going to want to control wind tension, so if you do the P-only thing, you'll need to decouple tension from dancer position, if it's not that way already.  Sounds like it isn't.  You could put weights on the dancer, or even better would be to apply the tension with a cylinder fed by a relieving high-flow precision regulator, because then you avoid the inertia associated with the physical weights.  You could even use an I/P controlling a volume booster, which is essentially the same as the precision regulator, but with a fluid pressure setpoint instead of a screw and a spring.  Then you can still programmatically control the tension without worrying about dancer position.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: PID Loop Issue
« Reply #14 on: December 22, 2016, 07:36:18 PM »
The winder tension is controlled by the dancer, as it has air cylinders on it that I control the pressure to via transducer on the analog output. As far as drive control, I'm communicating using GS-EDRV100 controllers connected to the PLC via Ethernet.

Here's the general breakdown. I send the desired speed to the secondary nip drive (0-1081FPM -> 0-120.0HZ). On the rewind, I'm working backwards from that speed. Since it's a constant, I'm using the calculated diameter of the running roll (derived from the core diameter and material thickness entered by the operator) to get myself the RPM that the rewind needs to be running. I send the speed to the drive in terms of RPM. So if at 60.0HZ it runs 720RPM, I calculate how many RPM it should be running, input it into a scaling function, and out comes my (what I call) Base Speed Reference.

I have the PID loop output set to scale -100 to 100. This is -10.0 Hz to 10.0 Hz. To get a final speed reference, I add my Base Speed Reference and the PID Output (multiplied by the ratio of CORE OD to ROLL OD per your recommendation), and it gives me a number that I send to the rewind drive (whichever one is inboard).

I think what I'm going to do is turn the accel times way down on the drives, have the speed setpoint be slowly ramped by the PLC (rather than having the drives just slowly accelerate to speed) so that the PID loop will have much better drive response.
« Last Edit: December 22, 2016, 10:46:43 PM by Evilbeard »