Sunday, April 29, 2018

Robogames 2018

This year, I competed in a combat robot competition called Robogames. If you are familiar with the show "BattleBots", Robogames is essentially the same thing. There are many different events, such as combat, hockey, autonomous or even things like robotic bar tending. I participated in the Junior League one pound combat category. In this event, your team has to build a robot less than a pound that will face others in a boxing-style combat arena with a dual-elimination tournament setup. I did this same event last year, and lost both my games. I pretty much built my robot the night before the competition and it didn't turn out too well. This year, I wanted to do a lot more planning and not procrastinate as much. I thought my design from last year, a horizontal spinning drum attached to the front of the robot, was decent, and I decided to stick with it. My friend and I formed a team and started researching. I saw a video by YouTuber Robert Cowan (link here) that seemed to match perfectly with the design I had in mind. I messaged Robert for the chassis and weapon files so that I could modify them for my particular components. I planned to 3D print the chassis and weapon, but would've liked to CNC the weapon out of steel or titanium if I was able to gain access to proper machinery. For electronics, I used the same parts from last year, with a quadcopter motor powering the weapon and Fingertech brushed motors and ESCs feeding power to the wheels. After modifying the chassis and weapon to fit the components, my friend and I 3D printed them in my engineering class at school. We printed duplicates of each so that we would have back-ups if anything broke during the competition. In Robert's design, he uses a plastic called Garolite G10 that is screwed onto the top and bottom of his chassis to cover and protect the internals. I went to my local Tap Plastics store and purchased some high-impact resistant acrylic plastic instead of Garolite G10, as it wasn't available. In school, we used the laser cutter in our engineering class to cut the acrylic to our specifications (again, we cut multiple plates so that we would have replacements for the competition). Finally, we assembled all the parts together. We used a skateboard bearing and a bolt to hold the drum into the chassis, and the motor was simply press-fit into the 3D printed weapon. After soldering and installing all the parts, we added some hot glue to strengthen the electrical connections. Next, we weighed the robot and found that we still had about 100g to spare. At that moment, it was the day before the competition, so we decided not to add any weight. We tested the robot and were pleasantly surprised at the strength of the 3D printed weapon and chassis. At the competition, we realized that we could've improved our design a bit. There were six screws that held the acrylic plates to the chassis, and were a pain to remove when we wanted to change the battery or fix something. Unfortunately, in the first fight, the weapon motor seemed to be stuck and not spin up very fast or at all. After the fight, I realized the battery we used, a 2S LiPo, could not sustain that constant spinning of the weapon for the full 3 minutes of fighting. This was the main issue for why our robot lost the first fight. Luckily, I had brought a larger 3S LiPo, and it barely fit the chassis. Also, it left about 20g of weight to spare. Thinking about it now, we should've used this battery from the very beginning, not just as a backup. I used the 2S LiPo batteries in the first match since I had only one 3S, and four 2S LiPo batteries, meaning I wouldn’t have to charge during the competiton. In the next fight (using the 3S), the robot worked properly, but we still lost. In this fight, the opponent had a robot shaped almost like a dustpan, with a very thin lower lip that was able to go underneath the spinning drum, essentially making it useless. This fight exposed another flaw of our design. However, all the other robots in this competition didn't have this dustpan design, and I think our robot would've competed better against any of the other bots. Next year, I plan to compete again in Robogames, but revise my design a lot more. I still do believe that the spinning drum is a great weapon, because it keeps the rotational forces balanced across the width of robot chassis, and it can flip/destroy other robots pretty easily. My revisions for next year's design would be to make the weapon out of metal, some how reduce the risk of failing against dustpan style robots, and make sure to use 3S batteries. See photos of the event






here.

Thursday, April 12, 2018

FPV and How to Get Started

FPV. It stands for First Person View. In other words, a camera on the front of your drone streams video live to VR-like goggles that you wear. Instead of flying the drone by a line of sight, you fly the drone using this video feed. FPV lets you do more acrobatic maneuvers and basically fly the drone better (because you see what the drone sees). Although I have been flying drones for a while now, none of mine have used FPV. I wanted to explore it without spending much money in order to see what it is like. I had heard of the Tiny-Whoop concept before, and I was interested in it. The Tiny-Whoop style quad is basically a cheap micro quadcopter that you can buy for around $35 to $50 that you add a camera to. Also, you need to buy a pair of FPV goggles in order to complete the setup. My friend was selling his micro quad for $40, so I bought it. Also, you need a transmitter (remote control) that is compatible with the quadcopter. Another friend was selling a compatible remote control (Spektrum DX5e) for $20, so I purchased that as well. Next, I bought a small FPV camera and cheap goggles from Banggood.com. Once all the parts arrived, I soldered the camera power wires to 5V output on the quadcopter board in order to power it. Finally, I plugged the quad into my computer and opened Cleanflight, which is a configuration utility for quadcopters. I made sure the accelerometer was working and that the propellers were all spinning in the right directions. I also assigned the switches on my transmitter to do various actions, such as arm the quad or put it into self-level mode. Once the batteries and FPV goggles were charged, I fired everything up and tested it. I was surprised about how easy the whole FPV experience was. Besides Cleanflight there isn't much configuration, and the only slightly skilled task is the simple soldering for the camera. After flying this quad for a few weeks, I am in love with the whole concept, and plan to do more projects that incorporate FPV. Not only does it make you a better pilot, but it is also a lot of fun to try and avoid obstacles or do tough maneuvers around the house. This quad is very durable due to its replaceable plastic frame that encircles the propellers, and since it can be flow easily indoors, it is something to do when you cannot fly your bigger quads outside. See photos here.






