We all have shaky hands sometimes, but we all want nice videos. If we had a budget system that could be used to move the camera fluidly with the movement of a joystick and while also stabilizing the camera, then vlogs and video selfies would be a lot nicer. Using a 3 axis setup, we can achieve all of that and bring quality videos in motion or of everyday vlogs to life.
What it does
The Stable Stick performs automatic stabilization to optimize the video recording experience for content creators on social media. A conveniently placed joystick allows creators to change the target angles, in order to match up with whatever they want to record. The joystick enables creators to track objects moving along one axis precisely, smoothly, and conveniently. The Stable Stick allows creators to easily and reliably have premium level hardware stabilization at an affordable price. The Stable Stick is compatible with all commonly used phone models and also action cameras, as long as they can be mounted using zip ties to the roll axis mount.
How we built it
We used an Arduino Nano, MPU9250 10 axis sensor, an analog joystick, and three 9 gram metal gear servos. The Arduino Nano takes in the gyroscopic and accelerometer sensor data from the MPU9250 and integrates it and smooths it to determine the orientation of the device. Then, it adjusts the output to the servos to stabilize the phone that it is holding. The computer also accounts for sensor jitter and variance. After paper sketching and idea debate, the entire frame was 3d modelled in Autodesk Inventor, sliced using Cura, and 3d printed on Friday.
This had to be done the fastest as programming would be our main issue on this hardware hack. Using calipers, we measured the hardware we had including the iPhone. Autodesk Inventor made it easy to assemble the parts virtually and make sure the fit was tight all between them. We also had our first dive into ergonomic design as we had to design a nice handle that wouldn't be too small for most human hands. Using the CAD software, we were also able to ensure that the iPhone would have enough degrees of freedom in all three axis before hitting its 3D printed supports, which we printed on Friday as well.
We wanted to make sure the servos could rotate the iPhone around without issue, so we opted for metal gear servos and used a breadboard to prototype the wiring. The breadboard made it easy to power all five components that used the Arduino's 5V power, because we could just power them in parallel through the contacts.
First thing we tackled in programming was the joystick. This code was a "warm up" to make sure we could use the built-in functions of reading the analog input and transferring it to smoothly control our pitch and yaw servos. After this came the long and hard work of getting the stabilization system working. Simply put, we researched the sensor and its libraries as just got it in the mail yesterday, and figured out how to get data from it and apply it to the stabilization system. Finally, we added data processing and stabilization improvements for a working device. The
MPU9250_WE library was extremely useful by providing sensor fusion algorithms for us so that finding the absolute tilt readings would not be big problem to the device.
Challenges we ran into
One of the largest challenges we ran into was the stabilization aspect of the device itself. Our sensor logged angles as a rate function, not as an absolute angle due to gyro drift. After doing research on our specific sensor, the MPU-9250, we found an Arduino library that allowed us to implement sensor fusion of the accelerometer and gyros to get consistent readouts of the absolute angle. Now that we had the data, we had to apply it to the servo motors themselves in order to properly control the phone. At first, we installed the sensor onto the gimbal's moving arms with the goal of programming so that the sensor would always return itself back to zero. However, since whenever we moved to correct, the sensor moved too, this led to many frustrating feedback loops and massive wobbles. Thus, we moved the sensor to the rigid handle of the device. Our initial code simply looked at the difference between the initial calibrated angles and current, and rotated the servos to adjust accordingly. However, this was not a good solution because the raw data could "spike" by a couple degrees due to vibrations from the hands, and this would lead to a very shaky phone video. We fixed this issue by processing the gyro data a bit before feeding the correction to the sensors. This was done by averaging the last two angle readouts to form a smoother flow of angle data. To combat jitters, we stopped the servos from moving if angles were too close in value to each other. Additionally, we set rate limits on how far the servos could move per Arduino tick to slow down the stabilization speed. In the code, the users can set these values to their liking for their personalized vlog StableStick settings.
Accomplishments that we're proud of
This was the first hardware hack we ever attempted and we are proud of what we created in just two days. We were unsure about the timing, since not only did we have to code the device, but also design it in Inventor and 3D print the rigid parts, which took us around 10 hours to print. The joystick part of the stick was a great feature in the end for us, despite being not the main part of what we worked on, because we were able to use the stable stick effectively by having much more control tracking moving objects like dogs at the park smoothly. The stabilization system could use upgrades, but in its current form it stabilizes effectively for shaking hands with 2 axis control, especially when bundled with the joystick's precise movement.
What we learned
We learned a lot about processing data, especially from a high-output sensor like the MPU9250, into an Arduino and turning into a system anyone can build and use. This was the first time we ever used sensor fusion with the MPU and it worked great for finding absolute angles of the device to apply to our stabilization corrections. Additionally, our whole process to improve the stabilization from an extremely crazed vibration machine taught us critical functions we can use in other real-time sensor-based hardware hacks, like smoothing data with averages and applying maximum rate changes per update. Having not gone into Arduinos this deep, these systems will come in handy for functions.
What's next for Stable Stick
Improving the aesthetics and creating a more ergonomic design to optimize the end user experience - the handle was too large and that made holding it for extended amounts of time strenuous. Additionally, we would try different types of motors like stepper or brushless motors, as those will provide better control and strength along with a more rigid torque connection than the servo horns themselves. With these new motors, we would also investigate using sensor fusion and mathematics to add another level of stability with yaw-axis stability, which we could not add due to limitations with the current library we used and the built-in magnetometer sensor fusion. There is also a hole inside the handle to store electronics, so in our new design we will fit all the electronics inside, without a breadboard.