Interfacing with unipolar stepper motor - Page 1
Forum section: electronics / general

author: newtekuser
author_rank: Frequent Contributor
timestamp: January 23, 2023, 03:10:08 am
content: I'd like to use the MikroE unipolar stepper motor (link below) in my projects (interfacing it with PIC16F887 or PIC18F46K) but not sure if I can use a Darlington transistor IC like a ULN2803/4 or some other driver.Can someone please offer some suggestions? What should I be looking for when interfacing with this stepper motor?https://www.digikey.com/en/products/detail/mikroelektronika/MIKROE-1530/5724295

author: brucehoult
author_rank: Super Contributor
timestamp: January 23, 2023, 04:51:26 am
content: Sure. You just ground the common wire and then turn on each of the other four in sequence one at a time. So you need half of the driver IC.Those small unipolar aircon louver stepper motors also work just fine using a "normal" H-bridge stepper motor controller and just leaving the common wire unconnected.

author: newtekuser
author_rank: Frequent Contributor
timestamp: January 23, 2023, 05:21:45 am
content: Thank you very much!

author: brucehoult
author_rank: Super Contributor
timestamp: January 23, 2023, 05:47:36 am
content: Just remembered I have an ancient video showing driving one with just 4 wires from an H-bridge controller.

author: brucehoult
author_rank: Super Contributor
timestamp: January 23, 2023, 05:57:05 am
content: Note also that H-bridge controllers use a 2-bit binary encoding of the phase as input, while the unipolar motor wants "1 hot" encoding. You can switch between the two in hardware using a 2:4 decoder or 4:2 encoder. Or of course, just use 2 or 4 microcontroller IO pins as appropriate if you are able to modify the software and have enough IO pins.

author: Sauli
author_rank: Contributor
timestamp: January 23, 2023, 03:07:07 pm
content: If you don't have a separate motor voltage supply, then the operating voltage of PIC18F46K is not enough to run the motor.For unipolar operation you connect the center tap of the motor windings (the red wire of your example motor) to the motor power supply. Also connect the COM pin of ULN2803 there.This stepper motor cannot be driven with a stepper motor driver meant for bipolar motors. You will do just fine with the ULN2803.

author: newtekuser
author_rank: Frequent Contributor
timestamp: January 23, 2023, 08:54:31 pm
content: Quote from: Sauli on January 23, 2023, 03:07:07 pmThanks for the tip! For now I can get by with my multiple channel bench PSU, but in a real circuit what is the best way to get a separate supply for the motor? I'm assuming there are ways to leverage the same voltage source without adding a separate one.

author: brucehoult
author_rank: Super Contributor
timestamp: January 23, 2023, 10:23:16 pm
content: Quote from: Sauli on January 23, 2023, 03:07:07 pmIt can.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: January 24, 2023, 01:21:10 am
content: The 28BYJ motors can easily be driven with a "normal" bipolar motor driver after a small modification. You just pop off the blue cap and then cut a single PCB track. After that the two coils are separated form each other.With the wide availability of the "stepstick" motor driver breakout boards and bipolar stepper motor ic's it's almost silly to use unipolar drive for these motors. With a bipolar motor driver you will also get much more performance out of the motors.Also:These motors come in 5V and 12V variants, and with 1:16 and 1:64 (approximately) gearing. I also suspect there are at least 5 different brands of these, judging from small differences I saw from photographs seen on Aliexpress.

author: james_s
author_rank: Super Contributor
timestamp: January 24, 2023, 02:01:26 am
content: Are bipolar steppers considered "normal" now? When I last played with stepper motors quite a few years ago 6 wire unipolar motors were by far the majority due to being easier to drive at the time.

author: newtekuser
author_rank: Frequent Contributor
timestamp: January 24, 2023, 02:47:32 am
content: Quote from: newtekuser on January 23, 2023, 08:54:31 pmOr maybe I can use a 12v input and divide it in two? Or use a 5v supply, boost it to 10v then divide it.

author: Sauli
author_rank: Contributor
timestamp: January 24, 2023, 05:39:34 am
content: Using a single 5V supply for both the motor and the microcontroller and driving the motor with ULN2803 is by far the simplest alternative. And it will do the job unless you need higher speeds than what the datasheet promises or you need more torque out of the motor. That then means using a bipolar setepper motor driver which does PWM coil current control at higher operating voltage. And you need to modify the motor as Doctorandus_P said. But things can soon get complicated with this approach as then you may need to consider things like start/stop ramps, resonance frequencies, decay modes and run/stop current levels.

author: brucehoult
author_rank: Super Contributor
timestamp: January 24, 2023, 06:17:52 am
content: Quote from: Sauli on January 24, 2023, 05:39:34 amWhy do you need to modify it? What bad will happen if you don't? I sure can't see anything.If one phase is driven (+ve on one wire, -ve on the other) then the (not connected) common point will naturally be at 0 and it doesn't matter whether the non-active phase is high impedance or driven to 0.If it happens that for some period both phases are driven then you will simply have two adjacent coils driven +ve and their opposite (adjacent to each other) counterpart coils driven -ve. The (not connected) common will still be at 0. All currents and voltages will be as expected, exactly the same as if the two windings were separted.

author: NorthGuy
author_rank: Super Contributor
timestamp: January 24, 2023, 02:38:19 pm
content: Quote from: brucehoult on January 24, 2023, 06:17:52 amThe current-controlling drivers use higher voltage. Therefore they cannot simply apply it to a winding. They apply voltage to a winding to rise current, then there must a period of decay when the accumulated current must dissipate. There are different decay modes. Drivers often use so-called slow decay where both ends of a winding are shorted together (either through two low FETs or two high FETs of the bridge). If you drive 5V motor with 24V, most of the time is spent in decay, so the mid-tap will rarely be at mid-voltage point.

author: Sauli
author_rank: Contributor
timestamp: January 24, 2023, 03:38:24 pm
content: So, without the motor modification you frequently have the situation shown in the attached picture.