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 [2020/05/22 14:04] 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 ===
Line 59: 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 243: 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 395: 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.1590170678.txt.gz · Last modified: 2020/05/22 14:04 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki