mycnc:independent_pulse_generator
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
mycnc:independent_pulse_generator [2019/09/27 15:55] – ivan | mycnc:independent_pulse_generator [2019/10/03 14:10] – ivan | ||
---|---|---|---|
Line 192: | Line 192: | ||
====Pulse Generator control for Spindle==== | ====Pulse Generator control for Spindle==== | ||
- | It is possible to control the spindle speed through the pulse generator. | + | It is possible to control the spindle speed through the pulse generator. This is done through the independent pulse generator implemented in myCNC, which can be "mixed into" the B axis channel. An independent generator is controlled by writing values to the global variables 8130-8133, as described in the table at the beginning of this page (Register Name / Description table). |
- | The independent pulse generator | + | When using the GUI elements (buttons, input lines, etc.) it is convenient (and necessary) to use the multiplier and frequency registers when setting the generator |
- | An independent generator is controlled by writing values to global variables 8130-8133, as described in the table at the beginning of this page. . | + | When utilizing the Hardware PLC, you MUST use the " |
- | + | ||
- | When using the GUI elements (buttons, input lines, etc.) it is convenient (and necessary) to use the multiplier and frequency registers when setting the generator frequency. When changing the value of register #8133 (the preset generator frequency), myCNC software will automatically recalculate the value of the preset frequency | + | |
- | + | ||
- | When utilizing the Hardware PLC, you must use the " | + | |
**Independent Pulse Generator Spindle implementation example** | **Independent Pulse Generator Spindle implementation example** | ||
- | 1. Add the code to enable | + | 1. Add the code that enables |
- | It is convenient to add code to the end of the procedure before the exit(99); line. | + | |
<code C> | <code C> | ||
Line 224: | Line 219: | ||
</ | </ | ||
- | 2. Add the code to to enable the generator into the Hardware PLC spindle speed adjustment procedure (SPN.plc). | + | 2. Add the following |
<code C> | <code C> | ||
Line 234: | Line 229: | ||
// 12-bit spindle speed to generator frequency | // 12-bit spindle speed to generator frequency | ||
k = 123456; | k = 123456; | ||
- | freq = eparam * k; // Calculate the raw value of the generator frequency | + | freq = eparam * k; // Calculate the raw value of the generator frequency |
// Send the generator frequency value | // Send the generator frequency value | ||
Line 241: | Line 236: | ||
</ | </ | ||
- | 3. Add the generator shutdown code to the Hardware PLC spindle shutdown procedure (M05.plc turns the spindle OFF). | + | 3. Add the generator shutdown code to the Hardware PLC spindle shutdown procedure (M05.plc turns the spindle OFF). It is also convenient to add this code right at the end of the PLC procedure, before the exit(99); line. |
- | It is also convenient to add this code at the end of the PLC procedure, before the exit(99); line. | + | |
<code C> | <code C> | ||
Line 250: | Line 244: | ||
</ | </ | ||
- | In this implementation, | + | In this implementation, |
< | < | ||
If the task is to connect both spindles at the same time and switch them during operation | If the task is to connect both spindles at the same time and switch them during operation | ||
(for example, by referencing their tool number), it is necessary to organize | (for example, by referencing their tool number), it is necessary to organize | ||
- | a more complex PLC procedure, | + | a more complex PLC procedure, which will be checking |
the value of the global variable or input controller and by this condition | the value of the global variable or input controller and by this condition | ||
- | include only one of the spindles. | + | would include only one of the spindles. |
</ | </ | ||
- | In this example, we are assuming that the speed of a conventional spindle is 24,000 rpm. | + | In this example, we are assuming that the speed of a conventional spindle is 24,000 rpm. This value, respectively, |
- | This value, respectively, | + | |
- | + | ||
- | At this spindle speed, a full 10V signal must be sent to the analog output, so the " | + | |
- | When calling the PLC procedures for turning | + | When calling the PLC procedures for turning |
myCNC controllers have 12-bit registers for PWM and DAC at 0-10V.This means that with a maximum spindle speed of **24000 rpm** and a factor of **1**, the '' | myCNC controllers have 12-bit registers for PWM and DAC at 0-10V.This means that with a maximum spindle speed of **24000 rpm** and a factor of **1**, the '' | ||
Line 273: | Line 264: | ||
< | < | ||
- | The Pulse-Dir input of the servo spindle is set to 10,000 pulses, i.e. the motor shaft will make a full revolution every 10,000 pulses. Then, to achieve a full speed of 4500 rpm, the following pulse rate is needed | + | The Pulse-Dir input of the servo spindle is set to 10,000 pulses, i.e. the motor shaft will make a full revolution every 10,000 pulses. Then, to achieve a full speed of 4500 rpm, the following pulse rate is required: |
< | < |
mycnc/independent_pulse_generator.txt · Last modified: 2022/02/11 15:45 by ivan