Wednesday, January 27, 2016

Brainwave Reading Applicatons

As mentioned last time, This new technology has limitless applications. It is one of the first steps towards integrating technology in to the human body.

The mind is a highly versatile and flexible tool. Techniques such as hypnosis, as well experiences like learning a new skill or habit show that the brain is not completely hardwired, and can be rearranged to link one mental thought pattern(trigger) to a completely unrelated action. This means we can link different thoughts with specific effects that they have, caused by the EEG headset. This has been most prominently used in prosthetics. New experiments have shown that artificial limbs can be controlled by thoughts through the headset, in a natural fluid motion. Obviously, you're not using the same neural pathways to control the artificial hand as the ones everyone else uses,  however the different pattern becomes second nature after constant use. That is how we learn

A direct extension of this is the use of EEG headsets to control a full robotic body!

-Jump cut to the scene form James Cameron's Avatar(2009)- and now replace the blue humanoids with the robots from iRobot. HOW COOL WOULD THAT BE!!

Of course this level of thought reading is probably hundreds of years in the future, but the implications are so beautiful. Currently, the commercially available headsets have a very narrow range of functions. The MindWave specifically, reads raw data, attention, relaxation, blinks, and a broad spectrum of brain wave frequencies. While the relatively mediocre technology reads a larger band width, it can not effectively read more detailed fluctuations/patterns. 

I was looking at the problem of controlling an RC car with this tech. There are four basic commands needed to operate: forward acceleration, negative acceleration, turn left, and turn right. The headset only reads two mental states: attention, and relaxation. 

Some people have approached this problem by only using the headset for part of the controls. for example, use a joystick for controlling direction, and the headset for moving forward or backward. I don't know about you, but this seems pretty boring and unnecessary to me. I want full control. For this, I think we need to experimentally find new mental states/brain wave patterns to use. 

To be continued...


Monday, January 25, 2016

TELEPATHY!!

Recently, while I was sitting in the university library, letting my thoughts wander, thinking about the technology of the future, I remembered a ted talk I had watched a couple years ago, about a headset that could read your thoughts! It was pretty far developed at the time, but I never heard of it actually taking off. So I looked in to it again, and what I found was a Gold Mine!

There are currently So many businesses and research labs designing and  working with small EEG (electroencephalogram) scanners in the form of a headset or a cap, that read your thoughts. The scanners read a wide range of electromagnetic waves from your brain, and neuroscience has correlated the different frequencies to different thought patterns.

Currently, the most common application for these devices, is treating mental health through biofeedback, or helping the disabled. However, several low cost scanners have also been added to the market for enthusiasts and developers.

The Potential is Endless for this tech. It can be integrated into robotics, internet of things, and data analytics, just to name a few. The best part, is that while the actual devices are a minimum investment of $100,  the software to operate them is virtually free, making it a developer's dream!

Neurosky is one of the products I was looking in to. They have a cheap EEG headset with Bluetooth capabilities, and furthermore, have made it a Point, to invite Developers to use their product. While I don't doubt that they have some selfish motives for this (publicity and increased market size), giving the people a chance to experiment and play with it is a big step in pushing technological development forward.

I am eager to invest in a Neurosky headset, and experiment with it. In my next post, i'll explain some of the ideas I had in using this technology and its future, and also how I plan to use it.

Saturday, January 9, 2016

Raspberry Pi Quadcopter Version 4

I went to college after the props shattered and I took the Pi with me, to continue my analysis on how I could tune the gains easier.

I am a part of the Micro Air Vehicles (MAV) Club at ASU, and I took my problem as well as my designs to some of the members there. I got some pretty good feedback from them: first of all, the frame was too wide, and so the props were back washing on to the quad, reducing the effectiveness of the motors, and causing further turbulence that the PID was to slow to correct for. Essentially, I was pushing against myself.

After I came home for winter break 2015, i continued my search for a better design. I found a blog called Pistuffing. Some guy was using the Pi to build a Quad, just like me, and although it was a work in progress, His code was a million times more sophisticated than the chicken scratch I had thrown together. Still, I found that I had the right idea, and so I began to look at his Github Repository, and analyze his code. I adopted the files he had created, and started experimenting. It took almost the whole break to understand it, because I started out having no Idea how to even begin, but eventually I got it.

I bought strips of balsa wood, which is light, and new propellers. I once again mounted everything, and began testing, by tying the four corners of the Quad to chairs, so that it would not flip over or shoot up in to the sky. I learned how to debug code using print statements to narrow down the location of the problem.

I found some flaws in the code, which were causing the quad to just go full thrust instantly, or perhaps that is due to my design. It turns out that the latest version is lighter than anticipated, and so it takes less thrust to lift.

That is the point where i am right now. It may work reasonably, and have found a way to test it. I am going back to college now, but will for sure continue to try and get it to fly in the future.

