B.1.5 circle to line samples, B.1.5.1 circle to line, Maestro – ElmoMC Multi-Axis Motion Controller-Maestro User Manual
Page 259
Maestro
Software Manual
Appendix B: Sample Programs
MAN-MASSW (Ver. Q)
wait(10)
end while
end function
function homing()
int x_home_pos, y_home_pos
x_home_pos = 0
y_home_pos = 0
v1.mo
=
1
// homing a1
a1.hm[2] = x_home_pos
a1.hm[3] = 0
a1.hm[4] = 0
a1.hm[5] = 0
a1.hm[1] = 1
// homing a2
a2.hm[2] = y_home_pos
a2.hm[3] = 0
a2.hm[4] = 0
a2.hm[5] = 0
a2.hm[1] = 1
end function
B.1.5
Circle to Line Samples
B.1.5.1 Circle to Line
function run()
a1.rm = 0 //The reference is generated by the interpreter command or by the user program.
a2.rm
=
0
sync(0, 10) //send a sync signal to CAN bus 0 every 10ms
v1.mo=0 //motor off
v1.px=0 //call this "home"
v1.mo=1 //motor on
v1.vum=1 //build trajectory in max. velocity mode
v1.vsc=1 //smooth intersection with max. velocity
v1.vtm=1 //enable PVT motion initialization
v1.vac = 28000000 //max acceleration
v1.vdc = 28000000 //max deceleration
v1.starts() //begin trj
v1.vsp = 30000 //max. velocity
v1.vse = 30000 //end velocity
v1.addcircle(
5000,180,180
)
//create 5000 count radius
circle from -180 to 180
v1.vsp = 10000 //max velocity
v1.vse = 0 //end velocity
v1.addline( 10000,15000) //create line from current
point to coordinate
// 10,000 on X and 15,000 on Y
v1.ends() //end trj
v1.bg
while
(a1.ms==2)||(a2.ms==2)///wait until both axes have stopped
wait(10)
end
while
end function
B-7