NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Let's do a project

September 02, 2014
by Ralphxyz
Ralphxyz's Avatar

Ha well maybe I can stir up some interest in a project I'd like (need) to do.

Yes Daryl this involves a stepper driver.

The Stepper Driver is the SureStepr SD8825 from Panucatt.

This is a fabulous Stepper Driver.

The speed of the stepper is determined by a pulse. You could use a 555 timer or any source for the pulse.

I would like to use the mcu.

Now here is were I get dangerous I would like to control the pulse using a potentiometer.

I have not done any programming for a couple of years now, not since I got burned out on my Water Curtain project. Actually now that I have a 3D printer I might revive the Water Curtain project. I need to make a custom header with 128 matched channels for water flow from the solenoids but that is another subject.

Now remember I am not a programmer I am a modifier I take other peoples working or broke code and modify it to my needs. A signature of the past used to say "I am not a programmer but I play one on TV".

So where do I start?

I figured I could use the Nerdkits ADC temp sensor code.

So I can connect a pot and get a variable.

Then how do I feed the variable to a PWM routine?

September 03, 2014
by JKITSON
JKITSON's Avatar

Ralph

Sounds interesting. I have not used PWM yet so hope to learn along with you..

Jim

September 03, 2014
by sask55
sask55's Avatar

Hi Ralph

I likely will not be of much help in your project for a few weeks. We are just getting started on what is proving to be one of the most frustrating and drawn out harvest seasons I have experienced. Our normally warm and dry weather this time of year is cool and wet making it impossible to make much progress. The rain last night many set us back another day or two.

The stepper driver chips/boards you are using look interesting. This fall/winter I will be finishing my prototype boards for my project. Everything works as I expected on my bench with the motors and callipers not attached to the mill. I have had a few of the Toshiba controller chips blow unexpectedly which seams to be a common problem for that chip as I have found a number of web articles discussing the problem. I have considered making a change to a different controller chip/board. I could purchase ready made controller boards to do the job, or for that matter the entire CNC set up is available complete with software. But like many projects I see, I am not doing it because I believe it is the most practical or economical way to complete the project. I just find the challenge interesting and use it as an opportunity to learn something new. The SD88825 stepper drivers you are using would require less supporting circuitry then the chips I am using. They appear to function in a similar manner as far as control interface is concerned. I could not use them for my project as I require a 3.5 Amp max current for my motors.

Sorry about all the unrelated small talk.

I believe that you are correct. You could use PWM available on the MCU to drive the STEP input pin on the controller. If your project requires the motor to turn both ways you will also need to control the DIR input pin from the MCU.

One consideration that you will need to work out is what is the range of speeds that you expect to be able to achieve from your motor? A number of factors will influence the STEP pin clock rate that you will need to produce. Your motor specification steps/rev. Do you intend to set the controller for microstepping? And the RPM of the motor shaft will determine the STEP rate required. Once you have an upper and lower STEP rate determined you can see how useful the PMW might be to achieve the range you want. Without further information I cannot work out the timing. You can influence the range of PWM available by using the 8 bit or 16 bit timer/counter and selecting the prescaler appropriately. I have not used PWM much. I would calculate the slowest (longest) pulse possible with a 16 bit PWM and the prescaler set at 1024. That would be your slowest pulse rate available using PWM. If that value is in the range that you require PMW should work without requiring any other software to slow things down.

Darryl

September 03, 2014
by Rick_S
Rick_S's Avatar

I think you'd have to generate a PPM signal not PWM, wouldn't you need to change the freqency of the pulses rather than the width of the pulse?

Rick

September 04, 2014
by Ralphxyz
Ralphxyz's Avatar

Hi Rick and Darryl, great to hear your input thanks.

I think I was thinking about PWM just because I have not done any projects using PWM, well I have done other peoples projects using PWM but none I had to really think about.

This is liable to be a long drawn out project as the only reason I started thinking about it was because of the high 80's and 90+% humidity, it was just to oppressive for my outdoor work. We have not had hardly any rain all summer.

Darryl, 3.5amps for a CNC rig sounds impressive what spindle are you going to use. Couldn't you use the SD8825 to drive some heavier transistors to handle the amps.

Rick I think you are correct, I have used the SureStepr SD8825 with just the LED blink project as my pulse train.

Gee it is nice to have a discussion.

Thanks for the feedback, I really need any and all help.

Ralph

September 04, 2014
by sask55
sask55's Avatar

Ralph

Since I am trying to get my mind of all the rain we are getting here I have some time to think about your project

I don’t know what your motor specifications are and it may well be the case that you are not too concerned about optimizing the motor performance. You may just require a simple speed setting dial for a very small, low torque motor

