RSLogix RAMP instruction

Marie1982

Member
Join Date
Feb 2007
Location
House
Posts
121
Hi,

I want to ramp an analogic signal in RSLogix 5000 v19. The RMP instruction in RSLogix 500 isn't available in RSLogix 5000.

What is the solution? I already tried to program it myself but with no great result. My instruction is scan time dependent, which isn't good for my application.

Thanks.

Marie
 
I found the RMPS instruction, which is supposed to be used with a PID instruction... All I want to do is specify a ramp rate, a setpoint and have an output value go to the setpoint using the ramp rate. Can I do that with the RMPS instruction?
 
Hi,

I want to ramp an analogic signal in RSLogix 5000 v19. The RMP instruction in RSLogix 500 isn't available in RSLogix 5000.

What is the solution? I already tried to program it myself but with no great result. My instruction is scan time dependent, which isn't good for my application.

Thanks.

Marie

I don't like the RMPS myself, so always roll my own and stick it in (usually) a 15msec periodic task, so it isn't scan time dependent. Why not do something like that?
 
I haven't used this function myself, but it appears it will do what you want. It doesn't HAVE to be used with a PIDE. Did you get the Logix5000 Controllers Advanced Process Control
and Drives Instructions (Publication 1756-RM006G-EN-P - September 2010) from the literature library?​
 
I would do as rdrast suggests. But that's just the kind of guy I am.

Keep in mind that just because you ramp the value to given value in a given scan doesn't mean that the value will get out the analog module at the same time. The analog output will have it's own RPI that factors into the update time.

Keith
 
I tried to use the code attached, I get a ramp, but not with the good rate. The step is ok, but if I change the scan time of the routine, I get different rates.

I also don't get the same results if I put this code in the main task or in a periodic task.

Any ideas?

code.jpg
 
Instead of using a stepped add use a timed ramp and compute the ramp.

The ramp equation is Beginning_Point + ((Ending_Point - Beginning_Point)*(Timer.ACC/Timer.PRE))

Program the timer to run the full time of the ramp, eg if you want to ramp over ten seconds then use a ten second timer.

In the CLX the timer ACC can overrun the PRE so after the CPT do a final range check on the result.

Here is an example.
attachment.php


------------------------------------------

Using the method you posted above, if you want to use a periodic task then don't use a timer. Since a timer is a computer instruction, not a device, if it gets executed at a periodic rate that is longer than its PRE then you will have significant timing accuracy issues. Resetting it adds another task period (or scan period) in and compounds the problem.

Instead of using a timer, determine what vale to add at the task period rate and just add that each time the task runs. You can use the GSV instruction to get the task period and compute the amount to add so that even if the task period is changed the right ramp will be generated.

Use GSV TASK THIS Rate TaskRate where TaskRate is a DINT tag to return the task period in microseconds.

Here is an example of a step/add ramp in a 50 millisecond periodic task ramping a pressure setpoint at a rate defined in KPa/second.
attachment.php

One thing to watch out for with this method is when ramping at very low rates the computed step change might be smaller than the resolution of the IEEE-754 floating point number format. In that case no matter how many times you add the step in the setpoint wont change. That is only an issue for very low rates with proportionally very large setpoints, I only mention it because occasionally someone comes here with that kind of a problem.

A022311-1.JPG A022311-2.JPG
 
Last edited:
I would use the Real Time Clock. "Timers" are not really timers. They are mimimum delay blocks. Timer should be called Delays not Timers. The RTC will provide accurate results. I like to compute fractions of total ramp time f=(t-t0)/Δt
Then I have a bunch of polynomials that will provide 1st, 3rd, 5th and 7th order ramps.
A first order ramp is
x(f)=xf*f+xi(1-f)
xf is the final x
xi is the initial x
f is the ramp time fraction from 0..1
 
IIRC, the 1756 analog modules have an on-board ramp feature. If it needs to be variable, I expect that you could SSV the key values to set that up...then you aren't dependent on the update rate of a timer, a task or even the RPI if I am remembering right.
 
Last edited:
IIRC, the 1756 analog modules have an on-board ramp feature. If it needs to be variable, I expect that you could SSV the key values to set that up...then you aren't dependent on the update rate of a timer, a task or even the RPI if I am remembering right.

You don't need SSV, this has nothing to do with the controller, it is a parameter specified in the Analog module's ":C" tag (Config), which is only downloaded to the module once.

However you can write new values into the Config tag, but they will not do anything to the module unless you issue a special "Module Reconfigure" CIP Message (MSG Instruction) to the module. This transfers the ":C" tag to the module again - effectively re-programming it.

The 1756 module ramp is nice and easy to set-up. Once the channel's scaling is set-up, everything else in the configuration relates to the Engineering Units, which makes life very easy indeed.
 
Thanks for the clarification on this daba! I thought there was a special instruction required to change the ramp rate at runtime, but I have not used that feature since a class I took in 2001.

Most of my programming is with SLCs these days and I use something similar to what Alaric posted except when the ramp timer is DN I MOV the PRE to the ACC before I divide to deal with overrun.
 
...when the ramp timer is DN I MOV the PRE to the ACC before I divide to deal with overrun.

D'oh. :unsure:

I never thought of doing that. A simple and clean solution for both positive and negative ramps.

I've never noticed an ACC overrun on a SLC but I see it all the time on the CLX.

Thanks for the tip. 🍺
 

Similar Topics

Good afternoon, This is my first post with this website and I am also relatively new to ladder based programming (used mostly SAMA with DCS...
Replies
3
Views
5,061
Hello, I am using RSLogix 5 to code a PID controller. Is there a RAMP function (or something similar) avaialbe as a template in RSLogix 5...
Replies
5
Views
5,120
I have an application using AC drives driven from an analog speed reference. Each has a position command to run to with encoder position and...
Replies
3
Views
9,042
Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
91
Hi folks, in the alarm manager of Rslogix 5000, the tag-based alarm has been created. But when I tried to change the condition, it was found the...
Replies
2
Views
163
Back
Top Bottom