Friday, June 15, 2018

MATE PA 2018


Dreams do come true.

Despite not having a working underwater robot before 2 A.M on May 12, my robotics team and I still managed to pull off a historic and unprecedented win at the 2018 MATE ROV Pennsylvania Regional Competition.

We won 1st Place for technical documentation, 1st Place for the marketing display, 3rd place for product demonstration, and 2nd place overall, beating out 33 other high school and college teams from the Northeastern region (we beat out Thomas Jefferson High School!!) and narrowly losing 1st place to Drexel University - a college team. And I even won the most outstanding senior award!




What made the victory that much sweeter was that my team and I had done so well despite our circumstances. Having gone through 3 different iterations of this club, bouncing from organization to organization in attempts for legitimacy as a robotics focused group, it has been nothing less than extremely difficult to keep the MATE robotics organization afloat. Being kicked out of High Tech, fighting to keep our hard-earned money and the robot itself, waiting 3 excruciating long months simply to get a 4-H charter, sending hundreds of panicked emails to local technology and manufacturing companies for sponsorships - my 4-year journey with MATE robotics has been anything but easy.

This week is the internationals competition so it's the final stretch. I've been mostly hands off as I've wanted to hand off the stress and the pressure of managing to next year's President - I don't expect we'll do well at all unfortunately, but it will surely be an experience that will be unforgettable and eye-opening as my team and I meet robotics enthusiasts from all over the world.

Friday, April 13, 2018

History

 

It's finally come together. The fruit of the past 8 months labor in the form of an orange and black underwater contraption, the Nemo ROV. We've made history by being the first MATE team from High Tech to not have ANY waterproofing issues with a bottomside electronics design, and now we actually have 5 weeks to practice and hone our strategy for the mission tasks. The claw's working great, movement is mostly okay (need to fine tune the strafing movements), and I can actually grab things with the ROV. The alumni are shocked that we actually got the ROV functionality done before the week of the competition I'll probably make a promotional video some time or later because it looks super cool underwater.

We're still far from done though. We still need another end effector to make my job easier (as pilot) to carry the power connector for Task 1, a 2nd camera to be sufficiently waterproofed and mounted, and our simulated ocean bottom seismometer REALLY needs to be worked on. It looks like this:



I have to wake up at 9 AM tomorrow to practice/test the ROV until 5 PM, so I'm going to end the blog post here; my next or the blog post after that will cover everything that happens at the MATE ROV 2018 Pennsylvania Regional Competition, so stay tuned :)

Hacking a Topside Control Box

                                          

Underwater ROV systems often have a "topside control box", a box with electronics to control the electronics on "bottomside". Pictured above is the topside control box of our over from the summer. For our MATE competition ROV however, we needed to upgrade our topside control box. Other teams usually feature expensive and bulky Pelican cases, adorned with shiny 12" monitor screens. But of course, no one has $300 to drop on an expensive branded Pelican case, and neither do I.

                                                         
So this here is a dusty plastic case for my dad's label maker. It's not that great in terms of spacing, but it is definitely sufficient for a couple of electronics components (watt meter, kill switch, USB breakout, HDMI cable). I basically borrowed (stole) this, dremelled some holes, and voila - a control box.

Next was the built-in monitor. Again, being the cheap person as I am, I decided to hack a built-in monitor from an old laptop to serve as a display for the Raspberry Pi 3 microprocessor.



A laptop, as any other.

Slowly getting taken apart - those rubber-like things around your laptop monitor frame cover screws!

A side view of the laptop getting even more rekt.

            
                       The LCD screen is coming out!                                      Success!

Next to connect the controller board - I bought mine off of Ebay. For more details on how to connect the dead monitor to the board, here's the Instructable that I followed:

http://www.instructables.com/id/Turn-a-dead-laptop-into-a-monitor-with-Plexiglas-s/ 

                  
                                       Very nice.                                                      Amazing.
       
Final product!!!

Overall, a pretty cool and fun thing to do, and it only cost me $20! 10/10 would recommend. 

Thursday, February 1, 2018

Console.log("Javascript Robotics!")

