Machsupport Forum
Mach Discussion => FAQs => Topic started by: nishantpol 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
-
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.
-
Thanks.
Also, what is the state of the dir pin when the motor is not supposed to turn?
-
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.
-
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?
-
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.
-
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:
-
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
-
Hi John,
Excellent explanation you have given there.
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.
-
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
-
sorry. Should have said "thanks" for the compliment
john f