Modifying Fly By Wire B for Custom Function

Hi All,

Currently I don't use the FBW B mode on my aircraft, and I wanted to modify it for a custom function.  Specifically, I want to make a doublet command, so that when I throw the switch into FBW B, it will do a quick succession of predetermined control-surface movements, and then go back into manual control.

At this stage, I've tried adding some code to move the rudder servo below Arduplane.pde line 1062 (case FLY_BY_WIRE_B), and likewise below line 1102 (case MANUAL) to see if I can just get different modes to toggle the servo, but it doesn't seem to do anything.

Could someone point me in the right direction here?  Perhaps there's some detailed code documentation that I could look at.  Alternately, if there's a simpler solution, suggestions would be appreciated.

Thanks,

- Lewis

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

Join diydrones

Email me when people reply –

Replies

  • Hey, I'm taking a look at where you talk about using the APM_RC.InputCh(CH_x) method to get radio input.  What's the difference between that and g.channel_xxxx.radio_in?  Do they produce the same integer value that can be fed to the outputs?

  • What code are you substituting in place of the normal FLY_BY_WIRE_B code to toggle the servo?

  • I've now determined that custom_mode exists in the code.  Perhaps I need to take advantage of this feature to implement my custom code without overwriting FBW_B.  Can anyone give advise on how to do this?

    Thanks!

  • Well, I've gone through ArduPlane.pde (now changed to ArduPlane.ino by the latest version of Arduino...) and I've managed to figure out that the update_current_flight_mode() function doesn't change the operation of the servos, even if it's disabled completely (by commenting out line 741).  But seeing as this function is described as "custom code/exceptions for flight modes", I'm really not sure why.  Do I have to activate it somehow in APM_Config.h?

    For now, I'm going to delve into the other functions called in ArduPlane.ino and see if I can manually control the servos in there.

This reply was deleted.

Activity

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
DIY Robocars via Twitter
May 8
DIY Robocars via Twitter
RT @SmallpixelCar: Noticed my car zigzagged in last run. It turned out to be the grass stuck in the wheel and made the odometry less accura…
May 8
More…