Content guidelines
In 2018, I had a line follower robotics course in my University. We used Lego Mindstorms Stuff back then, though it did piqued my interest in small robots. From my search on what was available for them, many Robot Sumo Wrestling robots came up. They all had custom hardware, sometimes custom chassis too. Fortunately for me, I also found Pololu's Arduino Uno based Zumo Robot Kit.
The kit was small enough and great for starting out in to the world of robotics, however, it lacked a few features if you want to do advanced stuff. The use of 4 AA batteries makes the robot rather heavy, which is nice if you're entering in Robotics Sumo Competitions, but not so much if you'd want to use it for say learning about mobile robots in general. The motors were also basic micro metal gear motors, so no encoder positioning for the robot.
My aim for making this version of Zumo Robot was to create something better, using the best of what the original Zumo Robots had to offer.
Features
The current hardware on the PiZumo Robot has the following hardware features:
- Pololu Zumo Robot Kit.
- Two Micro Metal Gear Motors with incremental encoders.
- STM32G030C8T6 micro-controller
- MPU-6050 6-DOF Accelerometer and Gyroscope
- RGB LEDs
- Two Buttons
- Motor Driver DRV8833 with Hard Motor Control
- Two Servo Motor Pinouts
- 128M-Bit W25Q128JVSIQ NOR FLASH.
- A custom LiPo Charger and Boost Converter
- Zumo Reflectance Sensor Header
- Stemma-QT 4 Pin JST for external I2C devices.
- Header for a Raspberry Pi Zero 2 W.
- A 2000mAh 3.3V LiPo Battery.
Hardware Bring-Up
The first step was to decide not to use the Zumo Shield from Pololu. It's a great shield designed specifically for the Arduino Uno, but it cannot be used to charge batteries. I wanted to use Lipo Battery Charger from Adafruit. However, with chip shortage being the pain of the day (week? month? year?? When will it end lol), I did not have anything which would meet my first need, a battery charger and boost converter. Not to let a crisis go to waste, I decided to design my own Battery Charger and Boost Converter Circuit.
Designing a Battery Charger and Boost Converter can be difficult, and soldering QFN packages is worse. I went the simpler way instead, and got them assembled at jlcpcb.com For 10 such "Power Booster" PCBs, I paid ~€79, so about €8 per piece, which includes the PCB Manufacturing as well as PCB Assembly cost!
At the time of manufacturing, JLCPCB did not have the Battery Charger in quantities I needed. So I used their new Global Part Sourcing feature in which they source any parts from Global sellers including Digikey, Mouser, Arrow, and many more. One would think sourcing a component from DigiKey in US to assembly in China will cost a pretty penny, but it was a great surprise when they charged a mere price of €0.95 for handling of the components, so all you pay for is the component itself. I ordered 15 Battery Charger ICs, and since I got 10 assembled, I still have 5 more in my library which I can use for other designs!
Zumo STM32 PCBThe actual PCB required to fit directly on the Zumo Chassis. For this, Luckily Pololu provides the dimensions of their Zumo Arduino Uno Shield. This helped me a lot in deciding on positions of the mounting holes and the Reflectance Sensor Array. They also provide 3D Step files for the Chassis itself, which I loaded in to Fusion 360 during design process to make sure all components are in correct and accessible positions.
Once again, I got them manufactured by JLCPCB. I've tried soldering previous versions of this project on my own, and I failed, specially with the QFN packages there were multiple solder-joints and shorts, not to mention the ugly goop left behind from all the soldering is just not worth it.
Mounting PlateThe Mounting Plate that comes with the Zumo Chassis kit would not fit the custom PCB, since even though the mounting holed align, the PCB has through hole header pins not aligned with the original Mounting Plate. I designed a simple Mounting Plate in Fusion 360 and got it manufactured by, once again, JLCPCB. I cannot thank their streamlined service enough, not only did they did an excellent job on the PCB assembly above for the Power Booster and Zumo PCB, during the 3D printing process, they reached back with critical spots on the Mounting Plate which could possibly break during use. I fixed those issues and they quickly went processing.
So if you are looking for a one stop solution for your PCB Manufacturing, PCB Assembly, as well as Enclosure and Mounting Solutions, please visit https://jlcpcb.com/see Small time individual developers like me can benefit greatly from their affordable and cheap services in designing their next project. The quality speaks for itself, and the customer support is prompt and detailed.
Special Hardware Features
The Power Booster was designed to cut off power with the slide switch if need be. However, post production, I realised there is a flaw in there. The Enable Pin of the Boost Converter when connected to the VCC Pin, does not turn of the power, instead, just stops boosting the output voltage to 5.17V. Another crisis I could benefit from I guess. So on the main PCB, I added two P-Channel MOSFETS in Power 56 Package as Switches. The idea is that the first switch controls the main power input from the Power Booster, and provides power to the microcontroller and the Second Stage P-Channel MOSFET, which can either be manually switched off or controlled by the microcontroller. This second MOSFET switches the power on or off for the Raspberry Pi. Thus, the RPi can be either switched on or off manually, or from the on board microcontroller.
Similarly, the Motor Controller has a Hard Stop Input which is controlled by the Micro-controller to turn the motors on or off.
The Micro-Controller is programmed from a 5 pin Header, or can be programmed from the Raspberry Pi itself if three jumpers connecting the SWD and Reset Lines are shorted.
Software Bring-Up
At the heart of the robot sits a STM32G030C8T6 micro-controller from ST Microelectronics. It controls the following units:
- Power to the Raspberry Pi
- Motor Controller Inputs for Speed and Direction
- Encoder Inputs from the Motors
- The RGB LEDs
- The two buttons
- The Zumo Reflectance Sensor Array
- The Servo Motor Control
The Raspberry Pi communicates with the micro-controller through I2C. In addition, it also has 2 GPIO Lines connected to the microcontroller. I'm not yet decided if I will use one for I2C interrupt from STM32G0 to the Rpi, or use it to detect Power Status of the Raspberry Pi.
Current Software State
- The Micro-controller can control the following peripherals:
1. The RGB LEDs.
2. The Buttons.
3. DC Motors and Encoders.
- The Raspberry Pi can control the STM32 from I2C and transmit control commands to steer the Motors and control LED intensities.
- The Micro-controller can take notice of when the Pi shuts down and control the power to it.
Current Project Issues
- I've still to write the following code
1. I2C Code to transmit data from the STM32G0 to the Raspberry Pi.
2. Servo Control
3. Zumo Reflectance Sensor Array Control.
- The Motors are faulty that their encoder is not linear and often misses count. I will need to check this hardware issue if exact positioning is needed. For now the robot is accurate within 10cm, which is small, yet not tiny enough for a robot of this size.
- I did not use Timer Events for measuring the Encoders as all the timer pins were assigned for other hardware PWM needs. Hopefully in a future iteration I'll change that.
- The hole made to pass the LiPo Battery is slightly smaller and requires clipping the sides of the battery connector.
- The PCB cuts for the motor inputs were slightly shorter vertically. Filing the PCB corners of the motor connectors worked for now, but I'd like to make the slots better.
- The 3D Printed Mounting plate's slot for the sumo reflectance sensor array is slightly shorter for the 24 pin header. I'll redo it in next iteration.
Future Work
- For the Raspberry Pi, I'm designing a NRF24L01P+ and a LoRa Module pHAT.
- The two servo control can be excellent for adding a pan-tilt control on the robot.
- With the on-board IMU, I'll be trying out some advances control system techniques for a self balancing robot.
Thank You for reading so far. If the project inspired you, please make something amazing and let me know. If you have any questions, I can be reached here, or on GitHub.
Comments