Monday, April 9, 2018

Adding Aux Input to 2006 Toyota Corolla

As I am going to start driving soon, I'd like to be able to listen to music from my phone in the car. I'll be driving a 2006 Toyota Corolla, which has a CD drive and radio, but no Bluetooth, USB, or aux input. An older car with a cassette tape drive would've actually been better, because there are cassette to aux adapters that can be bought for fairly cheap. I tried to use a device which connects to a specific radio station and routes the aux output from your phone to that station. While this device worked and met its claims, the audio quality wasn't great, and there were some instances where there would be a lot of radio static noise. I wasn't satisfied with this. I did some research online and found a cheap device which plugs into an empty slot of the entertainment system and acts as a another input by identifying itself as another CD. I purchased this product from Amazon for around $20, and watched some tutorials online on how to install it. The installation process is fairly simple, just removing the plastics panels in order to gain access to the entertainment unit. Next, I plugged the device into the empty slot at the back of the system and routed the aux cable out near the center console. Finally, I tested if the whole thing worked, and it did. The quality is better, but the main benefit is the stable playback. This is because the audio isn't being transmitted over radio. In the future, I plan to add Bluetooth by attaching a cheap aux-Bluetooth adapter to the aux cable. 

Monday, March 26, 2018

GPS Lockbox

I recently completed a project for my computer science project in school. The project was an end of the year type thing, and it was to make anything you wanted using code. Most other people made apps or games, but I wanted to do something with hardware. My partner and I came up with the idea to make a box that only unlocks itself when it is within a set radius of a location. I already had a Raspberry Pi, so I planned to use that. To open the box, we used a servo motor from an RC plane. I ended up purchasing a GPS module for the Raspberry Pi and a small LCD screen to print out location data. Getting the GPS to interface with the RPi was pretty hard. I watched a lot of Youtube videos and did a lot of research before finally being able to receive some data. However, this data just looked like random strings of different characters. I did some more research and found that GPS uses special tags in front of different data to identify what type it is. For example, the string "GPRMS$" will be in front of the date and time data. I found the tag for latitude and longitude data and wrote some code in Python to only print out the latitude and longitude. Next, I had to figure out how to make sure the device was within the radius of a set lat/long. I found a mathematical formula online called the Haversine formula that could be implemented in my code. It takes in destination and current location coordinates and spits out the distance between the two, taking into account the earth's curvature. After doing some tuning and testing of the coordinates, the code worked. I figured out how to control the servo motor with the Raspberry Pi using PWM (Pulse With Modulation) and added the servo control part to my existing GPS code. I cleaned up the final code a bit so that the data being outputted to the LCD screen was more reader-friendly and usable. Finally, I put all the hardware components into a plastic container I found lying around and created a simple locking mechanism with some old Lego pieces and hot glue (this box is really easy to get into even when it was locked, but it was meant to be a proof of concept). The RPi was powered by a portable charger and the LCD from a 9V battery. This made the whole setup portable, so you could walk towards the location and watch the current lat/long. change. Overall, the whole project was a success. I learned about GPS and got better at programming in Python during this experience. See pictures and code here
Entire Assembly 

Raspberry Pi Code

Locked Position

Unlocked Position

Servo connected to GPIO Pins

Command Line UX

GPS module via GPIO

Pi and GPS module

Saturday, January 13, 2018

DIY Amazon Echo

The Amazon Echo devices running the Alexa AI voice assistant have been gaining a lot of popularity lately. While the new Echo costs $100, the Echo Dot costs $35-$50 depending on if there is a sale. At that price, the Echo Dot is very affordable and practical, and the sales have shown that people agree with me on that. After recently purchasing two smart switches to control lights in my room, I was interested in purchasing an Echo Dot for myself. But then I realized that I could build my own for a little cheaper. An actual Echo would have more features and better components, but I wanted to have some fun and build my own. I found many articles and videos online on how to do this project. The key parts of this project are a Raspberry Pi running special Amazon software, a USB microphone, and some sort of wired speaker. I had an original Raspberry Pi Model B (the first one) sitting around after I had used it to make a retro video game emulation box, so I decided to use it. I also had an old webcam with a mic, so I used that as well, along with a Bose SoundLink speaker (with aux input). I installed Raspian (a Linux based operating system for the RPi), and followed directions from this website to configure all the Amazon software. Essentially, you sign up for a free Amazon Developers account, register a product, enter some product info into some software that you install on the RPi, and it all works pretty well. I had a few issues regarding the mic being detected and the software responding to me saying "Alexa", but I found very helpful advice that solved my problems on various forums, usually on Reddit or GitHub (the software that actually runs the Alexa platform on the RPi is from a GitHub developer). Another tip that might help you is using SSH. SSH is a method to access your Raspberry Pi from another computer over the internet. This means that you don't have to hook up a display to the RPi, instead just receive a visual feed on any internet-connected computer. Setting up the SSH is fairly simple, and was a breeze for me. Again, there are many videos and articles about this to help you. After some testing with my Echo, I realized that the RPi wasn't able to read long articles or play music without some buffering or glitching. I suspected that this was due to the lack of processing power in my old RPi, so I bought the newest RPi model on Amazon (the RPi 3) for $35. I also bought a far-field sensitive USB mic to replace my old webcam. After reinstalling the Amazon software on my new RPi, everything worked as planned and just how I expected it to. To finish it off, I 3D printed a mount for the RPi so it could stand upright, and cleaned up the cables. This AlexaPi (as many call it), can do almost everything a regular Echo Dot can do, except play music without using the Alexa app (the actual Echo can do it through voice command). Also, the far-field mics on the actual Echo are better than the cheap mic I got on Amazon as well. With most of my projects, it usually takes me a while before a desirable result is reached. However, this project was a lot easier than I thought it would be, and I think most people who simply follow instructions could do it with ease. While the actual Amazon Echo Dot is more practical in terms of price (if you don't already have a RPi, mic, speaker), I like that I built my own. Whenever you build something on your own instead of buying it, all your work pays off, and you get a feeling of accomplishment and achievement. 

Friday, December 15, 2017

Building a Boosted Board

If you don't know already, electric skateboards have been becoming more and more popular, mostly due to a Silicon Valley startup known as Boosted. They are the Apple of electric skateboards, and accordingly, their boards go for as much as $1500. When I saw YouTube star Casey Neistat riding a Boosted Board around, I really wanted one for myself. However, I don't have $1500 lying around.  I realized that the actual parts cost for the Boosted Board was much less than the selling price. I understand that Boosted needs to make a profit and all, but I figured that I could do it for much less. I started by researching the parts and watching a lot of YouTube tutorials. Everyone who built one pretty much used the same components: A motor around 200-300KV(KV is short for kilovolt, and the higher a KV is, the faster a motor spins), some type of electronic speed controller (ESC), two or one big Li-Po (Lithium-Polymer) batteries, and an enclosure to hold everything. I tried to find the cheapest parts that would still offer good performance. After a lot of researching, I chose a 280KV motor from Turnigy, two 3s 3000mAH Zippy batteries, a 150A RC car ESC and a waterproof plastic fishing bait box from Walmart. For the actual board itself, I bought a cheap longboard off of Amazon (parts link will be below), a motor mounting kit, and some larger 80mm wheels. After all the parts arrived, I was faced with a few problems to solve. First, setting up the pulley system. The wheels I ordered had spaces in them that made fitting bolts in them easy. The bolts threaded into a circular sprocket gear that was affixed to one of the skateboard wheels. Yes, this skateboard is one-wheel drive, but so are other commercial electric skateboards. Next, I had to attach the motor mount onto the skateboard truck (the thing holding the axle to the board). This part of the build took a lot of time, as I had to file down the metal skateboard truck in order to fit the hole of the motor mounting plate. At the hole, the mounting plate was secured by three grub screws (basically bits of thread that hold something to another object with friction). After I managed to get a secure fit between the motor mount and the skateboard truck, I moved onto fitting the pulley gear onto the motor shaft. The motor screwed into the motor mount just fine, however, my pulley gear had a bore of 8mm, while my motor shaft was about 6mm. I had to order a separate pulley gear online that had a bore of 6mm for the project to continue. This is important - don't assume the parts will all work together. Next, I focused on the electronics, which were surprisingly easy to put together. After confirming that motor was spinning in the correct direction (you can reverse motor direction by switching any two of the 3 motor wires that go to the ESC), I soldered the ESC to the motor. Next, I soldered the two batteries together in series. Series means that one negative of one battery and one positive of the other battery are soldered together, and the remaining positive of one battery and negative of the other battery are used to output power. After soldering the ESC to the battery, I plugged in my RC car receiver. I bought an RC car transmitter and receiver on Amazon, but I plan to return it for a transmitter and receiver that are actually made for an electric skateboard. The RC car transmitter and receiver work perfectly fine, but the transmitter is kind of bulky. I drilled some holes into the skateboard and mounted the plastic fish bait box from Walmart to the bottom of the board with nuts and bolts. I had to shave off some of  the plastic compartments in the box so that my electronics would fit. I cut a hole for the ESC (for ventilation - gets very hot) and for turning the board on (ESC was wired to a on/off switch out of the box). After that, I fired it up and tried the board without my weight on it. It seemed to work fine, but once I got on it, the throttle response was way too jerky. I trimmed/adjusted settings on the throttle on my transmitter, and then I was able to actually ride the board. I had never ridden a skateboard prior to this build, so I practiced a bit before without a motor. I found that starting the motor with a moving start in the direction you want to go in helped with stability. I went to a local park and tested the board there, and it worked very nicely. In terms of charging, you will need two balance chargers or one multi charger to juice up your batteries(there are separate charging cables on most LiPo's, so don't worry about soldering the batteries together). I already had a few balance chargers lying around that I used for my drone batteries, so I was good to charge. The chargers that I use are very inexpensive, and can be purchased from Hobbyking.com. I haven't yet tested top speed and range, but I will report that info to you guys in a follow up post. Back to the main reason I started this - building my own Boosted Board on a budget. I think I pretty much accomplished my goal. I don't have a fancy app for my board, two wheel drive, a bamboo deck or fast charging, but in essence, I built a practical method of transport that's not only fun to ride, but fun to build.
Here's a video of me riding the board: Skateboard Video
Parts List:
- 3s 5000 Zippy LiPo x2: $43.76 - Hobbyking
- 280kv Turnigy Aerodrive Motor: $46.96 - Hobbyking
- ‎Hobbyking 1:8 Scale 150A ESC: $73.20 - Hobbyking
- ‎Turnigy Twin Pack Charge Lead: $1.99 - Hobbyking
- ‎83mm Longboard Wheels: $26.99 - Amazon
- ‎Motor Mount and Pulley: $29.99 - Amazon
- ‎Magic Union 41" Longboard: $45.99 - Amazon
- ‎HTD 3M 15 Tooth Timing Pulley: $13.88 - Amazon
- ‎FlySky FS-GT2B 3ch Transmitter and Receiver: $28.99 - Amazon
- ‎Waterproof Fishing Bait Box: $7.75 - Walmart
- Turnigy 12V 2-3s Balance Charger: $5.00 - Hobbyking
- 12V DC Power Adapter: $10.00 - Amazon



Monday, August 14, 2017

More on the IOT

When I discussed the New Matter MOD-t printer, I explained a feature that allowed for remote printing and monitoring. A 3D printer connected to the Internet. A coffee maker connected to the internet. A lawnmower connected to the Internet. A thermostat connected to the Internet. These days, more and more things are getting connected. The devices and links between them are known as the Internet of Things. I recently purchased two Belkin Wemo Smart Plugs to control lights in my room. The devices plug into a socket, and you can plug anything you want into the Wemo. This allows for a lot of flexibility, because a lot of things inside your house plug into the wall. Also, you can plug a power strip into a Wemo to toggle multiple devices at once. In my setup, I have one Wemo controlling a lamp in the corner, and then another Wemo that is hooked up to a power strip controlling two lights near my desk. The setup process is extremely easy, just requiring you to connect your Wemo plug(s) to your home Wi-Fi network and give each plug a name. After the initial setup through the Wemo app, you are greeted with a screen that has switches for each of the plugs and more settings. The app is great, but for even more convenience, I linked the Wemo plugs with the Google Assistant on my Android phone. In the Google Assistant settings, I was able to set catch phrases to trigger different actions. Now I can say "Ok Google, turn on the Desk Lights," and the two lights near my desk will switch on in a few seconds. You can also get creative and make up phrases. For example, when I say "Good night" to Google Assistant, it turns off all the lights. I feel that smart plugs like these are the best way to get into home automation. You don't need much, just an Internet connection, device with digital assistant (Siri, Alexa, Google Assistant) and available power outlets. Also, you pay a reasonable $30 for one Wemo. The Internet is evolving, and reaching almost everything that has electricity in it. These Wemo plugs won't start the Matrix, but are indeed a start to a new way of interacting with the things around you. The convenience of home automation is amazing, and shows how our lives and environment will be connected to the Internet.