Sometime it's completely unnecessary, but who doesn't love creating custom hardware?Β πΒ
For a work project on the side and for learning, I wanted to create a custom driver board to run 4 stepper motors for a PoC test automation project.Β I decided to use the ESP32 as it is an MCU that I am familiar with and enjoy to use due to its large feature set including integrated WiFi and Bluetooth. I decided to also use the TMC2209 stepper drivers from Trinamic due to their popularity in the 3D printing community, as well as silent operation of stepper motors.Β
The stepper motors are driven with STEP and DIR pins, but all motor tuning parameter's can be adjusted through a single UART connection to all four TMC2209s based on an addressing system.
This board has onboard regulation to 5V and 3.3V lanes and thus only requires a VCC connection. It also incorporates a CP2102 USB-Serial converter so that firmware can be uploaded through the USB port without the need for an external programmer. The board also incorporates a CANBUS transceiver since the ESP32 has a built in CAN2.0 controller for future implementation and integration within systems.
Assembled PCB
PCB Schematic
PCB Routing
As one of the directors for the Senior Design category for the Canadian Engineering Competition 2024, I was tasked with organizing the design challenge which usually consists of a mechatronics related challenge. As a director, we had to source 8 kits worth of parts with a very limited budget that would be sufficient to allow teams to build an adequate robot in 8 hours and complete a mechatronics challenge.
With a limited budget, it was unlikely to find a COTS part within the budget ($<10) to allow teams to remotely control their robots tele-operated. Typically RC controllers or wireless modules were either too expensive or too challenging to implement within the 8 hour time constraint. With other robotics platforms, there is usually a remote module that is easy to integrate and control and teams do not have to worry about the integration and only the implementation. Normally we would just supply the teams a raw ESP32, but to keep it fair to competitors across the country (since they all had different competitions to qualify), we wanted to keep the playing field fair regarding technical capabilities. We wanted to create a simple module that would directly map a button or joystick directly to a GPIO so that teams code write basic code to integrate with the remote module.
This was an interesting learning experience where there was a few DFM lessons to be learned to save costs since 8 of these boards needed to be manufactured. This included solidfying the BOM, being savvy with part selection, evaluating different trade-offs between performance and cost, and ensuring that core functionality wouldn't be compromised.
After 3 revisions, the Remote Control Module was successfully designed and manufactured including a 3D printed enclosure to protect the custom hardware. This board is based off of the ESP32 WROOM32E which allows for BT and BLE connection to either a PS3/PS4 or smartphone. The board has an integrated voltage regulator, a USB-UART bridge so it can be programmed easily over USB-C, ESD protection, as well as GPIO protection. Due to budget and time limitations, there was not much time to implement test LEDs and TPs and unfortunately there was no room in the budget for DACs for the outputs. I could have been savvy and used a RC filter to convert the pwm signal into an analog voltage, but I did not want to risk integration issues.
This is the first time that CEC has had custom hardware and the project met it's successful objectives in being a cost-effective remote control solution to ensure equal accessibility for participants across the country to build their Senior Design solutions. All-in-all, all 8 teams were able to get their remote control module working with the included documentation, and none of them disconnected nor failed during the competition so this project was a success! π
As a follow-up to my ATmega328p Robot Controller Board, I reflected upon what could be improved on the previous iteration. One of the main areas that I identified was a bottleneck/challenge was the microcontroller with the lack of IO, hardware peripherals, and processing power. Because of this, I decided to use the ESP32 MCU from ESPRESSIF which uses a Tensilica LX6 chip and includes integrated WiFi and Bluetooth.
This board is also based the L298N motor controller IC and has the appropriate voltage regulators, as well as a CANBUS Transceiver built into the board. It controls up to 4 DC brushed motors with quadrature encoders. This board also incorporates the CP2102 USB-Serial adapter meaning that firmware can be uploaded over the USB port.
Some lessons learned is the limitations of the L298N driver as it is an older chip and is quite inefficient and has its downsides. In the future, I want to look into more modern and better motor driver ICs that have external MOSFETs as opposed to integrated FETs in the driver IC.
PCB Schematic
PCB Render
This is currently a work-in-progress project but I wanted to design a motor controller that had external FETs to get better experience at using MOSFETs to control high power and high current applications. The plan for this controller is to control the inexpensive but challenging to control a DC "CIM motor". As such, this motor controller is designed for 100As at 12V.
This board uses the STM32F103 which is a cheap and powerful MCU with useful integrated peripherals. This board uses two half bridges with a total of 8 FETs that give it a rated capacity of 200As in total.
The board will be programmed with HAL library on the STM32 platform and I plan to include the following features such as PWM control, CANBUS, Current and Voltage monitoring, USB.
For my technical team AC Robotics, I was tasked with creating a PoC integrated motor controller solution for the initial prototype of our robot dog project: XP1 CANIS. We were initially having issues controlling several motors with encoders over one MCU, so we wanted to experiment with having one integrated controller per motor, and then having a central processor control each individual integrated controller over a communication bus such as RS485 or CANBUS.Β
For this PoC, I decided to use the RP2040 due to the chip shortage at the time for ATmega, and STM controllers, as well for the price since we would need a board per motor. This was a challenging project, fitting and routing the PCB within mechanical constraints and space, while also being able to deliver the power requirements and communication requirements for this integrated controller.
This project incorporated the appropriate voltage regulators for the ICs, a small motor controller IC with integrated FETs, a RS485 Transceiver, and the corresponding headers to connect the various components together.
I did make a mistake where I did not do the USB traces properly, so I had issues where the pads and traces would consistently rip off the board, hence the electrical tape connecting the USB! Another alternative was chosen and we are currently deciding on whether to get an after market solution or rethink the development of a better integrated controller to have precise control and speed for applications such as a robot dog.
PCB Schematic
PCB Layout
PCB Render
In 2021, the Raspberry Pi foundation announced the RP2040 which was their attempt at entering the microcontroller environment for both education and embedded applications.Β The RP2040 is a budget dual-core M0+ ARM Cortex controller that runs at 133MHz and contains a variety of hardware peripherals and various unique features for around $1 USD.
I wanted to get familiar with the chip as it could be a potentially good alternative for future embedded/hardware projects given the price to performance of this chip.
I decided to create a small breakout board with the RP2040 to run an nRF24Β Transceiver in conjunction with keyboard switches to create a basic wireless application and user interface to be used for various potential applications.
Due to the simplicity of the RP2040 from the user design perspective, the only items required for a bare-bones setup were a regulator, flash memory, and just a USB port since the MCU has integrated USB interface. I also tried various ways of programming the MCU including MicroPython, Arduino Core, and the native SDK with C++.
PCB Schematic
PCB Render
With the STM32 as a popular industry choice for microcontroller, I wanted to get some experience designing reference boards for STM32 chips. I decided it would be fun to design a "remote controller" board for robot interfacing applications or general controller design for future projects. I decided it would also be fun to incorporate the joysticks from the popular Joycons on the Nintendo switch.
This board is designed with an MCU from the STM32 F0 series which is the lower cost and lower power M0 ARM Cortex controllers. I experimented with placing the IC at 45 degrees to observe how it would change/simplify routing as I saw an experimental video regarding this topic. This board has the appropriate voltage regulation for the various peripherals and controllers, as well as an USB-Serial converter to be programmed directly over Serial without the use of an ST-LINK. However, it does have breakouts for SWD, an nRF24 wireless transceiver, and general I/O breakout.
Through this project, I was initially going to use an Arduino core to be able to program this board with the Arduino IDE. However, this project led me to look into programming the STM32 using HAL and led me into learning more how to program the STM32 chipset using HAL as well as through native C/C++ instead of an Arduino core.
Schematic
PCB Render
PCB Routing
I noticed that many "basic two drive robot" starter kits consisted of typically an Arduino and L298N motor controllers and wondered why there wasn't a board that integrated all of the several components onto one board to save on space and cost.
As a personal project, I decided to create the custom hardware with the ATmega328p integrated with 2 L298N drivers and the additional peripherals to support a general purpose robot board that could be used to create fast robots or for educational/STEM purposes. This board can support up to 4 motors with quadrature encoders. Since the L298N is an older driver, a multiplexer is used to control the directionality of the motors due to the limited IO and peripheral capability of the ATmega328p.
This board is also equipped with breakouts for a nRF24 wireless breakout board, I2C OLED screen, and WS2812b LED strips, and a USB-Serial converter. It has the appropriate regulators to feed the 5V, 3.3V and VCC power lanes and can be powered from one VCC input.Β
Through this project, I discovered various limitations of handling 4 motor control with quadrature encoders on a microcontroller from 2008 in which the clockspeed, (8MHz), hardware peripherals, and overall capabilities are limited.
PCB Schematic
Soldered PCB