April 18, 2015:
So it's a bit late, but I still want to try to fit in at least some programming, like I intended to do when I set out. Change of plans, I won't try to replace the flight controller in its entirety, but I can replace the remote control receiver/transmitter pair with something of my own!... I hope. Anyway, yesterday I began reading up and trying things out.
My dad had various little boards and pins and connector circuit things, and I'll spare you the details, but my first attempt didn't work out. The work other people did with this board that was documented online was nowhere near developed enough for me, a fairly beginner programmer, to try to do anything with it. If you're wondering, the board was ESP8266 ESP-201, a wireless transceiver board, intended to communicate through WiFi.
After that didn't work out, my dad recommended a Raspberry Pi, a board he had from one of his old projects. With research and fiddling, we worked with it until we had success tonight!
What, you want details? Fine.
Okay, so the basic plan was to get a board to receive signals wirelessly and translate them into PWM (pulse width modulation) signals, wired to the flight controller. Now, my current remote control setup does exactly that, but I want to be able to build it with my skills.
If you're wondering what PWM is, it's basically the digital way to send analog signals. Binary digital signals only can send on or off (1 or 0) signals. This means you can only go full speed or completely stopped on any single signal. Analog signals say "at this point between stopped and full speed," something digital signals can't do. The way around that is repeatedly flickering between on and off, too fast to be noticeable by humans. If the signal is flickering so that half the time you're sending an on signal, you're saying "half speed." If the signal is sending "on" only a quarter of the time, you get "quarter speed." Make sense? Moving on!
So, there's been a lot of work done with the Raspberry Pi board already, so it's perfect for someone like me to fiddle with. I approached this from several directions. One, find a way to interface between the Raspberry Pi and something else wirelessly. Two, find a way for the Raspberry Pi to send PWM signals that the flight controller can interpret.
For the first part, there is WebIOPi, a project to get a Raspberry Pi to host its own local website. Anything connected to the same wireless network that has the IP and login information can enter the website and send signals for the Raspberry Pi. I worked with this first, trying out how to make a webpage with buttons and sliding controls that would send signals through the Raspberry Pi to whatever it's connected to. I got the basic stuff to work, by testing with a simple on/off switch for an LED. Trying to make a dim/brighten slider didn't work, though. That's when I moved on to the next part.
Next, there's RPIO, a module for the programming language Python for GPIO (general-purpose input/output). It had the ability to send PWM signals if I coded it correctly, and after a bit of work, I was able to set the test LED to whatever brightness I wanted!
Next up, sticking all of this together and onto my quadcopter!
No comments:
Post a Comment