beautypg.com

B.1.4.2 line to circle with homing – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 258

background image

Maestro

Software Manual

Appendix B: Sample Programs

MAN-MASSW (Ver. Q)


v1.mo=0 // motor off

a1.px=-10000 //x now at -10000

a2.px=10000 //y now at 10000

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 building trajectory

v1.vsp = 30000 // maximum velocity of line

v1.vse = 30000 // end velocity of line

v1.addline ( 0,0) // go to (0,0)

v1.vsp = 10000 // maximum velocity of circle

v1.vse = 0 // end velocity of circle

v1.addcircle( 5000,180,180 ) //create circle with a radius of 5000 starting at 180 deg. for 180 deg.

// in the clockwise direction

v1.ends() // end trajectory build

v1.bg // start motion


while

(a1.ms==2)||(a2.ms==2)//wait until both axes have stopped

wait(10)
end

while


end function

B.1.4.2 Line to Circle with Homing

function run()

a1.rm = 0 //The reference is generated by the interpreter command or by the user program.

a2.rm

=

0

sync(0, 20) //send sync to CANbus 0 every 20ms

homing()

v1.mo=0 // motor off

a1.px=-10000 //x now at -10000

a2.px=10000 //y now at 10000

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 building trajectory

v1.vsp = 30000 // maximum velocity of line

v1.vse = 30000 // end velocity of line

v1.addline ( 0,0) // go to (0,0)

v1.vsp = 10000 // maximum velocity of circle

v1.vse = 0 // end velocity of circle

v1.addcircle( 5000,180,180 ) // create circle with a radius of 5000

// starting at 180 degrees for 180 degrees

// in the clockwise direction

v1.ends() // end trajectory build

v1.bg // start motion


while

(a1.ms==2)||(a2.ms==2)//wait until both axes have stopped

B-6