PID Control of machine speed forward and reverse

Jasondelane

Lifetime Supporting Member
Join Date
Mar 2015
Location
Florence sc
Posts
221
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it.

The machine runs on a track, roughly 50 feet in either direction. It is manually controlled by the operator to move from 0-500 FPM in either direction using a joystick. There is no braking function. In order to stop or slow the machine an opposite control input must be made, or the machine will coast, eventually impacting the end stops which damages the machine. Under no circumstances must the machine hit these stops. The machine accelerates fairly quickly, reaching full speed in less than 3 seconds.

I am tasked with improving the control of the machine to within 20 FPM of a variable speed limit dependent upon process variables. Normal speeds are from 100-300 FPM.

Control must be performed with +-10 v Analog Output.
FPM speed feedback is being received with a 60ms update rate.

How do I use a PID or other control method to predict that I'm approaching my setpoint velocity and give just enough opposite input to slow it, and then hold that speed until the operator initiates a stop and reverses direction?

All methods I've tried have resulted in overshooting the target and oscillation of the PV around the SP due to the coasting nature of the machine and the inability to brake without giving an opposite input. Adjusting gains doesn't seem to accomplish it.
 
The 0-10V signal will be the output of the PID?

What kind of process measurement is the setpoint that you want the PID to follow? I.e. what is the PV (Process Value/Present Value)?

When that signal is 10V, it accelerates the the machine from 0FPM to 500FPM in about 3s, an accleration of about 10kft/s2?

If that signal is 5V, would it accelerate the machine from 0FPM to 500FPM in about 6s?

There is speed feedback at 60ms intervals, i.e. 16-17 samples per second, or 1000 samples per minute?

There is no position feedback?

How do you control which direction the PID is accelerating the machine?

Characterizing the system might be useful. Make some trends of the velocity vs time, start with the machine one end of the track with a 0V signal, and send a signal of "X" volts in the direction of the other end for 3s, then "X" volts in the other direction, which should stop it assuming the acceleration is symmetrical, and post the trend images here. Try several different values for "X." If X=10V, then it should move no more than ~25ft. If you think it might move more, then use a shorter time and/or lower values for X.
 
The 0-10V signal will be the output of the PID?
-10 to +10 v signal is the output
What kind of process measurement is the setpoint that you want the PID to follow? I.e. what is the PV (Process Value/Present Value)?
PV is Current FPM, positive or negative. SP is Commanded FPM positive or negative. I'm controlling speed rather than position.
When that signal is 10V, it accelerates the the machine from 0FPM to 500FPM in about 3s, an accleration of about 10kft/s2?

If that signal is 5V, would it accelerate the machine from 0FPM to 500FPM in about 6s?

There is speed feedback at 60ms intervals, i.e. 16-17 samples per second, or 1000 samples per minute?
I'll try to get a more accurate measurement but this is pretty close.
There is no position feedback?
There is position feedback, and speed feedback is derived from the position.
How do you control which direction the PID is accelerating the machine?
Pos voltage = Forward direction or Positive FPM and vice versa

Characterizing the system might be useful. Make some trends of the velocity vs time, start with the machine one end of the track with a 0V signal, and send a signal of "X" volts in the direction of the other end for 3s, then "X" volts in the other direction, which should stop it assuming the acceleration is symmetrical, and post the trend images here. Try several different values for "X." If X=10V, then it should move no more than ~25ft. If you think it might move more, then use a shorter time and/or lower values for X.
I'll work on doing some of this this weekend. Thanks!
 
The +/10 volts must go through an amplifier or drive to generate the desired current/power.
Is the motor running in torque mode or velocity mode?
In torque mode the motor will accelerate in proportion to the control output.
In speed mode the motor will move at a speed proportional to the control output.
There is no braking function. In torque mode a negative current will slow down or stop the motor and act like a brake.
In velocity mode the motor should stop when the control output is 0.
It doesn't appear you are working in any of these two modes.
A feedback rate of 60ms is not very fast.
What no position feedback? If you control position, you control velocity too.
Ditto drbitboy's request for a trend.
 
When that signal is 10V, it accelerates the the machine from 0FPM to 500FPM in about 3s, an accleration of about 10kft/s2?
Did I translate or realize something wrong?

500 feet per minute / 60 = 8.333... feet per second
8.333... feet per second / 3 seconds = 2.777... feet per second^2

@Jasondelane, I would like to understand more precisely how speed is measured/calculated

PID output value (control value) scaling: 0% = -10 Volts, 100% = 10 Volts. Correct?
PID input value (process value) scaling: 0% = -500 fpm, 100% = 500 fpm. Correct?

Time scaling. Have you correctly configured the time periods for calling the PID procedure and the corresponding variables in the PID procedure?

I'll take the liberty of assuming that the motor running in torque mode.
If the assumptions I stated above are correct then plant TF
Wp(s) = k / s

