help in step motor - MacRumors Forums
Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 22, 2006, 01:51 AM   #1
kishkashta
macrumors newbie
 
Join Date: Feb 2006
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.
thx
kishkashta is offline   0 Reply With Quote
Old Feb 22, 2006, 05:34 AM   #2
demallien
macrumors regular
 
Join Date: Oct 2005
Quote:
Originally Posted by kishkashta
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.
thx
My advice would be to not do it with a Mac. They don't have any ports that are simple to control at the application level. Actually, to do simple control on stepper motor, the easiest way is just to wire up a simple electrical ciruit - stepper motors are designed to be easy to control.

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? :-)
demallien is offline   0 Reply With Quote
Old Feb 22, 2006, 01:49 PM   #3
savar
macrumors 68000
 
savar's Avatar
 
Join Date: Jun 2003
Location: District of Columbia
Send a message via AIM to savar
Quote:
Originally Posted by kishkashta
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.
thx
Whoa--that's a very advanced project for a high school student. There isn't a cheap answer that's pre-built. If you can't build it yourself, ask your teacher about it.

What is the end goal that you're trying to achieve? An RC servo motor may be more appropriate.
__________________
Mehce
savar is offline   0 Reply With Quote
Old Feb 22, 2006, 04:01 PM   #4
notjustjay
macrumors 603
 
notjustjay's Avatar
 
Join Date: Sep 2003
Location: Canada, eh?
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)
output 1
delay a few ms
output 2
delay
output 4
delay
output 8
end repeat

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.
notjustjay is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
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

Forum Jump

All times are GMT -5. The time now is 12:05 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC