I designed and built this balancing robot to get some practice writing estimation and control algorithms in C++. The frame is 3D printed from my own CAD designs, and the electronics are mostly cheap parts from an Arduino kit. I chose to use motors without encoders to make it more challenging to control the position of the robot.
I started by using a complimentary filter to estimate the orientation with gyroscope and accelerometer measurements, then I tuned a PID controller to keep the robot upright. I immediately noticed that the robot would drift across the floor when I gave it a push because I was only controlling the orientation and not the position. I tried to address this using a dead-reckoning approach based on the integral of the commanded power to the motors. Since I did not use encoders, I used this integral to estimate the total rotation angle of the wheel. I added a second PID controller that was tuned to keep the estimated rotation angle near zero. This was somewhat successful. The robot did a better job of returning to its original position after being pushed, but tuning the two separate PID controllers was difficult because they would interfere with each other near equilibrium and cause oscillations. I also noticed that the optimal gains depended heavily on whether the robot was on a hard floor or a rug.
I build a simulation of this robot to get some practice using Simulink. My idea was to use the simulation to quickly test and iterate on different controllers and estimators such as LQR and Kalman filters. I also experimented with adding an ultrasonic distance sensor in the simulation to help with estimating the robot's position.
I ended up incorporating this simulation into a course project where I tried to figure out if it was feasible to estimate the rolling resistance between the robot's wheels and the floor using only an IMU and a distance sensor. If so, I could schedule the controller gains based on rolling resistance. I found that estimating the rolling resistance was feasible with an uncented Kalman filter in the simulation, so implementing this on the robot is a potential next step for this project (link to my paper).
I designed this FPV drone to be as small as possible in terms of volume. The frame is 3D printed using PLA which is relatively weak, so the flight computer and ESC PCBs carry as much of the load as possible. The trickiest part of this project was sizing the propellors and motors. I originally used 31mm propellors, but they required very high RPM which resulted in only about 2 minutes of flight time. I ended up switching to slightly larger 40mm propellors and moving the motor mounts slightly further from the body of the drone so that less of the structure was below the propellor. These changes slightly increased the size, but also increased the flight time to around 5 minutes.
This airframe is from my first RC aircraft project. It started as a traditional hand-launched RC plane with Ardupilot for fly-by-wire, and I have since added a GPS, compass, airspeed sensor, and quadcopter propellors to convert it into a VTOL. I went with a five motor design to avoid the complexity and additional failure modes of vectoring the motors. One motor is for the original horizontal pusher propellor, and the other four are for the quadcopter propellors.
The quadcopter propellors are mounted to carbon fiber tubes that are fixed to the bottom of each wing. The two front propellors are in a traditional puller configuration, and the two rear propellors are in a pusher configuration. This keeps the propellors away from the pitot tube in the front and the V-tail in the back.
I used a 4-in-1 ESC for the quadcopter motors, which was originally mounted just below the GPS/compass unit. This ESC pulled significantly more current than the single ESC for the horizontal motor, so the additional magnetic fields significantly degraded the heading estimation performance. This was fixed by moving the GPS/compass to the tail.
The next step for this project is to attempt a fully autonomous flight using the GPS and compass for navigation and the airspeed sensor for timing the transition from vertical to horizontal flight.