Can't add negative number to Low Range Spindle Speed RatioRatio <milling machine as a lathe, resolved>

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

cnckeith
Posts: 7363
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: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by cnckeith »

best way is to modify the Lathe PLC to look for an input and decide whether to spin the spindle motor CW or CCW based on that input.
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
cncsnw
Posts: 3864
Joined: Wed Mar 24, 2010 5:48 pm

Re: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by cncsnw »

Your reported spindle speed comes from the spindle encoder.

If your spindle encoder is on the motor (rather than on the spindle) then CNC12 would have to compensate for the gear ratio when it interprets the encoder rate.

CNC12 for Mill does that, if you set bit 4 of Machine Parameter 36.

I do not know whether CNC12 for Lathe does that. That may be another feature that did not get shared with the Lathe software, on the basis that it would not be very useful (because threading on a lathe nearly always requires multiple passes, and successive passes will only be synchronized if the encoder is always 1:1 with the final spindle rotation).
msauto
Posts: 42
Joined: Wed Sep 04, 2019 3:06 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by msauto »

My encoder is on the top side of the spindle. But does read from the spindle not the motor. The strange thing is it was reporting the right rpm then overnight it started reporting high range rpm only.
cncsnw
Posts: 3864
Joined: Wed Mar 24, 2010 5:48 pm

Re: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by cncsnw »

Putting the spindle encoder on the top of the spindle of a knee mill is equivalent to putting the encoder on the motor. The top of the spindle does not rotate with the tool when you are in back gear; it rotates the opposite direction, and faster.

Maybe it was reporting the right RPM when you were running the Mill software with an appropriate value in P36, and it stopped reporting the right direction when you switched to the Lathe software?
msauto
Posts: 42
Joined: Wed Sep 04, 2019 3:06 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by msauto »

I have spent the last 3 hrs comparing mpu.plc from cnc12 mill to cnc12 lathe and cannot find anything pertaining to the SpinRangeAdjust_FW,SpinRangeReversed_M,BackGearEnabled_M, and anything else that i could imagine that would cause low gear ratio & spindle reversing as a reult of selecting "spin low" on the vcp or adding an input button for low range (i addded an input on nput3 and set it to 'backgear' as kieth suggested) NOT TO WORK. Can someone throw me a bone? Just point me to a search term that would get me in the neighborhood. The fact that not even low ratio convertion is working seems wrong to me. I have 3 lathes to convert all old iron with at least 3 speeds that i want to be able to use if needed. I cant wrap my head around why the options are on the default vcp screen if there not available. I purchased lathe pro based on that assumption. Anyway... this has become a personal challenge now and i will modify the plc if needed(modification is easy..knowing what to modify is whipping my butt. So if power users could point me in the right direction it would be EXTREMELY APPRECIATED :D
cnckeith
Posts: 7363
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: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by cnckeith »

post a fresh report.zip so we can see your current setup. do you have photos of the machine in a photo album? so we can see what we are working with?

note: you can always pay for custom plc work as an option if you'd like us to work on your project.
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
cncsnw
Posts: 3864
Joined: Wed Mar 24, 2010 5:48 pm

Re: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by cncsnw »

First, you would not edit the mpu.plc file. You would edit the .src file, then compile it to make a new mpu.plc file.

Yes, there is a copy of the source file in comments at the top of mpu.plc, but it is just there for reference in case the original source file has gone missing.

See lines beginning in the vicinity of line 4170 in acorn_lathe_plc.src.

As far as I can tell from reading the sources, the Acorn "BackGear" input, if enabled, causes SpindleRange_W to be set to 1 (low) if the input is open, and 3 (medium-high, which is treated as high) if the input is closed. Note that this is backwards from what you might expect.

SpindleRange_W is then used to set SpinRangeAdjust_FW either to the value from Parameter 65 (in low gear) or to 1.0 (in high gear).

Then, the PLC checks if the resulting SpinRangeAdjust_FW is less than zero. If it is less than zero, then the PLC sets SpinRangeReversed_M, and then makes the working value of SpinRangeAdjust_FW positive.

Elsewhere (ca. line 4076, processed on the next scan of the PLC program) the PLC uses SpinRangeReversed_M to decide whether to invert the sense of the SpindleDirectionOut bit, which in turn controls the spindle direction output relays.

Since CNC12 lathe will not let you enter a negative value for P65, the existing PLC logic is unable to work as intended.

If you want your BackGear input switch to cause spindle motor direction to be reversed at the same time that it select the low-range ratio, then you could replace the line that controls SpinRangeReversed_M. Rather than responding to the switch directly, I would probably make it depend on SpindleRange_W, so the new logic would work regardless of what method you use to select or indicate low range.

Code: Select all

IF SpindleRange_W==1 THEN (SpinRangeReversed_M)
msauto
Posts: 42
Joined: Wed Sep 04, 2019 3:06 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by msauto »

Thank you! And yes I understand that I need to edit a copy of the .src file then compile it and paste in place of the existing .mpu file I was just using the .mpu file to do comparison's. Thanks again for all the help, I must have missed something because that is where i was searching and parameter 820 (backgear enable) is set to 0 on both mill and lathe cnc12 software. I did enable it just to see if it would make a difference but made no change and cnc12 mill is still working as expected.
cncsnw
Posts: 3864
Joined: Wed Mar 24, 2010 5:48 pm

Re: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by cncsnw »

Parameter 820 or Parameter 412?

Did you assign BackGear to an input, using the Acorn Wizard?
msauto
Posts: 42
Joined: Wed Sep 04, 2019 3:06 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Can't add negative number to Low Range Spindle Speed RatioRatio

Post by msauto »

:oops: OOps, ment to say 412 but i also tried just changing 820 to lathe from within my mill software(which did nothing..lol)but it stuck in my mind. And yes i asigned input 3 to backgear.
Post Reply