Maker Pro
Maker Pro

Controlling stepper motor with a computer

I've recover the stepper motor that moves the printer head of a IBM proprinter III XL and I whant to use it to make a automated dolly for a photograph camera.

The motor is this:
emlq.jpg


With 4 wires so i think it is a bipolar motor as i be able to find on the web about the 4 wires and the poor information about that motor model 23f5317:
0ds6.jpg


I want to control it in order to make it move 1 step when i order it to do from a computer.

I've think it would be a good way to do what i want if i control it via serial port. I could make a software to control in which momment I want the motor to rotate 1 step.

I am tottaly lost, so I have many questions on how to achieve this. ¿How wcan I do a controller with serial port for that motor? I've seen many controllers that are yet done, but they too many expensives to this project that i do only for fun son I decided to make the needed circuit on myself unless I find a really cheap control. ¿Anybody knows what will I need to do a circuit to control this motor with a serial port?


¿What would be a good language or program enviroment to program the software neede to send the orders?

All I need is a progran in wich I will choose the direction of the movement, the total time it will be moving and the number of seconds between each step. The goal is to make a slow dolly to film timelapse photographs with a smooth movement of the camera so i suppose i will only need move 1 step each minute or 10 minutes or so not continuous movemente of the printer head.
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Take some measurements of resistance between the wires. You'll likely find a pair of windings with similar resistance. It is likely that each of the red and black pairs is a winding.

Do they have the same resistance (or very similar)?

if you're doing time lapse photography, the steps would be between your exposures. I'd recommend you expose, step, wait, expose, step, wait... since that gives the maximum time for any vibrations to die away.

I have recently interfaced my EOS camera to an ATMega chip which wakes the camera up, turns on lights, focuses, and then takes an exposure. It really is pretty simple.
 
Take some measurements of resistance between the wires. You'll likely find a pair of windings with similar resistance. It is likely that each of the red and black pairs is a winding.

Do they have the same resistance (or very similar)?

if you're doing time lapse photography, the steps would be between your exposures. I'd recommend you expose, step, wait, expose, step, wait... since that gives the maximum time for any vibrations to die away.

I have recently interfaced my EOS camera to an ATMega chip which wakes the camera up, turns on lights, focuses, and then takes an exposure. It really is pretty simple.

Thanks.

It was what I was thinking about. Expose, step, wait, expose, step....

But controling the camera shots with the same program that I will use to control motor step is not possible becacuse of my cámera, so I think I will control it separately. No problem if I make good sincronization.

Once I have detected each winding ¿what would I need then?

I have not much electronics knowledge so I have no idea what to do to control that motor with a PC.

I've read about 2 components that I think they would make me able to do what I want. A L293e chip and a MAX232 board ( http://www.mikroe.com/add-on-boards/communication/max232/ )


¿Would it make me able to control that stepper motor with a PC?.

And other question. ¿What should I use to program some software in order to send orders through 232 port to the L293e chip? ¿There is some program language that is better to make this kind of sofware? I've whatched an example using something called Autolt but I dont know if it is what i should use.


Thanks
 
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
I would imagine that since the advent of uC's there are many free serial port apps available for download. If not the old Quick Basic will do the job.

Keep in mind that XP and above does not run with DOS as its root. The DOS that's included with XP runs as a console window. It can be best described as a faux DOS. It doesn't do it very well either. My experiences running QB, which is a DOS based app, in XP is even worse. My processor wants to have a heart attack from overwork!

Chris
 
Hahahahah, ok, then I will try to avoid it.

Anyway I cant found any info about what component and circuit I would need to conect motor to PC. ¿Arduino and a motor shield could be the easiest way for me?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
¿Arduino and a motor shield could be the easiest way for me?

Possibly.

There is no reason why the arduino can't listen for commands from the PC to step the camera. That way a program on the PC can command the camera to take images and also the motor to move. The arduino takes care of the actual interface stuff.

Arduino and motor shield (do they have a stepper shield?) is a simple way to go but it's not really a permanent method of construction. A reasonable way to prototype though.

It is also a way you can quickly learn to operate the stepper motor. And you need to do that before you start building anything just in case there are problems with that stepper motor.

