Micrologix Ramping Between Setpoints

rmb550

Member
Join Date
Nov 2009
Location
Ontario
Posts
86
I am using an ML 1400 and have a setpoint that scales to an analog output.
I want to be able to enter a new setpoint and a ramp period and have the setpoint go from one to the other over the selected time period. I would welcome some pointers on how to get going on this.
rmb
 
use a timer. Decide how often you want a new output - like every second or more likely every scan. Set up a linear relationship between time (begin & end of period) and the two setpoints. your setpoints will have the count range of the analog card 0 to 32760 but your actual two setpoint values. On every scan, use the timer ACC value to calculate a new output value.

Hope i was clear.

narlin
 
1. Calculate the difference between the setpoints.
2. Start a timer with the preset the ramp period.
3. Until the timer times out calculate: Output = original setpoint plus ((difference * current time)/timer preset)
4. Once the timer times out then output = new setpoint.

This works even if the new setpoint is less than the old setpoint. The difference calculated in 1 will be negative and everything works out.
 
In a Micrologix just use an SCP instruction to scale a timer to your setpoints. SCP will compute the ramp line for you. It also works for positive or negative ramps.

TC0213121705.JPG
 
Last edited:
Adding to Troy's example, you would write the period to RAMP_TIMER.PRE (He used symbols so you could add those symbols or substitute your own addresses).

Also, it is wise to clamp the ACC value because it can over run the preset. In cases like this I would just add a branch to the timer rung:
XIC RAMP_TIMER.DN --> MOV Source: RAMP_TIMER.PRE Destination: RAMP_TIMER.ACC

If you let the timer accumulator go past the preset, your SCP block could generate a whacky number at the very end (been there, done that in a PLC-5 years ago).

I have never seen that happen with a 1.0 second timebase, but with a .01 second timebase it will happen regularly depending on scan time.
 
Thanks for all the great ideas. I really like the simplicity of the SCP block.
Should have enough to make it work now.
rmb
 
Personally I like using Scantime (in seconds) to increment my ramps of course it a must to have a scantime calculator in your program. Not a big timer fan...
I'm of course assuming the micrologix can handle Floats.
Cheers

Ramping.jpg
 
Jac,

Here is a hint that you might find useful if you want to use that method.

The ramp is programmed in a periodic task.

This instruction in that periodic task returns your task execution rate in microseconds.

GSV TASK THIS Rate TaskRate where TaskRate is a Dinttag you define.

This way you aren't dependent on a timer or subject to the variableness of a scan rate.

You can see it used in one of the examples in the thread I linked above.
 
TConnolly,
I had not thought of that approach. That would be very good for a positioning application or ramping to a distance. But for what I do... mostly ramping speeds/draws of drives this works great. I will remember that though.
 

Similar Topics

Hi, I cannot find the DLCA1764.EXE utilty software for data retrieving. Can someone share the link to download this software. Thanks!
Replies
1
Views
38
I am working on setting up a Prosoft Datalogger model PLX51-DLplus-232. This unit will be collecting data from a SLC 5/05 on the DB9 port set to...
Replies
3
Views
84
Hello, I have a 1764 1500 LSP Series A that keeps failing with DTL_E_FAIL I/O error. Searching around it seems there's a weird issue specifically...
Replies
2
Views
92
I am currently backing a Micro Logix 1100 and no-one seems to have the file for me to upload from. Is there a way for me to upload the project off...
Replies
15
Views
494
Hi, I am working with a Micrologix 1400 model 1766-L32BXB. With no input wires connected to the “in12” thru “in19”, I am getting 24 volts while...
Replies
4
Views
217
Back
Top Bottom