Welcome! Log In Create A New Profile

Advanced

Stepper motors stepping

Posted by Noz 
Noz
Stepper motors stepping
July 02, 2008 11:36AM
got a couple of questoins about the stepper motors and drivers, first is that if the enable is on does it stay active (so it stays in place) or does it not stay in place, or will stay in place while power is active and the enable doesn't matter?

Secound questoin is does it matter if they dont work syncronsly when moving along two axis's? if each motor step is 0.1mm will it make a differnce?

I was looking at the wiring diagram trying to figure out how to put a extra motor on and i was thinking we could cut out 6 wires if we used the same step, directoin ,min and max wires, and wire the enables up to choose what motor we want, we could only move one motor at a time but if the step is small enough i would of thought no one would notice.

any comment is welcome!


6 wires.
Re: Stepper motors stepping
July 02, 2008 02:44PM
As near as I can tell the 'Enable" inputs on the stepper driver board 1.1 are not currently used by the Arduino electronics. It goes straight to the ENABLE input of the L297 so a look at the L297 specification would say what happens when ENABLE is pulled low.

I think the easiest way to add a 4th axis would be to consolidate the limit switches with some OR gates, using only two inputs instead of 6. Depending on how the limits are used for you might even be able to reduce it to one input. This gives you 4 or 5 pins to use for the new axis Step and Direction.

Of course the standard Arduino programming would have to be modified to deal with the consolidated limit pins.
Re: Stepper motors stepping
July 03, 2008 05:09AM
I think to really add anything to the Arduino electronics we need to move onto the two arduinio design, as almost all of the program memory is currently used. This will also add plenty of I/O pins. I think zach has already started this, or at least he's made the arduino firmware in a very nice modular way to make the task relatively easy. Having one arduino got tools and one for Cartesian would probably be best
Ru
Re: Stepper motors stepping
July 03, 2008 05:52AM
Or wait for the atmega328 to turn winking smiley

Soon enough, memory isn't going to be the problem... it'll be IO pins, and that's probably a very good reason to move to a second board. Keeping all the endstops as well as having extra toys like a nozzle valve or and extruder rev counter isn't possible with a single board, even if you've painstakingly written a super-efficient tiny firmware program in assembler or whatever.
Re: Stepper motors stepping
July 03, 2008 06:21AM
The endstops issue - why cant they all be wire-ored together ? To find the origin you move each axis individually to find its start then back it away and move the next axis. This would work for both ends of the travel as you know which way you are moving each axis too.
Or is the problem with the stepper driver IC itsself and is it actually important that the endstops are done in the IC?

(I realy ought to read more of the code & documentation)
Re: Stepper motors stepping
July 06, 2008 06:34AM
Wiring them together would definitely gain us some I/O pins... But I think we might need a circuit that functions as an OR-gate for that?


Regards,

Erik de Bruijn
[Ultimaker.com] - [blog.erikdebruijn.nl]
Re: Stepper motors stepping
July 06, 2008 07:17AM
If they are all wired together, then how do you know which axis is which? Just running one axis at a time is not really a solution because if and axis is already at zero, then another can't be detected. Ideally we want to add more endstops on the other ends of the axies. A workaround may we possible - e.g. reseting an axis, then moving it 10mm in, then reseting another, moving it 10mm in etc, but bastardising your firmware just to save a couple of i/o pins always starts to get rather messy, and you just end up wasting program space instead.
Re: Stepper motors stepping
July 06, 2008 07:25AM
Why not stay one step away from the actual origin so that there is never more than 1 endstop sensor tripped?


Regards,

Erik de Bruijn
[Ultimaker.com] - [blog.erikdebruijn.nl]
Re: Stepper motors stepping
July 06, 2008 07:35AM
That was what I was describing above, but one step is not enough because the machine will not be completely perfect. Even then, if you switch the machine on when the axies are in their home positions, it is going to have to blindly run them all forwards for a bit, then run them backwards on at a time, then forwards again. It's a huge complication compared to using two arduinos
Re: Stepper motors stepping
July 06, 2008 09:05AM
If the system is reset when one or more axis are already at an endstop then we would need seperate + and - stops, but these can be shared across the 3 axis (and a 4th if needed say for rotary stuff)

Backing up 1 step is a bit small, backing up 10mm may be a bit large, but the variability in the detection zone of the opto sensors isnt big (I should hope not, absolute positioning isnt critical so long as the zero can be relied on during a build). The data sheet says sensing is over about 0.5mm in the worst axis.

