Jump to content
Sign in to follow this  
jean28

Hard to interface with Stepper Motors?

Recommended Posts

Good day guys!

The Mechanical Engineering department at my school was planning on doing a fairly simple dog robot that moved forward, and asked me if I could do the programming part of the project. For this, we would need to use an MCU and connect it with 4 stepper motors. These stepper motors would simple move 360 degrees constantly in a clockwise or counterclockwise direction (depending on what side of the robot they are).

The programming part is simple enough, and I understand how a stepper motor works. However, I did not want to do this project with an Arduino, because I feel that would make it a bit too easy for my taste. I was thinking of doing it with the 40-pin MSP430F5529 MCU. However, even though I understand how stepper motors worked, I have never interfaced with one before. Is it hard to do? Can I do it simply by connecting them to the MSP's GPIO pins? Should I go with Arduino instead? Has any of you guys gone though this experience before?

 

All tips, replies, and possible places to start with stepper motor interfacing would be greatly appreciated.

 

Thanks,

Share this post


Link to post
Share on other sites
However, even though I understand how stepper motors worked, I have never interfaced with one before. Is it hard to do? Can I do it simply by connecting them to the MSP's GPIO pins? Should I go with Arduino instead? Has any of you guys gone though this experience before?

 

Project based on MSP430F5xx...   http://3dprinter.zemris.fer.hr/stepper_motor_control.html

Share this post


Link to post
Share on other sites

Some good advice by @@rockets4kids and @@jazz, but for a straight answer to your question, no you can't drive a stepper directly from a microcontroller. The easiest route would be to get a ready-made stepper driver module like the Pololu A4988. Whatever microcontroller you chose (MSP430 or Arduino) then provides the STEP and DIR signals to control the stepper.

Share this post


Link to post
Share on other sites

Hi Jean,

 

I used a ULN2003 stepper motor driver from Ebay to drive a small stepper motor.

I just took me four pins. Source code already available in Energia examples.

 

Good luck.

 

Share this post


Link to post
Share on other sites

Longer answer than the others here, but what the hey... Waiting for a several gig software update to come through (Net neutrality is not in the vocabulary of Verizon....)

 

Driving steppers is pretty straightforward from the software end. The processor isn't an issue. The key issue is, as mentioned, that virtually no processor can drive even the smallest, lowest power stepper directly. There are a few processors that are designed for such tasks, but they are not likely relevant to you.

 

For any substantial stepper (or DC motor) you will need a driver interface. The setup depends on the stepper used. There are several flavors, but they can be, broadly, labeled as unipolar and bipolar.

 

Unipolar are those that operate with current of only one polarity. Each phase has two opposite sense coils to provide the opposite sense magnetic fields required. These devices have a minimum of five wires, generally six or eight. Five wire units are treated the same as six wire units as the common for the two phases are tied internally. The six wire units are wound as center tapped coils for each phase, and to drive, you pull one of the two end taps low with the common connected high (or vise-versa, but it is usually easier to pull low). The eight wire units have two independant coils for each phase, and you can tie the appropriate leads together externally for a common to use them as unipolar, or tie pairs together to use them as bipolar. You can use a driver IC or individual transistors.

 

Bipolar use only two lead per phase (one coil, or two parallel coils is 8 lead units in bipolar mode) and to provide the two senses of mag field for each phase, you need to be able to reverse the current. This can be done two ways: Bipolar power supply or H-bridge. H-bridge is cheaper and easier, usually, and IC's are available off the shelf.

 

ANY inductive load (stepper, DC motor, etc) will need protection for the driver against inductive flyback and other issues. Minimally, this consists of diodes to channel flyback current to the power supply. It is also a good idea, if possible, to isolate the drivers and the power for the motors from the control processor. Opto-isolators are an easy way to do this. Allows total isolation, so you can do silly things like use 48V steppers powered by a bank of lead acid truck batteries without worrying about a transistor shorting (they do) and taking your control with it. Many people don't bother, and most commercial products don't, but for a student project, it provides insurance and eases debugging. For my own projects, I tend to isolate. Just makes  life easier.

 

 

If DC motors come into it, the drivers are the same as for bipolar steppers.

 

 

Exactly what you will need depends on the required drive current and voltage for the stepper, and the voltage and drive capability of the processor..

 

Hardest part about driving steppers, especially with large loads, is getting the required torque without missing steps. This can take some planning. If you have manufacturers data available, there may be info as to torque vs current vs step rate. This will help you plan step rate ramp up and down. You can also work it out experimentally. For large loads, it is rare that you can just start stepping at full speed. Typically ramp up is needed to prevent missed steps or, worse, the 'it's just sitting there and vibrating' syndrome.

 

I have avoided giving any part numbers or real specifics, as a little looking at the IC manufacturers web sites will lead you to many driver IC's, and the stepper manufacturers have a ton of information on their web sites, as well. I am old. I generally build my own drivers rather than use ICs, but I don't do commercial products at this point. The majority of what I do is for myself or for teaching.

Share this post


Link to post
Share on other sites

You don't need MSP430F5529, MSP430G2553 should be more than enough. As for the motor driver, SN754410 is a good choice.

Also, do you have to use stepper motors? Could you use servos instead?

Share this post


Link to post
Share on other sites

You don't need MSP430F5529, MSP430G2553 should be more than enough. As for the motor driver, SN754410 is a good choice.

Also, do you have to use stepper motors? Could you use servos instead?

 

I want to use the stepper motor because I need the full 360 degrees in order to emulate a robot "wheel". 

Share this post


Link to post
Share on other sites

Thank you all for your great replies, specially enl who really gave a great answer. I would like to do my own drive like he says, but I might end up just using some ULN2003 drivers instead, depending on what happens.

 

Thank you all again. I'll ask any questions I come across with throughout the project.

Share this post


Link to post
Share on other sites

Thank you all for your great replies, specially enl who really gave a great answer. I would like to do my own drive like he says, but I might end up just using some ULN2003 drivers instead, depending on what happens.

 

Simple hardware solution will request complicated software, and apposite.

 

ULN2003 are OK for start playing with steppers (and I used them for this at the begging), but there is problem with current when stepper rotating speed is going down and especially if stepper is stopped (holding position). In this case (if PWM is not used, and I don't know if this is included in Energia) current will go to max (short connection) and ULN will become very hot.

 

Using DRV881x (or something else) at end will cost few $ more, but control (software side) will be simple.

Share this post


Link to post
Share on other sites

I want to use the stepper motor because I need the full 360 degrees in order to emulate a robot "wheel". 

 

Yet again, if you don't know what a motor-encoder is, you would do well to research that before commiting to steppers.

Share this post


Link to post
Share on other sites

Continuous rotation servos can also be a cheap and easily interfaced solution (via PWM direct from the MCU's pins) if you don't require accurate speed control.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...