In the summer of 2015, I started designing a quadcopter from scratch. I decided to use the raspberry pi as the main flight controller Because I had one, and it is relatively light weight. Disclaimer, I started this project with next to no knowledge as to how I would go about designing and building the quad.
After a few initial days of research as to what it would take for me to build a quad, I decided to use the motors and props of the Syma x5 quad that I already had. The Raspberry Pi would be on board the quad, and after seeing a video online about a quad some guy had built, I decided to use styrofoam as my mounting surface. I also realized that in order to control the motors separately, I would need two H-Bridges, each powering and regulating a separate motor. The Syma x5 uses tiny DC motors, and bring the props up to a suitable speed by using a couple of gears. i was using the same props, so I had no problems with that. The motors needed a 6.6 V supply, so i just used the same lipo battery pack that came with the Syma.
I connected to the Rasperry Pi via SSH from my windows machine, and for that I also had to setup a wifi adapter. A big problem I realized was that the raspberry pi also needed to be powered, and it had to be through micro USB, and after some more googling, I found that it had to be 5V and 1A, and most lightweight commercial power packs were 500mA. To power the Pi as well as the wifi adapter and use so many of the GPIO pins, I would need a substantially heavier power source. I decided to worry about that later, and first just focus on getting my motors running using the H bridges.
Several online tutorials showed me how to use the basic bash commands, to access the raspberry pi via SSH, and to open up the nano editor to code in python. I also learned how the H bridges worked, and how to wire everything up. Finally, learned to use the GPIO libraries in python to send a PWM signal and. I had not learned Python as a language before, so at first I was just copy pasting, and it took a few days to understand the code, as well as how the language worked at a basic level. Meanwhile, I just used a couple of long wires running from the GPIO Pins to the H-Bridges. I got a sheet of styrofoam from a hobby store and cut it in to the measured lengths, and cut out open portions in the center. (side note: when cutting styrofoam, and mounting the motors, the styrofoam bits will get everywhere, and cleaning up will be a pain, so put a plastic sheet underneath your working surface.) After mounting the motors in to the sides of the styrofoam, I wrote a small program in python that just started the signal, changed the duty cycle a couple times, and then stopped.
The motors spun, and changed speeds when the duty cycle changed, however the speed that they were getting was not enough to even lift the frame, without the raspbery pi or its battery. The Problem i found was that the H bridge was poorly designed, and a forum told me that the bridge sapped about 2 V from the power input. In the end, this version did not have enough thrust. So I would have to make some design changes.
In my next post, I will show you What design changes I made, some problems I faced, and hopefully, I'll get my quadcopter to fly!
No comments:
Post a Comment