Indice

DC10VelCam

D = Device(CAMMING2, CAMMING3)

C = Calculation functions

The purpose of the DC10VelCam function is to calculate Master and Slave spaces in order to build the sectors of acceleration, deceleration and a constant speed for a device type electronic cam.
These fields are calculated so that the gradients of acceleration and deceleration ramps are respected by the acceleration and deceleration time set parameters.
The speed profile of the cam that you get with this function is as follows:

IMPLEMENTATION

DC10VelCam (aslParam, codeG, codeM, codeQm, codeQs, codeQma, codeQsa, Error)

Parameters:

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
IN ARRSYS aslParam [1] L Master space to cover (UM)
IN ARRSYS aslParam [2] L Slave space to cover (UM)
IN ARRSYS aslParam [3] L Reference Master speed (UM/sec)
IN ARRSYS aslParam [4] L Maximum Slave speed (UM/sec)
IN ARRSYS aslParam [5] L Acceleration Slave time to go from zero to max speed (s/100)
IN ARRSYS aslParam [6] L Deceleration Slave time to go from max spedd to zero (s/100)
IN ARRSYS aslParam [7] L Starting speed of the Slave (UM/sec) (opt.)
IN ARRSYS aslParam [8] L “Measure” parameter of used device
IN ARRSYS aslParam [9] L “Pulse” parameter of used device
OUT ARRSYS CodeG L Array containing calculated G Code (OUT)
OUT ARRSYS CodeM L Array containing calculated M code (OUT)
OUT ARRSYS CodeQm L Array containing calculated CodeQm (OUT)
OUT ARRSYS CodeQs L Array containing calculated CodeQs (OUT)
OUT ARRSYS CodeQma L Array containing CodeQma (auxiliary code) (OUT)
OUT ARRSYS CodeQsa L Array containing CodeQsa (auxiliary code) (OUT)
OUT SYSTEM Error B Error var in the cam writing (OUT)

Error

After calling the function the error variable assumes certain values, the meaning of these values is summarized below:
0: calculation executes without errors
1: Maximum Slave speed less than or equal to 0
2: Master speed less than or equal to 0
3: Acceleration time less than or equal to 0
4: Deceleration time less than or equal to 0
5: Cam not available (space too small)
6: Cam not available (sum of calculated exceeds the maximum time ramps)
7: Maximum speed greater than the speed calculated Slave Slave

Example

MAIN:                  
     IF gfCalcVel
           gfCalcVel = 0
 
           aslParam[1] = 10000	;Master space
           aslParam[2] = 3000	;Slave space
           aslParam[3] = 1500	;Master speed
           aslParam[4] = 4000	;Maximum Slave speed
           aslParam[5] = 50	;Acceleration time
           aslParam[6] = 50	;Deceleration time
           aslParam[7] = 0	;Starting Slave speed
           aslParam[8] = 1000	;"Measure" parameter of device
           aslParam[9] = 4000	;"Pulse" parameter of device
 
           DC10VelCam (aslParam, codeG, codeM, codeQm, codeQs, codeQma, codeQsa, Error)
           IF NOT Error
              SettIniz = 1
              NumSet =  3
              DW20WrCam(cmCamma,CodeG,CodeM,CodeQm,CodeQs,CodeQma,CodeQsa,SettIniz,SettFine,NumSet,Error)
           ENDIF
     ENDIF

Operation notes

N.B.: In the graph represented the speed could become negative (and then push back the Slave) if the case of the Slave space set is lesser of the space covered for the acceleration and deceleration ramps.