plc:spindle_speed_control_through_-10v_dac_channel_et10
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
plc:spindle_speed_control_through_-10v_dac_channel_et10 [2017/05/22 23:24] – skirillov | plc:spindle_speed_control_through_-10v_dac_channel_et10 [2022/09/13 13:51] – ivan | ||
---|---|---|---|
Line 13: | Line 13: | ||
== PLC controller (Hardware) == | == PLC controller (Hardware) == | ||
- | DAC offset register is mapped to address 0x32 of [[mycnc: | + | DAC offset register is mapped to address 0x32 of [[mycnc: |
<code c># | <code c># | ||
Line 20: | Line 20: | ||
high 4 bits is DAC channel | high 4 bits is DAC channel | ||
- | Message PLCCMD_SET_CNC_EXTVAR should be sent to myCNC control core from PLC to get access [[External | + | Message PLCCMD_SET_CNC_EXTVAR should be sent to myCNC control core from PLC to get access [[mycnc: |
<code c># | <code c># | ||
Line 32: | Line 32: | ||
command=0x32;// | command=0x32;// | ||
parameter=dac_value+(2<< | parameter=dac_value+(2<< | ||
- | texit=timer+2; | + | texit=timer+2; |
</ | </ | ||
Line 47: | Line 47: | ||
{{doc-mycnc-dac-offset.png}} | {{doc-mycnc-dac-offset.png}} | ||
+ | === New functionality for DAC control === | ||
+ | |||
+ | As of September 2022, the firmware for the ET10 boards has been updated to make DAC control easier. For instance, now users can run code such as this: | ||
+ | |||
+ | < | ||
+ | |||
+ | { timer=0; | ||
+ | proc=plc_proc_spindle; | ||
+ | val=eparam; | ||
+ | | ||
+ | //if (val> | ||
+ | //if (val<0) {val=0; | ||
+ | | ||
+ | val=2048+val/ | ||
+ | | ||
+ | if (val> | ||
+ | gvarset(7371, | ||
+ | timer=30; | ||
+ | | ||
+ | dac01=val; | ||
+ | | ||
+ | portclr(OUTPUT_CCW_SPINDLE); | ||
+ | portset(OUTPUT_SPINDLE); | ||
+ | gvarset(7370, | ||
+ | gvarset(7371, | ||
+ | // | ||
+ | | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | | ||
+ | Here, we are utilizing the usual '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | You can change the DAC used in the following config window, however it will still be listed as '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Please note that since it is necessary to have a voltage value between -10 and +10 V, the value of 2048 is assigned to 0V. Therefore, for the maximum value we will be adding 2048 (i.e., |
plc/spindle_speed_control_through_-10v_dac_channel_et10.txt · Last modified: 2022/09/13 13:51 by ivan