Written By: Josh Tristan (Project Manager), Ricardo Gordillo (Manufacturing), Ruben Petersen (Mission, Systems, and Test), and Yoseph Yegezu (Electronics and Control)
Approved By: Josh Tristan
Josh Tristan-Project Manager
Ruben Petersen-Mission, Systems, and Test
Yoseph Yegezu-Electronics and Control
The MicroSegBot is designed to be a self-balancing two-wheeled robot. It is designed based on a 6:1 scaled ratio of a Segway Glider. Just like a full sized segway it is designed for a passenger and the passenger for the MicroSegbot is scaled to be 12 inches. The Micro-SegBot will be controlled via Bluetooth by any Android phone that is equipped with the Arxterra mobile application.
Objective: Create a micro robot that will be scaled to a Segway Glider for an action figure to travel across a figure 8 course.
MicroSegbot is designed to resemble a Segway Glider with a 6:1 ratio that is controlled via Bluetooth using an Android phone with the Arxterra interface. Like the Segway, it is self-balancing and can move forward, backward and rotate left and right. The budget was set at $250 and completed on 12/16/2015.
The figure 8 course was designed to test the MicroSegbot’s capabilities in most aspects. It would test the ability for it to navigate in all directions while keeping its balance. As shown in more detail in the provided link, it states that the course include a 2.8° incline that the MicroSegbot needed to account for. This would all be done as well with a 12” doll that was calculated to be the 6:1 ratio to meet the mission objective.
Level 1 Requirements
- The total cost of the MicroSegbot project will not exceed [$250]. This budget was set by the customer.
- The MicroSegbot will resemble closely to a Segway Glider with a 6:1 scale ratio.
- The product will be able to complete a figure 8 course.
- The MicroSegbot will be able to travel up a 2.82 degree incline as defined by the course.
- An action figure will be used to ride the MicroSegbot through the course.
- The MicroSegbot will have the capability to maneuver on berber carpet and linoleum tile which can be shown in the course .
- In order to complete the course, the MicroSegbot will be able to travel at a minimum of .5 ft/s.
- The MicroSegbot will use an android phone/laptop to navigate wirelessly by the customer.
- The project will comply to the health and safety policies enforced by CSULB.
- The Project will be completed no later than December 16, 2015 which is the end of the semester for CSULB.
Level 2 Requirements
- In order to travel the course and be faithful with the design of the Segway, the MicroSegbot will implement dual DC motors.
- The printed circuit board (PCB) cannot exceed the frame of the base of the MicroSegbot.
- To communicate with the MicroSegbot, BLE and V2.0 were being studied; but to finish the project on time, a Bluetooth V2.0 device will be used and will be compatible with the Arxterra software.
- A device containing a gyroscope and accelerometer that sense orientation and acceleration will be used on the MicroSegbot. The device shall have a max baud rate of 38,400, which is the optimum rate for the Arduino Nano which has the same clock speed as the Arduino Micro.
- Per the design of the tires, and according to our calculations, the selected DC motors will travel the calculated speed as well as overcome the incline and friction. This can be verified by analyzing the torque that the motors can perform.
- Because two DC motors are being used, a dual DC motor driver must be utilized to provide the motors with enough current, voltage, and PWM compatible based on their specifications. After performing a motor driver trade off study, the DRV8835 was chosen.
- A microcontroller that will support each component of the MicroSegbot will need to be used to be able to accomplish the program requirements. The microcontroller will need rx/tx serial communication to be able to be compatible with the Bluetooth module. It will also need to have two PWM pins and two analog pins to be compliant with the motor driver and the accelerometer respectively. The microcontroller that meets these specifications and fits within the dimensions is a Sparkfun Pro microcontroller and will be the module that will be used to control the MicroSegbot.
- The battery chosen for the MicroSegbot must be capable of providing enough current and voltage to our MicroSegbot and be within our budget. According to our power budget and battery tradeoff conducted the battery we have chosen fits all our program requirements and will be a 7.4 V, 1000mAH, 5C Lithium Ion Battery.
- A voltage regulator will be needed to supply the correct voltage to the motor driver that can step down 7.4V to 6V.
Preliminary Project Documentation
The Preliminary Project Documentation can be found here.
Major Project Features
The Micro-SegBot features has a compact design that is easily assembled as the pieces are all female and male connected. They all have a tight fit and do not need any glue or restrain to keep the pieces together. All the electronics fit within the base with the exception of the bluetooth which is located in the pouch.
The base is designed with a bracket that holds the PCB board in place and two motor mounts that hold the motors within the base. The base has fillets all around the exterior part to give it an aesthetic look that resembles a segway glider.
The MicroSegbot can be remotely controlled via the Arxterra remote control panel in the Arxterra mobile application, which can be downloaded on any Android phone or tablet. It connects to the MicroSegbot via Bluetooth.
Completely 3D Printed Body:
The entire MicroSegbot is 3D printed out of P430 ABS Model (Ivr) plastic. This plastic is extremely durable and strong. The MicroSegbot also has the pouch laser engraved with the CSULB logo.
Design and Storage Solutions
Two major design problems that the group needed to overcome was the packaging of all the components and climbing up the incline of the course. To store the components, the team decided on using a pouch in front of the handlebars to hold the bluetooth. The battery will also be placed on the exterior and be specifically attached to the doll will be used to ride the segway. These design innovations will solve the packaging problem and result in a smaller base which will help accomplish the requirement to resemble a Segway. The handlebar shaft will also to be hollow to allow wires to connect the bluetooth to the PCB located in the base. The specifications of our design innovations can be found here.
System Block Diagram
The system block diagram represents the way all of the components are connected together. To get here, we first have to determine the components. To determine the components, they all require different specification to be able to complete MicroSegbot’s mission objective, as well as be light enough and take less space. Because of these requirements, we decided to go with the Sparkfun Pro Micro which is similar to the Arduino nano, Spring 2015’s microcontroller, but smaller. The DC micro motors were also selected for their small size and weight, since they only weigh less than 10g each, and provide enough power to meet the objective. The driver motor was selected because it supplies each motor with enough voltage (0-11V) and continuous current (1.2A). Also, the MPU 6050 was selected because of its well known use to provide accurate gyroscope and accelerometer readings at a sufficient baud rate of 38400 to complete our requirements. The HC-06 bluetooth device was selected because of its low cost and ability to receive information via bluetooth. One of the challenges this project presented was fitting all the components in a confined space, as a result the selected items are selected to meet those restrictions. The trade off studies for each component can be found in the Prototyping, Simulations, & Trade-Off Studies section of the Final Documentation.
Prototyping, Simulations, & Trade-Off Studies
Motor Driver Trade-Off Study
The team was tasked with finding a motor driver that would be capable of operating the motors at optimum efficiency. A dual DC H-Bridge motor controller can control the speed and direction of two DC motors independently. After deciding on a breakout board, our decision was between the Pololu DRV8835 and the SparkFun TB6612FNG. The specifications are similar, but ultimately it was decided to use the DRV8835 as it is smaller, has a higher continuous output current, and has a higher max PWM frequency.
Battery Trade-Off Study
The battery trade-off study details how the team decided on which battery was going to be used to power the MicroSegbot. It describes the specifications of the battery chosen as well as how we arrived to those specifications. It also describes an important discovery that allowed us to purchase a battery that was lighter and smaller in dimensions than what we had originally planned for. The battery chosen was a 7.4 V,1000mAH, 5C Li-po Battery.
Motor Trade-Off Study
The motor trade off studies go over different types of motors we looked at and which type we chose. We ended up choosing pololu’s micro geared motor with 120 rpm and 60 oz of torque. This was based on a calculation we did to determine which combination provided enough power to get the segbot up the ramp as well as looking into the dimensions of the motor compared to the other motors.
Accelerometer Trade-Off Study
The MicroSegbot needs to be able to balance itself both while standing and while on the move, so it must contain an accelerometer with a gyroscope. All of the devices looked at communicate with the microprocessor via the I2C bus, making them able to receive its sensor data without the system processor interfering. The 16 bits on each channel of the MPU6050 allow it to capture the x, y, and z channels all at the same time with better accuracy than the MMA8451 and the ADXL345. The higher scale factor shows that the MPU6050 also has a higher range of sensitivity that can be chosen for our segbot. Because of these reasons, we have decided to go with the MPU6050 as the accelerometer in our project.
Bluetooth Trade-Off Study
The Bluetooth trade off studies go over the different types of bluetooth 2.0 and the selected device. The bluetooth was chosen based on the dimension, price, and weight. The HC-06 was the best priced and weighed less and also has a smaller dimension, because of this it was selected.
Microcontroller Trade-Off Study
This trade off study compares different Arduino IDE compatible microcontrollers, giving us a decision between the similar ATmega32U4 and ATmega328. One of the main obstacles that we as a group need to overcome is the packaging of the segbot, which means the Arduino Nano will be too big, and gives an advantage to the Pro Micro. The weight category also goes to the Pro Micro, as it is 3.5 grams lighter that the Arduino Nano, and 11.5 grams lighter than the Arduino Micro. Because of these specifications being met, along with the slightly lower price, we decided to go with the SparkFun Pro Micro.
In order to get a clear reading on the angle provide from the MPU6050 accelerometer and gyroscope, a few things need to be done. Since the individual readings from the accelerometer and gyroscope are not accurate on their own, they must be combined after going through a low pass filter and integrator respectively. A Kalman filter is added to eliminate remaining error by looking at previous values and making an educated guess of what the ange will be next. A more detailed explanation is contained here.
Motor Controller Test
In order the get control of the motors to get the MicroSegbot moving, we first had to test our DRV8835 motor controller with our motors and the Arxterra app via bluetooth. This test involved manipulating the Arxterra firmware and connecting our motor driver to the motors and Pro Micro while programming them to spin in different directions. The blog post of the test can be found here.
The MPU6050 test was done using Jeff Rowberg’s I2Cdev library and the teapot code on the Processing app. On Arduino, a live feed of the current angle of the device was printed on the serial monitor. The code was then taken to Processing where a visual of a plane was used to mimic the movements made with the MPU6050. More information on this test is in the blog post here.
The motor test was performed to get an idea of how fast the actual motors rotated compared to the specifications on the datasheet. We concluded that the RPM was around 120. Next, the torque of the motors were tested. This was a needed test to confirm that the motors would be able to travel up the ramp in the course. Three tests were performed and the blog post here goes more into detail.
The rapid prototype was essential to the completion of the final MicroSegbot. The experimentation with the prototype led to finalizing the final dimensions of our Microsegbot as well as giving the team a solid foundation on helping the MicroSegbot with its balancing. All the information pertaining the prototype can be seen here.
Interface Design Matrix
The interface design matrix illustrates all of the connections that are made between the different components of the MicroSegbot. Using the schematic for the SparkFun Pro Micro, the team had to figure out which pins exactly could be used for all of the correct pin configurations. Column by column, the matrix shows every connection involved with the Pro Micro, MPU6050, DRV8835 motor controller, HC-06, 7.4 volt LiPo battery, micrometal gearmotors, and voltage regulator. The matrix and the interconnections between each component are explained here here
The PCB is designed to house most of the electronics at the base of the MicroSegbot to eliminate the need for excessive wires. This is done by putting the connection excessive pieces such as the microcontroller, motor driver, and gyro and accelerometer on the PCB. It was also designed to keep the 6:1 ratio aspect, by being much smaller than the base. More details on the design and troubleshooting can be found here.
Link for the PCB can be found here.
The final design for the MicroSegbot had a lot of revisions until the final version was created. The final design was scaled to a ratio of 6:1 based on the Segway glider. The total Micro Segbot was composed of six 3D printed parts including the two motors, doll, battery, PCB, jumper wires, two fishing weights and two rubber bands. The entire design was then painted using black and grey colors. The entire design explaining the details of the design can be found here.
Hardware Files (SolidWorks files) found here.
Most of the final code that was written was contained in the pololu_DRV8835 tab of the Arxterra firmware. This code incorporated three libraries to balance, which were wire.h, Kalman.h, and I2Cdev.h. Using the MPU6050, the current angle is calculated. Once the MicroSegbot is outside the balanced angle and no longer upright, a subroutine is used to calculate the speed the motors need to move to bring it back to balance, and then the motors are told to move that speed. In order to move the MicroSegbot, the Arxterra app is used. Moving the robot forward or backward changes the setpoint of balance in the needed direction of motion, and the motors work once again to balance the motors in the specified motion. This moves the MicroSegbot where we need it to go. A link to the blog post with a more detailed description is located here.
The power budget accounts for all the electronic components that require energy from the battery. Once this data was accounted for the battery was chosen which is the main reason the team was able to obtain a much smaller battery than anticipated. Originally, the MicroSegbot was going to use a battery that gave an output twice as much as the battery we chose, it was also heavier and more expensive then the final battery the team chose. Creating the Power Budget helped the team in many aspects of the project as it decreased the dimensions, weight, and price.
The mass of the MicroSegbot continuously changed as the team attempted to find the center of mass that worked best for the project. The team tried adding different weights at different points of the Microsegbot until the ideal weight distribution was finally found. The team found that changing the weight distribution of the doll was one of the key reasons the MicroSegbot was able to balance with the doll riding it. The final weight of the MicroSegbot was 462.27 grams or 1.109 pounds.
The estimated total cost to recreate this project is approximately $150.00. However, this price is lower than expected because of the connections the team had with the manufactures that printed the MicroSegbot. The price paid for the 3D printing was roughly one fourth of what the total cost should have been for the MicroSegbot. The cost report states the team spent $219.38 which is higher than it should be because the team had to buy an additional Pro Micro as a result of the first one became damaged . The battery, motors, and the PCB fabrication (which we sent out to OSH Park) was the most significant costs for this project.
The team was able to complete 85% of the tasks that was assigned to the project. The project was on schedule from the start (8/24/015) until the final testing of the MicroSegbot. Final testing started on 12/2/2015 and being able to keep the robot stable and able to hold up the doll took until the final due date. If the team was not on schedule to begin with, the project might not have completed as many requirements as expected. Below shows a figure of the project’s milestones.
In conclusion, the team was excited for the progress that was accomplished. The main goal the team wanted to pursue was to improve off of the Spring 2015 Segbot project. This goal was accomplished with its resemblance to the Segway Glider with the pristine 3D printing that the manufacturing was able to get. A special thanks goes out to the Hawthorne High School Robotics Lab who 3D printed the entire frame. Another goal was to be able to have a doll ride the MicroSegbot while self balancing. Even though the MicroSegbot was not able to complete the course or climb the incline, the team’s numerous improvements and accomplishments were a great leap forward and hopefully the next group can excel even more.