Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: JonnyElectronny on March 16, 2009, 08:34:48 PM

Title: 4th Axis - How do I constantly rotate it?
Post by: JonnyElectronny on March 16, 2009, 08:34:48 PM
 just added a 4 axis to my system.  This axis is a rotary head / divider.
I want to turn it on so that it continues to rotate at a constant speed while Mach3 runs my program (g-code).
In other words I want to use the rotary head like a lathe head.   
So how do I program the 4th axis to turn on at the beginning of my g-code file, then turn off at the end?

Any suggestions?  Thanks.
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: ger21 on March 16, 2009, 08:58:38 PM
Make a separate profile and set it up as a spindle.
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: JonnyElectronny on March 17, 2009, 09:03:43 AM
I like that idea.  So last night I tried it.

Now my next question is.....can you use a stepper motor as a spindle?

I read my mach3 manual and went through all the steps.  And after some time I finally got the stepper (4th axis) to turn using it as a spindle.
However it was very slow and harsh sounding, and there was no speed control, it was either on or off.
It's as if the stepper was just receiving the wrong pulses.

So what do you think I am missing?  All my other motors set up without a hitch, and my 4th axis works fine when not used as a spindle.

Any help would be great.

Title: Re: 4th Axis - How do I constantly rotate it?
Post by: ger21 on March 17, 2009, 11:29:47 AM
Try using an S********* in the MDI to set the speed. S500 for 500 rpm.

You can add that to your g-code to automate it.
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: Hood on March 17, 2009, 03:18:10 PM
Have you set the correct steps per unit? Not sure what the velocity should be set as, manual says Revs per Second however with the SmoothStepper it is Revs per Min for a Step/Dir spindle so it could be the same for normal PP operation.
Hood
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: GaryB on March 17, 2009, 09:50:10 PM
I would set it up as an A-Axis, that way you get full control under code just like your X, Y, and Z-axis plus it will allow you to run as a rotary or an indexer and finally you can add to your post processor to generate code.
just my 2 cents
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: Greolt on March 17, 2009, 09:58:34 PM
JonnyElectronny said

"I want to turn it on so that it continues to rotate at a constant speed while Mach3 runs my program (g-code)."

How do you do that if it is set as A axis?

Greg
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: JonnyElectronny on March 19, 2009, 09:14:03 AM
Thanks for the input guys.

It seems as if I haven't found the correct settings to use a stepper as a spindle. 
I have tried different values in the MDI using "S*********" 
I have played with every posible variable imaginable.
The best I can get is a heavy pulse to my stepper about once every half second.
I have set my steps per unit, velocity, out puts, I have played with spindle speeds etc.

Under setup - spindle setup - motor control - I changed to "PWM control" and my stepper started to turn, but only at one speed (slow) and the pulses where very harsh and heavy sounding.
I also got a reverse this time. But I think that "PWM control" if for servo motors.

I am so close, I just feel as if I am missing one step.  My stepper works very well set up as an a-axis, just wish it would set up as well as a spindle.

 
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: BClemens on March 19, 2009, 04:15:07 PM
Someone clarify this! Why do you need to set the forth axis ('A' in this case) up as a spindle to have it rotate? 'A' can be used for anything but isn't the forth axis ('A') rotation in the X axis (or 'Y')? When someone needs to have 'A' axis rotate, what is the proper method in Mach3?

Sorry for the thick spot but this makes no sense at all.....It appears that there are a couple of explanations going on here.

Bill C.
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: Hood on March 19, 2009, 04:33:58 PM
Bill
 the OP wants to have the axis constantly roatating so if he used the 4th axis as a normal 4th then he would have to command an A move on every single line of code. Maybe he doesnt need it constantly rotating but I suspect he may be wanting to use it as a lathe. You could of course use the 4th axis as a true 4th for lathe type work but that mean lots of calculations for each move, well as far as I can see.



Jonny
 Please attach your xml.

Hood
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: JonnyElectronny on March 19, 2009, 10:25:51 PM
Ok sorry, what is XML?  I will as soon a I know what it is.

Yes, as a forth axis it works well for gear cutting, dividing etc.  Where the problem comes in to play is where I wanted to try it to do some lathe work.
But as I soon found out, you have to program almost every line of code with code to move the A-axis, and some heavy calculations.
I used my cordless drill on the divider to cut some shapes out, but now that I have the stepper connected, I would lust like to use it.

JonnyElectronny
Title: Re: 4th Axis - How do I constantly rotate it?
Post by: Hood on March 20, 2009, 03:22:49 AM
The xml is the file that has all of your settings. If you are using the standard Mach3Mill profile then it will be called Mach3Mill.xml, if you have a custom profile then it will be the name of your custom profile.xml. You will find it in C:\Mach3 folder on your drive, you will need to copy it to your desktop then rename it for the forum to accept it, suggest you call it JonnyElectronny.xml

Hood