Hello Guest it is April 18, 2024, 10:13:20 AM

Author Topic: Step and Dir signals  (Read 18973 times)

0 Members and 1 Guest are viewing this topic.

Step and Dir signals
« on: May 13, 2010, 07:45:05 PM »
Can someone please tell me the truth table for the step and dir signals.  In the manual, it says that the dir signal is active low, however, how can the computer tell the machine to go cw and ccw while in the low state?  Is it that high is cw and low is ccw, or the other way around? 

Thank you,
Nishant

Offline Tweakie.CNC

*
  • *
  •  9,198 9,198
  • Super Kitty
    • View Profile
Re: Step and Dir signals
« Reply #1 on: May 14, 2010, 05:28:57 AM »
Hi Nishant,

The step and direction signals can be configured either active high or active low within Mach3.
Your driver board will prefer either the 'high to low transition' for a step pulse (active low) or a 'low to high transition' but either way trial and error will tell if the driver board instructions do not. The direction bit set active low will produce stepper rotation in one direction and active high rotation in the opposite direction and this is set to match the machine axis etc.

Hope this helps,

Tweakie.
PEACE
Re: Step and Dir signals
« Reply #2 on: May 14, 2010, 08:44:27 PM »
Thanks. 
Also, what is the state of the dir pin when the motor is not supposed to turn?

Offline Tweakie.CNC

*
  • *
  •  9,198 9,198
  • Super Kitty
    • View Profile
Re: Step and Dir signals
« Reply #3 on: May 15, 2010, 01:11:23 AM »
Quote
Also, what is the state of the dir pin when the motor is not supposed to turn?

The direction pin retains it's current state until it is changed by the next direction move - so it could be either state.

Tweakie.
PEACE
Re: Step and Dir signals
« Reply #4 on: June 29, 2010, 11:18:13 PM »
The step pulse is a square wave and the machine triggers either on the rising or falling edge of the square wave. So active low i think....is when the transition is going from high to low. and the active high would be when the transition is going high...but i am guessing.

 and the direction line...i am still a bit confused about...I think the line is in either a high or low state but have no idea how that works just yet... any one with some definitive answers?

Offline Tweakie.CNC

*
  • *
  •  9,198 9,198
  • Super Kitty
    • View Profile
Re: Step and Dir signals
« Reply #5 on: June 30, 2010, 01:44:47 AM »
Hi Zero Cool,

Welcome to the forum.

You are correct in what you say about the step and direction signals. Some controllers prefer active high for these signals but all the ones I have used (so far) prefer active low.

Tweakie.
PEACE
Re: Step and Dir signals
« Reply #6 on: July 12, 2010, 07:36:44 AM »
One way of looking at this is to realise that a two bit up/down counter is the basic logic for driving a stepper motor
The signal controlling the direction of the counter is the signal that is equivalent to controloling the direction of the motor.
given tw outputs q1 and q2 the table of outputs for one direction is:

Re: Step and Dir signals
« Reply #7 on: July 12, 2010, 07:46:10 AM »

sorry about the previous posting. it happened because of my inadvertent use of the tab key.

One way of looking at this is to realise that a two bit up/down counter is the basic logic for driving a stepper motor
The signal controlling the direction of the counter is the signal that is equivalent to controlling the direction of the motor.
given two outputs q1 and q2 the table of outputs for one direction is:

   q1    q2
   0     0
   0     1
   1     0
   1     1
   0     0

q1 and q2 are the signals drining the power amplifiers

if dir is reversed then we get

   q1    q2
   0     0
   1     1
   1     0

this shows that the dir signal sets things up so on the next clock another step is taken
clock = step
changing dir by itself does nothing
the waves are not square waves since the time between clock signals can be anything.

It is not really meaningful to talk about these signals as having active levels since they are doing something whatever level they are.
where the sense of the signal can be active low or active high is arbitrary but the ability to swap the sense can be useful for testing

Offline Tweakie.CNC

*
  • *
  •  9,198 9,198
  • Super Kitty
    • View Profile
Re: Step and Dir signals
« Reply #8 on: July 12, 2010, 08:33:05 AM »
Hi John,

Excellent explanation you have given there.

Quote
It is not really meaningful to talk about these signals as having active levels since they are doing something whatever level they are.
where the sense of the signal can be active low or active high is arbitrary but the ability to swap the sense can be useful for testing

Not quite sure about this bit though. The terms "active high" or "active low" are meaningful to me and are understood by Mach3 when it comes to setting everything up.  ;)

Tweakie.
PEACE
Re: Step and Dir signals
« Reply #9 on: July 12, 2010, 10:26:34 AM »
yes because thats the way that mach3 allows you to handle them. But on say a board with
a micro processor on it some control signals are often inactive and are often at a high level
during this time. When something has to be done the signal goes low. examples would be chip select,  memory write.

the advantage of the way mach3 allows you to change the active level is that you can use this to toggle individual signals to test the effect (if any!)

john f