Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Cary on July 22, 2016, 07:50:42 PM

Title: newbe with 4th axis problem
Post by: Cary on July 22, 2016, 07:50:42 PM
Hi, could I get some help with my 4th axis. I built my own cnc 4 axis machine and am using Mach3. I have followed all the help many of you have posted on how to "tune" my 4th axis rotational head. I got the steps right for my motor it is a nema 23 so 200 steps per/rotation. it is mounted to a 3 jaw chuck and the ratio is 6:1 (motor turns 6 times for the head to turn once). So the steps per/rotation is 1200 200 x 6 = 1200. So I set my "A" axis motor tuning to 1200 and the motor turns fine. I accelerated it to the best I could and all that is okay.

So here is my problem. When I go to MDI and input G0 A10, the head runs for about 8.5 rotations instead of 10 degrees. Help!!! Please!!!
Title: Re: newbe with 4th axis problem
Post by: Cary on July 22, 2016, 09:08:12 PM
Oh yeah I forgot to say that I tried the divide the steps by 360 and it comes up 1200/360=3.33333 and the motor tuning will not go that low so I could not use it as steps per unit number.
Cary
Title: Re: newbe with 4th axis problem
Post by: Highspeed1964 on July 22, 2016, 09:37:25 PM
You need to set the 4th axis to rotary.  It is calculating the input (A10 in your example) as a linear measurement and not a number of degrees.  You may also need to check if your 4th axis driver is configured for "micro steps".  If so, your calculation is not complete.  On my 4th axis, I have 8 micro-steps/step so a full rotation is actually 1600.

Hopefully, it's one of those two things and you should be on your way.

Stephen "Highspeed" Kruse
Title: Re: newbe with 4th axis problem
Post by: Cary on July 22, 2016, 09:57:09 PM
. While I was waiting for some input I kept fiddling around with the settings in motor configuration and this is what I got. I thought that maybe I was doing some calculations wrong I mean the nema 23 says that it is 200 step p/r but maybe it was a typo so I used 2000 and changed the 1200/360=3.333 to 12000/360=33.3333 and tried that well the motor turned so slow that I had to turn the velocity up to 12,000 and the acceleration up to 500. And believe it or not the motor sounded pretty good. But I still had the problem of when I got to MDI and typed A10 it wanted to run for like ever lol. So I thought okay I will go back to motor tuning and change the value to 3.33333 (original calculation), and turned the velocity up to 60000 acceleration to 5000 and bingo it ran great. But in MDI I only got 5 degrees with an input of A10.0  Sooooo I went to settings page and clicked the set axis button and put in 360.0 and the head rotated 180.0 and so I accepted the new setting of 6.6666 and now I get 10 degrees when I input A10.0 Or a full 360 when I input A360.0

Just saw my first reply. Highspeed thank you for your help....How do I set it to rotary? I can't find it.

Title: Re: newbe with 4th axis problem
Post by: robertspark on July 23, 2016, 02:17:26 AM
Set rotary on the general configuration tab
Title: Re: newbe with 4th axis problem
Post by: robertspark on July 23, 2016, 02:27:17 AM
I am confused... what is your microstep resolution setting for your stepper drive?

200 * 6 * microstep setting= number of steps per revolution.

Divide this by 360, if you want the steps per degree.
Title: Re: newbe with 4th axis problem
Post by: Highspeed1964 on July 23, 2016, 03:46:49 AM
Often time, the micro step setting on the driver is not readily available.  My particular driver for the 4th axis is printed in Chinese so I can't really tell what it's saying.  However, my X, Y, and Z axis drivers are clearly marked in English and I can tell it's set to 8.  So I figured I'd use that for my starting point and sure enough it was correct.

Reversing the calculations for the settings Cary finally came to:

6.6666 * 360 = 2400 Steps for one complete revolution of the axis
2400/6 = 400 Steps for one complete revolution of the motor
400/200 = 2 micro steps on the driver

So there you have it, Cary's machine has the 4th axis driver set to 2 micro steps.

In my case:

