Notifications
Clear all

Stepper Motor and Driver

39 Posts
5 Users
18 Reactions
1,955 Views
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 318
Topic starter  

While it's in the high 90s outside I though I would look at replacing the automatic door on the chicken coop.  I watched Bill's video's on stepper motors and drivers and I think I picked out units that would work.  I would like confirmation that I selected a proper stepper motor (i have no specs on door weight, travel length, etc.).  This is my first time working with a stepper motor.

The vision would be to integrate this with the existing ESP32-S3 system already in the coop.  The ESP32-S3 would talk to the A4988 H-Bridge motor driver.  

For the stepper I've selected a Nema 17 Stepper Motor 42-34 3D Printer Motor DC 1A-3.4V 2 Phase 4 Wires 1.8 Degrees (Stepper Motor).

Since there are so many variations of the Nema17 I would confirmation this unit would work or maybe a suggestion on a better option.

Thanks

Mike


   
Quote
Topic Tags
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio That link is not working, I can't even edit it to work. Also why that driver?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 318
Topic starter  

@zander Ron, Link is fixed.

Why the driver?  IDK, it was in Bill's video.  I thought I needed a driver when using a Bipolar Stepper Motor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio Yes a driver, but if I recall you are simply lifting a small door, that driver is for very advanced micro stepping (as in 3D printing), you only need a basic driver or even a gear motor and driver.

Double check the stepper specs, and the driver specs, I thought I noticed a mismatch.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 318
Topic starter  

@zander Ok.  Thanks!


   
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1963
 

Hi Ron @zander@huckohio,

  With due respect Ron, the A4988 driver chip may have a few tricks built in, but with shopping around, it is available on a small board for around US $1. It provides an answer to the current control requirements, at least for lower current applications, which are rather more complex than many people realise.

------------

The electrical requirements of stepper motors are quite different from brushed motors. So with the possible exception of the tiny motors, like the 28BYJ-48, which is included in many of the Arduino style teaching kits, I think that they deserve appropriate electrical drivers, of which the A4988 would be at the lowest end of the technical sophistication and cost spectrum.

----------

As to whether, the proposed Nema 17 motor and A4988 will meet the requirements of this project, I am sorry to say, I can't answer. Stepper motors are specified to produce a certain torque value, when the current through the coil is at a certain value. Hence, it is necessary to know what torque is required to achieve the required mechanical result, which obviously depends on factors like friction, mass of object and so on, taking into account the effects of any gearing, etc. Others on the forum have more mechanical engineering experience than I do, and may be able to provide some practical experience.

--------------

Note that when setting up an A4988, the current level is preset by the user adjusting a small preset, before connecting the motor. The A4988 has a practical maximum current limit, which from memory, is about 1A for each of the two motor coils. The motor will similarly, have a maximum specified limit, based on its ability to dissipate heat.

If for any reason, the A4988 cannot supply enough current, and/or the Nema 17 motor does not have the required torque, then there are many upgrade products that are conceptually very similar, to chose from.

---------

A common mistake is to look at the specification of a motor, and see values like 4.0V and 1.5A.

Unless you only intend to step at a very slow rate, this is not what needs to be sent to the motor. Instead, it will be normal to supply the driver with a considerably higher voltage, say 24V, and allow the driver chip to limit the current. You may be surprised to learn, that if the driver has been set to a motor current of 1.5A, for this 4.0V motor, then if you measured the current demand of the driver chip when supplied with 24V, it will probably be less than 0.3A, even though the motor current is actually 1.5A.

-------------

Hence, designing a stepper motor system from scratch, requires a bit of a learning and experimenting phase. It shouldn't be too hard, but expect a few surprises at the beginning. I recommend doing some preliminary trials, using the great examples provided by Bill (@dronebot-workshop), and maybe others, before trying to design your project system.

As I already mentioned, it is difficult to know whether a given motor will be powerful enough. I would start with a small experimental system, like a small Nema 17 and A4988 on the bench, and do some experiments, possibly using a bench or other convenient power supply. I am sorry that this may mean also buying a larger motor and/or driver for your final project, but I suggest the learning you can achieve with a 'minimal' system will probably be a good investment.

On the positive side, once you have mastered the basics, stepper motors provide a much more controlled source of power, especially for tasks that involve moving a certain precise distance, then holding that position, repeated many times.

----

I hope this helps. It may be a little more daunting than you were expecting, but hopefully you will enjoy the challenge and become an expert.

Best wishes, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@davee My only concern was that this controller is a very capable controller with I believe up to 1/16 micro-steps so I thought it would be a higher priced model. It is only $4.95 direct from Pololu so that's not really an issue. I just find it strange to use a controller this fancy to lift a little chicken coop door, but that's just my frugal side showing I guess which is somewhat rare. I find the following statements to be strange, it's a chicken coop door, none of those attributes apply.

As I already mentioned, it is difficult to know whether a given motor will be powerful enough. I would start with a small experimental system, like a small Nema 17 and A4988 on the bench, and do some experiments, possibly using a bench or other convenient power supply. I am sorry that this may mean also buying a larger motor and/or driver for your final project, but I suggest the learning you can achieve with a 'minimal' system will probably be a good investment.

On the positive side, once you have mastered the basics, stepper motors provide a much more controlled source of power, especially for tasks that involve moving a certain precise distance, then holding that position, repeated many times.

 

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1963
 

Hi Ron @zander,

  As you know, I tend to look for the cheap side ... but because of the way relatively sophisticated electronic parts can be manufactured for practically nothing, I think A4988 will be one of the cheaper options, providing it can supply enough current. (I have no idea how much torque will be required, as that is down to the mechanics of the door.)

Stepper motors tend to be a little more expensive than their brushed relatives, but if a project can use one that is already on sale for 3D printing or similar, the price difference can be minimal.

So, whilst I think your original comments would have been valid until quite recently, I respectfully suggest that the scenery has changed since then, especially if you accept buying from the cheapest online sources.

---------

Sorry, I don't understand why you question my suggestion of starting with some preliminary experiments with a small Nema 17 motor + A4988, to get some experience regarding the physical aspects. Admittedly, I am assuming @huckohio has not worked with such hardware before, and I apologise if he is already familiar with them. However, I am concerned that others have got in a bit of tangle, expecting them to be the same as brushed motors. They are not massively complicated, but they are a bit different, and maybe even counterintuitive, when trying to estimate current and voltage drive requirements.

The small motor and A4988 may have enough mechanical drive for the final project, but I do not have enough information to be sure.

---------

Best wishes, Dave


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 318
Topic starter  

@davee @zander

Posted by: @davee

Sorry, I don't understand why you question my suggestion of starting with some preliminary experiments with a small Nema 17 motor + A4988, to get some experience regarding the physical aspects.

Dave, your recommendation is spot on.  While my potential project is to make a replacement coop door (current door works fine), I need to start some experimentation with the stepper.  I've never worked with one, so this effort will pure discovery.  There are so many Nema17 stepper motors that deciding which one to start with can be daunting.  I just wanted to make sure the combination of driver/motor would at least work (even thought I don't have any load data). 

I realize that I have no specs for the motor based on the door/frame/mechanical design.  I was actually thinking of looking for a door and frame design on some of the 3D forums (would be lighter and cheaper to 3D print the door/frame). I do have a very smart brother that can help with the remaining mechanical design (if I can get him off the golf course).

