Page 1 of 1
Ajax Spindle Control
Posted: Fri Sep 03, 2010 10:38 am
by please no smoke
I want to control the spindle CW and CCW with mach. I wish to use a brain to control RPM. How do I tell mach which relays I want it to use to do this?
I assume that I use ports and pins, spindle setup. Under relay control it only says you can use #'s 1-6. I am using output 8. When it is open my spindle is CW, when it is closed my spindle is CCW. Output 6 is my low speed, and Output 7 is my high speed. How do I set this up?
I am trying to set RPM with a brain, but I am not entirely sure where to pull this from. I have it reading the true spindle speed rpm. I am guessing this will not work?
Thanks
Matt
Re: Ajax Spindle Control
Posted: Sat Nov 13, 2010 9:22 pm
by bobby.neal
I'm trying to use the feed per rev g code and to do that I need to hook up true spindle speed. I'm using a cnc4pc index pulse card. Do you know how to hook that up to the ajax mpu11 and have mach3 use it for the spindle speed dro. I could really use the help. Thanks.
Re: Ajax Spindle Control
Posted: Mon Nov 15, 2010 11:04 am
by please no smoke
I wish I did. My Hurco used a speed control board but it required strobes from the cpu. I am just having the machine wait while I crank up the speed. I have not gotten an answer about where "true spindle speed" comes from or how it is derived. That might be a good one for Scott. I was thinking that I could write a brain or a program to use the prox switch to calculate actual speed and compare this with what mach is telling me in "true spindle speed" then compare these and either crank it up or down. Let me know if you come up with a good way.
Re: Ajax Spindle Control
Posted: Mon Nov 15, 2010 3:16 pm
by diycncscott
please no smoke wrote:I want to control the spindle CW and CCW with mach. I wish to use a brain to control RPM. How do I tell mach which relays I want it to use to do this?
I assume that I use ports and pins, spindle setup. Under relay control it only says you can use #'s 1-6. I am using output 8. When it is open my spindle is CW, when it is closed my spindle is CCW. Output 6 is my low speed, and Output 7 is my high speed. How do I set this up?
I am trying to set RPM with a brain, but I am not entirely sure where to pull this from. I have it reading the true spindle speed rpm. I am guessing this will not work?
Thanks
Matt
Matt,
I must have missed this.
Mach maps the spindle to "Outputs" 1 & 2. These are not true outputs but rather just settings for "ports and pins". You don't need to change anything in ports and pins, the Ajax Brains map those "outputs" to the real outputs on the Ajax hardware used for spindle enable and direction -outputs 7 (enable) and 8(direction).
In order to set max speeds for your spindle pulley/gear ratios -which I think is what you are trying to do- you need to set those under "Config"->"Spindle Pulleys".
The other thing you probably want to do is to create a couple of macros and/or screen buttons to turn on/off whatever outputs you use to change gears.
The following is untested:
Lets assume that you want to use m40 for low gear and m41 for high gear and that low gear is Pulley1 & high gear is Pulley2, your macro(s) would look something like:
m40.m1s
SetPulley(1)
m41.m1s
SetPulley(2)
Mach/Ajax will automatically scale your analog output to match the max speed defined for the pulley selected.
Re: Ajax Spindle Control
Posted: Mon Nov 15, 2010 8:58 pm
by bobby.neal
Can someone please tell me how to get my rpm for my spindle to work through my ajax hardware using a cnc4pc index pulse card!!!!
I currently have the card hooked to input 14( dp4 ) on my dc3iob
I have a brain written that takes that input ( mod 14 with bit only checked ) and then it terminates at spindle index input. Under ports and pins I have the index enabled with port defaulted at 1 and pin defaulted at 0 and emmulated enabled this allows me to see the index led change state when the spindle rotates but theirs nothing showing on the rpm dro.
Re: Ajax Spindle Control
Posted: Tue Nov 16, 2010 8:34 am
by diycncscott
Bobby,
We don't support the index card you refer to.
We currently don't support feed per rev in Mach or Mach Lathe but if you have a differential encoder on spindle
you can connect it to a free encoder port on the MPU11 and read the encoder directly.
Re: Ajax Spindle Control
Posted: Tue Nov 16, 2010 11:22 am
by please no smoke
Thanks Scott. I may use that eventually. My old style head does not support step and direction that I know of. I have a manual back gear and motor up and motor down of a vari belt. For now I will probably just use the macro to make it wait then use a switch to change the speed.
Can you do a post on setting an on screen button?
Re: Ajax Spindle Control
Posted: Tue Nov 23, 2010 10:21 pm
by bobby.neal
I would love to connect a differential encode to the spindle and use the mpu11 encoder input but i still have the same problem getting the true spindle dro to read rpm. the problem being I don't know how to map the ( a ) encoder input on the mpu11 to the mach3 true spindle dro. or how to convert the signal from encoder pulses to rpm.
Re: Ajax Spindle Control
Posted: Tue Nov 30, 2010 10:13 am
by diycncscott
Assuming you have you spindle encoder plugged into encoder #6 on MPU11 (UserDRO #1235)
Something like this should work reasonably well:
In macropump (untested)
Dim SpindleRPM As Double
Dim SpinCountsPerRev As Integer
Dim SpinLastCount As Long
Dim SpinCurrentCount As Long
Dim SpinDiff As Long
SpinCountsPerRev = 4096? <- Set to your encoder ppr value
SpinLastCount = GetUserDRO(2007)
Sleep 100 'Wait 100 milliseconds
SpinCurrentCount = GetUserDRO(2007)
If Not (Abs(SpinCurrentCount) >= Abs(SpinLastCount)) Then 'check for rollover
SpinDiff = (Abs(SpinCurrentCount) - Abs(SpinLastCount))
SpinRPM = ((SpinDiff * 10 * 60) / SpinCountsPerRev)
End if
SetUserDRO(1235, SpinRPM)
NOTE: SpinDiff * 10 = # counts per second, * 60 = #counts per minute, /counts/rev = SpinRPM