Hi,

I had an "accident" with my Ardupilot mega which resulted in the dipswitch getting lost. I have now resoldered the wires so that the dipswitches show the following configuration:

 

test] dipswitches

Hit Enter to exit.
Mix:elevons rev elev:-1, rev ch1:-1, rev ch2:-1

 

Seems like the dipswitches have the following config if I understand it correctly:

 

elevon mixing: on

elevon reverse: reversed

ch1 elevon: reversed

ch2 elevon: normal

 

So I have a few questions:

1. What dipswitch would fit the ardupilot mega? Which dipswitch model is used originally? I probably need to order one and solder it back on to get the dipswitches working. 

2. Can the dipswitch configuration be altered by programming the board? Can I set the dipswitch positions in the Ardupilot code so that I don't have to order and resolder a new dipswitch or just so that I can set the dipswitches in the code while I find and order a new dipswitch?

 

The throttle can be reversed by modifying the following in the APM_Config.h:

 

# define THROTTLE_REVERSE ENABLED

 

Is there a similar function for the dipswitch functions?

 

Best regards,

Kim Halavakoski

 

 

 

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Here are a few pics of the broken IMU and missing dipswitch. I had a friend help me solder the wires in instead of the dipswitch. He soldered them in allright but seems like he did it in "reversed" mode so that now all dipswitches are on by default and hence all channels are reversed and elevon mixing is on. But now with the fix in the code it doesn't matter!

    broken_IMU_1.JPG

    broken_IMU_3.JPG

    broken_IMU_fixed.jpg

  • Got some good advice on the chat from Darren, thanks Darren. 

    The file that needs to be hacked is the control_modes.pde file.

     

    The dipswitch settings are controlled by the following lines:

     

    mix_mode = (PINL & 128) ? 0 : 1;

    if (mix_mode == 0) {

    reverse_roll    = (PINE & 128) ? true : false;

    reverse_pitch   = (PINE & 64) ? true : false;

    reverse_rudder  = (PINL & 64) ? true : false;

    } else {

    reverse_elevons         = (PINE & 128) ? -1 : 1;

    reverse_ch1_elevon      = (PINE & 64) ? -1 : 1;

    reverse_ch2_elevon      = (PINL & 64) ? -1 : 1;

    }

     

    Where the mix_mode = (PINL & 128) ? 0 : 1; sets the elevon mixing dip. Set this to 0 : 1 for no elevon mixing and 1 : 0 for elevon mixing(Elevon mixing is for flying wings and vtails...)

     

    Then set the reverse_roll, reverse_pitch and reverse_rudder lines to your needs. 

     

    Check the settings from the APM cli using the test and dipswitches command which shows the current dipswitch configuration. 

     

     

     

     

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @gclue_akira: 柏の葉で走行させてるjetracerの中身 #instantNeRF #jetracer https://t.co/giVvuE4hP7
Jul 4
DIY Robocars via Twitter
Cool web-based self-driving simulator. Click save when the AI does the right thing https://github.com/pncsoares/self-driving-car
Jul 4
DIY Robocars via Twitter
RT @donkey_car: Human-scale Donkey Car! Hope this makes it to a @diyrobocars race https://www.youtube.com/watch?v=ZMaf031U8jg
Jun 25
DIY Robocars via Twitter
Jun 25
DIY Robocars via Twitter
Jun 16
DIY Robocars via Twitter
RT @GrantEMoe: I won my first @diyrobocars @donkey_car virtual race! Many thanks to @chr1sa @EllerbachMaxime @tawnkramer and everyone who m…
Jun 13
DIY Robocars via Twitter
RT @gclue_akira: JetRacerで自動走行したコースを、InstantNeRFで再構築。データセットは別々に収集 #jetracer #instantNeRT https://t.co/T8zjg3MFyO
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: SPC 3.0 Now the motor also works. This car is doable. I just need to design a deck to mount my compute and sensors. http…
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: My new car SPC 3.0. https://t.co/CKtkZOxeNQ
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: High speed at @diyrobocars thanks @EdwardM26321707 for sharing the video https://t.co/o4317Y2U1S
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: Today at @RAMS_RC_Club for @diyrobocars. Used @emlid RTK GPS and @adafruit @BoschGlobal IMU. Lap time 28s https://t.co/R…
May 28
DIY Robocars via Twitter
May 15
DIY Robocars via Twitter
May 14
DIY Robocars via Twitter
May 13
DIY Robocars via Twitter
RT @f1tenth: Say hi to our newest #F1TENTH creation for @ieee_ras_icra next week in Philly. It’s going to be huge! 😎 🔥 @AutowareFdn @PennEn…
May 13
DIY Robocars via Twitter
May 11
More…