|Feb 22, 2006, 01:51 AM||#1|
help in step motor
I have a project in my school and I need a way to controll the step motor.
it is a floppy step motor with 2 coils and I need something that will conect between the micro and the engine, so I could give an prder to the motor to turn right or left. I'm only in highschool so plz if you can make it simple do so.
|Feb 22, 2006, 05:34 AM||#2|
Alternatively, I happened to have to control a stepper motor as part of my thesis for my elec. eng degree (automatic shifting on a bicycle). But again, the simplest way was to use a small microcomputer that gave direct access to CPU ports.
Assuming you absolutely HAVE to use a mac, the simplest way I can think of is to get a USB -> RS-232 converter, and then write an app that sends differnt bytes "down the line". At the other end of the line you stick an RS-232 controller chip, and you pick of the stepper motor control signals on the controller's output...
Anyone got a better idea? :-)
|Feb 22, 2006, 01:49 PM||#3|
What is the end goal that you're trying to achieve? An RC servo motor may be more appropriate.
|Feb 22, 2006, 04:01 PM||#4|
Personally, I'd use a parallel port, since it's easy to wire 4 data lines from the port to the 4 activation wires in the stepper motor (through a power transistor, please!!!)
Then you can write software to cycle the bits in the appropriate sequence. For example, say you had a 4-wire stepper and the step sequence is:
0001 --> 1
0010 --> 2
0100 --> 4
1000 --> 8
Then your pseudocode would look something like:
repeat (for as long as you need)
delay a few ms
On a PC, in QuickBasic, it might be as easy as:
OUT 888, 1
OUT 888, 2
(and so on)
To reverse the direction, just reverse the output order. There are also other bit patterns you can use, depending on the particular step sequence of the motor in question.
... I used to LOVE this stuff in high school and university (systems engineering degree... ) I did my fourth-year university project on a stepper-motor and servo-controlled pan/tilt camera unit for an autonomous robot, which was pretty fun...
edit: hmm, OP refers to a two-coil motor, which is going to be bipolar, and therefore might not be quite as easy to control without building a little bit of additional circuitry (e.g. an H-bridge). My write-up above is for unipolar motors... if you can find one of those, it'll probably be easier for you...
edit2: here's a sample bipolar motor controller which uses 2 discrete CMOS IC's (a dual flip flop and a quad XOR) and a 10 MOSFETs to build the H-bridge... http://www.web-ee.com/Schematics/Stepper/stepper.htm It wouldn't be too difficult to breadboard or perfboard this.
What's nice about this is that once built, you only need to generate a clock source, enable, and a direction signal. If your motor is only ever going to operate at one speed, you could "permanently" wire an oscillator into the CLK input of the flip-flops, and then just use the enable and direction signals. You could easily drive that from RS232 (just toggle some signal lines like DTR, RTS)...
Last edited by notjustjay; Feb 22, 2006 at 04:16 PM.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Step-By-Step Guide to Restore Mac Mail via Time Machine||jeffreyk||OS X Mavericks (10.9)||1||Feb 2, 2014 12:39 AM|
|Help securely erasing & restoring factory setting MacBook Pro for resell step-by-step||sun surfer||MacBook Pro||9||Jul 19, 2013 12:13 PM|
|Step by step guide from SSD upgrade in 2010 15" MacBook Pro||iChopSticks||MacBook Pro||23||Feb 24, 2013 02:32 PM|
|Step by step guide for SSD upgrade in 2010 15' Macbook Pro||iChopSticks||Mac Applications and Mac App Store||8||Feb 23, 2013 12:05 AM|
All times are GMT -5. The time now is 06:48 PM.