But for now you both have provided me with a starting vector.  I did order the A4988 (~$2.00 each) and a Nema 17 Stepper Motor Bipolar 1.5A 42Ncm 42x42x38mm 1.8deg 4 Wires.  The ONLY reason I purchased this combination was because the stepper motor was listed under "Frequently Bought Together" for the A4988 (how's that for extensive engineering work? 😆 ).  BTW, both the driver and motor came to $12.00 USD.  

Thanks guys.  As always, I appreciate your input.  

 


   
Ron reacted
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1963
 

Hi @huckohio,

  Thanks for your kind reply. I wish you well with your learning and subsequent project.

  It maybe that the A4988 and motor you have ordered on the basis of your 'extensive' research will work fine in the final design, especially if you have a lightweight door and 'smooth' mechanism.

Personally, I think your attitude is spot on, since, if for any reason you decide to use a different motor and/or driver, or even a different mechanism in general, hopefully you will feel the $12 was a good investment in learning.

You could spend years watching videos, reading blogs and books, etc. But whilst such information sources are invaluable in obtaining a necessary 'theoretical' background, actually playing with something in front of you will often teach you more about the practicalities of the situation in a day, and that is also vital for a successful practical project like yours.

----------

You might get some ideas about mechanical options by looking at the design approaches of the simpler, basic 3D printers. The $100-$200 ones ... not to buy, just look for ideas, as it is often possible to cheaply buy the parts they are made from through the usual online vendors. Of course, there are some major differences, including the mechanical precision, as well as the effect of chicken waste products on bearings, etc. to consider 🤭, but maybe there are also similarities, and some parts might be cheaply available if they are being produced for 3D printers.  (Just a crazy suggestion ... treat with as much contempt as you feel appropriate.)

------------

Obviously, if you come across something that is confusing etc., please pose another question. Hopefully, someone on the forum will be able to provide some useful advice.

Best wishes and good luck, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio I don't know if you know, but to me this is another (lightweight) elevator. In that case, think counterweight so you only need to lift up/down the net weight, and some sort of mechanism to hold the door in place when in the up position assuming it will be left there for some time. I am thinking spring held brake with solenoid disengage or solenoid operated latch.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 318
Topic starter  

@davee

Posted by: @davee

You might get some ideas about mechanical options by looking at the design approaches of the simpler, basic 3D printers

Great idea.  I have a Creality Ender 3 and Elegoo Neptune 3 that I can look at mechanical design.

Thanks!


   
DaveE reacted
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 6 years ago
Posts: 318
Topic starter  

@zander

Posted by: @zander

In that case, think counterweight so you only need to lift up/down the net weight, and some sort of mechanism to hold the door in place when in the up position assuming it will be left there for some time. I am thinking spring held brake with solenoid disengage or solenoid operated latch.

Thanks Ron.  Great suggestion.  After reading this I did a quick search and I did see a video of a wooden door that was using a similar concept.

Thanks to you and @davee for your support, comments, and suggestions!

 


   
DaveE and Ron reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio Also, picking up on Dave's comments, I think a threaded rod approach with the stepper driving a toothed belt might also work. That approach will not need any kind of brake so that is both cheaper and maybe more reliable and simpler to build.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
DaveE and huckOhio reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 8047
 

@huckohio A couple things just occurred to me. I apologize if I am stating the obvious, but I am not a good mind reader.

If you go with the stepper/cogged belt/threaded rod ala 3D printer style solution, a couple things come to mind.

As well as counting steps and decelerating at the end of travel, still use a limit switch for backup. Consider coming down slower than going up. I don't know the full scenario so some suggestions might seem kooky, but what about a PIR to sense a hen or even worse a chick in the way of the door?

Also consider if a second limit switch on each end is advisable in case of a failure of the stepper to slow or a complete failure of the first limit. I would use a smallish limit switch as the normal limit and a more robust for the 2nd. I doubt they will ever get used, but they are inexpensive and as long as Mr Murphy is still around you know what will happen without them.

I wasn't that big a fan of steppers before they were mentioned here, but I am quickly becoming one, they have some definite advantageous. The only con I can see at the moment is there do not appear to be any small enough to replace the standard 'yellow' motors and similar that are so common in various vehicles.

Please keep us informed, I think this will turn out to be a fun project.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Page 1 / 3