13.3333 *360 = 4800 Steps for one complete revolution of the axis
4800/3 = 1600 Steps for one complete revolution of the motor (my belt/pulley arrangement is 3:1)
1600/200 - 8 Micro steps on the driver

The math is correct as you indicated robertspark.  The confusion is that the micro step setting was unknown in Cary's machine.

Stephen "Highspeed" Kruse
Title: Re: newbe with 4th axis problem
Post by: robertspark on July 23, 2016, 06:31:35 AM
The problem with half stepping a drive will potentially be resonance and stall when the stepper is driven at certain speeds.

I would recommend you carry out some tests at quite a few speeds, you can write an incrementing feedrate macro that increases the speed of the 4th axis so you can test for any resonance issues.  The key elements is all cnc applications tends to be acceleration and tuning the drives not just for maximum velocity (g00 rapid motion), but the acceleration setting which also requires you to shunt the axis not just back an forth but forwards in stages....

Basically spend as much time as possible performance testing at various feedrate to check nothing stall at any point also note that adding a cutting tool (non plasma or laser) will add some cutting force or resistance to the motion... making it more inclined to stall.... hence the basic rule to thumb tends to be, find the stall points, and choose a setting of about 60% of the peak stall and stall acceleration.... but each to their own... depends what you are cutting and with what.

Also with a 4th axis you may be just incrementing around the axis or 3d cutting (simultaneous) blended x, Y, z and a... b ... c axis motion...

Back to the start of my waffle... you may want to consider 1/4 or 1/8th ustep settings if you can... but no higher than 10usteps.. only a good set of testing will tell you and demonstrate any improvement with a flick of the dip switches
Title: Re: newbe with 4th axis problem
Post by: Cary on July 23, 2016, 01:15:44 PM
Thanks everyone, I appreciate the help. To robertspark, the manufacturer only listed the motor as having 200 steps p/r. (the nema 23's are only 4 wire, does that matter with micro steps?) There is no mention of micro steps so I haven't a clue as to what they are for these motors. Next, you said "set the A axis to rotary in the general config tab", there is no button that says rotary. I am going on the assumption that you are referring to the "check box for angular" vs. unchecked for linear. If that is what you meant then I am okay there. I like your suggestion to run many practice under pressure trials to fine tune the velo/accel in motor tuning. Finally I am unclear as to what you mean by "ustep settings" I will look around the net today and see if I can't teach myself. Otherwise I will look back here later to see if others post. Again many thanks!
Title: Re: newbe with 4th axis problem
Post by: robertspark on July 23, 2016, 01:28:05 PM
With regards to to rotary and linear, and config tab check box, you are correct.

What stepper motor drives are you using? Not the motor, the drive, have you a photo, link or model number?
Title: Re: newbe with 4th axis problem
Post by: Cary on July 23, 2016, 05:16:01 PM
I'm using a Chinese built TB6560 controller it was included with the stepper motors. Controller, power supply and nema 23 stepper motors. I will post YouTube video in a couple of days where you can see my machine and the rest of it. I have it all done just need to do some editing about the rotary head. I will post a link. Thanks again.
Title: Re: newbe with 4th axis problem
Post by: fixittt on July 25, 2016, 11:44:02 AM
The thing about rotary is that they are steps per degree.  Not full rotation.

For example, I have a Chinese rotary axis that is a stepper with 2 gears and a belt.
It is a 1.8 degree stepper which has like yours 200 full steps per rev.  No clue what the belt drive ratio is.  Micro stepping is at 10.

So to tune it, I started with a number, lets say 100 steps per.  
Zeroed te A axis in mach.  MDI G0 A360
Watched it rotate.  If it went to far then the steps per for A is to big.  Not far enough, then steps per is to small.
After each steps per change, you must SAVE AXIS SETTING.
Zero A axis work coordinates because it will change.  Then repeat the MDI.

Your 3.3 steps per sounds close to the right ball park.  I think I was in the 10 steps per range.

There is no logical reason why the steps per cannot be that low.  Just type it in  I just did it as 3.333 and it took the setting.