Analog Out simple ramp up/down

Jnox

Member
Join Date
Apr 2008
Location
St. Louis, MO
Posts
9
I've been trying to figure this out, but I'm still scratching my head.

I am using AB RSLogix500 with SLC 5/05 cpu.

I have a simple three button control: Speed up/Slow down/Estop.

I am trying to create logic that would control analog (0-10V) output based on specific input (Speed up/Slow down/Estop).

Speed up/Slow Down has a different rate vs estop. (Estop stops quicker).

I've been trying to accomplish this using a RMP instruction, but I am having difficulty assigning different timing between RMP instructions.

Is there any other quicker and more efficient way to accomplish this?
 
You could use counters. A "CTU" and a "CTD" instruction with the same counter address (e.g. C5:0) Then have three different self resetting timers. One for speedup one for slow down and one for the e-stop.
 
How is this meant to work? Does holding the "Speed Up" button down gradually ramp up the speed or does pushing the button repeatedly increase the speed in steps? Also your description of the E-Stop sounds like it acts as a stop button (not really an E-Stop).
 
How is this meant to work? Does holding the "Speed Up" button down gradually ramp up the speed or does pushing the button repeatedly increase the speed in steps? Also your description of the E-Stop sounds like it acts as a stop button (not really an E-Stop).

Holding the button will gradually increase/decrease the speed (lets say, output would go from 0-10V in 15 Sec). Estop on the other hand will decrease the output (ex 10V-0 in 7 sec). Hope this makes sense.
 
You could use counters. A "CTU" and a "CTD" instruction with the same counter address (e.g. C5:0) Then have three different self resetting timers. One for speedup one for slow down and one for the e-stop.

I guess this makes sense, but how can I adjust the counter to increase/decrease the 0-10v analog signal? Not to mention the rate at which it increase/decreases the signal. hmmmmm
 
Jnox - This is relatively straightforward IF you want the output to raise/lower at a constant rate.

Say (for example) the analog output card has a value range of 0-32767 for 0-10V output (depends on the module).

To make the output go from 0 to 10V over 15 seconds, you need to ADD one-fifteenth of 32767 each second (2185 will do). This will make the output "step" once per second.

To make it smoother, add 218 every 0.1 Secs, and smoother still, add 22 every 0.01 Secs.

You can either use a self-resetting timer to trigger the ADD (for speed-up), or SUB (for slow-down), or put the ADD and SUB in a STI file triggered at your desired timebase.

You can use the buttons to move different values into the register you ADD or SUB to program the rates (eg. 22 for Raise/Lower, and 250 for EStop).

Remember to include limit-checking on the value sent to the Analog Output :-

LES {value} 0, MOV 0 {value}
GRT {value} 32767, MOV 32767 {value}

Please also reconsider the usage of your "EStop" terminology. What you have described will never be recognised as an Emergency Stop, but just a "Faster Stop". EStops should never be controlled by a PLC alone.
 
I guess this makes sense, but how can I adjust the counter to increase/decrease the 0-10v analog signal? Not to mention the rate at which it increase/decreases the signal. hmmmmm

As said above another way. You would increase or decrease the the rate at which the timers reset (preset values) themselves. You then rescale the counter's ACC to match your analog output cards requirements.
 
I personally think using a counter complicates this....

Timebase - ADD or SUB the required increment/decrement..


Paste these 2 rungs into an STI File set at 10mS and it will work.

BST CLR N7:0 NXB XIC I:1.0/0 MOV 22 N7:0 NXB XIC I:1.0/1 MOV -22 N7:0 NXB XIC I:1.0/2 MOV -220 N7:0 NXB ADD N7:0 N7:10 N7:10 BND

BST LES N7:10 0 MOV 0 N7:10 NXB GRT N7:10 32767 MOV 32767 N7:10 BND

I:1.0/0 Increase Speed
I:1.0/1 Decrease Speed
I:1.0/0 Decrease Speed (Fast)
N7:0 temp
N7:10 Raw Value to Analog Card

Note : Figures based on 0-32767 for 0-10V output : 15 second ramp = 1500 steps at 0.01 S timebase. (32768/1500 - 21.8, hence 22)
 
Jnox's post (#4) requested an "EStop/Fast" slowdown only twice as fast (7 seconds full span) as the normal full ramps. In Daba's program example modify the '-220' as needed for your rate. For the 7 seconds it would be about -47.
 
I like to use the scan time of the processor for ramping. Gives the smoothest ramp possible in a PLC. see the pdf.
 
Wow, you guys are awesome! I guess I was trying to complicate things too much using a RMP instruction.

I will try the above solutions in the next couple of hours and see how it pans out. I'll keep you guys informed. Thanks for great replies.
 
jac, how did you assign the F8:0 to the scan time of the processor? I've tried your method and the output goes almost instantenously to 32767.
 
The easiest way to calc the scantime in a SLC is to take s:23 (average scan in 10ths of an msec) and multiply by a 100. But s:23 is the seconds clock in a PLC5.
F8:0 = S:23 | 100.0
Typically though I calculate the average scan time continuously. Time long it takes to do 500 scans and divide the value by 500.

I hope that helps.
 
daba/jac

I am able to cont up/down with the program, but the output goes to 32767 without any time delay. How do I configure the program to slow down the output?

Example
When speed up button is pressed for 7s (out of 14 total) output reads ~16000.
When speed up button is pressed for full 14 sec output reads ~32767.
.... and anything in between.
 
Last edited:

Similar Topics

Does anyone know of a simple, inexpensive, preferably DIN rail mounted device that will add a ramp to an analog signal. I'm envisioning something...
Replies
4
Views
2,434
Hi All, I'm new on PLC about Analog Output and Input problems, but i know how it works. I'm using PLC Omron CJ2-CPU32 with Analog Output Module...
Replies
0
Views
3,196
Hi, guys How to make program for analog input S7 300 for sonar bero application? Thanks a lot in advance
Replies
1
Views
5,078
When one refers to linearization of an analog input does it mean converting the signal into a value that is useful? How exactly is this done? Am...
Replies
11
Views
10,628
Can anyone show me a simple program with at least one analog input and one analog output. Also you need to use timers and counters. As simple as...
Replies
6
Views
6,268
Back
Top Bottom