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 10:08] 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 105: Line 111:
   * the Ratio set up   * the Ratio set up
  
-It's supposed operator no need to change frequency acceleration and this setting is hidden from operator.+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. The acceleration can be set up in the Software or Hardware PLC for example.
  
Line 127: 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