# Machsupport Forum

## Mach Discussion => General Mach Discussion => Topic started by: nickle989 on March 29, 2009, 10:46:26 AM

Title: Motor tuning calculations
Post by: nickle989 on March 29, 2009, 10:46:26 AM
Hello to all this is the setup,

Units = Inches
Stepper motor - 200 step / rev
Driver - 1/2 step -

When I setup in motor tunning I am using this calculation ...

200 x 2 x 10 = 4000 steps per inch (motor does not run correct) ... but this does not work ... 2000 steps per inch does the job, but this does not make sense to me from what I have read.

I started with 400 steps per inch ... but this was not correct either, the motor does run smoothly ... only gives me about 1/4 of an inch.

Could someone help show me where I messed up the calcualtion.

Thank you.
Title: Re: Motor tuning calculations
Post by: HimyKabibble on March 29, 2009, 10:54:51 AM
Sounds to me like you're not really running 1/2 steps.  If you set it to 200, and tell it to move 1", does the motor turn exactly one turn, or half a turn?  I"m guessing you'll find it moves a full turn.

Regards,
Ray L.
Title: Re: Motor tuning calculations
Post by: bowber on March 29, 2009, 11:42:59 AM
With half step and a 10 tpi lead screw you should have 4000 units per inch (unit) so as Ray said it looks like your not running half step.
Also check your lead screw, if it's a 5 tpi twin start it'll look like a 10 tpi. To check this turn the screw 1 turn by hand and measure the movement.
Sorry if this is all obvious to you but I thought it's worth mentioning.

Steve
Title: Re: Motor tuning calculations
Post by: nickle989 on March 29, 2009, 12:04:52 PM
Strangeness indeed ...

I did a power down power up reset ... set the acceleration from 10 to 4 and X axis to 4000 steps ... looks like it is working, now that I am at least in the ball park I can fine tune ... thought maybe my grade 1 math was forgotten LOL.

Gcode ?

G0 X1.0
G0 X0.0

Would this move the table 1 inch and then move it back to the beginning?
Title: Re: Motor tuning calculations
Post by: Hood on March 29, 2009, 01:37:57 PM
Gcode ?

G0 X1.0
G0 X0.0

Would this move the table 1 inch and then move it back to the beginning?

Yes as long as you zeroed the X axis before you started.
G0 is a rapid move so will go at the full speed that your velocity is set at in the motor tuning. G1X1F10  will do the same thing but at a feedrate of 10 inch per minute.

Hood
Title: Re: Motor tuning calculations
Post by: nickle989 on March 29, 2009, 01:53:41 PM
Great, thank you all for the help.
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 08:38:44 AM
Hello, I am having the same problem where Mach3 is doubling the step on the X / Y drives/motor ... the Z drive/motor works just great.  I had been using it for a few weeks now and back to the same flakey problem.

If I drop 4000 steps to 2000 it works just fine.

This all happenend when I went to adjust the max feed rate down on the X/Y drives.  I only touched the feed rate.   I have tried reinstalling Mach still the same put a created a new profile still the same.  I placed the Z drive in place of the X drive still the same, tried to rule out the drive to make sure it is running in half step.  Using the latest stable Mach version.

Another thing that I have noticed is the Max Feed Rate always defaults to 6 on the main control screen when Mach is restarted ... I change this and it still goes back to 6 why is this when it should remember what I have set it for?

Best I can tell is Mach / Windows problem does anyone have any suggestions?

Attached is the xml file maybe I am blind.
Title: Re: Motor tuning calculations
Post by: Hood on April 24, 2009, 09:28:36 AM
What does the Drive Test look like?
The feedrate resetting to 6 is normal, if you want to have a differennt feedrate set at startup the put F**** (**** being the speed you require) in the initialisation string on General cofig page

Hood
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 09:55:12 AM
The drive test look normal.  On the init string G80 G61 F4  ... does it need to be sepperated by commas or spaces  .. ie.  G80,G61,F4 ?

The feed rate resetting at least gives an explantion of that, Thank you.

I am reformated the controler machine right now ... I am hoping it is a windows xp problem ... trying windows 2000.

P4 - 1.2 Gig
1 Gig of ram

I have contacted the manufacture of the controller and drives .. SOC-Machines ... they have been running Mach for a few years.
Title: Re: Motor tuning calculations
Post by: Hood on April 24, 2009, 10:17:06 AM
On the init string G80 G61 F4  ... does it need to be sepperated by commas or spaces  .. ie.  G80,G61,F4 ?

Shouldnt matter whether you have it all with no spaces, have spaces or have commas.

Hood
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 11:34:08 AM
Well, installed win2000 .. same problem .. re-flashed the drives to make sure the drives are set to 1/2 step ... x,y double the distance .. z is correct.  I am now at a complete loss to figure this out.

Title: Re: Motor tuning calculations
Post by: SteinarN on April 24, 2009, 12:19:22 PM
What happens if you swap the step and direction pins of the z and say x axis in the port and pins configuration? Does the error switch to the x axis then?
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 04:41:32 PM
The issue remains the same when I use the setting of 4000 steps.

I have now made sure with the manufacture of the controller and driver that it is going from full step, half step, quarter step and 1/16 step.  It does work as it is supposed to ... ie move an 1 inch it does.

The problem lies with Mach3.  How do I make sure that the 1:1 ratio is working or engaged ... it looks like it is turned off ... not sure if this would cause the problem or not.  Somehow Mach3 is not working as it should be or at least how I think it should be with the way it is configured.

Title: Re: Motor tuning calculations
Post by: Hood on April 24, 2009, 04:47:06 PM
So you are saying that you have changed the pins for X and Z around in Mach and the X is still wrong and Z is still OK?
Hood
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 05:55:22 PM
Okay here goes ...

Units = Inches
Stepper motor - 200 step / rev
Driver - 1/2 step -
X,Y Steps set - 4000 - no gear just ball screw
Z Steps set - 7000 (turns a worm gear)

Before the reformat ... I took the Z Drive and interchanged it with the X Drive ... no settings changed .. X Drive doubled ... and the Z Drive did not.  Now I changed the motor pins around X over to Z ... changed the steps from 7000 to 4000 and it still doubled the distance.  Changed the drive wires back and rechanged the Z to 7000 and it doubled the distance.  Conclusion resulted in a fresh install.  Same problem ... tried the non-locked down version same thing.  From there I reformated the drive thinking that it is a Windows problem ... nope the problem remains.

The drives are optically isolated and are programmable for Full Step, Half Step, Quarter Step or 1/16 Step
They are flashed for 1/2 step and have been verified to be this ... If I change to 1/4 step or full the issue remains the same which is that it doubles the distance.

Since I have formated the hard drive with Windows 2000 the Z axis now also must be set to 3500 steps in order for it correctly move the distance.

Ratio's are working.
The driver test comes out excellent from 25 to 100 ... I have tried 25 , 35, 45 with a restart of Mach with each change.

Title: Re: Motor tuning calculations
Post by: MachineMaster on April 24, 2009, 05:58:19 PM
I have run into the same thing on my Bridgeport. I have 200 step per rev steppers and 5TPI ball screws = 1000 steps per inch.
I have to set X & Y to 2000 steps per inch and Z to 1000 steps per inch to get correct moves. In the AHHA software all axes are 1000 SPI.
Darrell
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 06:14:28 PM
Well thank @#\$%@#\$ I thought I was going insane and maybe lost to many brain cells along the way!  I can now see that I am not the only one that is having this issue.  I drop the setting down but I fear that in the middle of a part it might just then decide to correct itself.
Title: Re: Motor tuning calculations
Post by: Hood on April 24, 2009, 06:17:04 PM
Darrel what version of Bridgeport was it?
Hood

Edit, I am presuming it still has the original BOSS drives?
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 24, 2009, 06:35:38 PM
It was a BOSS5 and yes I am still running the Bridgeport SMD and ACC boards using an interface board that takes step and direction and converts to what is being called "Wave Drive" here.
What is puzzling is why Z is still 1000 steps and X & Y are 2000 steps when with the other software all are 1000 steps.
The driver can't be sending 2000 step pulses per inch or the mill would be moving 2 inches and there is no 1/2 step setting available.
Title: Re: Motor tuning calculations
Post by: Hood on April 24, 2009, 06:39:53 PM
Not sure if Boss5 was half step or not, mine was a Boss6.1 (UK version of Boss6) and it was half stepping. Was just wondering if some way the AHA knew that and put out pulses accordingly.
I have a doc somewhere that has the specs of most of the BOSS versions so will look see if I can find it.
Hood
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 24, 2009, 06:46:37 PM
Actually your BOSS6 was full stepping with a 2:1 ratio on the belt drives. The SMD cards are interchangeable between BOSS 5 & BOSS 6.
I have used other software and it was always 1000 per inch. It has to be Mach 3 as that is the only change.
Title: Re: Motor tuning calculations
Post by: Hood on April 24, 2009, 06:53:10 PM
Well wont argue as to be honest I cant remember but gearing on mine is 2.5:1 and I am almost certain it is 1/2 stepping, that may be the difference between Boss 6 and 6.1. Been looking for the pdf but not found it so far.

Well I dont have an answer for either of you, yours needs to be doubled and nickles halved, very strange indeed.

Hood
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 24, 2009, 07:04:49 PM
The difference between BOSS 6 and BOSS 6.1 was in the Bridgeport software. The Iron was all the same for the Boss 6 mills in the same series. (Series I or Series II) BOSS 3, 4 & 5 iron was mostly the same different in electronics and software.
Did you change motors? I have been doing tech support for Bridgeport CNCs for the last 18 years and the 6s have all been 2:1.
Darrell

Title: Re: Motor tuning calculations
Post by: Hood on April 24, 2009, 07:09:47 PM
The UK ones were built by Adcock and Shipley and they had different setup, for example they have metric ballscrews 5mm pitch. ThisĀ  definitely had the original motors and gearing when I got it, its now got new steppers but belt and pulleys are original.
Hood

Edit, now you have me wondering if it is 2:1 will have to look tomorrow at the steps per I have set :D

Edit again, just found a backup xml, set to 1000steps per so thats 200 steps x 10 microsteps x 2.5 gearing divided by 5mm = 1000 so definitely 2.5:1
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 07:14:58 PM
MachineMaster .... are you still using Mach3 ... how long? if so have you had any hickups ? I am wondering if I can trust it not to try to correct itself in the middle of the job as it has done this a few times in past on me screwing up the piece completely.  Even if I set the drives to full step I might end up getting half the distance plus the resonance won't be good.
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 24, 2009, 07:44:52 PM
Hood,
I see the difference being that your mill is using metric ball screws where all of the ones that I have worked on were 5 turns per inch ball screws.

Nickle,
I have been using Mach 3 for about 1 month and I haven't had any hickups yet. I am running Windows 2000 on the computer on the mill and I haven't bought a license yet because I am still testing like they said to do on the web site. I mostly like what I have found except for the need to have a mouse. I am working at getting things set up to work from the keyboard much like the AHHA software does.
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 24, 2009, 07:47:23 PM
Now I am going to have to set the oscilloscope up out in the shop and check the pulse streams to see what is going on.
Title: Re: Motor tuning calculations
Post by: techsol on April 24, 2009, 09:37:26 PM
I'm very new to Mach3, and am hesitant to post on your topic, as I'm by no means a knowledgeable Mach3 user.

However... I know a few things about steppers, and some of your posts seem to present conflicting information.

You cannot be half stepping if you are doing Wave Drive.  Those are somewhat mutually exlusive terms.

Full stepping uses phases 1, 3, 5, 7.
Wave Drive uses phases 2, 4, 6, 8.
Half stepping uses phases 1, 2, 3, 4, 5, 6, 7, 8.... in fact it's a combination of Full Stepping and Wave Drive that produces half-stepping.

So... if you've got something that says it is Wave Drive, you are still "full stepping" in that it moves one full step increment per phase change.

The difference between Full Stepping and Wave Drive is that Full stepping powers both A and B phases at once, whereas Wave Drive powers only 1 of the phases at a time.

Look at page 3 of the following document.

http://www.solarbotics.net/library/pdflib/pdf/motorbas.pdf

I'm sure I didn't post that link properly (I'm in Quick Reply) but just cut and paste...

Also... this page has a pretty good representation of the differences between, Full, Wave, and Half stepping.

http://www.doc.ic.ac.uk/~ih/doc/stepper/control2/sequence.html

Finally... here's a pretty good little "Stepper Fundamentals" tutorial (from StMicroelectronics) on the Digikey web-site.

http://dkc1.digikey.com/us/en/tod/STMicroelectronics/StepperFundamentals/Stepper_Fundamentals.html

Hope some of the above helps.

Best regards,

Michael
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 24, 2009, 10:22:52 PM
You are correct. That is why I said that Bridgeport (at least the US model) was full step only.

Hood,
Did your BOSS 6 have 3 SMD cards and an ACC card mounted on the right hand side of the main card cage cabinet? If so it was definately silgle step.
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 10:26:32 PM
Michael .. interesting ... I will have to driver manufacture tommorrow and find out how they are handling the step and direction.

I have just completed an install on another computer .. AMD this time 1GhZ , 512 ram ... same thing ... so this has to me has to be the way the controller / driver is interpitating what and how Mach is sending its signals.

What gets me though ... is that it worked for almost a full month until I went to tune it a bit more.

Title: Re: Motor tuning calculations
Post by: techsol on April 24, 2009, 10:51:10 PM
Whew!  I can breathe again.

It sounds like you found that information a little useful.

I almost didn't post... I'm a noob... I know it... and I'm not looking to start posting lots of useless noob advice.

I find the problem you describe very interesting.

It is very strange that it worked for so long, and then seemed to change when you tweaked some settings.

It would seem to me, that it's one of two things:

1.  Either the Step signal coming out of your LPT port (if you are using an LPT port) or out of your motion controller, has changed.  Meaning it's not putting out the same number of steps for a given distance as it was previously.

Or...

2.  The number of step pulses coming out are correct... but somehow the stepper drivers are no longer operating in the same mode (Full, Wave, Half, some level of micro-stepping).

I'm an electronics guy... so my next move would be to hook up either a counter or a logic analyzer to my STEP signal for the problem axis... tell Mach3 to do a move that would generate a specific number of steps... and see how many pulses I actually got.

At that point... I would know something... as I would actually see the expected number of pulses... or not.

If the number of pulses were right... I'd look for what changed downstream... probably the mode that the stepper driver is running in (some can be changed).

If the number of pulses were wrong... it's got to be something in Mach3... almost certainly some configuration setting.

edit --- If you are using an external motion controller... it could also be that, as that's what would be generating the step pulses.

My take on this would be that the Mach3 software has worked for too many people for too long to have that fatal of a flaw... where it's flaky and only works sometimes... it's got to be something more definitive.

Your own attempts to solve the problem by re-installing and using different P.C.s seems to indicate that whatever it's doing... the result is very consistent... it's just not resulting in what you expect.

I wish you the best of luck.

Best regards,

Michael
Title: Re: Motor tuning calculations
Post by: nickle989 on April 24, 2009, 10:58:53 PM
Tommorrow I am going to run TurboCNC from dos ... to see if the results repeat or are corrected ... if they remain then most definatly the controller and drives ... if not then it is the way the Mach3 is sending signal and they way the controller and drivers are interpetating the signals.

for what is is worth ....

www.soc-machines.com ... Mark4 and MM220's ... in the download section for the pdf's.
Title: Re: Motor tuning calculations
Post by: techsol on April 24, 2009, 11:57:55 PM
Gawd... I typed up this lengthy reply... and then something went wrong with the posting and it got lost.

Ouch.

Sorry man, but I'm not up for typing it all again.

Here's the summary.

Cool stuff on that Soc-machines site, thanks for the link.

The docs on the MM220s pretty clearly indicate that they were shipping them configured for 1/2 step, but that they can be reconfigured for full, 1/4, and other modes.

With the earlier MM220 software... you had to download a new hex file to the boards to change the stepping mode.

I think you would probably know if you had done that, grin.

However... I also spent some time looking at the docs for the MM130s.

The MM130s have this interesting feature where they can be reconfigured via the same STEP and DIR pins normally used for motion.

You change the STEP and DIR signals in a particular way... and instead of generating motion... you send commands to the stepper drivers processor.

One of the things you can do with those commnads... is change the stepping mode.

This is possibly relevant... as one of the MM220 documents mentions a new release of the MM220 software which will give the MM220's features similar to the MM130s.

It doesn't elaborate on excatly which features... but hey... it's not a stretch to think that maybe "configuration commands over the step/dir interface" is one of them.

If your MM220 drivers have updated software, and now have that feature... then it suddenly becomes at least possible that the step/dir signaling coming out of Mach3 could... depending on your configuration... result in a configuration change of your stepper drivers.

A lot of speculation here... sorry for that... but I'm working with very little real knowledge of the stuff you are using... I'm just reading tech. documents and looking for clues that might help.

Best regards,

Michael
Title: Re: Motor tuning calculations
Post by: SteinarN on April 25, 2009, 01:01:57 AM
Michael,

I have also written lengthy replays several times and lost them when posting on various forums. Now I always copy what I have written just before I post it. Has saved me from rewriting a long reply many times :-)
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 25, 2009, 03:00:48 AM
Well that doesn't explain what I am seeing. My electronics don't have any provision for anything except full step.
Yet two of my axes are now running set at 2000 steps per inch and the third is set at the normal 1000 steps per inch.
There has to be a bug in Mach 3. I am going to get my O scope on it maybe tomorrow.
Title: Re: Motor tuning calculations
Post by: Hood on April 25, 2009, 05:29:10 AM
Hood,
Did your BOSS 6 have 3 SMD cards and an ACC card mounted on the right hand side of the main card cage cabinet? If so it was definately silgle step.

