+\- 10vDc PLC spindle code for ALLINONEDC
Moderator: cnckeith
-
- Posts: 68
- Joined: Sun Nov 18, 2018 7:22 am
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: Yes
- Oak CNC controller: No
- CNC Control System Serial Number: CNC12-m39-104028
- DC3IOB: No
- CNC12: Yes
- CNC11: Yes
- CPU10 or CPU7: No
- Location: Western NY
+\- 10vDc PLC spindle code for ALLINONEDC
Does anyone have the PLC code for the ALLINONEDC to do spindle control +10vdc forward and (-)10vdc reverse?
Rob Jackson
RJ Technical Services
RJ Technical Services
-
- Posts: 68
- Joined: Sun Nov 18, 2018 7:22 am
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: Yes
- Oak CNC controller: No
- CNC Control System Serial Number: CNC12-m39-104028
- DC3IOB: No
- CNC12: Yes
- CNC11: Yes
- CPU10 or CPU7: No
- Location: Western NY
Re: +\- 10vDc PLC spindle code for ALLINONEDC
This seemed to work.
Rob Jackson
RJ Technical Services
RJ Technical Services
Re: +\- 10vDc PLC spindle code for ALLINONEDC
Assuming you only want to use it for speed control, then that should work (output a value from 2048 to 4095 for 0V to +10V).
My standard code is like this (having previously set "SpindleAnalogBipolar_M" per a parameter selection).
My standard code is like this (having previously set "SpindleAnalogBipolar_M" per a parameter selection).
Code: Select all
;Convert RPM to 12 bit value
IF True THEN TwelveBitSpeed_FW = SpinSpeedCommand_FW/RPMPerBit_FW
; Factor in gear range
IF True THEN TwelveBitSpeed_FW = (TwelveBitSpeed_FW/SpinRangeAdjust_FW)
;Convert to integer word for DAC & I/O display
IF True THEN TwelveBitSpeed_W = TwelveBitSpeed_FW
IF SpindleAnalogBipolar_M && !SpindleDirectionOut
THEN TwelveBitSpeed_W = 2048 + (TwelveBitSpeed_W / 2)
IF SpindleAnalogBipolar_M && SpindleDirectionOut
THEN TwelveBitSpeed_W = 2048 - (TwelveBitSpeed_W / 2)
; Bound min to 0, max to 4095
IF TwelveBitSpeed_W < 0 THEN TwelveBitSpeed_W = 0
IF TwelveBitSpeed_W > 4095 THEN TwelveBitSpeed_W = 4095
; Output to DAC
IF True THEN WTB TwelveBitSpeed_W SpinAnalogOutBit0 12
-
- Posts: 68
- Joined: Sun Nov 18, 2018 7:22 am
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: Yes
- Oak CNC controller: No
- CNC Control System Serial Number: CNC12-m39-104028
- DC3IOB: No
- CNC12: Yes
- CNC11: Yes
- CPU10 or CPU7: No
- Location: Western NY
Re: +\- 10vDc PLC spindle code for ALLINONEDC
We hope to rigid tap as well. So the code change I've made wouldn't be suitable for that?
I'll try your code and find the parameter you mentioned. I think I saw it from another ATC post on your website.
Thanks as always Mark
RobJ
I'll try your code and find the parameter you mentioned. I think I saw it from another ATC post on your website.
Thanks as always Mark
RobJ
Rob Jackson
RJ Technical Services
RJ Technical Services
Re: +\- 10vDc PLC spindle code for ALLINONEDC
Rigid tapping is not a factor one way or the other.
To do tapping, you need to be able to make the spindle rotate forward and rotate reverse, at more or less the requested speed. It does not matter whether reverse rotation is accomplished with a bipolar analog signal, or with an alternate "run" input to the drive.
I think the only functional issue with your code, is that it would not work correctly with a reversed spindle range (e.g. back gear on a knee mill), because the jog panel LEDs would not accurately indicate motor direction.
The sample bipolar code above references SpindleEnableOut, to choose whether to output a negative voltage. Typically I would assign that to a memory bit on any machine that uses bipolar analog for direction control, since OUT8 is no longer needed or used; but if you do not need all of the outputs, you could leave it on OUT8. Just be sure to wire your spindle run command directly from OUT7, or from OUT7 through the E-stop contactor; and not through OUT8.
To do tapping, you need to be able to make the spindle rotate forward and rotate reverse, at more or less the requested speed. It does not matter whether reverse rotation is accomplished with a bipolar analog signal, or with an alternate "run" input to the drive.
I think the only functional issue with your code, is that it would not work correctly with a reversed spindle range (e.g. back gear on a knee mill), because the jog panel LEDs would not accurately indicate motor direction.
The sample bipolar code above references SpindleEnableOut, to choose whether to output a negative voltage. Typically I would assign that to a memory bit on any machine that uses bipolar analog for direction control, since OUT8 is no longer needed or used; but if you do not need all of the outputs, you could leave it on OUT8. Just be sure to wire your spindle run command directly from OUT7, or from OUT7 through the E-stop contactor; and not through OUT8.
Re: +\- 10vDc PLC spindle code for ALLINONEDC
My complete Allin1DC basic mill PLC program is attached, for reference. I use Parameter 178 bit 2 (+4) to select bipolar analog.
- Attachments
-
- report_PLCUpdate_allin1dc-basic-mbl-cwp4.zip
- (132.42 KiB) Downloaded 3 times