Using Analog Torque Mode in an AKD Basic Program
When using torque mode in an AKD Basic program, you must set DRV.CMDSOURCE=0 (Service) and DRV.OPMODE = 0 (Torque) in the program.
If the program executes an IL.CMDU command while DRV.CMDSOURCE=5, it will throw an F825 Runtime error. The runtime error message says that DRV.CMDSOURCE must be set to 5. This is normal for position control, but for torque control it must be set to zero. The Basic program will continue to run even after the command source changes to Service mode.
If the program uses both position mode and torque mode, remember to change the command source and operation mode together each time the control is changed.
This was tested in firmware 1-16-00-002 and 1-17-00-000.
Here is a simple program using Analog torque mode:
'-------------- Device Params -----------------------
Params
End Params
'-------------- Define (dim) Global Variables --------
Dim MOVING as integer
'-------------- Main Program -------------------------
Main
DRV.SWENABLE = 1
DRV.OPMODE=0
DRV.CMDSOURCE=0
While 1
If DIN1.STATE = 1 Then
DRV.SWENABLE = 1 'Enables Drive if Input State = 1
End If
While DRV.ACTIVE
IL.CMDU = AIN.VALUE * 0.5 'Scaling 1 Volt is Equal to 0.5 Amps
If DIN1.STATE = 0 Then 'Disable Drive if Input State = 0
DRV.SWENABLE = 0
End If
Wend
Wend
End Main
Home >
Knowledge Base >
FAQs >
Downloads >