If you require the option to turn the motor either direction control of the DIR pin would be required. It may be important to have control of the ENABLE pin as well. Any time there is voltage to the motor power connection, VMOT, the motor will be “holding” with a constant current to at least one coil. In order to stop and start the current to the motor coils the ENABLE must be controlled. Stopping the clock pulses to the STEP will stop the motor and “hold” at the current position. Stopping the motor using the ENABLE pin will protect the controller and the motor from overheating when not turning if that is ever the case.

Stepper motor specification will very a lot. 200step/rev seams quite common for larger more expensive motors. Many inexpensive small motors produce a larger turn with each step. I have a couple that are 40 steps /rev. I have never really tested by I would guess it may be possible to achieve higher motor speeds with motors that have wider coil spacing (higher RPM).

In my limited experience I have found that the maximum practical motor speed I can reliably achieve, with some reasonable level of torque, is about 400 RPM. That equates to about 1300 Hz pulse rate for a 200 step/rev motor. That 400 RPM motor speed is possible only because I am overdriving the controller with 24 volts- 15 amp DC supply and letting the motor controller chips limit the current to 3.5 Amps /phase to match the motor specifications. Without the current limiting PWM built into these chips, 24V DC would fry the motor coils in a few seconds at low speeds, when the motor coil inductance is not a factor in the coil total impedance.

The SD8825 controller is rated at 2.5Amps which could drive a reasonably sized motor. Since motors that are rated at relatively higher amperages are more expensive and produce more torque designers attempt to get the most from there stepper motors. These stepper controller chips are designed to make use of overdriving power supplies. In order to achieve maximum performance from the motor a DC voltage supply (8-35V) capable of producing at least the combined current of both motor coils should be used. The higher the voltage used the better the motor should perform at high speed when coil impedance increases do to the inductance of the coil itself and the alternating voltages from the controller. With higher voltage it becomes more important to have the controller limit the current to the coils. For the SD8825 you can measure the set current limit using the VREF pin and set the current limit using the ADJUST TRIMMER as described on the web page you posted a link to.

With inexpensive, smaller, low torque motors it seams common to not overdrive the voltage level to the coils. In that event it is likely that the coil resistance is enough to limit the current and the full power supply voltage could be applied to the coil indefinitely without any problems.

I do not know what level of resolution we could expect from your potentiometer, I would use only the 8 MSB byte of the 10 bit ADC convention that would yield 256 possible values for your speed setting. So in theory we could set the motor speed at any one of 256 speeds between the slowest and highest rate that you have designed for. It would seam, that would allow for fine motor speed setting but this may not actually turn out to be true for the entire speed range.

As I see it basically you have two approaches to make a PPM signal generator with variable output. There is quite possibly a better idea that I am not familiar with. Let’s hope someone else has a comment on how to achieve frequency control with your potentiometer and the Micro.

Approach # One: you have a reoccurring interrupt timer set to one constant frequency. you then set up software to count the interrupts as they are triggered. Once the desired interrupt count is achieved the software toggles the output to the stepper motor controller STEP pin. By varying the count top number with the ADC output you vary the frequency of the output on the pin and the motor speed. The shortest time (highest frequency) pulse would be a count of one, or more, interrupts producing the fastest motor speed desired. The longest time would be 256 timer interrupts times 2 since each pulse cycle would consist of two pin changes one going high and the next going low. The interrupt timing could be set to produce the speed range you desire. With this approach we can use any available pin that is configured as an output pin.

Approach # Two: you could use the clear Timer on compare Match mode and change the value of the OCR1A register with the ADC output. You could configure the OCOA pin (pin 12) as an output pin that would toggle each time the count is matched. By varying the top count number held in the OCR1A you vary the frequency of the output on the pin and therefore the motor speed.

Unfortunately both the OCR0A (pin12) and OCROB(pin 11) are in use in the Nerdkits setup, driving the LCD screen. Therefore if we wish to use the LCD screen to display information like motor RPM, enable and direction statues we cannot use this method without considerable software adaptation.

I think there is an inherent issue when controlling frequency by adjusting the pulse width or delay timing. The pulse width is inverse to the frequency rate. Therefore equal sized changes in pulse length will not produce equal changes in the frequency across the range of the dial movement. To put it another way, if we increase the pulse length by any constant increment as the ADC output value increases the motor speed changes will be nowhere near linear. For example if the frequency is set at 1000hz the pulse cycle length would be 1ms. Now if we increase the pulse cycle length by 1 ms to 2ms the frequency drops to 500hz. The frequency is cut in half a drop of 500 hz with a very small movement of the dial. On the other end of the dial if the frequency is set at 10hz the pulse cycle length would be 100ms. Now if we increase the pulse cycle length by 1ms, as we did before, to 101ms the subsequent frequency drop is less then 1 hz. This small change would hardly be noticeable. So it seams the larger the values of pulse width cycle the less significant of a change will occur in the frequency or motor speed as you move the potentiometer dial. With a possible 256 (8 bit) change in value of the output from the ADC I think this would be an important consideration. The software should be done in a way to eliminate or at least mitigate this non linear speed change with respect to dial adjustments. I do not think you want most of the motor speed change occurring in the last small portion of the dial movement.