CO 50% = 10 V equivalent 2.777... feet per second^2
PV 50% = 8.333... feet per second

k = CO / PV = 2.777... / 8.333... = 1/3 s^-1

Controller P-only
kp = 1 / (k * T)
T – closed loop desired FOL T

closed loop TF
W (s) = k / s * kp / (1 + k / s * kp) = k * kp / (s + k * kp) = k * ( 1 / (k*T) ) / (s + k * 1 / (k*T)) = 1 / ( T * s + 1 )

curves attached (kp = 3)
 

Attachments

  • p.png
    p.png
    7.3 KB · Views: 9
  • v.png
    v.png
    7.6 KB · Views: 9
  • vl.png
    vl.png
    8.7 KB · Views: 9
CO 50% = 10 V equivalent 2.777... feet per second^2
You are running in torque mode.
It would be much easier if your drive had a velocity mode. Then the velocity would be proportional to the control signal instead of the acceleration.
It looks like you can control the speed after some lag due to the long time constant.

How do I use a PID or other control method to predict that I'm approaching my setpoint velocity and give just enough opposite input to slow it, and then hold that speed until the operator initiates a stop and reverses direction?
PIDs don't predict, they react. You have a closed loop time constant T. It will take 5 time constant to get within 1% of the desired speed set point.
It isn't easy for an operator to consistently apply braking to slow down to a stop at a desired position. You are relying too much on the operator's skill. It would be best if you have position feedback and operated in velocity mode instead of current mode.
 
There is position feedback, and speed feedback is derived from the position.
That statement is from the OP (Original Poster).

The first post only mentioned speed feedback, but apparently both speed and position measurements or calculations are available.

We still don't know, from OP, if the -10V to +10V signal controls acceleration or velocity, or something else.

Once we know those things, perhaps a solution will present itself.

-drbitboy, D.M.D.
 
From OP:

All methods I've tried have resulted in overshooting the target and oscillation of the PV around the SP due to the coasting nature of the machine and the inability to brake without giving an opposite input. Adjusting gains doesn't seem to accomplish it.

From @MaxK:

Time scaling. Have you correctly configured the time periods for calling the PID procedure and the corresponding variables in the PID procedure?

↑This.

The most important aspect of PID control, if it is more than Proportional-only, is matching that actual loop update time to the configured update time.

Also, we don't know what brand and model of PLC is in play here. For example, if this is CCW, then the PID algorithm is broken wrt the documentation (and wrt any sane universe), and a workaround is necessary to understand and set the tuning parameters (gains).
 
To elaborate on the drive system some more, the system is hydraulically driven. Think of it like a hydraulic setworks operating off a +/- 10V proportional valve with a 4-20ma input position signal. The hydraulic cylinder is 55 feet long and 4 inches diameter. To facilitate moving this much hydraulic fluid, the big spool when centered is open to the tank so the spool bypass allowing the 20,000 lb mass to continue coasting.

The position update time is currently 200 ms due to a very noisy 4-20ma signal which is being filtered with a 200ms running average. I'm working through how to clean up the noisy position signal at this very moment.

The velocity is being calculated every 50 ms.
 
To elaborate on the drive system some more, the system is hydraulically driven. Think of it like a hydraulic setworks operating off a +/- 10V proportional valve with a 4-20ma input position signal. The hydraulic cylinder is 55 feet long and 4 inches diameter. To facilitate moving this much hydraulic fluid, the big spool when centered is open to the tank so the spool bypass allowing the 20,000 lb mass to continue coasting.

The position update time is currently 200 ms due to a very noisy 4-20ma signal which is being filtered with a 200ms running average. I'm working through how to clean up the noisy position signal at this very moment.

The velocity is being calculated every 50 ms.
Hmm, such insignificant additions...
(What kept you from presenting this information in your first post?)

I'd be curious to see:
hydraulic diagram (with explanation of how the central spool works)
control process curves (indicating PID controller settings)

At the moment, I continue to believe that control is carried out in torque mode, accordingly P-only (at least for initial experiments) is quite sufficient (this will allow us to ignore the possible problem of time scaling)

Is my assumption correct that the main difficulty is the noisy velocity "signal" (which is calculated by the discrete derivative of position)?
 
I don't see why a properly sized servo valve couldn't decel and stop the load, this seems to be a poor design allowing 10 tons to possibly drift into an endstop. A proper hydraulic design would allow for a ramped stop.
 

Similar Topics

I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
605
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
418
I am setting up control for Hypochlorite dosing. The easy part is the dosing calculation for flow pacing but I would also like to setup trimming...
Replies
8
Views
948
Hey guys! I'm a newbie in the control area, so I'm gonna drop some thoughts here... We want to control the opening of big silos (about 1900...
Replies
6
Views
1,490
Hi, I started off my career in PLC programming doing water/wastewater on AB around 20 years ago, but then moved overseas a few years later and...
Replies
57
Views
12,071
Back
Top Bottom