Galil Design Kit (GDK)

Application examples for motion controllers

Move the voice coil back and forth (digital encoder)

'*************************************
' Description:
' Move voice coil back and forth. Feedback is a digital encoder (incremental encoder)
' DMC-30012, firmware rev.1.3b
' VCA
'*************************************
' General configuration
'*************************************
'#AUTO;' With this jump label, the program starts as soon as it is switched on
MG "General configuration"
ST ;' Stop all axes if something is still running
WT 1000 ;' Wait 1 second
MO ;' Switch off the control for all axes, they are now free to move

IA 192,168,9,106 ;' Define IP address
TM 125 ;' Here we define the sample rate

'*************************************
' Axis configuration
'*************************************
MT 1 ;' Motor type is a servo, with -1 you can change the direction
'CE 0 ;' or also with the CE command
BR 1 ;' Axis A is a voice coil, comparable to a brushed DC

OF 0.0 ;' The VCA has no spring, its force can be compensated with an offset

AG 0 ;' Set the current amplification in the controller, different depending on the drive and controller
AU 0 ;' The manual in the appendix explains the respective controllers with AU and AG 

TL 2 ;' Set the current/torque limitation for the continuous value
TK 3.975 ;' Set the current/torque limitation for the peak value

KD 10 ;' Define PID values for axis A
KP 1 ;'
KI 0.001 ;'

IT=1 ;' If this filter was active, first return to default

AC 1073740800 ;' Acceleration
DC 1073740800 ;' Deceleration
SP 100000 ;' Initial speed

DP0 ;' Define zero position

#LOOP ;' Main loop
PA2000 ;' Move to absolute position 2000 increments
BG ;' Start movement
AM ;' Wait until movement ends
WT500 ;' Wait 500 ms
PA0 ;' Move to absolute position 0 increments
BG ;' Start movement
AM ;' Wait until movement ends
JP #LOOP ;' Jump to label #LOOP

EN ;' End of listing

Allow the voice coil to oscillate sinusoidally (analog feedback)

'*************************************
' Description:
' Make the voice coil oscillate in sine form. Feedback is an analog sensor on the ADC
' DMC-30012, firmware rev.1.3b
' VCA LAS13-18-000A-P01-DASH
'*************************************
' General configuration
'*************************************
#AUTO ;' With this jump label, the program starts as soon as it is switched on

MG "General configuration"
ST ;' Stop all axes if something is still running
WT 1000 ;' Wait 1 second
MO ;' Switch off the control for all axes, they are now free to move

IA 192,168,9,106 ;' Define IP address
TM 125 ;' Here we define the sample rate

'*************************************
' Axis configuration
'*************************************
MT 1 ;' Motor type is a servo, with -1 you can change the direction
'CE 0 ;' or also with the CE command
BR 1 ;' Axis A is a voice coil, comparable to a brushed DC

AQ 1,3 ;' Axis A should work with analog feedback, AQ defines the voltage range
AFA=1 ;' Activate analog feedback for control with axis A

OF -0.1 ;' The VCA has a spring whose force can be compensated with an offset

AG 0 ;' Set the current amplification in the controller, different depending on the drive
AU 0 ;' The respective controllers with AU and AG are explained in the manual at the back of the appendix

TL 2 ;' Set the current/torque limitation for the continuous value
TK 3.975 ;' Set the current/torque limitation for the peak value

KD 0.25 ;' Define PID values for axis A
KP 0.25 ;'
KI 0.001 ;'

IT=1 ;' If this filter was active, first return to default

AC 1073740800 ;' Acceleration
DC 1073740800 ;' Deceleration
SP 100000 ;' Initial speed

'Move to starting position
SHA ;' Axis A switch on the control loop/servo controller
PAA=34000 ;' Move to absolute travel command position 34,000 inc
BGA ;' Start move command
AMA ;' Wait until move command is finished
MG "Pos. is: ",TP, " ink"

MG "Configuration ready"
WT 1000

'************************************* 
' Variables and constants
'*************************************
amp = 13000 ;' Amplitude in ink
freq = 10 ;' Frequency in Hz
rate= freq*amp*6.2832 ;' Calculate speed

'*************************************
' Main program
'************************************* 
VS rate ;' Define vector velocity
VAA=1073740800 ;' Define vector acceleration
VDA=1073740800 ;' Define vector deceleration

#init
go= 1
' sine wave on "A" axis
VM AN ;' Generate vector mode with plane of axis A and N for virtual
CR amp,0,360 ;' Generate a sine wave at the start
BG S ;' Start movement
#l
CR amp,0,360 ;' Always add 1 sine wave
#wait ;' Jump mark 
JP #l,_LM>1 ;' _LM shows the number of segments in the buffer
JP #wait,go=1 ;' always generate new sine waves until go=0 e.g. is entered in the terminal
#stop
ST ;' Stop movement
AM S ;' Wait until movement finished
VE ;' End vector mode
CS S ;' Clear vector buffer
MO ;' Switch off axes or their controllers
MG "End"
EN

Pick and place

'***************************************************************************
'Description:
'Example pick and place (pick and place of a component)
'***************************************************************************
#initial ;'Jump label

MG "Find index positions"
FI AB ;'Find home index with axis A and B
BG AB ;'Start movement
AM AB ;'Wait until movement ends

MG "Define variable"
x0 = _RPA ;'Define start position
y0 = _RPB
x1 = 10000 ;'Define first recording position
y1 = 10000
x2 = 20000 ;'Define first storage position
y2 = 20000

#pick ;'Jump label for loop

MG "Move to pick position"
dx = x1 - x0 ;'Calculate delta dx
dY = y1 - y0 ;'Calculate delta dy
VP dx, dy ;'Define target position
VS 40000 ;'Vector velocity
VA 200000 ;'Vector acceleration
VD 200000 ;'Vector deceleration
VE ;'Define end of vector movement
BG S ;'Start XY movement
AM S ;'Wait until movement finished

MG "Pick up component"
PR ,,-50000 ;'Move gripper down (Z axis)
SP ,,20000 ;'Speed of Z
AC ,,80000 ;'Acceleration of Z
DC ,,80000 ;'Deceleration of Z
BG C ;'Start movement of axis Z
AM C ;'Wait until movement finished
SB 1 ;'Set output 1: e.g. activate component hold
PR ,,50000 ;'Move gripper up
BG C ;'Start movement Z
AM C ;'Wait until movement complete

MG "Move to deposit position"
dx = x2 - x1 ;'Calculate delta dx
dY = y2 - y1 ;'Calculate delta dy
VP dx, dy ;'Define move command
VE ;'End of vector movement
BG S ;'Start move command
AM S ;'Wait until move command finished

MG "Place component"
PR ,,-50000 ;'Lower gripper movement command
BG C ;'Execute move command
AM C ;'Wait until Z-axis move command executed
CB 1 ;'Clear output 1: here gripper releases component
PR ,,50000 ;'Raise gripper move command
BG C ;'Start move command
AM C ;'Wait until move command is finished

MG "Calculate new positions"
x0 = x2 ;'New start position is where we last deposited
y0 = y2
x1 = x1 + 20000 ;'Calculate new pick-up position
y1 = y1 + 20000
x2 = x2 + 20000 ;'Calculate new storage position
y2 = y2 + 20000

JP #pick ;'Endless loop through jump command

MG "END"
EN ;'End of program


To top