• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can I get a bit of advice? (Simple stepper project)

Status
Not open for further replies.

Max Girth

New Member
I have a 3 axis (+ relay) stepper driver board with a DB25 interface, as well as pins for manual control.
I can control the motors via MACH3 Mill (demo), using the joystick.

The M Ctrl pins (16) are labeled as follows:

1/2 : +5V
3 : X Axis CLK
4 : :X Axis CW/CCW
5/6 : GND
7 : Y Axis CLK
8 : Y Axis CW/CCW
9 : EN
10 : ESTOP
11 : Z Axis CLK
12 : Z Axis CW/CCW
13 : M/A
14 : GND
15 : Relay CLK
16 : Relay CW/CCW

It appears as though I can't use this board manually, unless it is attached via the DB25 interface.
I presume that this is because the CLK signal is coming from the PC, and/or the CNC software.

This is what I'd hoped to accomplish...
For most of you this will likely be simple, maybe even mundane, but for me, a mechanic, it's a bit more complex.

I want to have a motor, on any axis (I'll be using 2), move to point A, or X inches, when the controller "sees" +5V from a remote device.
When the controller "loses" that +5V, the motor should reverse, and return to "home".
High precision is not required. Part of the problem I think I'm going to have is that the controller board will need to be able to recover
from a loss of power, and still know where "point A" and "home" are, and return to either in the correct direction.
3 manual control buttons may be added as well, once I get closer to understanding what I'm doing. Maybe "Point A", "Home", and "Stop" or even "Reset".

I feel sure that I'll have to "add" a CLK source of some sort to the driver board. Would that be like a 555 timer?
If so, would it be a timer for each axis? Easy enough to add? (I can solder).

My theory...
A> I'll have to add CLK source, probably per axis.
B> I'm sure that this board has no capacity for "memory" of any sort, much less non-volatile. So this will mean no real "logic". Limit switches, at least.
I can do limit switches if I can get my laymans mind around using the M Ctrl inputs, and how to find a "home"

On the other hand, if it's easier, I can salvage the MTD2003 controller ICs from the printer controller board that originally drove the motors, and build something
(even breadboard style) around them to learn what I need to know, then build a PCB.

If any of you can provide a relatively simple schematic, using either the driver boards M Ctrl input, or just the MTD2003 chips. That would be spectacular.
A good laymans example of the use of the M Ctrl input pins would be even better. It appears that these are "standard" stepper controls, and not board specific.

This is my first forray into the realm of steppers, but I learn fast. I already learned that I likely bought the wrong driver board. LOL

Worst case scenario is that I keep a pc attached via DB25, and find software or code better suited for projects, rather than CNC. Ideas?

Anyone have time for this? You rock.

Thanks a lot.
 

dougy83

Well-Known Member
Anyone have time for this? You rock.
I do?? well thanks.

Have a look at the schematic I drew up of a controller, it's only for 1 axis, but the circuit for the other axis is the same. The chip is a 4093 schmitt-trigger input NAND, with 4 gates, so you'll only need 1 chip for both axes. Remember to connect the power (5V) and ground (0V) to pins 14 & 1. Also put a 10uF and a 0.1uF capacitor on the 5V supply to the chip.

The 5V control voltage input is used to set the motor direction, the limit switches (connected to 0V) are used to gate the oscillator (U1B). R1 and C1 control the stepping rate, given by the formula { rate = 0.7 / (R1 * C1) }, which should be about 700 steps/sec with the current values.

You may need to swap the limit switches, or use the inverted direction (shown as 'OTHER DIR' on schematic) if the motors go the wrong way.

good luck!
 

Attachments

Max Girth

New Member
Thanks dougy83.
This is precisely the sort of help I need.
I will digest this a bit before I ask any really stupid questions.
I'll be back, I'm sure!
 

dougy83

Well-Known Member
For some reason I'm getting email notifications of your posts, but I cannot see them in this thread. The last displayed post is "Getting there... really fast", even though I know you've posted 2 more. Feel free to email me your questions.
 

Sceadwian

Banned
The local god is playing with us today =) Electro Tech is tweaking the forums and I've had a few weird things happen today so far, if you have any recurring problems send him an e-mail.
 

Max Girth

New Member
OK... After several revisions, this is what I foresee, based on your schematic.
I'm guessing about pins 9 and 10 of the M Ctrl.
I'm also guessing on pins 5, 6, and 14. GND... should the MD3AXIS8435 and this circuit share GND?
I'm almost ready to run out and buy the parts.
I think I mostly understand the logic.

Thanks for your great idea!

Do you think this will work?
 

Attachments

dougy83

Well-Known Member
Looks good to me. You have 2 remote device switches; one is going to control the x-axis movement, the other controls y-axis movement. Those switches may be connected together (or just use 1 switch) if you want both axes to move at once.

Also, as the remote device inputs are clean contacts to 5V, you will need a pulldown resistor on the 2 inputs (between 470 - 1k ohm res. to ground).

Yes, the ground should be shared between this circuit and the control port of the card.
 

dougy83

Well-Known Member
I don't think that made much difference. The inputs of the NAND gate are the same.

Also, note that you'll need the aforementioned pulldown resistors on the control input signals.
 

Max Girth

New Member
Grabbed all the parts today, and hope to tinker tonight.
I'm not clear on the location of the (1k) pulldowns. At "In" on your schematic?
Also, I couldn't find the CD4093BCM, but for two bucks I got 5 HEF4093BP. Different pinout, but can I use them? The gates have something going on before the inputs, not sure what this means. I can get the others, online, but would like to test in the meantime...

Thanks!
 

dougy83

Well-Known Member
Yes, pulldowns at 'in'. The HEF4093BP has the same pinout as the CD4093BC/BM. Not only the same pinout, but the same function.

The gates have something going on before the inputs,
Likely you're talking about the schmitt-trigger inputs. The 4093 chips have them; it allows the simple oscillator in the above circuit to work.

If you care about what a schitt trigger is, see Schmitt trigger - Wikipedia, the free encyclopedia
 

Max Girth

New Member
hmmm... the datasheet I have shows a very different pinout for the HEF4093B. It's a bit confusing actually. The pins have 2 numbers... I tried to deduce, but it's still not clear.
I'll attach the comparison.
 

Attachments

dougy83

Well-Known Member
No the pinout is the same. On the left image, the pin numbers are shown outside the box. Inside the box the input number (I1 to I8) and output number (O1 to O4) is displayed (just ignore these). On the right image, only the pin numbers are displayed. They're the same.
 

Max Girth

New Member
Sweet... I'll start work then... You have been much more than helpful.
I'll give you the results once I can test...
Thank you
 

Max Girth

New Member
Sorry for no feedback... Things getting busy around here.
I've built the circuit, checked and double-checked, but no results.
I suspect it's my limited knowledge of how to use the MCtrl feature of this board. There is no documentation, that I can find, that describes how to provide the proper signals to run manually. I'll attach a copy of the only reference I can find. I'll keep trying. Keep in mind that the only diag tool I have, basically, is a DVOM. I am almost ready to scrap the steppers, and move to servo controls. I think I may be able to grasp PWM and use an ESC to realize similar results from a basic R/C car motor.
Any thoughts?
 

Attachments

dougy83

Well-Known Member
On the connector there is a 'charge pump' input on pin 17 (see page 12 of the manual). The board needs a pulse stream to keep the board active. You can use one of the 4093 gates for this - you said you had a few chips spare right?. Page 19 shows the charge pump led ('Fault').

I don't know what frequency the charge pump should be at (I saw some reference to 10kHz somewhere), but feel free to have a look yourself.
 

Max Girth

New Member
So, the charge pump connection needs to receive a pulse.
I don't see a connection on the M Ctrl connector, just on the P connector.
So I should use the M Ctrl connector, and add a connection to pin 17 of the P connector?
I do have extra 4093 ICs, but I wouldn't know hot to use one to generate a (10k?) pulse stream.
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top