So I have a couple of question if anyone has a solution or sees an error in my thinking.

How could we free up the OCROA(pin 12) or OCROB(pin 11) and still use the LCD display?

Does anyone know of an algorithm or technique that could be used to flatten out the non linear changes in frequency as a result of the dial movement of the potentiometer?

Darryl

September 05, 2014
by Ralphxyz
Ralphxyz's Avatar

Hi Darryl, thanks for the explanation of the enable pin, I knew it was there but had not really thought about what it was doing.

This pot controlled driver setup is largely just for testing.

When I see steppers at a large discount, I got some NEMA 11 steppers for $0.95 and some NEMA 23 for $2.00, I usually will get a couple just to play around with.

I am building a 3D printer in my mind and have other X,Y, and Z motion projects I am thinking about so I have a variety of steppers.

I want a easy setup for testing if these discount steppers are any good and then to see how they work at different speeds.

The SuprStepr is so easy to use and it has everything right there easily controlled with a mcu.

Direction, ON/OFF and Micro Stepping are just a pin change. Plus other things I haven't thought about yet.

Ralph

September 05, 2014
by sask55
sask55's Avatar

Ralph

NEMA 11 and NEMA 23 is a reference to the case size of the motor or more precisely the mounting plate or “form factor”. There would be a large number of different motor manufactured with different specifications in each form factor. In any event those are some very expensive motors for the sizes. Do you have any other specifications for the motors ie rated voltage, rated current, holding Torque, shaft size, step angle.

The motor I am working with on my project are MEMA 23 rated at 425 oz-in holding torque 3.5amp max, which I believe is on the large torque end of the NEMA 23 mount size motors.

Where are you finding motors for those prices? I think I would order a few to play around with. I looked around quite a bit before I ordered them from china a couple of years back I paid about $30. each for them back then.

Darryl

September 05, 2014
by Ralphxyz
Ralphxyz's Avatar

MPJA.com usually has some interesting sales like thes NEMA 23 steppers for $9.95. This is where I got the $0.95 NEMA 11 steppers. I am on their mailing list so I get their specials every week.

Most of these steppers came from other equipment so they probable are used that is why I wanted to set up a quick test rig.

September 05, 2014
by sask55
sask55's Avatar

That appears to be an interesting web site I will be looking it over more closely.

The other link you posted to the NEMA23 motor add is a good example of how little information NEMA 23 really is. As I posted earlier NEMA 23 only indicates the size of the motor mounting plate and really nothing else. The NEMA 23 motor on your link is a 2 Phase Uni-polar type motor. This type of motor could not be controlled with a bi polar motor controller like the SureStepr SD8825.

Uni-polar type motors do not require an H bridge circuit and could by controlled directly from a micro. All that you would require to drive that motor with a micro would be is a bit of hardware to handle the 1 amp coil current (a ULN 2803 or 4 transitors would do the trick) . It is a mater of energizing the four coils in the correct sequence to produce rotation.

Anyway interesting information

Darryl

September 06, 2014
by Ralphxyz
Ralphxyz's Avatar

Well that just goes to show there is power in ignorance. I have run a Uni-polar type stepper with the SureStepr I ran stepper power to VMOT and connect the coils the same.

Well I remember I did that with a six wire stepper, I "think" it was a Uni-polar, It looks like it would work with the five wire.

The problem with the NEMA 23 stepper is 5.3 volts the SureStepr wants 8 - 36 volts at +VMOT.

There is also a 5a chip DRV8829 it would be interesting if you could replace the SD8825 (DRV8825) chip directly

Ralph

September 06, 2014
by Rick_S
Rick_S's Avatar

Six wire steppers can be wired as either uni-polar or bi-polar depending on what you do with the center taps on the coils.

I have some Nema 17's that are in my 3d printer and a set of spares. They are rated at a little over 2 Amps at 4.xx volts. They are driven by a 12V supply. As Darryl was saying, the way they get a lot of torque out of these little motors is they keep the current near max but run higher voltage. That is what the stepper controller takes care of. Also wit micro stepping, they can PWM the fields to get steps in between full steps. While the holding torque between the full steps isn't as strong as it is on the full steps, it give you much finer resolution to a motor.

