User Tools

Site Tools


mycnc:independent_pulse_generator

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:independent_pulse_generator [2018/09/02 09:54] skirillovmycnc:independent_pulse_generator [2018/09/02 11:05] skirillov
Line 3: Line 3:
  
 myCNC controllers Axis B can be switched to independent pulse generator output. myCNC controllers Axis B can be switched to independent pulse generator output.
 +
 +<code>
 +Independent Pulse Generator was added to firmware dated July 20, 2018.
 +At the moment the firmware is available as the
 +"Testing" version at the "Support" widget.
 +</code>
  
  
Line 22: Line 28:
 If Generator Frequency register (#8133) is changed -  If Generator Frequency register (#8133) is changed - 
   * RAW value is calculated and stored in the RAW register #8130   * RAW value is calculated and stored in the RAW register #8130
-  * If Coolant Register is NOT zero, the RAW value is sent to the myCNC controller to update current frequency. Changing the RAW register in myCNC controller takes affect immediately. +  * If Coolant Register is NOT zero, the RAW value is sent to the myCNC controller to update current frequency. Changing the RAW register in myCNC controller takes effect immediately. 
     * If the RAW value is zero, the generator is stopped (with given acceleration).      * If the RAW value is zero, the generator is stopped (with given acceleration). 
     * If the RAW value is not zero, the generator is started (or current frequency changed accordingly) with given acceleration.      * If the RAW value is not zero, the generator is started (or current frequency changed accordingly) with given acceleration. 
Line 65: Line 71:
 </code> </code>
      
-The lines contain "coolant-widget" definition (background color, position on the parent widget, widget size and widget type (myitems).+The lines contain "coolant-widget" definition (background color, position on the parent widget, widget size and widget type (myitems).
  
 +"user-coolant.xml code is shown below
  
 +<code XML user-coolant.xml>
 +<mycnc-configuration version="1.0">
 +<gitem where="coolant-widget"
 + position="0;0" width="490" height="30" labelWidth="490" type="label" 
 + labelFgColor="white" labelBgColor="##f-display" labelFontSize="18" labelFontStyle="bold" >
 +  <message>Coolant</message>
 +  <message_ru>Охлаждение</message_ru>
 +  <message_vn>Chất làm mát</message_vn>
 +</gitem>
  
 +<gitem where="coolant-widget"
 + position="10;40" width="220" height="60" displayWidth="90" labelWidth="130"
 + type="bdisplay" action="item:cnc-gvariable-8133" name="display-cnc-gvariable-8133"
 + bgColor="##b-display" fgColor="##f-display" fontSize="18" fontStyle="bold" format="%5.1f" 
 + K="1" labelFontSize="16" labelFontStyle="bold" labelFgColor="white" >
 +  <message>Rate, ml/hour</message>
 +  <message_ru>Расход, мл/час</message_ru>
 +</gitem>
  
 +<gitem where="coolant-widget"
 + position="280;40" width="180" height="60" displayWidth="90" labelWidth="90"
 + type="bdisplay" action="item:cnc-gvariable-8132" name="display-cnc-gvariable-8132"
 + bgColor="##b-display" fgColor="##f-display" fontSize="14" fontStyle="bold" 
 + format="%d" K="1" labelFontSize="16" labelFontStyle="bold" labelFgColor="white" >
 +  <message>Ratio</message>
 +  <message_ru>Коэффициент</message_ru>
 +</gitem>
  
-=== Pulse Generator setiings in the Software PLC ===+</screen> 
 +</code> 
 + 
 +The code contains 3 parts  
 +  * the widget label set up 
 +  * the frequency setup 
 +  * the Ratio set up 
 + 
 +It's supposed operator no need to change frequency acceleration and this setting is hidden from an  operator. 
 +The acceleration can be set up in the Software or Hardware PLC for example. 
 + 
 + 
 +=== Pulse Generator settings in the Software PLC ===
 The rate, ratio and acceleration can be set up in the Software PLC as well.  The rate, ratio and acceleration can be set up in the Software PLC as well. 
  
Line 89: Line 133:
 </code> </code>
  
 +
 +==== (Coolant) Pulse Generator control through Hardware PLC ====
 +
 +Function coolant_motor_start() is addaed to "mill-func.h" include file
 +
 +<code C mill-func.h>
 +coolant_motor_start()
 +{
 +  timer=10;do{timer--;}while(timer>0);
 +
 +  gvarset(8131,1000000); //acceleration
 +  timer=10;do{timer--;}while(timer>0);
 +
 +  x=gvarget(8133);//get the speed (frequency)
 +  k=gvarget(8132);//get the ratio
 +
 +  x=x*k; //calculate the RAW frequency
 +  gvarset(8130,x); //send the raw frequency to the register
 +  timer=30;do{timer--;}while(timer>0); //wait a time for the frequency value to be delivered
 +};
 +</code>
 +
 +M08.plc procedure which starts the coolant motor would be 
 +
 +<code C M08.plc>
 +#include pins.h
 +#include mill-func.h
 +
 +main()
 +{
 +  gvarset(7372,1);
 +  portset(OUTPUT_FLOOD); //
 +  coolant_motor_start();
 +  exit(99); //normal exit 
 +};
 +</code>
 +
 +
 +A procedure M09.plc to stop a coolant motor is simpler. Just need to write "0" to the raw frequency register.
 +
 +<code C M09.plc>
 +#include pins.h
 +main()
 +{
 +  gvarset(7373,0);
 +  gvarset(7372,0);
 +
 +  portclr(OUTPUT_FLOOD);
 +  portclr(OUTPUT_MIST);
 +
 +  gvarset(8130,0); //stop the pulse generator
 +  timer=30;do{timer--;}while(timer>0); //wait a time for the frequency value to be delivered
 +  exit(99); //normal exit 
 +};
 +
 +</code>
  
  
mycnc/independent_pulse_generator.txt · Last modified: 2022/02/11 15:45 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki