(Project) - Computer Controlled RC Helicopter With Automated Landing Using Image Processing
(Project) - Computer Controlled RC Helicopter With Automated Landing Using Image Processing
1. The first thing is to open the remote of the car or the helicopter using a
screwdriver. Be careful not to break any connections or damage the circuit
board. Take out the circuit board and do keep in mind while opening the remote
the points on the board where the buttons make a contact.
The buttons on your remote are nothing but a way to connect two points on the
circuit board using a metal plate. So what we are going to do is we will be
making these switches computer controlled. In other words, we would be
connecting the two terminals of every switch to the computer.For example, take
a small piece of wire of metallic plate. Switch on the remote and the
car/helicopter. Now on the circuit board search for the two points (if you don't
know) which when connected with this piece of wire make the car move forward
or say helicopter move upward.
Similarly search for the pairs of points for each function on the remote and
mark them.
I am sorry but I don’t have a better picture with a close up view but I guess You
must have an idea now what to look for. The above two terminals shown when
connected by a conductor would just make the helicopter fly at speed level 1 as
if the conductor was a switch. We would connect our computer controlled circuit
between these two terminals. And so on for other points on the remote
corresponding to other speed levels.
2. Now we have to make connections to the parallel port of the computer. If you
do not have any idea about the parallel port then the following paragraph will
help you. Parallel port is a 25 pin port on your PC or laptop. Most of the latest
laptops don't have it but some earlier models of IBM used to have them. But
you can easily find a parallel port at the back of your CPU. Simply try plugging
the parallel port cable into the different ports. The one that fits in is what you
will require.
Now use the multimeter to find the corresponding wires on the side you have
cut which corresponds to pin D0 to D7 shown in the figure. Mark the colors and
note them down. You will need to refer them a lot while making connections.
Also, please find a wire corresponding to any of the ground pins (18-25) shown
in the image above.
Connect the points marked as ‘a’ and ‘b’ to the wire corresponding to Data pin 1
and ground pin respectively.
Download this program for switching on and off the data pins of the parallel port
from the linkhttp://neil.fraser.name/software/lpt/lpt.exe. Click on the
LPT: 378 to select it. Select the box in from the pin1. As soon as you do it your
bulb/motor will switch it on. You can toggle it on and off just by a simple click.
6. Relay board
Before we start with the
programming let me show
you an alternate method to
just avoid most of the crap I have written above. But believe me know its much
better to know it because that is how the relay boards work. So you must be
wondering by now what are relay boards actually. These are pre built circuits
with 8-16 computer controlled switches. So you just don’t have to search for all
those transistors and make all those circuits if you want. Here’s an example of a
relay board from ‘Robokits India’. Although they have some nice stuff but its
weird that they don’t have a nice support or a good tutorial. Very soon you can
buy a “relay board” from our site “EMBED AUTOMATION” with a full video
tutorial and anytime support. We have first-hand experience as students who
strive hard to work on hobby robotics and I believe we know your problems
better.
Check the relay board from the software mentioned in STEP 5. Here’s the link
again :http://neil.fraser.name/software/lpt/lpt.exe .You can easily toggle
the LED’s by checking the boxes in front of each data pin. Just for your
knowledge, if you use a +9V battery, the LED’s might seem to toggle but the
relays might not be working if they don’t get enough power. You should hear a
CLICK sound every time you turn on or off a relay channel. It means the switch
is working.
Now on every channel there are three pins or terminals marked as “NC
(normally closed), Ground, NO(Normally open)”. Don't be confused NC means
the if you connect your circuit between NC and GRND pin, the switch will be in
OFF position when data pin is off. And if you connect your circuit between NO
and Ground, the switch is in ON position when the data pin is off and vice versa.
If you didn’t understand what I just said, don’t think much just connect you
circuit which you want to be computer controlled in between NC and ground
terminals. In this case, the two wires corresponding to a BUTTON on the
remote.
7. Programmed flights
For achieving this you just need to know how to toggle a data pin using C++ or
Matlab. I prefer Matlab for the same as sometimes there are problems of
accessing parallel port using C or C++. Suppose you have 4 throttle (upward
speed) levels in your remote. So what you can do is program a nice take off or
a landing for your RC helicopter. Just connect the terminals corresponding to
throttle level 1 on the remote to the two terminals of a transistors as explained
above. Similarly do it for other 3 throttle levels. So now if you switch on 1st
data pin, your helicopter blade would be moving on the speed corresponding to
level 1 on remote. Now to achieve a stable take off, we need to program the
flight such as say :
Now we will follow the same algorithm in matlab to actually perform these
functions.
So it is like we have set the rotor speed level 1 at wire corresponding to Data
pin 0, and similarly other levels on other data pins.
So this code funtions as:
putvalue(parport,bvdata1);
pause(3);
RC helicopter flies at speed level 1 of the remote for 3 seconds
- putvalue(parport,bvdata2);
pause(5);
Now we switch it to the level two thus increasing the speed slowly so as to
make the flight stable. The helicopter ascends slowly for 5 seconds
- putvalue(parport,bvdata3);
pause(5);
Increasing the speed to level 3 to make helicopter ascend at full
speed(assuming there are only three levels of remote connected)
PS: After this you can follow the reverse sequence to descend the helicopter
slowly achieving a stable landing.
To simulate the
original landing
sequence using
image processing,
we took a blue
mousepad as
landing spot. So
our image
processing task
would be to
identify some blue
portion with a
definite area (this
area will depend
on the height you
are flying). In real
life scenario your
image processing
task would be do
character recognition and find a “H” in white against a black background. Please
refer to the image processing tutorials already put up on the site for a deeper
insight into solving this image processing problem.
The control structure of the helicopter is outlined in the diagram above. The
continuous video feed from wireless camera mounted on helicopter is analyzed
continuously in matlab. Our algorithm has to find the location of the blue spot.
This basic color based image processing has been explained in the lecture series
on image processing.
I hope you enjoyed the article as a robotics enthusiast. Your feedback will be
highly appreciated.
»