Rick

September 06, 2014
by Ralphxyz
Ralphxyz's Avatar

I am building a 3D printer anyone have some great deals on some 12v NEMA17 high torque steppers? And of course I am always thinking about CNC so I'd like some good quality.

I worry about just grabbing steppers off ebay, I just do not know what is a quality description what else do I look at besides torque?

And what about voltage I think I would prefer 12 or 24 volts.

September 06, 2014
by Rick_S
Rick_S's Avatar

These are the motors I bought I bought them direct from his website and saved a bit on shipping because I live within 100 miles of him. According to the seller, these motors are made by the same company that makes the motors used by the printrbot folks only they are unbranded... I believe him, they are identical in every way I could check, other than the end plates are painted. They seem to be a pretty good buy for a high torque Nema 17 frame motor.

Rick

September 06, 2014
by sask55
sask55's Avatar

I also often wander about how to get reasonable quality when purchasing on the web. When I purchased my three motors and a switching power supply a couple of years back I looked around a lot read a few reviews, for what that is worth, and just took a chance. I ordered from wantmotor.com

I received the order quicker then I thought. The motors look very well made the machining is good they are very heavy and solid. I have had them turning quite a lot but I really have not challenged them to produce much torque for extended periods of time yet.

The power supply came damaged. It appeared to have gotten dropped in transit. The internal cooling fan was dislodged and broken. I email Wantai motor explaining the damage and sent a few picture of the damages power supply. They offered to discount the supply substantially or I could return it to them and they would send a new one. I took the discount and got a replacement fan for a fraction of the discount. The supply has work well with the replacement fan.

I would order from them again they had very good prices, fast delivery and reasonable to deal with when I had a problem. They also have a lot of very detailed information about there products on there site which I like .

Darryl

September 07, 2014
by Ralphxyz
Ralphxyz's Avatar

Rick, your stepper has a "Rated Voltage of 4.2v" do you use a Buck converter?

I would like 12v or 24v.

September 07, 2014
by sask55
sask55's Avatar

Ralph

If you intend to be using a stepper motor controller like the SureStepr then the voltage rating of the motor is not a factor. One of the major advantages of this type of controller is there ability to monitor and then control the current that flow in the motor coils using PWM. If you want high performance from the motor the controller must be capable of over drive the voltage above what is listed on the ratings for the motor. You should always supply the controller with as much voltage as the supply can produce. Then set the max current on your controller to the level your motor can handle ie rate current of motor. The controller is designed to limit the current to that level for all motor speeds even when the coil inductance has increased the coil impedance do to the alternating current to the coils. basically the high level of voltage available to the controller is used to off set the higher impedance as the frequency of the coils alternating current increase with motor speed.

So yes use as much voltage as the controller can handle and the supply can produce. just make certain to set the current limit with the trim pot on the controller.

September 07, 2014
by Ralphxyz
Ralphxyz's Avatar

"If you intend to be using a stepper motor controller like the SureStepr then the voltage rating of the motor is not a factor."

Boy Darryl, I hope you are getting more rainy days cause you need more time to explain this.

What would I do just turn the pot to minimum at first start and then increase? Increase it to where/how much?

Actually I can wait I hope you get some dry weather so that you can have a successful harvest.

September 07, 2014
by sask55
sask55's Avatar

The reason there is a voltage rating on a motor is to limit the current. Current is what produces the magnetic fields that move the motor. For maximum torque we need as much current as the coils can handle. Unfortunately current thru a resistor also produces heat.

The coils would have a more or less fix resistance that would increase only a small amount with temperature increase. The coils also have an inductance. The inductance has no effect on the total impedance when a DC current is applied. But the inductance does increase total impedance if the current is changing as is the case with a bipolar motor. The current is reversing polarity each time a coil is energized. That is what the H bridge circuit is allowing the controller to do. Too much current will produce too much heat and damage the motor.

If the designer of the motor specifies a motor can handle 1 amp of current without damage and the coil has a resistance of 10 ohms. By using ohms law I=V/R or IR =V we get I amp X 10 ohms = 10 volts. For that motor the designer will likely state the voltage rating of the motor is 10 volts. Any more voltage then that will overheat the coils do to too much current. I am not going into a detailed induction frequency impedance calculation right now. But suppose that the motor coil is being energizer with a frequency of alternating voltages such that the total impedance has doubled. The resistance has not changed but because of the motor speed there is also impedance produced by the inductance of the coil. Without any changes to the energizing voltage the current thru the coil is now ½ what it could be, to produce the maximum magnetic field and therefore maximum torque. To compensate for this changing total impedance that is bond to increase as the frequency increase we could increase the energizing voltage in direct proportion to the increasing total impedance.

