simple ramping function

obaj

Member
Join Date
May 2007
Location
us
Posts
8
hello,

I'm having some trouble with a stepper motor changing speed to fast. I now have to manually increase/decrease its speed in very small steps. I've been looking for a simple ramping function but havent found anything I've been able to use yet.

Found this one but I think its way to complicated for what I need.

It is basically a S7-313C with 0-10V output that has to be gradually increased/decreased. For instance if I change the output value from 5V to 7V or 7V to 5V, I want this to gradually happen over x seconds.


Thanks in advance :)
John
 
Hello obaj;

I have used this ramp function before, and I assure you it is very simple to setup and it is very stable. As they mention in their description, it is independant of the PLC scan cycle.
At least download the sample program and test it, I think you'll be impressed.
Hope this helps,
Daniel Chartier
 
I would agree it's probably more configurable than what you need. But since it is already done and tested I would use it. Assuming you do a copy and paste (no typos) it should work right away. There's alot to be said for that.

If you really feel the need to do something on your own you can try this pseudo-code:



IF (Setpoint > Command)

Command := Command + Increment
IF (Setpoint < Command)

Command := Setpoint

END_IF

END_IF

IF (Setpoint < Command)

Command := Command - Increment
IF (Setpoint > Command)

Command := Setpoint

END_IF

END_IF




Setpoint is the desired end result
Command is the ramped version of Setpoint
Increment is the per-scan change in Command

Make sure you imnplement the nested IF-THEN as shown or this won't work. This is pretty rough as it isn't scan time independent. And you will probably need to use floating point numbers if the ramp rate is very long. But it is quick and dirty.

Keith
 
Thanks for the quick replies, dchartier and kamenges.

I agree it might be a little rough although my cycle time is quite stable..

I tried the example from the siemens webpage and it worked like a charm, so I think I'll stick with that one :)
 

Similar Topics

Hi all, Writng a FB in ST on Beckhoff TC for a pulser which turns on and off on a cycle, is paused by turning bControlInput to FALSE, but resumes...
Replies
6
Views
244
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
311
I have a program that does a 7 second "scan" sensor calibration routine whenever a setting (setting is called assistance level or "AL" and ranges...
Replies
3
Views
206
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
296
Hi all! I am using unitronics Unistream plc, controlling two axis X and Y of polishing machine. Control is very simple as I have movement in each...
Replies
34
Views
3,927
Back
Top Bottom