Siemens speed => pulses conversion

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
I need a conversion from speed to pulses.

So the speed is 0 to 30 m/min.

The pulses: every 30 cm I need a pulse.

How can I calculate this ?

Should this be calculated in OB35 ?
 
Combo
Why not use a encoder?
Its job is to provide pulses from the units travelled
Pulses will be arriving fast if movement is fast.
I think calulating the difference in number of pulses from previous scan of OB35 and present will give you the speed.
 
Would also go for the pulse encoder. I think you will loose accuracy by doing a convertion from speed to pulses. Using the encoder will give you exact distance
 
Number of options depending on your budget an accuracy required really.

1. Encoder and fast input card.

2. Proximity switch picking up from manufactured tooth-wheel fitted to non-driven shaft, direct to input.

3. As 2. above, except via a digital to analogue converter to give you 4-20mA into the PLC.

4. A timed pulse, calculated on the known speed, derived from the PLC. This one would be difficult if your varying the speed.
 
Is this what you are after:

Code:
FUNCTION_BLOCK FB 1
TITLE =
VERSION : 0.1

VAR_INPUT
  OB35_EXEC_TIME : INT ; 
  rSpeedInMetresPerMIn : REAL ; 
  rDistanceBetweenPulsescm : REAL ; 
END_VAR
VAR_IN_OUT
  bPulseQ : BOOL ; 
END_VAR
VAR
  rStoredPositioncm : REAL ; 
END_VAR
VAR_TEMP
  rDistanceIncrementcm : REAL ; 
END_VAR
BEGIN
NETWORK
TITLE =
	  L	 #rSpeedInMetresPerMIn; 
	  L	 1.000000e+002; 
	  *R	; 
	  L	 6.000000e+001; //convert to cm per sec
	  /R	; 
	  L	 #OB35_EXEC_TIME; 
	  ITD   ; 
	  DTR   ; 
	  *R	; 
	  L	 1.000000e+003; 
	  /R	; //increment in position this scan
	  L	 #rStoredPositioncm; 
	  +R	; 
	  T	 #rStoredPositioncm; //update sum
NETWORK
TITLE =
	  L	 #rStoredPositioncm; 
	  L	 #rDistanceBetweenPulsescm; 
	  >R	; //rStoredposition > pulse distance ?
	  JCN   Exit; //no then exit
	  -R	; //else save difference for next accumulation
	  T	 #rStoredPositioncm; 
	  AN	#bPulseQ; //and toggle the output bit
	  =	 #bPulseQ; 
Exit: SET   ; 
	  SAVE  ; 
END_FUNCTION_BLOCK

Example call from OB35:

pulse001.JPG
 

Similar Topics

Hello, I use a Siemens Sinamics G120C inverter in combination with a S7-1200 cpu. I use the Main Setpoint with the Providrive option and send...
Replies
8
Views
799
I'm trying to figure out how to read the actual speed reference value from the move blocks, writing to a DB that is being sent to the VFD. For...
Replies
5
Views
2,663
Hi everyone, I am having some trouble with this counter and programming it correctly. The machine it is installed onto I believe this counter is...
Replies
10
Views
3,085
Hello, Maybe topic does not describe the best what do I want but I will try to explain it now. I'll post this to HARDWARE and SOFTWARE section...
Replies
4
Views
2,506
I'm working on a design for a cutting machine. This system gets synchronized with the production line speed, Do the cutting and come back to the...
Replies
4
Views
2,593
Back
Top Bottom