Micro Dual Stepper Driver

minidualstepper

This board uses a LQFP48 because I needed more pins and it extended the size to 50 x 15 mm to get everything in. It contains 2 x Stepper Motor Drivers and 2 x end point connections. This can operate 2 x 5-wire or 4-wire stepper motors. I have not decided on MCU yet. I used STM32F103CB on the schematics, but I know that STM32F303Cx can be used and I will check if the same is the case for the M0 series in LQFP48 package. All of these MCU’s are an overkill for what we do here.

I target 28BYJ-48 or similar stepper motors that can operate on < 0.5A current. Having two steppers rather than one is because it often is required to operate two steppers in parallel. I use two ULN2003 drivers mounted back to back on each side, meaning I have 6 spare PWM signals and plenty of spare pins on the MCU. I only need to expand the PCB Space for Connectors to have a full 3-axis driver. This is just an early draft where I focused on size only, so will see where I go next.

minidualstepperblock

 The beauty with the RS-X based micro modules is that you can just add on modules by connecting them to the network and locate them as an extension of cabling on the robot or in your house etc. We still need a more intelligent unit like a Raspberry PI in centre, but it expands our scalability to easily build more complex systems.

28BYJ-48

s-l225

I have a bunch of these that has been laying around for ages with the DIP version drivers of ULN2003, but I have never tested them. So I connected a STM32F030F4 dev board to the ULN2003 driver and tested a 4 step and 8 step algorithm.

I have used quite a lot of steppers and servo’s before, so I was a bit surprised. It uses about 4ich second on one turn, so it’s not the fastest, but it is incredible strong. The 8 step algorithm draws 130mA on the motor + driver and is absolutely soundless using 4096 steps on a 360 degree trip. At the cost of ca 1.- GBP on ebay I am actually impressed and I fully understand why these are so popular.

I can drive one of these using the micro PWM driver, but I will return with a few more specialised driver boards that support 1-2 motors and 1-2 endstops or position encoders.

8 x DC or 4 x Stepper Motor Hat

rpi-8x-small-dc-motor

As mentioned in a previous post I could extend this to 8x DC motors. I realized that the screw terminals I used had a smaller 2.54 pitch version. Connecting 8xL9110 to drive 8 DC motors or 4 Stepper motors are easy and straight forward. This is a draft as I was keen on looking at terminators, but we will add some protection logic and order the Hat.

I have a personal preference to keep motor controllers away from Raspberry PI, but it is quite handy to have a multi motor driver for small motors. I have a robot arm with 5 DC motors that this board is perfect for.

Mini PWM Driver

mini-pwm-driver

I am quite found of these small boards so I reuse the MCU and RS485 interface on various designs. This one uses a ULN2003 to provide 7 PWM ports with up to 16V and 0,5A each. I use a 8 pin 1.27pitch connector. the 8th pin is V+, while the second row is all GND. This allows the board to be used for driving steppers, LED’s or small solenoid style actuators.

ULN2003 can actually handle 50V, but the regulator on the back is LM1117 that only handle 16V. I am actually only planning a 12V system so it will do.

 These boards all have a 120 Ohm terminating resistor mounted. In real life this resistor will not be mounted as I expect to deploy a lot of these boards in the same RS-X network. This one is tagged for Christmas lights, but with two months to go I will need a bit of luck to get the PCB’s in time.

RS-X Cable

rs-x-shield

As you deploy RS485 (or CAN) on larger distances you will need to increase cable quality and lower baudrate. For 15 meter I don’t fuzz, I just twist a pair of cables and hook them up. A good advice is to have standard colours for A+ and B-. For better cable quality you can use a shielded solution like illustrated above.

Twisted pair Shielded cable is quite common and don’t cost to much. Just remember that the shield should be connected to ground only on one side of a cable to avoid creating a ground loop.

RS-X Network

rsx_switch_p8

This is a simple, passive switch anyone can wire on a vero-board. It just connect 8 ports in parrallell.  “GBA+” is easy to remember and means Ground, B(-), A(+) and Power. You use one port as input and 7 as output in a classic star network.

 The only thing you need in addition are 120 Ohm terminators at the optional place. I introduced 120 Ohm terminators on every module, but I either need to not mount them or add a jumper. The same goes for this circuit as it need a 120Ohm resistor with a jumper.

rs-x-network

The illustration above shows a classic star wiring using these switches. In reality you can cover quite some distance with only passive switches like this. I am not worried about short distances like 10-15 meters, but as the network gets longer we need to take more care.

 Needless to say, this is 50 x 12mm in size and you can use the switch as a cable extender or T point as well. The mounting holes are M2.

Mini SW Draft

mini-sensor-sw-2

The Software on the Mini Sensor Module is outlined above. I need to wrap up a tight RS-X protocol as illustrated earlier. I also need a RTOS ported as well as sensor Logic for each sensor.

DHL11 (or 22) uses a bit-bang protocol. We will use an interrupt on this pin with some timing for decoding. It will send us Humidity and Temperature once per second.

The IR module is connected to an ADC and will measure distance. The Light sensor is also connected to an ADC measuring light.  The last sensor is the temperature sensor on STM32F030F4 itself.

The Data Map tionary is a small module that will map variables in the interface with actual variables in the modules. This is set up as a pre-configured table.

I am a bit concerned about 16Kb Flash, so I have the STM32F042F6 as a fall-back.