Configuring Acorn for 0-5V spindle control

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
GranDan
Posts: 10
Joined: Mon Oct 22, 2018 6:43 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 40BD322E7843-0906181181
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Configuring Acorn for 0-5V spindle control

Post by GranDan »

I have drilled down in multiple posts to get clarity on configuring Acorn for 0-5V spindle control. It appears there are four possible solutions:
1) Throw away your 0-5V spindle drive and get a drive and motor that works on 0-10V (allow me a little humor here) = unacceptable
2) Install a KBSI-240D. Cost: $60 - $100 depending on source, shipping etc. = marginally acceptable if you don't mind spending the $$
3) Make a simple voltage divider circuit with a couple of resistors. = cheap, simple, easy, acceptable, but not an elegant solution IMHO.
4) Someone has alluded to the possibility of editing the PLC code by changing the DAC values. = elegant, no cost (except time and possible fear of mistakes).
So, is it possible to edit the PLC code to cause Acorn to output 0-5V, or not? If so, what values? Even better, a screen shot of the edited code - unless it is classified beyond my security clearance. ;)
Thanks guys,
Love y'all
Nigelo
Posts: 366
Joined: Tue Dec 11, 2018 4:03 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: F045DA80C8B8-0905181172
E415F6F70BC3-0318203049
98F07B91FC6B-0123236802
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK

Re: Configuring Acorn for 0-5V spindle control

Post by Nigelo »

Suggest you wait for CNC12 v4.60 which supports both 0-5v and PWM that is about to be released once the public beta has finished

Enhancement list on the following link
viewtopic.php?f=60&t=5094
"You can lead a horse to water but you cannot force it to drink"
Hope this helps
Nigel
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: Configuring Acorn for 0-5V spindle control

Post by cncsnw »

There are several ways it could be done. Among the simplest would be to let all of the existing code that calculates the output do its job, then divide by two at the point of converting it to the integer "12BitSpeed_W", limiting it to a valid range, and writing to the analog output.

Locate in your PLC program the code which reads:

Code: Select all

;Convert to integer word for DAC & I/O display
IF True THEN TwelveBitSpeed_W = TwelveBitSpeed_FW

; Bound min to 0, max to 4095
IF TwelveBitSpeed_W < 0 THEN TwelveBitSpeed_W = 0
IF TwelveBitSpeed_W > 4095 THEN TwelveBitSpeed_W = 4095

If !SpinAutoModeLED && G540SpindleStage && SpindleDisable_M THEN TwelveBitSpeed_W = 0
If !SpinAutoModeLED && !G540SpindleStage && !SpindleEnableOut_M THEN TwelveBitSpeed_W = 0

; Output to DAC
IF True THEN WTB TwelveBitSpeed_W SpinAnalogOutBit0 12
Change two lines (four counting comments) so it reads:

Code: Select all

;Convert to integer word for DAC & I/O display
; Also divide by two, to get 0-5V output instead of 0-10V output
IF True THEN TwelveBitSpeed_W = TwelveBitSpeed_FW / 2.0

; Bound min to 0, max to 2047.  2047 is maximum for 5VDC.
IF TwelveBitSpeed_W < 0 THEN TwelveBitSpeed_W = 0
IF TwelveBitSpeed_W > 2047 THEN TwelveBitSpeed_W = 2047

If !SpinAutoModeLED && G540SpindleStage && SpindleDisable_M THEN TwelveBitSpeed_W = 0
If !SpinAutoModeLED && !G540SpindleStage && !SpindleEnableOut_M THEN TwelveBitSpeed_W = 0

; Output to DAC
IF True THEN WTB TwelveBitSpeed_W SpinAnalogOutBit0 12
GranDan
Posts: 10
Joined: Mon Oct 22, 2018 6:43 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 40BD322E7843-0906181181
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Configuring Acorn for 0-5V spindle control

Post by GranDan »

Thanks guys. PLC mod works perfectly
jmezomatrix
Posts: 8
Joined: Sat Oct 12, 2019 3:17 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Configuring Acorn for 0-5V spindle control

Post by jmezomatrix »

I need to do this very procedure for 5v control. What is the file name that the changes need to be made in?
Thanks,
John
cnckeith
Posts: 7164
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: Configuring Acorn for 0-5V spindle control

Post by cnckeith »

try out the public beta, 0-5 analog out is a selection in the Acorn Wizard.
0-5.PNG
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
Post Reply