Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: kolias on August 26, 2009, 04:59:35 PM

Title: Step & Dir Pulse
Post by: kolias on August 26, 2009, 04:59:35 PM
On the motor tuning screen we have the entries for “Step Pulse” and “Dir Pulse”

Is it important to set the right values there?

Should I ignore these entries?
Nicolas
Title: Re: Step & Dir Pulse
Post by: RICH on August 26, 2009, 05:06:47 PM
The values are in u seconds. Some drives specify a preferred value.
Does your drive mention anything on the duration?
RICH
Title: Re: Step & Dir Pulse
Post by: kolias on August 26, 2009, 05:36:33 PM
The values are in u seconds. Some drives specify a preferred value.
Does your drive mention anything on the duration?
RICH

The drives manual only says: “Minimum pulse width for the step pulse is 5 uS”

ok so I know the minimum but what is the maximum? Is there an average value? Is it by trial and error?

Questions, questions,….heck if I don’t ask I will never learn
Nicolas

Title: Re: Step & Dir Pulse
Post by: Hood on August 26, 2009, 05:43:23 PM
Set it to 5 and it should be fine :)
Hood
Title: Re: Step & Dir Pulse
Post by: RICH on August 26, 2009, 05:47:44 PM
Hood,
What is the max duration that MACH will use if input, know off the top of your head?
RICH
Title: Re: Step & Dir Pulse
Post by: kolias on August 26, 2009, 05:50:56 PM
Set it to 5 and it should be fine :)
Hood

Which one? Step Pulse, Dir Pulse or for Both?
Nicolas
Title: Re: Step & Dir Pulse
Post by: Hood on August 26, 2009, 05:59:27 PM
both

Hood
Title: Re: Step & Dir Pulse
Post by: Britt on August 27, 2009, 01:19:34 AM
Er... if it says 5 ***min*** pulse, shouldn't it be set something above 5? Like 7 or 10?
Title: Re: Step & Dir Pulse
Post by: Hood on August 27, 2009, 03:26:39 AM
Er... if it says 5 ***min*** pulse, shouldn't it be set something above 5? Like 7 or 10?

You can please yourself what you put but remember more isnt always better ;)
If a manufacturer only gives you one figure then that is what I personally would use, it would be a bit stupid of them to quote a figure that is borderline  so I would think 5 would be perfect. :)

Hood
Title: Re: Step & Dir Pulse
Post by: kolias on August 27, 2009, 08:58:15 AM
5 it is for both Hood, thank you
Nicolas
Title: Re: Step & Dir Pulse
Post by: Britt on August 27, 2009, 10:37:27 AM
On the other hand... (just generally speaking) why run a component at the limit of it's supported performance (even taking into account the manufacturer de-rating the spec) when you don't have to? If I did my math right at 7 microseconds, and a 50% duty cycle, the max step rate is about 71khz... so a 10000 step per inch setup could rapid at a max of about 428 ipm... at 6 microseconds it goes up to 83khz and 500ipm... and the other potential issue is how tightly controlled is that pulse width being output (i.e, might jitter affect it)?


:)
Title: Re: Step & Dir Pulse
Post by: Hood on August 27, 2009, 10:39:08 AM
As said previously you can put what you like in, just saying what I would use :)

Hood
Title: Re: Step & Dir Pulse
Post by: stirling on August 28, 2009, 07:02:58 AM
Don't know if I can help with this but I'll try.

These input boxes aren't particularly well labelled or documented but they are covered albeit briefly in Art's video "Installation and Basic Configuration". In it he states that these values are ADDITIONS to Mach's standard step and direction PULSE WIDTHS.

He defines Mach's standard behaviour as being "approximately" 1 to 2 uSec for both. I assume (but may be wrong) that it's Mach's signal jitter that prevents him from being more accurate.

The Step pulse box:

Using a gecko 202 (other excellent drives are available) as an example, the manual says (for the step signal):

