User Tools

Site Tools


mycnc:mycnc_setup_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mycnc:mycnc_setup_examples [2019/06/10 09:33] ivanmycnc:mycnc_setup_examples [2024/01/30 12:09] (current) ivan
Line 1: Line 1:
 ==== MyCNC Setup Examples ==== ==== MyCNC Setup Examples ====
 +
 +//**NOTE**: The myCNC team recommends utilizing the examples provided in this manual (as well as other manuals in this documentation) as a starting point for your machine setup. When possible (and applicable), it is recommended to keep changes to a mininum. In general, using these examples as the basis for your PLCs/macro commands allows for an easier setup process.//
  
 === How to set up Axes and Pulses per Unit === === How to set up Axes and Pulses per Unit ===
 +
 +Video tutorial: {{youtube>x9xj4D-TQcU?large}}
  
 During the initial setup, the axes on your machine (X, Y, Z, A, etc) may be plugged differently from the desired software configuration. In order to assign the correct motor to the axis in the myCNC software: During the initial setup, the axes on your machine (X, Y, Z, A, etc) may be plugged differently from the desired software configuration. In order to assign the correct motor to the axis in the myCNC software:
Line 9: Line 13:
 2. Navigate to **Motor Outputs Configuration**  2. Navigate to **Motor Outputs Configuration** 
  
-3. Assign the correct axis to each attached motor +3. Assign the connected motors to the needed axes. 
  
 {{:mycnc:setup:axes-motors-software-setup-001.jpg}} {{:mycnc:setup:axes-motors-software-setup-001.jpg}}
  
-In the same window, the general calibration for the pulses per unit can be performed. This is done in order to calibrate the software readings of the machine (how much the machine "thinks" it has moved) versus the actual physical movements of the machine. To do that:+In the same window, the general calibration for the pulses per unit can be performed. This is done in order to calibrate the software readings of the machine (how much the machine "thinks" it has moved) versus the actual physical movements of the machine (how much it has actually moved). To do that:
  
 1. Physically record the position of the spindle/knife/sensor/etc on the machine with a ruler, caliper, camera attached to the machine arm, etc. 1. Physically record the position of the spindle/knife/sensor/etc on the machine with a ruler, caliper, camera attached to the machine arm, etc.
Line 31: Line 35:
 If the new number of pulses per unit is brought up too high without changing the maximum motor speed, the motors will start making jerking movements when moved. This is due to keeping the **Max Speed** the same. In order to eliminate the jerking movements, bring down the **Max Speed** value in CNC Settings > Axes/Motors until the movement is smooth again. If the new number of pulses per unit is brought up too high without changing the maximum motor speed, the motors will start making jerking movements when moved. This is due to keeping the **Max Speed** the same. In order to eliminate the jerking movements, bring down the **Max Speed** value in CNC Settings > Axes/Motors until the movement is smooth again.
 {{:mycnc:setup:calibration-software-setup-003.jpg}} {{:mycnc:setup:calibration-software-setup-003.jpg}}
 +
 +Max Speed is set in units/second (mm/s or inch/s), depending on what units you have chosen in your G-codes settings. 
 +
 +  * //NOTE: Overspeed acts in a manner  similar to CPU overclocking. Motion acceleration is increased together with motion speed when the overspeed is increased. Since toolpath planner does not have access to "Overspeed" value, a significant increase in Overspeed value up from 100% may cause issues, especially for analog servo control. Overspeed should be limited to 100% if you need to be sure the machine does not exceed "Max Speed".//
 +
 +7. Set the Backlash in units (mm/inch) for each axis. Backlash is the value that allows for some unexpected play in the machine due to clearance or looseness of mechanical parts. When the controller sends a movement command to the motor, the motor may turn briefly before any actual axis movement begins. That turn is defined as backlash, and can be accounted for in this setting.
  
 === How to set up Tangential Knife Cutting === === How to set up Tangential Knife Cutting ===
Line 51: Line 61:
  
 === How to set up a Lathe/Turning machine === === How to set up a Lathe/Turning machine ===
 +
 +[[quickstart:mycnc-quick-start:lathe_setup|Lathe/Turning Set up tips]]
 +
  
 1. Select Basic profile as "Lathe" in **Cfg** - **Preferences** - **Common** dialog 1. Select Basic profile as "Lathe" in **Cfg** - **Preferences** - **Common** dialog
