Hello Guest it is March 29, 2024, 10:30:05 AM

Author Topic: Missing steps on direction change  (Read 12557 times)

0 Members and 1 Guest are viewing this topic.

Offline dVE

*
  •  3 3
    • View Profile
Missing steps on direction change
« on: September 30, 2015, 09:00:32 AM »
Hi everyone,

first post here, but been a Mach3 user for some time now. Great software, by the way!

I had noticed that my parts tended to lose precision the more complex they were, but I couldn't tell exactly where the problem was until a few days ago. It seems that I am missing steps somewhere, but it's a very particular way of missing them.

Let me explain the test I have been running for a few days.

My setup is using a CNC kit like this: http://www.wantmotor.com/ProductsView.asp?id=272&pid=88. It uses a breakout board connected to the PC parallel port and to the drivers.
I have setup Mach3 and the drivers to use 1600 steps per mm (for this test, more on this later), and the kernel pulse speed is set at 75KHz.

I setup a micrometer on the tool measuring displacement on the X axis and set it to 0. In Mach3, I also zero all axes. Then I run this program, that moves X to 10mm and back to 0 a hundred times:

F2000
G90

M98 P0002 L100 (CALL SUB PROGRAM O0002 100 TIMES)
M30

O0002 (SUB PROGRAM)
G01 X10
G01 X0
M99
%


I have run the tests with motion mode set to CV and exact stop. Both have the same results so this is apparently not related.

