User Tools

Site Tools


mycnc:servo_on_off

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
Next revisionBoth sides next revision
mycnc:servo_on_off [2019/10/21 10:24] ivanmycnc:servo_on_off [2019/10/21 14:54] ivan
Line 1: Line 1:
 =====Servo ON/OFF===== =====Servo ON/OFF=====
  
-The Servo ON and Servo OFF commands allow the user to both creating an automatic PID ON/OFF (for example, when opening/closing the myCNC software)as well as a manual set of buttons or commands to turn on and off the servo motor(s)+**Summary**: It is necessary to have the following 4 Software PLC commands: %%__HANDLER_INIT%% to start the servo when the myCNC software is turned on%%__HANDLER_EXIT%% to turn the servo off when the software is shut down, %%__HANDLER_SERVO_ON%% to manually turn on the servo, and %%__HANDLER_SERVO_OFF%% to manually turn it off. This is done through the use of the 60000 and 60001 global variables
  
-The automatic turning on and off of the servo motor on software start/close can be done by going into Settings > Config > PLC > Software PLC and creating %%__HANDLER.INIT%% and %%__HANDLER_EXIT%% files (if they do not yet exist) with the following code:+---- 
 + 
 +The Servo ON and Servo OFF commands allow the user to create an automatic PID ON/OFF (for example, when opening/closing the myCNC software), as well as a manual set of buttons or commands to turn on and off the servo motor(s). 
 + 
 +The automatic turning on and off of the servo motor on software start/close can be done by going into Settings > Config > PLC > Software PLC and creating %%__HANDLER.INIT%% and %%__HANDLER_EXIT%% files (if they do not yet exist) with the following code:   
  
 <code c __HANDLER_INIT.PLC> <code c __HANDLER_INIT.PLC>
Line 23: Line 27:
 {{:mycnc:software-plc-002-handler-init.png}} {{:mycnc:software-plc-002-handler-init.png}}
  
-As can be seen, writing 1 to the register 60000 will turn the PIDs on, while writing 1 to register 60001 will turn the servo PIDs off. This will also be used in manual servo control, where a button can be utilized to quickly switch the motor on and off.+As can be seen, writing 1 to the register 60000 will turn the PIDs on, while writing 1 to register 60001 will turn the servo PIDs off. This will also be used in manual servo control, where a button can be utilized to quickly switch the motor on and off. 
  
-In order to do so, it is necessary to have the %%__HANDLER_SERVO_ON%% and %%__HANDLER_SERVO_OFF%% commands in the Software PLC section. These can be extremely similar to the INIT and EXIT commands shown above, as they effectively perform the same task (differences begin to crop up only when additional actions are required on servo startup, or on program start, etc). By default, the code will be the following:+In order to do so, it is necessary to have the %%__HANDLER_SERVO_ON%% and %%__HANDLER_SERVO_OFF%% commands in the Software PLC section. These can be extremely similar to the INIT and EXIT commands shown above, as they effectively perform the same task (differences begin to crop up only when additional actions are required on servo startup, or on program start, etc). By default, the following code is required for each respective PLC command 
  
 <code c __HANDLER_SERVO_ON.PLC> <code c __HANDLER_SERVO_ON.PLC>
Line 45: Line 49:
 {{:mycnc:software-plc-001-handler-on.png}} {{:mycnc:software-plc-001-handler-on.png}}
  
-**To summarize**: It is necessary to have the following 4 Software PLC commands: %%__HANDLER_INIT%% to start the servo when the myCNC software is turned on, %%__HANDLER_EXIT%% to turn the servo off when the software is shut down, %%__HANDLER_SERVO_ON%% to manually turn on the servo, and %%__HANDLER_SERVO_OFF%% to manually turn it off. This is done through the use of the 60000 and 60001 global variables. +The manual code allows to use buttons to turn on and off the servo motor such as seen in the X1366P Plasma profile: 
 + 
 +{{:mycnc:software-plc-003-servo-on-off.png}}
mycnc/servo_on_off.txt · Last modified: 2021/06/04 15:40 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki