DC10ChVelRat
D = Device(camming3, camming4)
C = Calculation functions
The DC10ChVelRat function execute the calculations needed in order to set and/or change the speed ratio RV (RV = Slave Speed/Master Speed) an electric shaft between a Master axis and a Slave axis.
You must pass values by reference speed of the Master, of the new speed ratio, the resolution is specified in the RV, the sampling time of the CAMMING device (or 4), the type of softening during speed changes. Function writes directly on the CAMMING3 (or 4) device sectors to run electric gearing with the new speed ratio. The function also returns the values on the “Error” variable, on the “Texec” variable and on “WrExec” flag.
If the function is executed with the cam is not in execution, the cam is programmed with the RV set. The next STARTCAM electric gearing attaches to the master with the RV.
If the function is executed with the cam in execution, activates a rewrite “on the fly” with the new RV cam that by the time “Texec” is carried out.
IMPLEMENTATION
DC10ChVelRat (Cam, Vmaster, Rapp_SM, Risol, Tcamp, TipoAdd, Texec, WrExec, Error)
Parameters:
IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
IN | CAMMING3 CAMMING4 | Cam | Device type to which you can apply the function | |
IN | SYSTEM | Vmaster | L | Reference speed of the master with which you perform calculations of space to be execute from the master and the slave (UM/sec, UM/min). It is recommended to insert the speed at which you are moving the master (see notes). |
IN | SYSTEM | Rapp_SM | L | Slave Speed/Master Speed ratio expressed in units, tenths, hundredths or thousandths depending on the Res. parameter |
IN | SYSTEM | Risol | W | RV resolution: greatness with which you can express the RV (0: tens, 1: tenths, 2: cents, 3: thousandths) |
IN | SYSTEM | Tcamp | W | Sampling time of the CAMMING3 (or 4) device expressed in S/1000. |
IN | SYSTEM | TipoAdd | B | Kind of softening during speed changes of the slave (0, 1, 2, 3, 4, 5). |
OUT | SYSTEM | WrExec | F | Flag to indicate that the writing of the cam was executed. |
OUT | SYSTEM | Texec | L | Time in s/1000 to execute the change of speed ratio. |
OUT | SYSTEM | Error | B | The function error |
Error
After calling the function, the error variable can take on certain values, the meaning of these values is summarized below:
0: calculation executed without errors
1: Null sample time
2: Null speed ratio
3: Null Master Speed
4: Cam error
Note
-
In case the Texec is too high for your application that uses the function, It is advisable to check that the resolution of the master and the slave CAMMING3 (or 4) device is the highest possible and that the relationship measurem / pulsem and measure / pulse is as nearest possible to 1.
-
The higher the resolution “Resol” more longer the time required to switch to the new RV, If you want to lower this time consider reducing “Resol” at the expense of accuracy in the value of the RV.
-
If the speed of the Master passed to the function is similar to the actual speed of movement of the Master (within the 80%) then you can run the function at intervals equal to the value contained in Texec. If the Master speed passed to the function is much lower (most of the 80%) from the real one, you have to increase the time between calls the other function (> of Texec) otherwise the device goes into error and the axis stops responding in emergency.
-
If the actual speed of the master is greater than 3 times the declared function, it's possible that the device goes into error and stops in an emergency.
Example of use
An example of using the function with a speed of the master of the real one is:
.... Rapp_SM = 1500 Resol = 3 Vmaster = 2750 ;Current speed of the master Tcamp = 2 TipoAdd = 1 DC10ChVelRat (Cam, Vmaster, Rapp_SM, Risol, Tcamp, TipoAdd, Texec, WrExec, Error) WAIT WrExec ;hold write occurred WrExec = 0 tmTim = Texec ;waiting change ratio of speed execute WAIT tmTim OR Error ....