The motor controllers do not actually increase the voltage they do increase the effective voltage. Motor controllers monitor the effective current that they are supplying to the motor coils. They adjust the duty cycle of a PWM current to the coils. If the coil is holding and therefore the total impedance is the same as the resistance of the coil the duty cycle would by small.

For the motor in my example when the motor is holding and if the controller is supplied with 24V DC and the coil would only require 10V DC to reach the 1 amp current. The PWM of the controller would be at 10/24 or less then 50% of the duty cycle. As the motor is sped up the controller measures a drop in current do to the increasing impedance, in response the controller increases the duty cycle to maintain the 1 amp current.

Basically the controller is now maintaining the current level with PWM we do not need to be concerned about what voltage it is using. The more voltage it has available the longer it can maintain the maximum coil current.

That may be kind of long winded I don’t have the time now for a much editing.

Darryl

September 08, 2014
by Ralphxyz
Ralphxyz's Avatar

Thanks Darryl,

How is the harvest?

September 08, 2014
by sask55
sask55's Avatar

Ralph

Harvest is very slow. late starts in mornings and early shut down in evenings do to cool humid weather. Very soggy field conditions resulting in equipment getting stuck. If things do not improve we will be at this for weeks assuming winter does not arrive first.

This forum is one of the ways I kind of get my mind off the farm for a few minutes.

Darryl

September 08, 2014
by scootergarrett
scootergarrett's Avatar

I've been thinking about stepper motors lately as well so I will jump in. First off what are people using for coupling? Something like this ? Also I like getting electrical supplies from a large website (it gives me the feeling that if I ever need more in the future I could get them without relying on someone on ebay) but it seems that the large websites (e.g. newark.com) only offer expensive motors, any thoughts?

As far a theory of voltage and current I think I'm getting an understanding, correct me if I'm wrong. The heat a motor makes is a function of the current through it. Because the coils, and back EMF increase impedance at high frequencies, the voltage can be increased with out increasing the total current through the 'resistor' part of the motor. I made a little schematic for what I remember about modeling a motor PIC. As long at the current is under a set amount the it won't over heat. So some stepper drivers are controlling current to the motor?

Also for my understanding if a motor over heats the epoxy coating on the coils starts to burn off shorting the windings coils and therefore more heat.

September 08, 2014
by sask55
sask55's Avatar

Scootergarrett

I machined my own couplers, not for any good reason except I have the equipment to do it and it was not a difficult project. I based my couplers on something like this style mostly because I could machine the various parts quite easily. I really don’t have much practical experience with any coupler type. I think the object is to transmit the rotational force of motor shaft with as little backlash as possible and allow for a small amount of misalignment of the shafts, doing that while adding as little additional torque to the motor would be important to me. It is apparent that some types of couplers may have a degree of wind up and spring back as torque is applied and removed. I don’t think that will be a significant factor for my project.

As I said in an earlier post I used wantmotor.com. They have a very wide range of produces and the prices, when I ordered, where not bad at all. I know they have bean around for at least a couple of years.

I mostly agree with your comments about the voltage and current in a motor coil. But since it is raining here again I will give my spin on it.

A motor coil is essentially an insulated wire that is wound into a coil to produce and electric magnet. As you have said the epoxy coating on the wire is essentials to insulate the wire and prevent a very low resistance short circuit between adjacent wires in the coil. If a motor coil wire ever gets hot enough to break down or burn the insulation between windings the motor is finished. The coil cannot be energized as designed and the motor will likely never will work properly again. So it is important to never heat up the coils to that point. The heat build up in the windings is a function of current and time. Way too much current for a short time or a little too much current for a long time could burn out the windings.

The motor coil has a number of electrical properties that cannot be separated from one another in the actual motor. These properties can only be separated in theory to simplify calculations. The physical length, size and material of the coil wire will dictate how much resistance it has. Many factors influence the inductance the coil will have, including the number of turns of the winding, the properties of the materials the motor is made of.

If a voltage difference is applied to the two ends a coil of wire a current will flow in that wire. The amount of current that will flow can be calculated using ohms law I=V/R. But there are two electrical properties of the coil that make up the R portion of the relationship. There is the resistance, which will remain more or less constant. If there is a changing current levels there will also be an impedance value. The inductance property of the coil is responsible for both the Back EMF and impedance of the current as a changing voltage is applied to the coil.

The typical bi-polar stepper coil is repeatedly energized in a sequence of alternating voltage charges separated by periods of no charge + off – off + off – off ext. In a way inductance is a measurement of how reluctant a circuit is to change current levels. It is somewhat like the mass of an object is a measurement of how reluctant the object is to change speed F=MA. The higher the inductance the more impedance there is to changes in current levels. An inductive load with no current will develop impedance as voltage is applied. Add that impedances to the existing resistive load to get the total number of ohms the coil has while the current is changing levels. As the motor is driven at higher and higher speeds there is more and more rapid changes occurring in the voltages levels applied to the coils. The motor inductance becomes more and more of a factor limiting the current. If the current level in the coils is to be maintained the effective voltage must rise in propotion to the increasing impedance.

The inductive property will produce voltage (EMF) as the voltage applied is reduced. A good example of that would be an old faction spark plug coil on an engine. The coil is energizer with 12 volts. When the points are opened the energizing voltage is removed. The magnetic field begins to collapse in the very high inductance ignition coil. This collapsing magnetic field will produce hundreds even thousands of volts. A similar effect will occur in the motor coils as the voltage supply is removed at the end each pulse of energizing voltage to the coil. Motor control circuits are designed with fast acting diodes in place to shunt off EMF produced by the inductance of the coils. If there is nothing is place to deal with the inductance induced voltages from the motor coils high EMF voltages would likely damage the controller or even beak down the insulation in the motor itself.

Controlling the EMF and current drop that are bound to occur when a changing voltage is applied to a inductive load (coil) is a big part of the motor controller function.

September 08, 2014
by sask55
sask55's Avatar

Correction

Actually now that I think about it again there is no off period when full stepping with a Bi-polar stepper motor. Each coil of the two coils are energized with a alternating square wave 90 out of phase. I was confusing the bipolar sequence with a uni-polar sequence and came up with a highbred imaginary sequence that is not useful with two phase motors.

I do realize I make a lot of spelling,typing and grammatical errors in these posts but correcting them would be a daunting task for me. I see more stupid mistakes every time I reread anything I have typed.

September 09, 2014
by Rick_S
Rick_S's Avatar

Great writeup Darryl. Don't worry about the spelling errors or grammar problems, the big ol' pile of information you just supplied about coils was very informative and opened my eyes a little to the mystery of induction and impedance.

September 09, 2014
by Ralphxyz
Ralphxyz's Avatar

Really, you have given such detailed and informative information over the past couple of years concerning steppers. One of these days in my spare time I am going to compile them all together.

This is starting to sink in but I am still wondering about using Rick's steppers with a 4.2v rating while the WANTAI have a wide variety of voltages for the same Model they range from 12.2 to 2.2 volts.

I like the Wantai selections but I am confused on which to order. Actually Rick's steppers have some of the strongest torque ratings so they look good but I am still worried about the voltage rating.

If the voltage rating is not relative why give one?

September 09, 2014
by sask55
sask55's Avatar

Thanks Rick

I am more or less looking for somthing positive to think about.

Ralph

I will use the motor Rick has spotted on ebay as an example to try to explain this.

Specifically the motor specifications that I will concentrate my comments on are.

Current Per Phase: 1.5A

Rated Voltage: 4.2V

Resistance Per Phase: 2.8Ω± 10%

The fixed resistance of the coils will dictate the voltage required to reach the maximum safe working current when the motor is holding or turning slowly.

Using ohms law I = V/R. we can calculate how much voltage could be applied to this motor before that current level is reached.

V=IR is ohms law written in a different arrangement to isolate voltage.

For this motor Volts = 1.5A X 2.8 ohms = 4.2 volts

4.2 volts is listed as the rated voltage because that is the maximum safe voltage that can be supplied to a coil of this motor when it is standing still or turning slowly. The voltage rating is an important specification in that if we are not using a current limiting PWM controller we should never use a voltage above that level, at least not for very long.

The coil resistance is a result of the physical characteristics of the coil wire it can be measured using a VOM. The rated current per phase value would be the motor designer’s best estimate of a safe maximum current that a coil could handle without damage. That value would be somewhat dependent on operating factors like ambient temperature ventilation around the motor and the length of time the current was present. The voltage rating is actually a derived value arising from the other two values. It is given to the motor user to make us aware of just how much voltage is required to reach that maximum current in the coils. But this only would apply when the motor is holding or turn slowly when the coil impedance is not a factor.

As I have explained in earlier posts if we are using a current limiting type motor controller that voltage rating does not apply. The entire point of the PWM from the controller is to overdrive the motor with more effective voltage then it is rated at but only when the motor is turning are higher speeds. In order to make use of the PWM future of the controller it is not just safe to supply the controller this voltages above the rated motor voltage level, it is essential. To get the added performance level your controller will offer as the motor is sped up you must supply the controller with a voltage well above the voltage rated for the motor. I don’t know how else to state it, the only way the controller can compensate for the increasing total impedance do to increasing motor speed is to increase the effective voltage to the coils, and maintain the coil current level at the maximum for maximum torque.

