Hello Guest it is March 28, 2024, 03:09:29 PM

Author Topic: Losing steps or something?  (Read 53885 times)

0 Members and 1 Guest are viewing this topic.

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Losing steps or something?
« Reply #90 on: November 02, 2010, 05:01:14 PM »
I was talking about the Dir setting under Motor Tuning. The value there is how many micro-seconds before the first step in the opposite direction, the Dir pulse changes state. You are correct about the direction line that its Hi or Low state essentially defines the direction of the motor rotation. But the timing is critical here. Change it too soon and you lose one step in the current direction, too late you gain one.
Thank you! I have been educated. I did wonder what those parameters were for.
By way of explanation: working with robotics in the past, I had to write the low-level driver code myself. So I could be sure the Dir state change did NOT clash with the step pulses. Ah well.

So the Dir parameter is the delay in microseconds between a Dir state change and a pulse?
Then what is the Step pulse parameter? I would love to know. it says 0-5, but accepted a 6 (I think).
Is this documented somewhere - I would love to read it up.

*******
Don: this is something to test! Some fine adjustment here might solve your problems.

Cheers

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Losing steps or something?
« Reply #91 on: November 02, 2010, 05:28:45 PM »
Don

Mach3Mill_1.84.pdf, pages 5-12 and 5-13, seem relevant.
Top of page 5-13:
"problems with the test moves (e.g. motor seems too noisy) first check that your step pulses
are not inverted (by Low active being set incorrectly for Step on the Output Pins tab of Ports
and Pins) then you might try increasing the pulse width to, say, 5 microseconds. The Step
and Direction interface is very simple but, because it "sort of works" when configured
badly, can be difficult to fault-find without being very systematic and/or looking at the
pulses with an oscilloscope."

Cheers

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: Losing steps or something?
« Reply #92 on: November 02, 2010, 08:59:56 PM »
Interesting thread to follow, that said, i am going to make some comments FWIW.

1.The software is the begining of the controlling process. It could be buggy, but, one dosen't know without some physical indication.

2. It can be useless looking for an electronic step / pulse  without the proper equipment.
Ideally it would be nice to have a pulse counter which could simultaneously take and compare say the following:
PC to PP - PP output - drive input - drive output to the motor ....and compare the electronics. Not manny folks have
access to such an instrument or one of high enough quality that it can be trusted as the "last word". Of course the signal quality
along the way by itself can contribute to a problem.

3. The motor acts as a converter to mechanical motion. So anything downstream of it becomes  motion /  distance.
The motor by itself can be a contributor.So now you have all the variables like timing gear, belt, bearing, screw, nut and
 each has it owne level of quality relative to the motion. Yes ....a belt can create what would apear to be a lost step.

So if one wanted to be  annal about all this, they would need to isolate each part of the system , define the error against some standard,
put it into perspective to the final outcome namely , motion. Good grief... thats only about 20 tests and it dosn't even include
other devices a user may be using or software influences. All of them need to be done in a very disciplined way and to higher degree than the
min resolution of the system.

Considering the above the user needs to work with what they have and can do and in most cases that is not much.
So what can you do quite accurately?
Minimise the electronics to only that which is needed for motion. PC/PP/drive/ then a motion measuring device upstream of the
mechanics. Simply put, you put out pulses and measure them at motor output shaft. To do that one can make mechanical ( not electronic )
indicator and see what that "block" of the system is doing. ie;

A simple disc of 6 " diameter would have a circumference of 18.849". At 20000 steps per inch, the resolution / single step is equal to  0.00005"
if all was perfect and 18.849 / 20000= 0.0001" of circumferential movement of the disc. An 8" disc would give you 0.0013" of circumferential movement.You need to make at least a 1 rev of the motor since the non linearinty of the stepper should repeat. You can figure out what commanded movement
is required for one complete revolution of the disc. Make note that if you fall in a micro step you may be +-  in cicumferential distance.

So the user can check a drive with micro step or without ( use the same motor ) , then swap the cables and compare other drives. Forward and reversemotion.Try the same with a different motor. Try a different PP port. But make note of the data of each test. Not all motors are the same!
At least this way you are comparing electronics to a motion standard without influences of the mechanical system.

Just some thoughts FWIW on testing,

RICH

Offline Dan13

*
  •  1,208 1,208
    • View Profile
    • DY Engineering
Re: Losing steps or something?
« Reply #93 on: November 03, 2010, 03:30:44 AM »
Hi Roger,

The Step Pulse parameter is how many micro-seconds are added to the base step pulse width (don't remember what it is). I think the label is wrong and it would accept values 0-15.

Dan

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Losing steps or something?
« Reply #94 on: November 03, 2010, 03:44:17 AM »
The Step Pulse parameter is how many micro-seconds are added to the base step pulse width (don't remember what it is). I think the label is wrong and it would accept values 0-15.

Ah - seems reasonable, albeit obscure ... :-)
Hum - at 35 kHz clock, you wouldn't want anything over 15 uSec, would you?
One day ... I will haul the CRO out there.

Cheers
Re: Losing steps or something?
« Reply #95 on: November 03, 2010, 05:13:07 AM »
Hi, All.  Good reading your input.
I have tried different step and Dir numbers ranging from 0us to 15 us with no change.  I would have expected something...  Currently have step set to 2 us per Gecko suggestion.
Question...  Does the Direction act as a pulse for each step? or does it change state for reversals of motion direction only, ie. steady state for duration of move in that direction?
My steps are set to "Low Active" in the Motor Outputs.  The Direction s are set to what ever makes the axis move the correct direction.
I'm running 25Khz clock on this setup since more than 50 inch per minute gets dangerously fast and toward stall speed of the steppers.  I don't make a living off this machine so I want accuracy and reliability more than speed.

I would like setup instruction on using an O'scope as I do have a BK Precision 1530  30mhz scope.  If it could be hooked up to see the timing differences between step and direction it would be nice.  It is a simple dual trace scope, not a storage type.  About 20 years old.  If you think it might be helpful, tell me how to set it up on the machine and I'll try it.  Most of my advanced electronics has been repair of old tube amps... Very basic.
Rich, good to hear from you,  I don't know if my scope is good enough for this application, but if you think it might be, I'm open to suggestion.  I have never seen a pulse counter, although it would seem such a device must exist.
The servo motor isn't hooked up and with the iterative tests it is quite obvious that it doesn't return to zero.  Also, the stepper motor for the X axis is shown in the picture or more correctly the belt and pulleys.  Changing the acceleration doesn't seem to have any effect at this time...  I'm sure the problem is not mechanical. 
Oscope settings would be helpful. 
Don

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Losing steps or something?
« Reply #96 on: November 03, 2010, 05:39:30 AM »
Does the Direction act as a pulse for each step? or does it change state for reversals of motion direction only, ie. steady state for duration of move in that direction?
Dir is a state, not a pulse.

Quote
My steps are set to "Low Active" in the Motor Outputs.
Is that what Gecko recommend? if so, OK.
Do confirm with the CRO that the negative going pulse on the Step line is narrow, with a wider Hi state. This is illustrated in the Mach3Mill doco. Check you can vary the width.

Quote
I would like setup instruction on using an O'scope as I do have a BK Precision 1530  30mhz scope.  If it could be hooked up to see the timing differences between step and direction it would be nice.  It is a simple dual trace scope, not a storage type.
Um ... putting into words what I do automatically ... Um! Interesting challenge!

OK. First, disconnect everything from the PP. Bare PC.
Hang channel 1 on Dir and channel 2 on Step. If you have a separate trigger channel hang that on  - um, try Step for now. Otherwise trigger off channel 2 for now.
Program the machine to do about 10 steps forward and 10 steps backwards, for many cycles. Adjust the CRO so you can see the Step pulses. The sweep rate won't be very high. The Dir channel will flip up and down. That gets the CRO going.

Now trigger off the Dir channel instead. You should be able to see the slow square wave on the Dir channel and the fast Step pulses on the other channel. Get this going. Now you will be able to see 'ground truth'.

Look at the timing between the Dir transition and the Step pulse downwards (leading edge) transition. What you do NOT want is for the Dir and Step transitions to be too close - that can confuse the Geckos. Also look at how fast the two signals go from Hi to Lo and Lo to Hi: the transition times. Record all these things - paper and pencil & sketches are fine.

Repeat all this with the BoB on the PP, looking at the output of the BoB. What do the pulses look like, and what is the timing like.

Repeat all this with other elements in the chain, up t5o the point of having a running motor. See if there is a shift in the timing between Dir and Step, or if the transitions times change, when some part is put into the chain.

You noted 'stuttering' at the start of a cycle - when Dir changes. This is where I would focus. You want to see what is going on here.

Hypothesis: you are getting a step pulse, or at least an edge of the Step pulse, or part of a Step pulse, while the Dir signal is changing state. This will confuse the hell out of the Geckos and most certainly cause 'stuttering' and screw up the movement of the motors.

Of course, if the stuttering has disappeared but the drift persists .. um ...

Cheers
Roger
« Last Edit: November 03, 2010, 05:42:29 AM by rcaffin »
Re: Losing steps or something?
« Reply #97 on: November 03, 2010, 03:37:38 PM »
Hi, Roger.  Thanks for the info.  I'll try to get to it tomorrow as I'm shor on time today.  Don

Offline Dan13

*
  •  1,208 1,208
    • View Profile
    • DY Engineering
Re: Losing steps or something?
« Reply #98 on: November 04, 2010, 03:43:52 AM »
I would like to note that it is not as easy as it may look trying to capture the timing between the step and direction signals using a plain scope. Thing is there is also the motor acceleration factor and the step pulse stream is not going to be constant frequency. One could probably try a very slow speed and VERY small acceleration and even then it's not going to be easy.

May be you could try in Incremental Jog mode, defining ONE motor step there...? But don't know if your scope can capture a single pulse.

Dan

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Losing steps or something?
« Reply #99 on: November 04, 2010, 04:01:49 AM »
Hi Dan

I would like to note that it is not as easy as it may look trying to capture the timing between the step and direction signals using a plain scope. Thing is there is also the motor acceleration factor and the step pulse stream is not going to be constant frequency. One could probably try a very slow speed and VERY small acceleration and even then it's not going to be easy.

True, true, but I think the arrangement I have described should work.

First of all, the CRO will trigger off the Dir transition in one direction only. That's the nature of CRO triggering, especially with something as simple as a BK Precision.
What will be seen on the CRO when it triggers off the Dir transition will be the Step pulses as they ramp up in speed, so their spacing will of course vary.
But if the machine is set to do 100 cycles back and forth, each cycle will be the same. So it should be possible to see the pulses on the screen. If 100 is not enough, try 200 ...

Cheers




May be you could try in Incremental Jog mode, defining ONE motor step there...? But don't know if your scope can capture a single pulse.

Dan
[/quote]