Archive for July, 2008

I just wanted to let you know about todays progress. The GPS module landed in the mailbox this morning, but I forced myself not to rush and wire it up to the Spot right away. I know that this GPS module is compatible with the Spot so there was no reason to rush it.

What I was more concerned with was the enable/disable switch and the rudder pass through signal. I started out wiring up the RC receiver to the spot and wrote some lines of code to get the pulse length of a signal connected to one of the Dx pins of the Spot.

    private int getRCPulse() {
        EDemoBoard edb = EDemoBoard.getInstance();
        IInputPin pin = edb.getIOPins()[EDemoBoard.D3];
        return edb.getPulse(pin, true, 30);
    }

These few lines of code should give me the length of the pulse coming in on the D3 pin every 30 ms measured in microseconds. And guess what happened when I connected the battery? It worked!! ;-)

Next up was to prototype the rudder servo pass through. I added some more wires to the Spot connecting the servo signal cable to one of the Hx pins and made sure the servo was powered by the RC receiver.

        Servo s = new Servo(EDemoBoard.getInstance().getOutputPins()[EDemoBoard.H1]);
        while(true) {
            int l = getRCPulse();
            s.setValue(l);
            System.out.println(l);
            Utils.sleep(1);
        }

This code reads the rudder RC channel and passes the value on to the connected servo. Amazing as it sounds, but it actually works!

I now have a spot decoding the RC receiver signal and later outputting it to a connected servo, passing it through the spot as if it was not there! This is what is supposed to happen when the autopilot is disabled. When I hit the gear switch on my transmitter the autopilot logics should kick in. But that is another story..

Share/Save/Bookmark

Comments 1 Comment »

Crazy me have been thinking about this for some time now. Those who know me know that I’m trying to make a part time business taking photographs from the air using RC model aircrafts. I have a dedicated page for some of the videos I’ve been making at http://paulrene.no/index.php/aerial-photography/. I even set up a page for my business at http://settfraluften.no (Norwegian only).

Anyway; During spring this year I got hold of a Sun Spot development kit and I’ve been playing around with it for a while. When writing a program to control servos using the built in accelerometer the idea struck me that this would be a nice platform for an autopilot. I’ve never worked in this field before so this is all new to me and a bit of a challenge. But if I can pull this of it would be a nice project and maybe something that would inspire others to do the same and improve it.

One of the first things I did was to assemble a list of parts:

  • Sun Spot - http://www.sunspotworld.com
  • Pressure sensor - MPX5100AP pressure sensor 15-115kPa
  • GPS module - GPS-module EM-406a
  • Headers - Stiftlist 2×10poler rak Au
  • Gyro - MKS 380 Aeroplane Gyro

Along with this I need servos, RC receiver, wires and connectors.

The feature list as I see it just now will include:

  • Way point navigation using rudder control
  • Altitude hold
  • Autopilot enable/disable using separate RC channel (landing gear channel)

I’ll continue to write about this as the project evolves. Stay tuned, this will be fun!

Share/Save/Bookmark

Comments 1 Comment »