"The minimum logic “0” time is 0.5 uSec .... Microstepping occurs on the falling edge of the step input"

So the "approximate" 1 to 2 uSec that Mach delivers is MORE than adaquate, so with this particular drive there is zero point in extending it. You can of course extend it to anything you like - it will make no difference whatsoever except if you go reaaaaaaaaally long (and why would you?) and particularly at a high Kernel rate you will ultimately affect your potential max step rate!

There has been mention of the Max pulse width. The reason there is no MAXIMUM for pulse width is because the minimum is all that matters for correct switching of the electronics. i.e. with the example gecko drive the step signal falls and as long as it's kept low for the minimum 0.5 uSec the electronics will "do their thing".

Onto the The Dir "Pulse" box:

I quoted Art above as saying that this value (like the step pulse) is an ADDITION to the Dir PULSE WIDTH. This in my view can not be taken at face value and needs a bit more thought. The Dir signal (at least for the gecko and for every other drive I have ever seen and/or used) is treated more as a STATE than a PULSE. i.e the Dir signal does not LATCH the drive on a falling or rising edge, rather, it's STATE either high or low is "read" by the drive WHEN it receives a step pulse. The issue of course becomes particularly interesting when the Dir signal CHANGES and this along with Art's description are the clues to what I think this value ACTUALLY means. Here's another quote from the gecko 202 drive manual:

"Direction Setup: 1uS min (20uS min hold time after Step edge)"

Now of course this tells us that the minimum PULSE WIDTH of the dir signal is 20 uSec but I don't think this is what this box value refers to. I think it's the setup time of a CHANGING dir signal of at least 1 uSec BEFORE the falling edge of the next step signal. Therfore Mach's default of the "approximate 1 to 2 uSec" is again absolutely fine (for a gecko at least). The reason I think this is because Art states that this value should be changed if you have the problem of missing a step on a direction CHANGE (yes that old chestnut).

FWIW the direction hold time would only be of issue if your application wanted to change direction more than 50000 times a sec! Hmmmm - cutting microscopic saw teeth perhaps!

So as summary: Check your drive's tech spec and set accordingly by ADDING to the default 1 to 2 uSec if required, or if you prefer, leave both values at 0 unless you have problems.

Cheers

Ian

Title: Re: Step & Dir Pulse
Post by: Hood on August 28, 2009, 07:10:10 AM
the 1 to 2 uS is due to the latency of the PCI Bus, according to Art, when I asked him a few months ago so anything you set in motor tuning is in addition to that as you have said :)
Hood
Title: Re: Step & Dir Pulse
Post by: stirling on August 28, 2009, 07:23:42 AM
Hi Hood - I was really more trying to make the point that Art states 1 to 2 meaning it can't be stated more accurately rather than why. but it doesn't really matter. The point really is that no-one prior to my post had mentioned that the values were ADDITIONS - I thought that was an important point to mention (edit back ;D).

Ian
Title: Re: Step & Dir Pulse
Post by: Hood on August 28, 2009, 07:35:34 AM
Yes it is a valuable point, was just clearing up that Art had mentioned it was due to the latency of the PCI. And sorry about the edit, I have a nasty habit of hitting enter before I have finished what I was meaning to say, might be due to my keyboard sitting about 2feet in the air on a heap of milling cutters. CAT40 chucks and other assorted crap ;D

Hood
Title: Re: Step & Dir Pulse
Post by: kolias on August 28, 2009, 08:43:34 AM
Very interesting subject
Nicolas
Title: Re: Step & Dir Pulse
Post by: Britt on August 28, 2009, 08:59:03 PM
And to make things more complicated ;) depending on how the timing is implemented, if a SMI comes in at just the wrong moment, it can totally throw off the pulse timing -- definitely being able to cause a late pulse end; and possibly being able to cause a late pulse start (effectively shortening the pulse width) though I'd have to see the source code for mach's ISR to be able to tell for sure.