And why can't you control the camera from the arduino? Are you exercising control over focus and exposure as well? or are you leaving that up to the camera?

What sort of camera are you using?
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
If you're going to mess with micros I recommend this for nubes and novices. The initial cost is very low. They also have their own forum with topics including serial port interface and code. We also have a code section right here on EP. ;)

http://www.picaxe.com/

Whatever you do never attempt to connect even the smallest motor directly to the serial port....Ever!

Regarding the serial port: RS232 has two TX control pins that are independent of the TX Data pin. They are the Data Terminal Ready (DTR) and Request To Send (RTS) pins. I've used them for basic switching control to circuits that didn't require data transfer.


Chris
 
If you're going to mess with micros I recommend this for nubes and novices. The initial cost is very low. They also have their own forum with topics including serial port interface and code. We also have a code section right here on EP. ;)

http://www.picaxe.com/

Whatever you do never attempt to connect even the smallest motor directly to the serial port....Ever!

Regarding the serial port: RS232 has two TX control pins that are independent of the TX Data pin. They are the Data Terminal Ready (DTR) and Request To Send (RTS) pins. I've used them for basic switching control to circuits that didn't require data transfer.


Chris


My problem with rs232 also is that i can't imagine how to send intructions to 4 wires polarity for the stepper motor with only 2 wires from rs232. If I found a way to figure out how to do it I would like to do whit any circuit done exclusively for that and not doing it with arduino.

I am totaly lost :confused:



Possibly.

There is no reason why the arduino can't listen for commands from the PC to step the camera. That way a program on the PC can command the camera to take images and also the motor to move. The arduino takes care of the actual interface stuff.

Arduino and motor shield (do they have a stepper shield?) is a simple way to go but it's not really a permanent method of construction. A reasonable way to prototype though.

It is also a way you can quickly learn to operate the stepper motor. And you need to do that before you start building anything just in case there are problems with that stepper motor.

And why can't you control the camera from the arduino? Are you exercising control over focus and exposure as well? or are you leaving that up to the camera?

What sort of camera are you using?
My camera is a olympus and I have no idea how to acces to the sdk of this cameras.
 
Woooow, lot of thanks, controling the camera directly with a circuit with IR control was somethink i really didn't think about.

I control my camera at now via USB with a software of olympus that is designed for doing that. The IR solution is a great choice!.

Thanks for de info!


I'm not a stepper motor expert but that has never stopped me in the past. I have a lot of that! :D

I like serial port projects, as I'm experienced with it. Tell me what your four wires need to see and when they need to see it.

In the interim this is a nice article with great animation.

http://www.pcbheaven.com/wikipages/How_Stepper_Motors_Work/

Chris

XD neverstoped man!!!

As I've read on internet I would have 2 choices if i make it as simple controll as possible.