I love frameworks for robotics.

Welcome to:
Related image

If you read my previous blog post, you would know that I've been trying to interface an MPU6050 gyroscope/accelerometer for a PID controller for the code.

Image result for gy88 module
This is the GY88 module that has the MPU6050 IC on it. It's pretty awesome. Also really hard to read data from it in Python :((

Problem is, there's not a lot of support for I2C devices through Python's implementation of the Firmata communication protocol, PyMata. It involves mapping the individual registers and trying to find the right value of the accelerometer/gyroscope within that whole low-level mess. In fact, I spent the entirety of last month just trying to figure out how to read data from the sensor.


But then the Internet happened. And so did Johnny-Five.

Johnny-Five is basically the best thing that has ever happened for the code for the robot. The Johnny-Five platform is based on Firmata, which already plays perfectly into our whole control scheme. It has built-in support for the MPU6050 chip, and I can read the data from the sensor in a matter of seconds. There's even a PID controller library that will do all the math for me when I program the auto-stabilization algorithm.

It's amazing.

So now the code is kind of a mix between Python and Javascript. We're using the inputs library in Python to get XBOX values because it's amazing and not noisy at all (ahem Javascript developers please make an actually working XBOX module thank you), but then using Node.js and Johnny-Five to get sensor data and make the ROV's movement a lot more precise.

Our second pool test is scheduled for February 15th, so stay tuned...



Sunday, January 7, 2018

Nemo ROV Prototype: Electronics

So in this blog post, I'll be covering everything from waterproofing the electronics enclosure to wiring the ESCs on the tray for the Nemo ROV. If you haven't figured out by now, the Nemo ROV is my robotics team's 2018 Ranger Class vehicle for the MATE ROV competition. We just finished assembling our prototype a week ago, so I figured I'd explain how all the electronics works (I'm in charge of the electronics :PP)


This is a System Interconnection Diagram, or SID for short, of the ROV. It details all the electronic components that make up the electrical system - that being said, this diagram is not very technical in nature, but it serves its purpose well. Hopefully this blog post will help you understand the ROV electrical sub-system.

Going from left to right, we have the information detailed in the box labeled "Bottomside". Here we have our six Electronics Speed Controllers (ESCs) flashed with custom Blue Robotics firmware for the T100 thrusters. In contrast with traditional motor speed controllers, such as the Sabertooth Dual Motor Drivers or the L298N motor drivers, ESCs have 3-phase AC outputs, not DC. My team and I are using ESCs because we opted for brushless motors over brushed motors, since they are lighter and relatively more efficient.

The Arduino Mega microcontroller sends PWM (Pulse Width Modulation) values to these ESCs to adjust the throttle (faster or slower). Microcontrollers are computers that are dedicated to a specific task - in my case, it's turning motors on/off, driving them faster/slower. I'm considering swapping the Arduino Mega out for an Arduino Duemilanove though. The Arduino Mega has a 16 MHz crystal oscillator, so there is significant lag when sending XBOX controller commands through serial to the Mega and out to the T100 thrusters. The Duemilanove, on the other hand, has a whopping 84 MHz crystal oscillator. The downside of this is that it can only operate at 3.3 voltage, consequently requiring a voltage regulator circuit.

Then, we have our 50 ft-long USB cable in the tether. This connects the host computer in the "Topside" box to the Arduino microcontroller through a communication protocol called Firmata. Basically, I compile and run the code on my laptop, and sends it to the "slave" microcontroller to execute. Using an XBOX 360 wireless controller, I am able to send joystick values to the software on my laptop and down to the microcontroller and out to the thrusters. 

Our camera system is fairly straightforward. The team and I repurposed two car backup cameras with RCA plugs and screwed them onto the frame of the ROV. They are inherently waterproof, so no need to epoxy anything. With 2 USB capture cards, converting the RCA signals to USB to my laptop, I can run a Python script to view the two camera feeds. 

The next step in developing the ROV electronics is auto-depth with PID. I was supposed to implement the PID controller a while ago, but got caught up with designing the ocean bottom seismometer. I also have to swap out the GY5521 module that I currently have with the GY88 sometime soon, because the GY88 also has a temperature and pressure sensor integrated on it. The temperature chip is kind of useless, but the pressure sensor would essentially allow the pilot to see if there is a leak in the electronics enclosure or not.

So yea, that's how the ROV works. We still need to make the electronics tray neater and design and mount our claw and end effectors, so there's a lot to be done. It's nearing the end of January so I'm actually a little nervous about our progress. I accidentally blew our fuse at our first pool test because I set the thrusters to full throttle instead of 47% (we have a 25A current limit), so we don't actually have an ROV that can fully move and see underwater yet. We do have 4 more months thankfully, but it's still cutting it close as I wanted to start practicing mid-February. But I digress...

To close off this blog post, here are some blurry GoPro pics! Hopefully the next blog post will be more positive.

  




Sunday, November 5, 2017

Gamepad ROV

I haven't gone to hackathons in a while, since college apps have been so hectic for me. But I've been working on the software for my underwater robotics team:

  

Here's also a nice concept model of the ROV:

I've been using the Processing 3 software to build the code for the robot. Processing has a bunch of great libraries to integrate with an Arduino and the XBOX 360 controller to control the robot, and is relatively straightforward and easy to code in. I'm looking into using more standard platforms like ROS or even Unity3D for a real-time ROV simulator, but for now Processing is good enough. I used the GameControlPlus library to take inputs from the XBOX 360 controller, and used the Arduino Firmata library. With the Arduino-Processing Firmata library, my laptop computer acts as a host computer and sends commands to the "slave-like" Arduino, and I only have to use Processing to write the code (no cross-platform communication!). The key here is simplicity and reliability, so that my entire team and I can easily troubleshoot and understand the control logic.

Right now I'm working on integrating a Proportional–Integral–Derivative control feed back loop for an auto-depth mode. An analogy for what this PID loop does is a person driving a car: a person's eyes sees that the car is veering slightly to the right, so the brain tells the arms to tilt the wheel to the left until the car is straight again. The "eyes" for the ROV is the MPU6050 modlue, with a triple-axis gyroscope and accelerometer. The MPU6050 can even allow for 2D and 3D rendering of a CAD model in processing! I've taken care of sending inputs from the XBOX controller to the Arduino from my computer,  but now I have to learn how to get the MPU6050 data from the Arduino. Stay tuned!

Friday, September 15, 2017

PennApps XVI: TattooCare

I went to the PennApps XVI hackathon (for 36 hours!) last weekend, and with a team of two other high school seniors and a nursing student at UPenn, created a smart tattoo system called "TattooCare". The team and I wanted to address the inconvenience of the bulky health monitoring system currently being implemented today by hospitals, a health monitoring system that greatly hinders the patient's day-to-day movement which is even so costly that it is rarely found in the comfort of one's own home.

TattooCare is low-cost, lightweight, wireless and somewhat imperceptible health monitoring system. The goal for TattooCare is to primarily allow for hospital patients to be able to move around more easily for two reasons: to allow for more mobile activity (exercise can help a patient recover faster), and improve a patient's quality of life while recovering in the hospital. TattoCare consists of a few key components: an Android Things NXP I.MX7D single-board computer hosting a Bluetooth GATT server, a voltage regulator, signal amplifier, Arduino MKR1000, and of course, the signature carbon-based ink tattoos.

Basically, the carbon-based ink tattoos detect skin moisture or muscle activity (EMG signals) from the differential voltage measurement across the tattoo. Based on another area of skin/body as a reference point, this data gets sent to an Arduino MKR1000 microcontroller, which then uses the Adafruit BLE SPI Bluetooth Friend Module to send data wirelessly over to the Bluetooth GATT server being hosted by the Android Things NXP board. This data is then displayed on a 5" touch display running an Android App for the patient/caretaker's viewing pleasure.

Here's a nice video of tattoo testing: https://www.youtube.com/watch?v=bYz-HIFjVHE

Fun fact! The acrylic enclosure for the NXP board hosting the Bluetooth server was laser-cut using UPenn's laser cutters in its AddLab.