User Tools

Site Tools


Sidebar

MyCNC Shop

MyCNC website

myCNC Price List

mycnc:axis_plus

Independent Axis ("AxisPlus")

The AxisPlus settings window allows the user to utilize an additional independent axis using a myCNC controller to our software. Such an additional axis can be controlled simultaneously with (and independently of) the main program - this includes manual movements, MPG control and positioning instructions from within PLC commands.

This functionality useful for applications such as grinding machines, laser cutting (to have a Z-axis with tracking and positioning simultaneous with regular program execution), oxy-fuel cutting (piercing operations with simultaneous XY movement), and others.

Hardware Pendant settings window

Independent axis control can be enabled via the Hard Pendant settings window (as of myCNC v.1.88.4494):

To enable:

  • Set the check mark next to AxisPlus Jog to ON
  • Select the input port number for the pendant button. Select -1 if no port is used.

To set the speed and acceleration for the independent axis, first head into Settings > Config > Axes/Motors:

The units used are based on AxisPlus setting. Changing speed is done via writing to global variable 8341 (as shown in the code examples below). Instead of an acceleration value, an acceleration time is set in milliseconds:

gvarset(8342,100); //acceleration time 100ms = 0.1s

Jog control

Register Access Description
8341 Write Set Jog Speed, [pulses/s]
8342 Write Set Jog Acceleration, [1000* pulses/s2]
8340 Write Start/Stop Jog
“ 1” - Jog in positive direction
“-1” - Jog in negative direction
“ 0” - Jog Stop
8343 Write Set Soft Limit - (Minus)
8344 Write Set Soft Limit + (Plus)

Position command (PLC)

Register Access Description
8330 Write Set Positioning Speed, [pulses/s]
8331 Write Set Positioning Acceleration Time, [msec]
8332 Read Get AxisPlus State
reading this register returns current state of the AxisPlus controller
“0” - Idle state
“1” - Positioning in action

Set Coordinate (PLC)

Register Access Description
9717 Write Set Machine coordinate for AxisPlus, [pulses]

A procedure “g0moveA()” is used to run AxisPlus positioning. A mask “0x1000” is used for AxisPlus

Code Example

 gvarset(8330,40000);  //G0PLUS SPEED - 40kHz pulses
 gvarset(8331,500);    //G0Plus Time (Acceleration) - 0.5sec acceleration time

 g0moveA(0x0,0x1000,8000);           //Axis Plus - move 8000 pulses
 do{ a=gvarget(8332); }while(a!=0);  //Wait in a loop till motion is finished

 g0moveA(0x0,0x1000,0-8000);         //Axis Plus - move 8000 pulses in negative direction
 do{ a=gvarget(8332); }while(a!=0);  //Wait in a loop till motion is finished

Motion can be done via the global variable #8340, like in the following code:

jog_plus()                         
{                   
 gvarset(8342,100); //acceleration time 100ms = 0.1s       
 gvarset(8341,3000); //jog speed                
 
 gvarset(8340,1); //JOG + direction     
 timer=2000;  
 do {  timer--; 
     if ((timer&0xff)==0)  {    gvarset(8340,1);   }; 
     //repeat jog command every 0.256 sec to reset WatchDog. 
     //If no repeat command, jog will be stopped after about 0.8 sec   
   }while(timer>0);
   
 gvarset(8340,0-1); //JOG - direction               
 timer=2000;  do {  timer--;
 if ((timer&0xff)==0)  {    gvarset(8340,0-1);   }; 
 //repeat jog command every 0.256 sec to reset WatchDog. 
 //If no repeat command, jog will be stopped after about 0.8 sec      
   }while(timer>0);
   
 gvarset(8340,0);

The above code results in a 2 seconds long motion in the positive direction, which is then followed by a 2 seconds long motion in the negative direction. The axis motion is done at a speed of 3m/min with an acceleration set to be 0.1 seconds long.

mycnc/axis_plus.txt · Last modified: 2022/02/20 13:10 by skirillov