Quadcopter V.4

Raspberry Pi Quadcopter Version 3

In my last post I previewed that I had bought Brushless DC 3-phase motors with their corresponding ESC's. After doing even more research, I bought a 3 cell lipo battery rated at 1300 mAh (the smallest one I could find.) I also bought a power distribution board to supply the power from the battery to the ESC's, as well as male and female bullet connectors, and 9045 propellers.

A source on the internet showed me that an accelerometer module could be used to find the angles that could be usid as inputs in the PID algorithm, to provide stability to the quadcopter. I had one of those modules in one of the Raspberry PI starter kits that I had gotten. It was the ADXL345

I made the frame of the new design Quadcopter using plywood. which I cut in to shape with a hand saw. I then drilled holes into the wood and screwed the motors and raspberry pi in to place. Because I needed to remove and recharge the batteries for the ESC as well as the Raspberry Pi often, I just stuck those on with tape. The power distribution board went on the bottom, and plastic cups cut in half were attached for the stands under each motor. 

I integrated the PID algorithm in to the code and wrote in a loop that gave me manual control of the base thrust given to the motors.

WARNING: The motors spin really really fast and are dangerous when first testing one, I accidentally set the thrust too high, and the propeller and the screw on top of it shot off the motor, nearly taking out my eye. On a separate occasion, when testing the quad, my mom was helping out, and she cut her finger pretty on the blades, because they were spinning so fast she couldn't see them. 

I was able to control the motors using the same PWM function on the Pi. 

FINALLY! the quadcopter was able to lift up off the ground! unfortunately, it consistently veered off on to one side or the other. I was able to correct it to an extent by changing the gains on the PID algorithm, however it could not reliably lift off the ground more than a foot without violently tipping and at that point I would have to shut down the code. 

I once again read some more online, and found a gyroscope module, which I had once looked at, but because I didn't understand the vital differences between the gyroscope and accelerometer, dismissed it as the same thing. but more expensive. This time I got a better sense of what was happening in the code and in the accelerometer module. the motion of the aircraft and the vibrations caused it to be a lot more unreliable in flight, whereas while testing it, it was fine. I bought an imu unit (MPU6050), and it gave me much more stable in flight angle readings. 

This looked promising, however, the problem with the PID gains still persisted. How would I tune the PID gains? they had to be tested manually(no easy mathematical solution), and I couldn't allocate a lot of space to trying it over and over, because I lived in a small apartment at the time, and needed a good wifi connection to use the Pi. 

I tried several times, and the one last time I changed the PID gains, one of the motors revved up a lot more than the others, the quacopter flipped on its back, and all of the propellers shattered. 

Stay tuned for the stunning continuation to the tragedy!

Raspberry Pi Quadcopter Version 2

After facing the plethora of problems with batteries and voltage drops in the first version, I decided to do some more research and found out that the motor speed and the propeller size I had gave me a much smaller total thrust than the weight of my quad. so after using an online calculator for the thrust, I decided to buy better motors and larger propellers.

What I realized was that newer quads use brush less motors rather than brushed ones because they are much more efficient at using power, and can spin much faster, but they cost a whole lot more than regular brushed dc motors, because you have to buy electronic speed controllers to manage those better motors. However this ends up costing around a hundred dollars, and I didn't want to spend that much.

I got brushed motors that were larger and more powerful than the previous ones, and I also bought size 1045 plastic propellers. Together this combination could theoretically lift 1kg, which was almost exactly the total weight of the one I had. The problem I found was that there motors were not meant for Quads, and so the rod on which I was mounting the props was too thin. I temporarily wrapped the mounting rods with masking tape to make them thicker, so I could mount the props. I also bought a small portable battery pack with a USB connection to provide the 5V, 1A power that the raspberry pi required. It was really a pain, because most lightweight portable batteries are 0.5A sources. I mounted everything on the styrofoam frame, and taped everthing on securely

I wrote a better version of the code inn python, and spend a while learning about PID algorithms, and how I could use them to make my quad have stable flight.

This time, the problem I faced was that all the batteries and the components were still too heavy for the quad, and moreover, because the motors were not made for air crafts, they did not spin as fast as they should have because of the resistance from the propellers. After a few more days of research and testing the motors at higher voltages etc., I decided that making a quadcopter using regular dc motors was not practical and a waste of time and energy.

I instead started to look at if I can use brushless DC motors like the ones they use in professional RC quads, for my project. It turns out that you can, however I had to make a pretty large investment of around $100 to buy the right motors as well as electronic speed controllers (ESC's)  for the motors.

It is really cool how the brushless motors work. The rotation happens due to the changes in a magnetic field in the coils of the motor, which oscillate in three phases. I decided to use those new motors in Version 3. Stay tuned and in my next post I will show you what design changes I made and the challenges I faced.