If everything is fine (let's not count backlash yet, more on this later), at the end of the program the tool should be again at 0 in the micrometer.

My result is that the micrometer shows a displacement of 0.63mm.

I hear you saying backlash!! But wait! looks like too much for backlash. So... if I run the loop 50 times instead of 100, I get pretty much half the error: 0.31mm. Looks like the error is proportional to the number of times the operation is repeated which would rule out backlash. Let's dig a bit more.

Now I change the microstepping, from 1600 to 400 steps/mm in the drivers and Mach3 motor config. (4x less steps, so every step produces 4x more mm). Measured error is now 2.52mm: exactly 4 times larger.
Change the microstepping again, this time 6400 steps/mm (4x more steps, now every step produces 4x less mm). Error now is 0.16mm, approximately 4 times less than before.

I'm starting to suspect here that whatever is happening, I am missing steps at some point. And it seems that the number of steps is proportional to the number of G01 operations, but not to the number of pulses needed to move the motors those 10mm.

So, how many steps are being lost, actually? Let's see:

1600 steps/mm * 0,63 mm = 1008 steps  
6400 steps/mm * 0,16 mm = 1024 steps
400 steps/mm * 2,52mm = 1008 steps

The test is running 100 times, back and forth, so it's changing direction 200 times, this is about 5 steps missed every time direction changes, but independent of the total steps involved in the overall motor movement.

Acceleration could be an issue, so when changing direction, the motors could miss steps... so I tried feedrate 200 instead of 2000: no change (except it takes 10 times longer...)

I wanted to rule out mechanical components affecting here, so I made a quick test wiring an arduino with GRBL 0.9i to my drivers and run the same program (actually I rolled out the loop, since GRBL doesn't support G98): the result is exactly as expected: the micrometer reads 0 at the end of the test. Basically it rules out electronic/mechanical problems and leaves the ball on the PC side running Mach3.

I'm out of ideas now, I have tried every setting I could think of in the Mach3 configuration, but I'm stuck.

Do you have any advice, guys?

Thanks!

David
« Last Edit: September 30, 2015, 09:04:31 AM by dVE »

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Missing steps on direction change
« Reply #1 on: September 30, 2015, 12:40:09 PM »
David,
You are comparing pulses to mechanical movement, which is ok for a comparison, but apples are not oranges.
 
The only way is to isolate each against an electrical or mechanical  standard and that is not easy.
Here is what we did a long time ago as a test:
A custom built analyzer was used to count pulses, which uses 6 cpu's to count and compare 6 different inputs at once. The analyzer pulse readout is  accurate to something  like 20 parts per million. So we had the following electronically, pc output, break out board input and  output, drive output. Then we isolated each mechanical / electromechanical point and got an accuracy graph of each based on the same calibrated indication (optically done with repeatable accuracy to 0.0001").

Backlash can be due to a number of things....did you know
-  belt tension can affect a physical  linear move
- a ball screw can have different profile depending on direction it's going
- bearing preload does affect / is  backlash also and it can't be "Zero" else the axis may not move
- not all drives and motors are equal when it comes to rotating the motor shaft
Just some things that comes to mind...........

Apples and oranges, good fruit , but not the same!

RICH

Offline dVE

*
  •  3 3
    • View Profile
Re: Missing steps on direction change
« Reply #2 on: September 30, 2015, 12:49:10 PM »
Hi Rich, thanks for your input.

I understand your points, but the thing is... the same hardware (ballscrews, drivers, etc) behaves correctly if I replace the PC + Mach3 with an arduino and GRBL. Seems like for some reason Mach3 or the PC are missing steps while GRBL is not.

Cheers!

David
« Last Edit: September 30, 2015, 12:51:48 PM by dVE »

Offline rdean

*
  •  94 94
    • View Profile
Re: Missing steps on direction change
« Reply #3 on: September 30, 2015, 05:16:32 PM »
You may want to change the Active State of the motor pulse output to see if that helps.

Ray

Offline dVE

*
  •  3 3
    • View Profile
Re: Missing steps on direction change
« Reply #4 on: October 01, 2015, 10:10:56 AM »
Hi Ray,

Quote
You may want to change the Active State of the motor pulse output to see if that helps.

Tried your suggestion and the result is that the motor didn't move. They were already set to active low, which got me thinking. Maybe there is some incompatibility between the breakout board and the way mach3 sends the pulses, perhaps related to the pull-ups. I'll try with a different breakout board I have from and old project to check if that makes any difference.

Thanks!

David
Re: Missing steps on direction change
« Reply #5 on: October 12, 2015, 07:39:16 PM »
David,  just for grins and giggles, enable sherline mode. 
When the first G540`s came out, I had one that did something close to what you are describing.  But it was very predominate when cutting a 3d model toolpath in wax.  by enabling sherline mode, It increased the pulse width.  ther breakout board in the website picture looks like a standard breakout board I used to mess with alot a few years ago. 

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Missing steps on direction change
« Reply #6 on: October 12, 2015, 09:36:30 PM »
Quote
Acceleration could be an issue, so when changing direction, the motors could miss steps... so I tried feedrate 200 instead of 2000

Changing the feedrate does not change the acceleration rate.
Go to motor tuning and reduce the acceleration by 50% and run your test again.

Quote
I hear you saying backlash!! But wait! looks like too much for backlash.

Backlash is not cumulative. If it was backlash, you'd get the exact same result every time.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Missing steps on direction change
« Reply #7 on: October 13, 2015, 02:41:27 AM »
That kernal pulse speed is very fast at 75 khz.....  way too fast if you ask me, why do you need it that fast?

>>>> in simple terms, can you post / email me your XML file?

If not, I'd suggest you go back to basics....

Look at your motor settings page for each Axis and consider what you are intending the machine to run at 1600 steps / mm ... is just that "steps per mm".... what velocity are you targeting?   What acceleration are you targeting?   [for each axis]

What is your pulse width for steps and DIR (on the motor tuning page).

say your machine is running at 1200 mm / minute [not sure what type of machine you have!], that is 20mm/sec..... and you have asked it to run at 1600 steps / mm

so 20 x 1600 = 32,000 steps / second [32 kHz....]

1600 steps / mm is also 0.000 625 mm / step  .... very high resolution.... do you need it that high? 

You can bring your mm / step resolution down and improve your machine speed as at high khz rates stepper motors may not like the acceleration or how fast they are being pulsed  (especially if they are big stepper motors).

[if you send your XML I'll have a look tonight .... + 12 hrs from now.... can you also post some information on your machine (what is it?), plus what leadscrews do you have, what pitch etc...]

Rob
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”
Re: Missing steps on direction change
« Reply #8 on: October 13, 2015, 04:13:16 AM »
Note, l did not believe the step frequency via arduino was very high

Have you measured your backlash, have you considered your backlash?

Acceptable limits of backlash are subjective, but really task specific..... Say you have 1 thousand of an inch backlash... (0.0254mm).... But your machine is running at 1 step per 0.000 625mm (1600 steps per mm)... That means your stepper drives need to turn 40.65 steps just to deal with the backlash before the machine moves....

Again I don't know your application, but if you are talking arduino and grbl... It's probably not that high precision

Rob
Rob

Albert Einstein ― “If you can't explain it to a six year old, you don't understand it yourself.”

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Missing steps on direction change
« Reply #9 on: October 13, 2015, 08:05:16 AM »
David,

Here is what I would do:

1. Find what your Pulse frequency is different kernel speeds:
   - Say, select 25K, save settings, go out and come back into Mach3. Now go to Diagnostics and note the pulse frequency.
     If steady record or if fluctuating note the range  ( +- record the lowest and highest value).  
     Use Kernel speed which provides the most stable pulse frequency and nearest the kernel speed.
     25K should be fine to start.

2. Set your drive for 10 micro stepping ( 1000)

3.  Now go to Settings (alt6) tab and calibrate the  axes. Use the longest possible movement.
     Move the axis in one direction so you remove any backlash, then calibrate.
     First time around use something like 50mm / a shorter distance.
     Frankly you should calculate the steps per first !
    
Steps per should be correct, see how "smooth the motors start, jog , stop, adjust accel value based on testing similar to velocity, but done after velocity
is satisfactory.

The name of the game is to get the axes to move smoothly, accurately with repeatability.

If you want to play around finding lost steps later then have fun,

RICH

« Last Edit: October 13, 2015, 08:08:07 AM by RICH »