Simple to do in a bit of code during reset and then set the actual zero/span a millimeter or two away from the detection zone. No significant loss of working volume. No need for loads of IO. but I understand there is a shortage of code memory...

One project I designed (portable traffic lights using PIC processors) ended up with 18 processors working together : at each head there is 1 main controller, 1 keypad processor, 1 display and message processor, 1 comms packet processor (radio telemetry), 1 radio driver (on the RF transciever), 1 lamp brightness&fail detect in each LED lamp, 1 radar processor.
It works, but sometimes the timing and interface protocol stuff gets painfull. Next time I will consolidate some of the functions.

Edit1:
The opto sensors are open collector, but unfortunately they pull low when not sensing the flag so cannot be simply wired together.

Edit2:
I looked at the opto data again : the H21LOI is the current part with inverted output. If we drop in the H21LOB (no pcb,electrical or mechanical mods required) it is the non-inverting open collector version. Wire the output lines together and no further parts required.

Edited 2 time(s). Last edit at 07/06/2008 09:44AM by Richard Benjamin.
Re: Stepper motors stepping
July 06, 2008 01:09PM
> The opto sensors are open collector, but unfortunately they pull low when not sensing the flag so cannot be simply wired together.

I think they can be chained together with the sense line from one sensor going to the next sensors Ground.

The only potential issue is using a virtual ground on all but the last sensor. If a sensor goes high resistance the voltage drop between Vcc and Gnd on the sensors above it in the chain will be almost 0v. Fortunately when one sensor is in a high resistance state the state of the sensors doesn't matter, the output is always 4.5V+. When the sensor returns to low resistance the sensor above it will power up; entering the low resistance state and hence allowing the next sensor to power up continuing until all sensors have returned to the low resistance state.

I've tried this with two of the sensors attached to a bread board and it appears to work.

The next bit got a bit long and can be skipped if you already know about open collectors and pull up resistors. It was mostly an exercise to check I did ;-}>

I may be reading the circuit diagram wrong but it seems like the the sensor can be considered like a high resistance or low resistance path to earth. When the gap is empty the resistance is low, when the gap is filled it goes high.

[skip this if you already know how a weak pull up works]
As the inputs to the micro-controllers can only detect voltages a 'weak pull up' is used. The weak pull up is a 10k resistor connected to 5v in this case. The other end is connected to the sense pin of the sensor. This creates a voltage divider with the micro-controller's measuring the voltage relative to earth of the sense pin. E.g. if the sensor is high resistance, say 90k then the voltage drop over the total 100k is 90% over the sensor and 10% over the pull up. 5v*0.9=4.5v will be measured by the micro-controller. When the resistance is low 10-Ohms 99.99% of the voltage is dropped over the pull up and about 0.01% is dropped over the sensor resulting in the micro-controller measuring 0v over the sensor.

Assuming that's how it's working here; then a second sensor can be added between the sense pin of the first and ground. If neither is interrupted the total resistance is still low and the micro-controller will see 0v. If either is interrupted then it will go to high resistance and the micro-controller will see 4.5v+

The only potential issue is that using a virtual ground on the first sensor if the second goes high the voltage drop between Vcc and Gnd on the first sensor will be almost 0v. Fortunately when the other sensor is in a high resistance state the state of the first sensor doesn't matter

Data-Sheet for the H21LOI:
[www.fairchildsemi.com]
Re: Stepper motors stepping
July 07, 2008 06:34AM
Peteredworthy - lateral thinking at its best. Actually, series thinking smiling smiley

All good thinking. My only concern is what happens to the first sensor whern it effectively looses its ground. It will also probably go high resistance on its outputwhich as you point out is immaterial. However, it now has no power supply so it will possibly not start up again until the second sensor pulls its ground low again. Thus the software will still need to just 'dip into' the endstop zone for each axis in turn, not all together.
Re: Stepper motors stepping
July 09, 2008 03:13PM
Hey Guys, a couple things here:

1. the enable pin turns the stepper motor on/off whether idle or not. they are used in the Arduino GCode interpreter
2. you can wire all the enable pins together which will collectively enable/disable all the steppers and save 2 pins
3. you can probably do the same with the min/max pins for each axis, saving 3 pins as well.

the GCode Interpreter firmware supports all of these.

finally, i have a solution to all these problems in the works, so please bear with us =)
Sorry, only registered users may post in this forum.

Click here to login