I honestly cant remember as I stripped and sold the boards and motors almost as soon as I got the BOSS. I did have pics of all the boards I had when I put them on eBay and will look to see if I still have them.
You are probably right regarding the full step, it was 4 years ago since I read the pdf regarding the differences between USA and UK Bridgeports and probably it was the pulley difference that was making the steps per unit difference rather than the full or half stepping.

Hood
Title: Re: Motor tuning calculations
Post by: Hood on April 25, 2009, 06:59:54 AM
Heres pics of the boards I had.
Hood
Title: Re: Motor tuning calculations
Post by: Hood on April 25, 2009, 07:01:31 AM
And these
Title: Re: Motor tuning calculations
Post by: bowber on April 25, 2009, 08:00:57 AM
Is it anything to do with the pulse length/duration?

I've never had anything like this at all, the only problem i had when first setting up was I assumed the lead screws were imperial so measured 5 tpi but they were actually metric and were 5mm pitch, very close but not quite right.
Doesn't help with your problem though, I curious that it's so consistant as well which indicates some setting somewere.

Have you checked the axis scaling?

Steve
Title: Re: Motor tuning calculations
Post by: nickle989 on April 25, 2009, 11:28:35 AM

I did not test TurboCNC (could not fing a darn floppy that would work LOL)  so I tested both KCAM ( http://www.kellyware.com/ ) windows driven and also Linux EMC both are doubling the distances as does Mach3 .... so now I am off to call SOC again to find out why this is happening.  I would have to say it would be with in the controller but this is specualtion at this point.

Machinemaster maybe we could get our systems drunk and let them mate take the offspring and we would be both set .. LOL
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 25, 2009, 01:46:39 PM
Hood,
Those five boards were in the main card cage when you open the side cabinet. Just to the right of that card cage would have been the 12-, 12+ and 5+ power supply. The 3 SMD & 1 ACC & 3 axis power transistor blocks would have been on the right end of the cabinet on the door that opens to the back.
They might still be there.
Title: Re: Motor tuning calculations
Post by: Hood on April 25, 2009, 02:30:04 PM
Hood,
Those five boards were in the main card cage when you open the side cabinet. Just to the right of that card cage would have been the 12-, 12+ and 5+ power supply. The 3 SMD & 1 ACC & 3 axis power transistor blocks would have been on the right end of the cabinet on the door that opens to the back.
They might still be there.

Afraid I have no recollection of what was in there and what was where, just gutted it all keeping only the contactors and the transformer from the tape reader and the one that produced 110v.

Hood
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 25, 2009, 02:54:12 PM
I checked the step out to X, Y & Z with X & Y set to 2000 and Z set to 1000 and they were all the same.
So I set X & Y to 1000 and there was no change and a 1" command moved 1".
Your guess is as good as mine.
Title: Re: Motor tuning calculations
Post by: Hood on April 25, 2009, 02:58:51 PM
Weird indeed, did you try restarting Mach in between changes, shouldnt be needed but something is obviously strange there.
Hood
Title: Re: Motor tuning calculations
Post by: MachineMaster on April 25, 2009, 03:07:42 PM
Yes I did restart. I guess it is a wait and see.
I restarted Mach, I didn't reboot the computer.
Title: Re: Motor tuning calculations
Post by: nickle989 on April 25, 2009, 03:10:50 PM
It appears that the problem on mine lies with the controller code.  When the drives were tested individually one hooked up at a time they functioned correcly but together they did wierd things.

MachineMaster not sure if you are able to test yours like this or even if it relates to your problem.
Title: Re: Motor tuning calculations
Post by: bowber on April 25, 2009, 06:34:45 PM
Nickle, that would point to the power supply or noise on the step direction lines, did you change any routing of move any wires in the control box between it working correctly and it changing? Still I wouldn't expect noise to create a consistant result.

Steve
Title: Re: Motor tuning calculations
Post by: nickle989 on April 25, 2009, 08:26:44 PM
I would agree that noise could be in issue if it were intermitent or unpredictable, that is not the case though.  Being a programmer with electronics and working in the electrical field I am pretty good at trouble shooting problems.  Sometimes though asking the correct questions is a problem.  In this case not alot to go on as most use the most common drives and control devices and do not have these experiences.  These devices however are overpriced and place more on a name.  The electronic part are not more then maybe 25.00 but they seem to charge alot.  Mach3 on the other hand pretty good bang for the buck but I did need to make sure it was not causing an issue with my setup and if it is how to correct it ... time will tell soon enough.
Title: Re: Motor tuning calculations
Post by: Chip on April 28, 2009, 03:54:56 AM
Hi, ALL

Don't know how I missed this Post, Been sidetracked a little with threading and other issues hear, Look's like you all need another opinion or two.

Nickle989, I think "Techsol" Hit the nail on the head as you seem to think also. So you should be on the way to resolving the Problem. I usually recommend setting all the Motor Outputs, Dir/Step Low-Actives to All the same State (checked or X), But in your case that may not be possible. If any of your motors run backwards you can use, Home & Limit's, "Reversed" to change there direction without re-wiring the motors.

To late for further comment, Maybe tomorrow.

Chip