Let the current monitoring feature of the controller protect the coils from over heat do to over current at slow speeds using PWM. The user must set the controller to the limit desired, using the trim pot, if we are talking about the sureStepr SD8825.

As far as what motor to order, I think you will require some idea what torque level and motor speed your application will demand. The facts are torque cost money in motors. A motor that is not capable of producing enough torque may not do the job at all. A motor with more then adequate torque capabilities will cost more to buy and may require a larger amperage controller and power supply, all that extra torque capacity will cost. If you have a rough estimate of the amount of torque required to turn the shafts at the speed you wish to turn them then you can use the pulse–torque characteristic graphs on the Wantai Motor web site to select the motor for the project. Rick motor may be perfectly adequate for the job I have no idea what level of torque you will require.

In fact, I am not certain the motors I have are adequate for my project. Since I am using my existing mill as my CNC project I have attempted to make some measurements of the torque required to move the table and spindle. It became very apparent that those values will change drastically depending on a number of factors like what the mill was machining and the feed rate. I ended up measuring what I considered to be a reasonable typical application, gave myself a wide factor for error, and ordered some motors. Eventually I hope to let you know how that works out for me.

Darryl

September 09, 2014
by Ralphxyz
Ralphxyz's Avatar

Thanks once again Darryl, now that is making more sense.

First I am looking for some motors primarily to do 3D printing which is what Rick's motor was sold for.

I am also "thinking" about CNC milling but that would be a new set of motors though if I could route around a Dremel milling foam just to learn CNC milling that would be cool.

At the moment my 3D printer has a 400mm cube build area so I could work on some good size projects.

Of course I am just assembling the Z Gantry so the size might change.

Damm, it is amazing how fast the cost add up when you just occasionally add some pieces off ebay good think I have a decent credit card I'll be paying it off for a while.

September 09, 2014
by sask55
sask55's Avatar

OK keep up informaed how things are going.

November 17, 2014
by Rodney
Rodney's Avatar

I have a question I am really new at electronics and I have a few nema 17 stepper motors , how do supply power to them just using a switchable power supply or is there away to supply enough voltages using batteries I get kind of confused on power requirements and different ways of making that work, thanks for your time :)

November 17, 2014
by sask55
sask55's Avatar

Rodney

Stepper motors are different from most other types of motors in that you cannot just connect them to a power source directly and they will turn. Steppers have internal coils that must be individually powered by connecting a power supply to the motors connection wires one phase at a time. There are a number of different ways or arrangements that the motor wires can be connected to the coils inside the motor. Steppers typically have 4, 5 or 6 wires depending on the type of connections there are inside the motor. In order to make stepper turn, power has to be supplied to the motor wires for short periods of time in a specific sequence or order. One of the features of a stepper is control of movement; each step will turn the motor a predetermined amount in either direction depending on the sequence of power supplied to the wires. A repeating sequence of motor coil connections can be set up to rotate the motor shaft a very specific amount. This feature is very useful for applications where motor speed and precise rotation are required, like printers and scanner ext. One of the draw back of using stepper is they require motor driver hardware to supply the power sequencing to the coils.

There are thousands of different Nema 17 stepper motors of all types with a wide range of power requirements. Nema17 is a reference to the motor mounting plate size and nothing else. All that we can say is that all nema 17 motors should fit unto the same mounting location and the mounting screws will be in the same location. The motor itself may not fit into the available space but the mount should be the same.

It is not a question of enough voltage for the motor. Either a DC power supply or a battery could be used to power your motors, but you will require some type of motor controller in between the supply and the motor to actually make a stepper turn.

I don’t want to leave you with the impression that the voltage and maximum current capacity of the supply is not a factor. It may be an important factor after you know the requirements and limitations of your motors and controller.

So to answer your question, there is no way to make a stepper motor turn with JUST a power supply or battery. You are going to require some type of motor controller.

If you want to get your motors turning the first thing to do is determine what type of stepper you have. Bi-polar motors usually have four connection wires. Motors with five wires are likely uni-polar type motors. 6 wire motor can likely be used in either bi polar or uni-polar configurations. Other information may be printed on the motors like the maximum rated voltage. Coil resistance, step size and coil maximum current. Or if you have model numbers you will likely find this information on line.

Uni-polar motors can be set up to operated using a Nerdkit with very little additional hardware. Bi polar motor will require an H bridge circuit and a controller chip is likely your best approach.

If you are still interested let us know and someone will help set things up.

Darryl

November 18, 2014
by JKITSON
JKITSON's Avatar

Darryl

I have re read this thread and am amazed at how well you write your ideas & comments. Fantastic information & very easy to understand... I have not played with stepper motors yet but have some uses coming up.

