Oliver's Posts (2)

Sort by

3689408226?profile=originalThe APM WIKI has a good page to describe the setup of the Radio for switching the Mode with the RC toggle switches.

However, there was no help on how to setup the T8FG. It's not rocket science, but took a bit of try and error to set it up.

I thought I document this here so it can be linked into the WIKI along with the other Radio guides for the benefit of my own short term memory deficiencies as well as to make this easier for anybody else with the same radio.

 

Here a quick guide for that Radio to save yourself the time to play around with something more exciting:

We will use two toggle switches. In my case I used "SE" as the main switch which also controls the radio channel 5.

This switch has three positions. To be able to select 6 positions we need a second switch. I used "SF", which is a two position toggle. so 3 x 2 will allow you to set all 6 modes.

 

  1. To get the right min/max PWM output we first need to set the Endpoint of channel 5 "SE":
    Linkage Menu (LNK) > END POINT > Move to Channel 5 and adjust to have a low of 67 and 72 for your channel.
    Your display will show: "5 AUX1 135 67 72 135" 3689408226?profile=original
  2. To be able to add in the second switch "SF" we need to add a Program Mix which will influence the first channel "SE".
    Model menu (MDL) > PROG. MIX > Choose any, I choose 1 as it was empty.
    On the first page change the x and y Offsets (OFFS) to +25 each. 3689408243?profile=original
    Continue scrolling to the second page and set ACT to ON. In the next field, set your second switch. "SF" in my case.
    Set the "MASTER" to SF and the "SLAVE" to "AUX1" or whatever your Channel 5 is called (Default of the radio would be "GEAR"). You can ignore the LINK setting which should not be selectable anyway.
    So the whole page reads:
    #1   ACT OFF   SF
    MASTER  SF
    SLAVE     AUX  OFF3689408351?profile=original

 

That's it!You now can control all 6 modes with your T8FG.

 

You can test the settings in the ACM/APM setup and test menu:

In CLI Mode: setup > modes

 

Flight modes
----------------------------------------
Pos 0: LOITER
Pos 1: RTL
Pos 2: ALT_HOLD
Pos 3: AUTO
Pos 4: STABILIZE
Pos 5: SIMPLE

 

Enjoy,

 

Ollie.

 

Read more…

Give your Arducopter Mega (and APM) a voice!

3689408299?profile=originalI have been playing with my Arducopter for a while now. Really cool stuff! It's time for a little contribution myself.

But first a really a big thank you to everybody working on this project and especially Jason for all the cool (and very stable) code he has been contributing!

I had hooked up the Battery Monitoring as described in the WIKI. Works like a charm, however beyond a message in the GCS it was hard to notice when the Voltage (or current, if that is hooked up) reached a critical level.

RTL sounds great, but in most cases it'll be good to get an audible signal when the batteries run low. In fact, I killed one LiPO just having my copter sitting on the desk and forgetting to disconnect the battery. The ACM draws quite a bit of current and low-discharged the LiPO... 20 more bucks down the drain.

So I had a look around in my electronic shop and found a little Piezo buzzer. It runs on 3-6V and only draws about 30mA which is not too much to be driven straight from one of the ACM port pins. It's a YMD1205. It only costs 30 cents - much cheaper than a new LiPO :)

After looking at the schematics of the IMU a usable port was quickly found. The IMU has two "Expansion Ports". As I did not plan to use either for other stuff, they are perfect as the buzzer fits neatly between one of the "gnd" pins and the hole marked "AN6". It looks like it actually belongs there, doesn't it :)

3689408145?profile=original3689408299?profile=original

 

 

 

 

 

 

 

 

 

 

 

 

Code was written very quickly as well in case you would like to integrate that into your project.

I wanted it to be configurable via the APM_Config.h file. Also I integrated a quickly audible beep on start-up to know if the Piezo Buzzer is working.

I tested the whole thing and it works like a charm. The nice side effect is, that the buzzer can be used from anywhere in the code for other audible signals via the piezo_on() and piezo_off() functions.

Let's see maybe I can get it to play a song before it takes off :)

 

APM_Config.h:

// Enables the Piezo buzzer code
#define PIEZO                                         ENABLED
// Required if PIEZO is "ENABLED"
#define PIEZO_PIN                                 AN6
// Optional to enable low Voltage alarm
#define PIEZO_LOW_VOLTAGE             ENABLED

system.pde:void init_ardupilot():


        #if PIEZO == 1
          pinMode(PIEZO_PIN,OUTPUT);
          piezo_beep();
        #endif

sensors.pde:
    #if BATTERY_EVENT == 1
        if ( (battery_voltage < LOW_VOLTAGE) || (g.battery_monitoring == 4 && current_total > g.pack_capacity) ) {
                        low_battery_event();
                        #if PIEZO_LOW_VOLTAGE == 1
                        // Only Activate if a battery is connected to avoid alarm on USB only
                        if (battery_voltage1 > 1){
                          piezo_on();
                        }
                        else {
                          piezo_off();
                        }
                         
                        #endif
                }
                else {
                        #if PIEZO_LOW_VOLTAGE == 1
                        piezo_off();
                        #endif
                }      
        #endif

events.pde:
#if PIEZO == 1
void piezo_on()
{
        digitalWrite(PIEZO_PIN,HIGH);
}

void piezo_off()
{
        digitalWrite(PIEZO_PIN,LOW);
}

void piezo_beep()
{
        // Note: This command should not be used in time sensitive loops
        piezo_on();
        delay(100);
        piezo_off();
}
#endif

 

Only one small annoyance. It does beep if the ACM is powered by USB cable only. I am wondering if there is a way to detect the presence of the USB cable plugged in, in code, which would allow me to disable the buzzer in that condition. Any hints would be appreciated.

Have fun !

 

Ollie.

 

 

Read more…