Line 235: Line 248:
 if [ #5409 EQ 3 ] 300 if [ #5409 EQ 3 ] 300
 G10 L80 P7005 Q0 G10 L80 P7005 Q0
 +JUMP 1000
 +
 +N50
 +G10 L80 P7005 Q1
 +
 +
 +N300
 +
 +N1000
 +G10 L81 P5400 Q5409    (set current tool number)
 +
 +</code>
 +
 +
 +=== How to set up a Multi-Tool Tangential Cutter ===
 +
 +FIXME //Section under construction//
 +
 +For tangential cutting, a common scenario is for the system switch between two different motors for both the Z and the C axes (to switch between the tangential knife and the creasing wheel, for instance). Therefore, the system will have: 
 +
 +  * X- and Y-axes motors
 +  * Two different motors for the Z-axis (for knife and wheel up-down movement)
 +  * Two different motors for the C-axis (for knife and wheel rotation)
 +
 +**1.** How to switch between motors:
 +
 +**Axis pulse-dir signal** can be connected/disconnected from **Motor output** by writing to CNC registers 0x70...0x75 (112...117)
 +  * 0x70 (112) - Motor output #0
 +  * 0x71 (113) - Motor output #1
 +  * 0x72 (114) - Motor output #2
 +  * 0x73 (115) - Motor output #3
 +  * 0x74 (116) - Motor output #4
 +  * 0x75 (117) - Motor output #5
 +
 +Low 4 bits (0..3) of the writing value represent Axis to connect - 
 +  * 0 - X
 +  * 1 - Y
 +  * 2 - Z
 +  * 3 - A
 +  * 4 - B
 +  * 5 - C
 +  * 15 - disconnected
 +
 +pulse-dir Direction will be changed (**DIR** signal inverted) if Bit #4 is set.
 +
 +This way we add PLC procedures M201 and M202 to switch Z axis between Motor outputs #3 and #4
 +
 +<code C M201.plc>#include vars.h
 +main()
 +{
 +  parameter=15;   //OFF
 +  command=112+2;  //motor output #2
 +  message=PLCCMD_SET_CNC_VAR;
 +  timer=2;do{timer--;}while(timer>0);
 +
 +  parameter=2+16;   //Attach to Z-axis, "16" is axis inversion
 +  command=112+3;   //motor output #3
 +  message=PLCCMD_SET_CNC_VAR;
 +  timer=2;do{timer--;}while(timer>0);
 +  
 +  parameter=15;   //OFF
 +  command=112+4;  //motor output #4
 +  message=PLCCMD_SET_CNC_VAR;
 +  timer=2;do{timer--;}while(timer>0);
 +
 +  parameter=5;    //Attach to C-axis
 +  command=112+5;   //motor output #5
 +  message=PLCCMD_SET_CNC_VAR;
 +  timer=2;do{timer--;}while(timer>0);
 +
 +  exit(99);
 +};
 +</code>
 +
 +
 +
 +
 +<code C M202.plc>#include vars.h
 +main()
 +{
 +  parameter=15;   //OFF
 +  command=112+3;  //motor output #3
 +  message=PLCCMD_SET_CNC_VAR;
 +  timer=2;do{timer--;}while(timer>0);
 +
 +  parameter=2+16; //Attach to Z-axis, "16" is axis inversion
 +  command=112+2;  //motor output #2
 +  message=PLCCMD_SET_CNC_VAR;
 +  timer=2;do{timer--;}while(timer>0);
 +  
 +  parameter=15;   //OFF
 +  command=112+5;  //motor output #5
 +  message=PLCCMD_SET_CNC_VAR;
 +  timer=2;do{timer--;}while(timer>0);
 +
 +  parameter=5;    //Attach to C-axis
 +  command=112+4;   //motor output #4
 +  message=PLCCMD_SET_CNC_VAR;
 +  timer=2;do{timer--;}while(timer>0);
 +
 +  exit(99);
 +};
 +</code>
 +
 +**2.** Homing for Z1, Z2 axes can be configured in Macro Wizard. **M133** macro is usually used for **Homing Z** procedure. We will use macro names M1331 and M1332 for 2 homing procedures for every Z axis.
 +
 +<code C M1331>
 +M201 (Turn ON Z1 axis, OFF Z2 axis)
 +G10 L80 P5521 Q1
 +G10 L80 P5525 Q1
 +M88 L0 P3(Soft stop when sensor triggered)
 +G91 G0 Z   200.0000 F   600.00
 +G04 P0.1
 +M89 L1 P3(Quick stop when sensor triggered)
 +G91 G0 Z  -200.0000 F    30.00
 +G04 P0.1
 +G91 G0 Z     1.0000 F   500.00
 +G90 G10L70 P0 Z #5453
 +G10 L80 P5521 Q0
 +G10 L80 P5525 Q0
 +G10 L80 P7393 Q0 (Homing Flag)
 +</code>
 +
 +<code C M1332>
 +M202 (Turn OFF Z1 axis, ON Z2 axis)
 +G10 L80 P5521 Q1
 +G10 L80 P5525 Q1
 +M88 L0 P4(Soft stop when sensor triggered)
 +G91 G0 Z   200.0000 F   600.00
 +G04 P0.1
 +M89 L1 P4(Quick stop when sensor triggered)
 +G91 G0 Z  -200.0000 F    30.00
 +G04 P0.1
 +G91 G0 Z     1.0000 F   500.00
 +G90 G10L70 P0 Z #5453
 +G10 L80 P5521 Q0
 +G10 L80 P5525 Q0
 +G10 L80 P7393 Q0 (Homing Flag)
 +</code>
 +
 +**3.** M6 - Tool Change macro for multitool configuration.
 +
 +<code C M6>
 +M600 P#5409
 +
 +if [ #5409 NE 1 ] 100
 +M150
 +GOTO 1000
 +
 +N100
 +if [ #5409 NE 2 ] 200
 +M201
 +JUMP 1000
 +
 +N200
 +if [ #5409 EQ 3 ] 300
 +M202
 JUMP 1000 JUMP 1000
  
Line 387: Line 557:
  
  
 +=== Setting up a 2-motor X+Y X-Y 3D-printer===
 +
 +A 3D printer shown below is an example of a setup which utilized the X+Y and X-Y axis configuration in Settings -> Config -> Axes/Motors:
 +
 +http://forum.pv-automation.com/download/file.php?id=1135&t=1
 +http://forum.pv-automation.com/download/file.php?id=1134&t=1
 +
 +=== Setting up a waterjet system === 
 +
 +Certain CAM software packages can automatically insert necessary waterjet M-codes at some desired distance from the corners to properly accelerate and decelerate the machine. These M-codes are **M64/M65**, as well as **M164/M165** - the first two turn a specified output on/off on the fly without stopping (using the special FlyCut license that we provide), while M164/M165 are reserved for controlling the PWM output. 
 +
 +Some profiles within myCNC software (such as X1366P) contain a Software PLC procedure (WATERJET_SLOWSPEED) that works by monitoring the state of the output that the above codes toggle on and off:
 +
 +<code C> main()  
 +{
 + a0=gvarget(7184)&(1<<10); 
 +do{ 
 +a1=gvarget(7184)&(1<<10);
 +if (a0!=a1) 
 +{  
 + a0=a1; 
 + if (a0==0) //normal speed   
 +  {   
 +   gvarset(9379,0);
 +  }else //slow speed 
 +  {     
 +    gvarset(9379,1);   
 +  }; 
 +};    
 +}while(1);       
 +};   
 +</code>
 +
 +The above software PLC monitors the state of the desired output and switches the state of the global variable #9379. Writing "1" to this global variable results in a timer being started in the myCNC system, allowing the software, with the help of "Overspeed %" value, to smoothly reduce/increase the speed while passing a corner.
 +
 +As mentioned before, this functionality requires a FlyCut license, which is available to purchase on request. 
 +
 +===Connecting a servo drive to a myCNC controller===
 +
 +[[mycnc:mycnc_setup_examples:servo_drive|Connecting a servo drive to a myCNC controller]]
  
mycnc/mycnc_setup_examples.1560173607.txt.gz · Last modified: 2019/06/10 09:33 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki