STM32F4 daughter board for use in robotics - thesis - Page 1
Forum section: electronics / projects

author: darko31
author_rank: Regular Contributor
timestamp: November 29, 2016, 03:20:19 pm
content: Hi guys,I've decided to take on this project for my bachelor thesis. It's meant to be used for mobile robots for Eurobot competition. Basically designing a daughter board for STM32F407-Discovery dev board with these requirements:- 2 high current and 2 lower current H bridges (high current about 5A nominal, low current 2.5A should be enough) for brushed motors- 4 quadrature encoder interfaces- at least 4 analog servo outputs- interface for AX-12 servos (half duplex UART and power supply)- couple of UARTs for debugging, wireless comm, additional boards, etc- at least 12 industrial sensor inputs- at least 4 ADC inputs- at least 8 MOSFET outputs with selectable voltages 5V or 12V (for powering small DC motors, pneumatic directional valves and other low current stuff)- meant to be powered with 3S or 4S LiPo batteries- 100x160 PCB or smallerI'll throw in my suggestions, what I'm planning to use, and if you have better or cheaper solution, please share it. I'll post schematic and PCB layout as I go, so if you could point out what could be done better.So let's start with power supply, at the input, I plan to use a reverse polarity protection with P-channel MOSFET and Zener diode. Then. straight from there directly connected to high current H bridges (4 x BTN89XX half bridges). Two voltages are needed 12V and 5V. If 4S battery is used, I was thinking of using 12V and 5V regulators (LM2576 or LM2596).Since analog servos can use a lot of current, I've planned to use 8-10 outputs for them, and leave an external connector for another 5V regulator. Only 4 (or maybe less?) should be powered by the on board regulator, and servos should not be stalled at the same time, since the same 5V rail is used for STM32F4 and MOSFET outputs.Questions:1) If 3S battery is used, could 12V regulator be bypassed with switch and a MOSFET?2) Do you have any suggestions for lower current H bridges? I've found A3950SLP-T which is okay but only has one full bridge output. The cheaper the better.3) Since encoders are supplied with 5V, and STM32F4 is 5V tolerant, is anything else required or can they be directly wired to timer pins?4) Industrial sensors are powered by 12V and have PNP/NPN outputs, I've planned to use 2xCD74HC4050M buffers. Is it suitable IC for this application?5) Where to put fuses? BTN89's have short circuit protection. I was thinking two fuses before each regulator.

author: DaJMasta
author_rank: Super Contributor
timestamp: November 29, 2016, 04:20:55 pm
content: It may be worth looking at the schematic for the discovery board and figuring out if you actually want to make a daughterboard for it.... or if you just want to put the chip on your board directly. The baseline required circuitry for an STM32 is something like a handful of bypass caps and a crystal, so you can probably save a huge amount of space (and maybe a little cost) by just sticking the chip directly on your board. Some of the discovery boards have a second chip for an STLink programmer, but getting one of those is extremely inexpensive and doesn't need many connections, so it's a very small addition to a potential layout. This would probably require at least an additional 3.3V rail, but I don't know about the requirements for the other chips.Not sure how much use I can be for the other stuff, but:It's easy enough to bypass a regulator, and you're going to know you're doing it when installing the battery, so I'd up for a physical selector. There's enough current that something like a jumper block wouldn't be suitable, but a power switch would always work. Of you still want to go the mosfet route, you could just jumper to powering the gate (and I like to use a 3 pin header so you have a place for the jumper to park when open). It's worth noting that most regular sized servos run on 6V, and the 5V rail would have to be pretty beefy and would result in slower turning speed than they're rated for in a lot of cases. If you're going to regulate down to a power draw like that, I'd toss in a lot of bulk capacitance. Of course, keep your main power traces wide too.It's not fancy, but what about a discrete transistor H bridge? You can probably get pretty good low current performance out of it if you just need basic forward and back and PWM control, and it's going to be inexpensive and easy to customize down to low currents.At least for some STM32 devices, not all inputs are 5V tolerant, so be sure you're picking ones that are - the datasheet does list them. If you're in doubt and it's only one way communication, a regular resistor divider can be an adequate step-down level shifter into the MCU.I would put fuses only on the main power input. If there is something especially sensitive down the line, there could be an argument to be made, but if you're going to include fuses (and I'm not sure I'd bother), you'd want protection for the main power input and then, maybe, protection for any high current rails that are going off the board, for short protection.I don't know a lot of the specific hardware you're considering, but I hope that helps!

author: darko31
author_rank: Regular Contributor
timestamp: November 29, 2016, 05:50:16 pm
content: It sure helps!Hm, I still kinda feel that going with dev board is the way to go, simply because it's too good bang for the buck. STM32F407VGT6 costs ~13 USD, and dev board is ~22 USD (Farnell prices). I know I could probably get away with cheaper MCU, but dev board has the ST-Link integrated, all the regulators, crystals, etc. Also it comes with LIS302DL or LIS3DSH 3-axis accelerometer which could be used as another PID loop for movement of the robot. Also LEDs, buttons, USB OTG, microphone and amplifier aren't crucial but it's a nice addition.Another point to the dev board is the space beneath the board can be used for the regulators, wireless comms, etc.We currently use similar board with ATxmega128 (Mikroelektronika board) and a custom daughter board very similar to this. It's elegant solution but it lacks more oomph and more IOs. Our other teams used other stuff like Raspberry Pi's with AVR/PIC slave boards, even Intel NUCs, but those aren't really elegant solutions, and it unnecessarily complicates things.For the lower current H-bridges, I'd like to find integrated solutions because of space. All the connectors will take a lot of room on the board. But yeah, discrete transistor bridge could work very well.For the encoders, you are right, a voltage divider won't hurt.For the fuse, should it be for everything including the high current H bridge?Example of hardware being used:- 60W or 90W Maxon DC brushed motors, datasheet in attachment- various DC brushed motors with less power (vacuum pumps and stuff like that)- hobby servos like Futaba S3003- AX-12 servos and other Dynamixel servos- pneumatic directional valves