Let me know when you head South...

Jim

November 18, 2014
by Ralphxyz
Ralphxyz's Avatar

I have run a stepper motor using the MCU as the controller.

This was a four wire stepper you just step through the pins B1 20ms, B2 20ms, B3 20ms, B4 20ms repeat.

At least I think that was how I did it it was a couple of years ago.

November 18, 2014
by sask55
sask55's Avatar

Ralph

I think you where using the micro as a motor controller for 5 wire uni-polar motors. With Uni-polar motors the current is never reversed in a coil (polarity of coils will never change). Uni-polar motor will only require that a voltage be applied to a coil and then removed at some point. It is a simple off /on requirement to control the current flow in each coil. The 5th wire is common to all the coils it just remains connected to the power or the ground (depending on how the motor is connected) all the time.

Bi-polar steppers require the ability to switch the polarity to the coils in the motor at the end of each motor phase. To produce a current in the opposite direction (bi-polar) four things must occur in the circuit. It is not just a mater of disconnecting one end of the coil as is the case in the uni-polar motors. Typically this is done using what is called an H bridge circuit.

Often the black wire is internally connected to one end of a motor coil and the green wire is connected to the other end of the same coil. If we connect the black to a voltage source and the green to the ground of that source, current will flow thru the coil. If we disconnect either wire the current flow will stop. In bi-polar motors the current is not stopped it is reversed (connected up the other way around). To reverse the current in that same coil three more things must occur in the circuit. The other end of the coil must be disconnected. Then each of the two connection wires must connect with the opposite polarity that they originally where. All that connecting and disconnecting is unavoidable to flip the polarity in the coils as required by bi-polar motors. It would be possible to drive a bi-polar motor with a mirco but you will require some type of H bridge to handle the bi-polar nature of the current flow.

Darryl

November 18, 2014
by Ralphxyz
Ralphxyz's Avatar

aha, I was thinking about that after I said it. A five wire stepper makes sense, thank you.

So Rodney what type of steppers do you have?

November 18, 2014
by sask55
sask55's Avatar

Ralph

I was also thinking about this and I could defiantly recall you working with bi-polar motors in the past. I did a little search of the NK forums and this is the thread I was thinking about. It went on for quite a while covered a lot of ground. You where using a L298N chip to do the H bridge functions and controlling bi-polar motors with the micro.

Now I am not certain, I think there may have been an earlier thread when we where working with 5 wire uni-polar motors as well. I did not try to find that thread on the forums. I may be thinking of my personal experiences with uni-pollar motors.

In any event the facts remain it would be difficult to drive a bi-polar motor without some type of h bridge in the mix. Whereas uni-polar can be driven using four transistors (2N7000 would work for most motors) or a chip like the ULN2803 darlington array to handle the coil current.

Darryl

November 18, 2014
by sask55
sask55's Avatar

Jim

I just noticed your comments. Thanks

I have done a lot of playing around with and reading about steppers and controllers in the last number of years. I guess some of it is sinking in a bit.

We are not sure if we will be traveling your way or not. We are still looking at options.

Darryl

November 19, 2014
by Ralphxyz
Ralphxyz's Avatar

I was driving the stepper directly from the mcu, it was a small stepper motor.

I just recently packed the motor setup away now I have no idea where it is it might take me about six months before I find it again.

I am finally setting up a shop and I packed everything up from the floor of my bedroom into a hundred boxes.

November 19, 2014
by BobaMosfet
BobaMosfet's Avatar

Normally, 5 and 6-wire motors are unipolar, and are actually the same. 5-wire just means that 2 wires are tied together as common.

BM

November 19, 2014
by sask55
sask55's Avatar

BM

I think that some, if not all, 6 wire motors can be operated as either a uni-polar motor or bi-polar motor.

As you have pointed out, by connecting the two wires that come from the center of each of the two internal coils together, the motor can be operated as a uni-polor motor . If those two wires are not connected at all, to anything, the other four wires can be used to drive the motor as a 2 phase 4wire bi-polar motor.

Darryl

November 20, 2014
by Ralphxyz
Ralphxyz's Avatar

Yeah that is what I did to use the MCU as the controller. I put voltage on the common wire and used the mcu to ground each pin, I did n't even need to use transistors. Again with a small stepper.

So Rodney where are you at, there has been some good knowledgeable discussions you should have learned a lot.

November 21, 2014
by BobaMosfet
BobaMosfet's Avatar

sask55- Agreed, I was mainly pointing out the most likely reason why some had 5 and others 6.

BM

Post a Reply

Please log in to post a reply.

Did you know that you can connect to certain car computers via the OBD-II port with a microcontroller? Learn more...