1- Stepper control chip. If I use somethink like that, then I would have to send several signals: 1 for direction, 1 for step mode, 1 for turn one step, 1 for enable/disable the motor. Something like that chip ( http://www.ti.com/product/drv8811#technicaldocuments ) I've seen several and diferent but the way all them seems to works is very similar, 1 pin direction, 2 pins modeselection, other pin step, other pin for enable/disable. I will need it to work even for hours continuosly(because of timelapse usage porpouse) so I will need to activate the enable/disable function of the chip in order to avoid motor heat as I have readed on internet.

2-Other choice would be directly suply votage to the 4 wires changin polarity of each one in order to get them making steps.

+ - - -
- + - -
- - + -
- - - +
or

+ + - -
- + + -
- - + +
+ - - +



I like the first choice with the stepper control chip because it seems to simplify the logic control and even I think it would enable me to make two controls: one by serial port and one by buttons in same circuit to move the motor. So my need is as follow for example:

-Direction pin: Low voltage / High voltage chose direction
-Mode pins: As I've seen on this kind of chips usually are 2 pins to select between several modes(microstep, halfstep, fullstep...). Pins set as 00 01 10 11 made 4 step modes selections
-Step pin: Low voltage make it turn 1 step - High voltage make it stand in same position
-Start/stop pin: Low voltage Starts motor outputs and logic analisis, High voltage stop it.
(other choice is a standby pin as i have readed on this kind of chips if there is not much time between stop/start)


So my orders should be made as follow: Start chip, chose direction, select mode, make step, stop chip.



If I would choose the second option I would need to send 4 signals of needed polarity one for each of the wires and transform them in the voltage needed for the motor.
 
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
If the serial port is being used only to provide logic states then there will be only 3 available output pins. I can also generate a pulse train on any one or all 3 pins. Anything more than that requires serial data communication with the external device.

The Parallel Port provides 8 output pins but few, if any, PCs have them any longer. A USB/LPT converter isn't an option either because they're not universal like USB/RS232 converters are. Let me restate that.. They weren't the last time I investigated them a few years ago. At that time they were made to interface device specific devices, ie, specific model printers, scanners, etc.

Chris
 

I'm not a stepper motor expert but that has never stopped me in the past. I have a lot of that! :D

I like serial port projects, as I'm experienced with it. Tell me what your four wires need to see and when they need to see it.

In the interim this is a nice article with great animation.

http://www.pcbheaven.com/wikipages/How_Stepper_Motors_Work/

Chris

If the serial port is being used only to provide logic states then there will be only 3 available output pins. I can also generate a pulse train on any one or all 3 pins. Anything more than that requires serial data communication with the external device.

The Parallel Port provides 8 output pins but few, if any, PCs have them any longer. A USB/LPT converter isn't an option either because they're not universal like USB/RS232 converters are. Let me restate that.. They weren't the last time I investigated them a few years ago. At that time they were made to interface device specific devices, ie, specific model printers, scanners, etc.

Chris

It is really something bad in order to use on modern PCs. Perhaps I should try to design a circuit that let me define by itself what time is needed between passes. I will think about it.

I will try to design some circuit that be able to do that and I will post it here for you all to tell me what things I should change.

Thanks
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
If you want to do this with the absolute lowest expense and brain strain I highly recommend checking out the Picaxe that I mentioned earlier. Here's a link to a bunch of Stepper Motor topics on their forum. I found them by using the forum search box "Stepper Motor". Did you download the FREE programmer and help files yet? There's nothing to loose!

http://www.picaxeforum.co.uk/search.php?searchid=483443

Chris
 
If you want to do this with the absolute lowest expense and brain strain I highly recommend checking out the Picaxe that I mentioned earlier. Here's a link to a bunch of Stepper Motor topics on their forum. I found them by using the forum search box "Stepper Motor". Did you download the FREE programmer and help files yet? There's nothing to loose!

http://www.picaxeforum.co.uk/search.php?searchid=483443

Chris

Lot of thanks. I will try it.

I'm looking also for a good EDA software to create schematics so I can ask other people about errors on my design. ¿What should I use?
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
I use Tina but only the Tina-TI version is free. Tina-TI can be downloaded from Texas Instruments. Most of the guys here use free LT-Spice. It's pretty good but the component models are too large for my tastes.

Chris
 
Cool project....

I use Python to control RS232 ports...It's a simple language and the pySerial module basically wraps the age old C code. In Linux, Python is already installed and it's possible to change the kernel permission for the port access....Windoze is another animal.

I really recommend learning Linux for anyone that hacks anything...it's very good at
slapping together scripts and different programming languages without a lot of hassle.
The only problem is the drivers for fancy cards. However, most of my hacks are totally home grown. Get Mint 14 and put it on a USB drive. AVOID dual booting...
use BIOS to switch boot drives.... :eek:ff_soap_box:

The MAX232 looks like a cool interface chip...I think RS232 is a great old school interface option for slow stuff....I just read that a 232 card can source something like 250mA. I'd still want to use a transistor to protect the card however.

@CDRIVE, I'm finally getting into PIC's....I never forgot your advice...
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
@CDRIVE, I'm finally getting into PIC's....I never forgot your advice...

Ha, it does open up a whole new aspect of electronics and ways of doing things. Every time I'm working on making a 555 do more than its basics I always think of how much easer it would be with a Picaxe.

Chris
 
Top