s7-300

aqayyum

Member
Join Date
Oct 2004
Location
LAHORE
Posts
21
Can anyone help to make rampup and rampdown analogue signal with adjustable time to drive a variable speed drive
 
Not sure of the application where the ramp itself needs contolling, but I would assume you would set the drive ramp to maximum to enable the PLC to do this control, or at least a value which would ensure that the ramp is limited.

I have had applications, powder filling onto loadcells for example, where the speed would change as you get closer to the target, but the ramp rate was fixed in the drive.

Might make it easier if you spec'd a few things, like max/min time values, the step change (or linear if calc'd).

The 0-100% I am assuming is the drive speed.
 
Here's one written in SCL. Call this function block from OB35. If you don't have SCL, just copy the processing logic and implement it in ladder/STL

Code:
FUNCTION_BLOCK FB200
VAR_INPUT
bResetRamp:BOOL;
bRampUp:BOOL;
bRampDown:BOOL;	
rRampTimeInSecs:REAL;
rInterruptTimeInSecs:REAL;	
END_VAR
VAR_OUTPUT
iAnaloguePQW:INT;
rRampMonitorPerCent:REAL;
END_VAR
VAR
rRampStore:REAL; 
END_VAR   
VAR_TEMP
rRampIncrement:REAL;
wFC106Return:WORD;
END_VAR	
BEGIN
rRampIncrement:= 100.0 * rInterruptTimeInSecs/rRampTimeInSecs;
IF bRampUp THEN rRampStore:=rRampStore + rRampIncrement; END_IF;
IF bRampDown THEN rRampStore:=rRampStore - rRampIncrement; END_IF;
IF bResetRamp THEN rRampStore:=0.0; END_IF;
IF rRampStore > 100.0 THEN rRampStore:=100.0; END_IF;
IF rRampStore < 0.0 THEN rRampStore:=0.0; END_IF;
rRampMonitorPerCent:=rRampStore;
wFC106Return:= FC106(IN := rRampStore
		,HI_LIM :=  100.0
		,LO_LIM :=  0.0
		,BIPOLAR := FALSE
		,OUT :=  iAnaloguePQW
		);
 
END_FUNCTION_BLOCK
 
I personally prefer an "S" curve function - but this is a straightforward ramp function :-
please declare ALWAYS_ON in your symbol table , and make it tru all of the time . If you wish an "S" curver ramp , let me know .
Is there any reason why you don't set the ramp time in the drive over profibus (assuming you are using this for comms) ?



FUNCTION "RAMP" : VOID
TITLE =
AUTHOR : AD
VERSION : 0.1

VAR_INPUT
ENABLE : BOOL ; //ENABLE RAMP
PULSE : BOOL ; //PULSE
TARGET : REAL ; //TARGET RAMP VALUE
INCREMENT : REAL ; //INCREMENT VALUE
END_VAR
VAR_IN_OUT
ACTUAL_VALUE : REAL ; //ACTUAL RAMP VALUE
END_VAR
VAR_TEMP
RAMP_UP : BOOL ;
RAMP_DOWN : BOOL ;
END_VAR
BEGIN
NETWORK
TITLE =If Ramp not enabled set actual value to target
AN #ENABLE;
JNB _001;
L #TARGET;
T #ACTUAL_VALUE;
_001: NOP 0;
NETWORK
TITLE =Check whether to ramp up or down
A #ENABLE;
= L 1.0;
A L 1.0;
A( ;
L #TARGET;
L #ACTUAL_VALUE;
<R ;
) ;
= #RAMP_DOWN;
A L 1.0;
A( ;
L #TARGET;
L #ACTUAL_VALUE;
>R ;
) ;
= #RAMP_UP;
NETWORK
TITLE =Ramp UP to Target Value
A #ENABLE;
A #RAMP_UP;
A #PULSE;
JNB _002;
L #INCREMENT;
L #ACTUAL_VALUE;
+R ;
T #ACTUAL_VALUE;
_002: NOP 0;
NETWORK
TITLE =Ramp DOWN to Target Value
A #ENABLE;
A #RAMP_DOWN;
A #PULSE;
JNB _003;
L #ACTUAL_VALUE;
L #INCREMENT;
-R ;
T #ACTUAL_VALUE;
_003: NOP 0;
NETWORK
TITLE =Limit ramp value to target and set flag when ramp done
A "ALWAYS_ON";
= L 1.0;
A L 1.0;
A #RAMP_UP;
A( ;
L #ACTUAL_VALUE;
L #TARGET;
>=R ;
) ;
JNB _004;
L #TARGET;
T #ACTUAL_VALUE;
_004: NOP 0;
A L 1.0;
A #RAMP_DOWN;
A( ;
L #ACTUAL_VALUE;
L #TARGET;
<=R ;
) ;
JNB _005;
L #TARGET;
T #ACTUAL_VALUE;
_005: NOP 0;
END_FUNCTION
 
PeterW said:
Not sure of the application where the ramp itself needs contolling, but I would assume you would set the drive ramp to maximum to enable the PLC to do this control, or at least a value which would ensure that the ramp is limited.

I have had applications, powder filling onto loadcells for example, where the speed would change as you get closer to the target, but the ramp rate was fixed in the drive.

Might make it easier if you spec'd a few things, like max/min time values, the step change (or linear if calc'd).

The 0-100% I am assuming is the drive speed.

Wouldn't you set the drive ramp to minimum in this case ?
 
This is what I had (but I'm still learning some STL)

This is what I had, but I'm still learning some STL:

NW1:

L #ramptime

Calculate a time in ms with the ramptime to determine the pulses, the calculated time I would use with SFB4 timers to make my puls that will run NETWORK 2




A xxxx // PULS
FP #membit_1
JC reg
BEC


NW2:

reg: A #ramp_up
JCN down
L #SETP
L 2.000000e+001
+R
T #SETP
L 2.764800e+004
L #SETP
>=R
JCN down
TAK
T #SETP
down: A #ramp_down
JCN end
L #SETP
L 2.000000e+001
-R
T #SETP
L -2.764800e+004
L #SETP
>=R
JCN end
TAK
T #SETP
end: BEC


Ahum..., that's how I should do it, donno what u guys think
 
10BaseT. said:
Wouldn't you set the drive ramp to minimum in this case ?

I would say maximum possible ramp rate or limit to what is safe for process (to inhibit trips).

We may be talking different meanings of the word maximum between actions of drive and values entered.
 
If you set the drive ramp to maximum (longest period) , then the actual ramp period would be a function of the two ramp periods . However , if you set this to minimum ramp (shortest period ) at least the drive would track the PLC generated ramp .

Assuming of course that my meaning of max and min is the same as yours ! and looking at it , it was different .

If I recall , a micromaster driver allows ramps of 0.1S to 650S
So I would set my drive ramp to say 0.1S , then control the rate minimum and maximum values as part of the Ramp block .
Much nicer to set the ramp over profibus if possible .
 
previous cycle time

Hi, someone of our team programmed ramps with the previous cycle time in OB1 ?

Is this good to do ?

ANd is this the most effecient way ?
 
Tested

NW1

L #ramptime // ramptijd
L 1.000000e+003 // omzetten naar ms
*R
RND
T #pulstime


NW2


AN #T_bit
= L 0.0
CALL "TON" , DB4
IN:=L0.0
PT:=#pulstime
Q :=#T_bit
ET:=



NW3


A #T_bit
FP #membit_1
JC up
BEC



NW4

up: A #ramp_up
JCN down
L #SETP
L 1.000000e+002
+R
T #SETP
L 2.764800e+004
L #SETP
<=R
JCN down
TAK
T #SETP
down: A #ramp_down
JCN end
L #SETP
L 1.000000e+002
-R
T #SETP
L -2.764800e+004
L #SETP
>=R
JCN end
TAK
T #SETP
end: BEC



The ramptime is the step made, if u enter 1, then every second there will be a raise of 100, is u enter 0,001 u will have a fast ramp function, maybe u can change the code as u like it.
 
Actually my application is to drive DC motor drive that is without ACC and DEC adjustment. In plc anlog out from a PID controller is going to drive as setvalue I need it continously ramping up and down. Normally I need a time of 25 second for rampup and 15 second for rampdown for 0 to 100 % output.
 
Last edited:
10BaseT. said:
I personally prefer an "S" curve function - but this is a straightforward ramp function :-
please declare ALWAYS_ON in your symbol table , and make it tru all of the time . If you wish an "S" curver ramp , let me know .
Is there any reason why you don't set the ramp time in the drive over profibus (assuming you are using this for comms) ?



FUNCTION "RAMP" : VOID
TITLE =
AUTHOR : AD
VERSION : 0.1

VAR_INPUT
ENABLE : BOOL ; //ENABLE RAMP
PULSE : BOOL ; //PULSE
TARGET : REAL ; //TARGET RAMP VALUE
INCREMENT : REAL ; //INCREMENT VALUE
END_VAR
VAR_IN_OUT
ACTUAL_VALUE : REAL ; //ACTUAL RAMP VALUE
END_VAR
VAR_TEMP
RAMP_UP : BOOL ;
RAMP_DOWN : BOOL ;
END_VAR
BEGIN
NETWORK
TITLE =If Ramp not enabled set actual value to target
AN #ENABLE;
JNB _001;
L #TARGET;
T #ACTUAL_VALUE;
_001: NOP 0;
NETWORK
TITLE =Check whether to ramp up or down
A #ENABLE;
= L 1.0;
A L 1.0;
A( ;
L #TARGET;
L #ACTUAL_VALUE;
<R ;
) ;
= #RAMP_DOWN;
A L 1.0;
A( ;
L #TARGET;
L #ACTUAL_VALUE;
>R ;
) ;
= #RAMP_UP;
NETWORK
TITLE =Ramp UP to Target Value
A #ENABLE;
A #RAMP_UP;
A #PULSE;
JNB _002;
L #INCREMENT;
L #ACTUAL_VALUE;
+R ;
T #ACTUAL_VALUE;
_002: NOP 0;
NETWORK
TITLE =Ramp DOWN to Target Value
A #ENABLE;
A #RAMP_DOWN;
A #PULSE;
JNB _003;
L #ACTUAL_VALUE;
L #INCREMENT;
-R ;
T #ACTUAL_VALUE;
_003: NOP 0;
NETWORK
TITLE =Limit ramp value to target and set flag when ramp done
A "ALWAYS_ON";
= L 1.0;
A L 1.0;
A #RAMP_UP;
A( ;
L #ACTUAL_VALUE;
L #TARGET;
>=R ;
) ;
JNB _004;
L #TARGET;
T #ACTUAL_VALUE;
_004: NOP 0;
A L 1.0;
A #RAMP_DOWN;
A( ;
L #ACTUAL_VALUE;
L #TARGET;
<=R ;
) ;
JNB _005;
L #TARGET;
T #ACTUAL_VALUE;
_005: NOP 0;
END_FUNCTION


Actually My application is to drive a DC motor drive from plc with a PID controller. In drive there is nooption of acceleration and DEc time. I need the output of the PID rampup and down continously. Time adjustment is approximately 25 sec for acc and 15 sec for DEc
 

Similar Topics

Hi Siemens guys! I am experiencing SF fault on our S7-300 (6ES7 315-2AH14-0AB0) CPU from time to time. I've checked the diagnostic buffer and...
Replies
13
Views
164
Have a system that has been running for over a year and all of a sudden getting a ExcessiveVelocityFault on one of the drives when the MSO command...
Replies
2
Views
142
Hello PLCS.Net Forum, First time posting. Let's assume I am a novice. BASIC PROBLEM: My servo/linear piston is no longer zeroed to the...
Replies
9
Views
216
hi... i have an issue in s7 300 plc, while we run the machine(in idle there is no fault) , plc cpu goes in SF mode, after restart the power cycle...
Replies
2
Views
117
gents, I am trying to configure communication with EMERSON PK300 controller through port A1 using generic ethernet communication module . I could...
Replies
0
Views
93
Back
Top Bottom