zondag 27 oktober 2013

Change unipolar 28BYJ-48 to bipolar stepper motor

Now here's something I was not expecting. Previously, I tried to drive this stepper motor with the driver board that came with the motor. My main goal was of course keeping the accuracy of the tiny motor safe and then testing at which speed I could get the maximum torque it could produce. Depending on the driving method, I came up with 300gcm when it was driven using half stepping and 380gcm when I switched to full stepping. Those were actually good results considering that the datasheet predicted these numbers more or less.

Now this kind of motor is not really up-to-date with modern technology. Unipolar stepper motors are not that common anymore. Bipolar steppers are twice as efficient with the same amount of copper on the internal windings. Even in full stepping mode, a unipolar stepper still has 2 out of four wires not active all the time. So basically, if there was a way to run current through all windings in the motor at all times, the thing would be stronger and faster.

That's what happens in a bipolar stepper motor. It has only two windings instead of four in a unipolar stepper. Both windings can be activated all the time, but their polarity is switched in four steps. This means that this kind of motor only has four wires instead of 5 (or 6 or 8). The tricky part is changing the polarity. That cannot be achieved by the simple driver board that came with this motor. It only activates one or two out of four outputs, but current always flows in one direction.

What if we could change the wiring of this motor, thus converting it to a bipolar model? All you would need to do is cut the red wire in the scheme above and then ignore the center connection marked 2+3+6+7. The result would be something like the left drawing.

I found out that this is very easy with this motor. All you need is a sharp knife and a tiny screwdriver. Use the latter to remove the blue plastic cap that hides a small PCB. On this PCB, you can see eleven solder points. All it does is fixate the wiring of this stepper (which can be either unipolar or bipolar by design) into a unipolar type by connecting the center of the two windings. If we cut this connection and ignore it in our scheme, what's left is a real bipolar stepper motor.






This is what the PCB looks like in detail. The red connection in the scheme above is actually the copper connection in this picture that I cut with a cutter knife. That's all you need to do! Well, for your own peace of mind, you could also try to re-attach the blue plastic cover. And now, ignore the red wire of the motor. We don't need it anymore.




But now we have a motor without a driver board. What you need is a H-bridge type which luckily exists in small packages if you're not going to drive heavy machinery. I used a L293D 16 pins DIP chip which I found online for $5.5 for ten chips.

I drew up this scheme that I used to drive the motor with an Arduino (actually I used an Atmega8 on a breadboard doing exactly the same thing, only a bit slower). I'm using 9V on the motor in this test since windings are twice as long as in the original version. I guess you could go much higher than that, this thing never heated up in my test.



My simple code example to drive it can be found here.

Finally, most importantly, my torque test resulted in :

800gcm !!

which is at least twice as much as full stepping unipolar (380gcm) and almost 3x more powerful than my half stepping unipolar test (300gcm)

Basically, if I cut one wire in the motor, it gains almost 3 times its original strength.

I like it! A lot! :)



46 opmerkingen:

  1. Cool - Very interesting!
    Thanks for sharing

    BeantwoordenVerwijderen
  2. Thanks for sharing this information!
    I'm still wondering though - does that connection really need to be cut? I mean, in bipolar drive with e.g. , the center taps of both coils are either disconnected or Vcc/2 so they shouldn't interfere with each other, should they? Driving the motor this way with the red wire unconnected does seem to work at least, didn't measure the torque it can deliver though. Tested with bipolar half stepping with an L293D similar to your setup, but also driving its enable inputs to disconnect the coils in the appropriate steps. Couldn't make out a difference whether the trace is cut or not.

    BeantwoordenVerwijderen
    Reacties
    1. Hi, thanks for your remark. I was wondering about this when I write this post, and I must say that in theory it's certainly true. For me, it was not an option because I'm not using the enable inputs of the L293D (it requires two extra pins on the microcontroller) and I'm planning on using a bunch of cheaper chips (L9110S) that don't even have this input, so these appropriate steps are connected to ground when inactive in my setup.
      I might try driving it in full stepping with the red wire connected and measure its current, this would be a nice test just to make sure...

      Verwijderen
  3. Hi Jangeox, I've followed the guide here (https://learn.adafruit.com/adafruit-arduino-lesson-16-stepper-motors/stepper-motors) which I think is similar with yours. But the "Vin" pin is not connected in the guide, but i still managed to get it working. You mentioned that you are supplying 9V to the motor, I am using a 12V power supply to the Arduino, is it the same? I'm not sure whether I am getting the same torque as you are...

    BeantwoordenVerwijderen
  4. Hey Jangeox,
    thanks for the idea! Can I simply use the small board that came with the ULN2003 and put the L293D on it instead?

    BeantwoordenVerwijderen
    Reacties
    1. Hi, no that won't work, the chips are really completely different. You really need to connect the chip according to the scheme above.

      Verwijderen
  5. Great ideas, thanks a lot.
    I asume that the wires are in sequence Pink=A Orange=NA Yellow=B and Blue=NB
    Is this right?
    Thanks for letting me know

    BeantwoordenVerwijderen
  6. Hi interesting work,
    Will this setup work with the Arduino Stepper library

    BeantwoordenVerwijderen
    Reacties
    1. It should work with the library, although I did not test it. Keep in mind that you must consider it to be a bipolar stepper after you cut the connection on the PCB ... because then it is ;-). The example circuit on the Arduino website is exactly this setup (using L293D)

      Verwijderen
  7. Hi,
    Just to clarify the setup workd with Arduino stepper library.I just had to change pin definitions for my setup.I am supplying 12v to the motor via the L293D and the Torque is really improved although i did not cut the trace i simply left red wire unconnected. This extra torque is just what i needed for my current project so thank you for sharing.

    BeantwoordenVerwijderen
    Reacties
    1. Thanks for sharing your trials!
      In theory and according to your setup, cutting the center trace may indeed be unnecessary. Full stepping should always work (as mentioned in comment above, both taps would always carry Vcc/2 Volts). Half stepping and even microstepping is possible if you use the enabled pin of the driver chip to disconnect the outputs from ground and Vcc in the appropriate steps .. although microstepping is a bit rediculous with this motor ;-)

      Verwijderen
  8. Hi, will it work with the easy driver board after this procedure?

    BeantwoordenVerwijderen
    Reacties
    1. I would really like to know that aswell!

      Verwijderen
    2. I'm not familiar with the board, but I Googled it and it should do just fine. Just keep in mind that after you alter this motor, it is a normal bipolar motor with gear reduction. This is important, because the board should best be used in full stepping mode for this motor, half- or microstepping is not useful because of backlash of the gears (you will never get accurate steps, just because of the gears, so microstepping is a bit silly in this case). Also remember, this is a 5V motor (in its basic version, 12V also exists) so be sure to use the correct motor voltage on the board.

      Verwijderen
    3. It does work with the easydriver board.

      Verwijderen
  9. instalar uma pequena chave on-off seria interessante...ficariamos com 2 motores em 1!

    BeantwoordenVerwijderen
  10. question what if i want to power it from an external power suply like battery. do i connect the drivers IC from the battery or after the voltage regulator circuit? can u post the battery connection?

    BeantwoordenVerwijderen
    Reacties
    1. It's the same as in the scheme where I use 9V of the Arduino power connector and 5V pin from the Arduino. Look at the scheme, the driver chip has two Vcc pins: Vcc1 is 5V max (pin 16) and Vcc2 is 9V (pin 8). You should use a battery of at least 9V, bipolar connection means two coils are in series (so 2x5V = 10V, I used 9V, you could go much higher before the motor overheats, but be sure not to overheat Arduino with more than 9V)

      Verwijderen
  11. Hi Jangeox, thanks for sharing, I'm looking a post like this. But my intention is to minimize pin usage when using this motor. So do you think it will work using A4988 stepper driver? (like this one https://www.pololu.com/product/1182)

    BeantwoordenVerwijderen
    Reacties
    1. Yes, this one will work (just based on the specs, I never tried the board). It drives currents up to 1A , which is more than enough. Be sure to use full stepping mode, the other modes are not useful with this motor (check other comments in this thread)

      Verwijderen
  12. I did this modification, and tried to run my 28BYJ-48 using the Adafruit Motor Shield running L293D chips, and it only rotates one direction, and has almost no torque. What am I doing wrong?

    BeantwoordenVerwijderen
    Reacties
    1. What you get is typical behaviour when one of the four wires is not connected (or one of the channels of the driver is broken)

      Verwijderen
    2. I tried a different bipolar stepper and it works fine, so I'm guessing it's a bad wire connection with my 28BYJ-48.

      What happens to a 28BYJ-48 if it's powered at 9V?

      Verwijderen
    3. After the modification, 9V is perfectly within specs (actually 10V , 2 x 5V of original coils in series). If you apply 9V before modification, it just gets a bit warm but it works fine.

      Verwijderen
    4. Well that's good, then.

      I double-checked my wires connecting the driver board to the motor's connector, and they check out. I tried my other 28BYJ-48 motor after making the same modification, and got the same results. It seems unlikely that both motors are defective in the same way. Maybe I'm wiring them up wrong?

      Verwijderen
  13. I found the problem. I was wiring the motor up wrong, connecting pink/blue and orange/yellow instead of pink/orange and blue/yellow. It's working now.

    BeantwoordenVerwijderen
  14. I realize this is pretty old post but I just found couple of these steppers in my "trash bin" and wanted to do something with them. I made them bipolar and got them working with easydriver in fullstep mode. Except that they do not turn in the right direction reliably. It's pretty random in which direction the motor starts turning and I can change the direction while the motor is moving if I turn it the other way with my fingers. Any idea what could be causing this? Also do you remember what values did you use for 'steps/revolution' and 'feed' as I think it could be somekind of timing problem with the pulses? Thanks.

    BeantwoordenVerwijderen
  15. The random direction is typically something you see when one of four wires is not connected or one of four stages of your driver is broken. I don't know these values, I don't use drivers with the logic built in.

    BeantwoordenVerwijderen
  16. Do you even need to open the cover? If you just left the center write unconnected on the far end, and always drove both ends of both coils with opposite polarities, wouldn't the centers of the coils remain at some middle voltage such that it didn't matter whether or not they were connected?

    BeantwoordenVerwijderen
  17. Do you even need to open the cover? If you just left the center write unconnected on the far end, and always drove both ends of both coils with opposite polarities, wouldn't the centers of the coils remain at some middle voltage such that it didn't matter whether or not they were connected?

    BeantwoordenVerwijderen
    Reacties
    1. That is not entirely true, there may be some loss in torque if you do that. On a DC level, it is true that the center of the coils should remain on the same middle voltage. When the motor is turning, you need to consider the coils acting as coils, not as resistors. Coils resist changes in current by creating a voltage across its pins. This may be different for each coil as the motor turns and resists its load. This is an old post, I always wanted to test the current running through both center connections, but I haven't tried it until now. So I really have no idea what influence (if any) this might have on the torque of the motor. Anyway, in case of this post with my driver chip, I do want to cut the connection because I want a 'real' bipolar motor that will also work in half stepping or microstepping (in that case, with my setup you would create a shortcut).

      Verwijderen
  18. You dont have to do that, just find apropriate pin output to use. I use 28by,20by,24by,3by without disconnect the red cable. it doesnot matter.

    I have simulate on electronic workbench, and yes it doesnot matter, no current go through the red cable at all.

    BeantwoordenVerwijderen
  19. I have to say that you had a very clever idea! I m not into stepper motor, but i will need one for a project where i will need some sort of precision (astro tracker) cutting as you shown will I be able to use the microstepping?

    BeantwoordenVerwijderen
  20. bom dia fiz a troca dos fios mas o motor esquenta muito

    BeantwoordenVerwijderen
  21. hice el mismo procedimiento , pero ahora mis motores vibran bastante , por allí me dijeron que al cortar el común del motor unipolar para convertirlo en bipolar la tensión aumenta , sera cierto ?

    BeantwoordenVerwijderen
  22. Hi there, just became aware of your blog through Google, and found that it's truly informative. I am gonna watch out for brussels. I'll be grateful if you continue this in future. Numerous people will be benefited from your writing. Cheers! all of craigslist

    BeantwoordenVerwijderen
  23. Hi, It does work with an original motor for me(not modified). It also works if you connect pin 1 and 9 (enable pins) to 5volt instead of 9-12 volt. I use 12 volt and it works very well. Thanks

    BeantwoordenVerwijderen
  24. Thanks for this.

    It is still possible to power the motor without this modification and the red wire unattached, but I notice a definite increase in torque (and smoothness) with the connection cut on-board. (Perhaps there is alternate sequence?)

    Based on your schematic, with the internal connection in place from the middle of A--B to middle of C--D coils, pulling A-B high with C-D low will leak current out from the middle of A-B through the C-B coils. Right?

    BeantwoordenVerwijderen
  25. Hi, what is the max. power(Volt) we can supply the motor (28byj-48)

    I made all the same, same results :P

    Many thanks

    BeantwoordenVerwijderen
  26. หวยใต้ดิน
    A good article gives a lot more knowledge about this. I will continue to support your work. Thank you.
    http://betwayonline.net/
    https://howto4you.xyz/

    BeantwoordenVerwijderen
  27. สล็อตออนไลน์
    A good article gives a lot more knowledge about this. I will continue to support your work. Thank you.
    http://betwayonline.net/
    https://howtoeasy.net/

    BeantwoordenVerwijderen
  28. เจาะลึกประเด็นเด็ด ดราม่าข่าวกีฬาลูกหนัง
    บรูโน่ ชอบขัดใจ โซลชาอยู่ 1เรื่อง

    BeantwoordenVerwijderen