5
$\begingroup$

I’m looking to make a drone capable of deploying a parachute, so I need a servo release mechanism.

How can I configure a servo and map it to a switch in Betaflight?

Thanks.

$\endgroup$
6
  • $\begingroup$ This seems like a generic question which should be answered on Beta flight's forum. $\endgroup$ Apr 15, 2020 at 18:33
  • $\begingroup$ @KennSebesta thank you for your input, but part of the point of the beta is to populate the Stack Exchange with questions prior to public release, so any technical questions that can be answered here are, in my opinion, okay. I do agree that another good place would be the Betaflight Forum, but it’s always good to have multiple sources of information:) $\endgroup$ Apr 15, 2020 at 18:36
  • $\begingroup$ I agree with the notion to populate, but not with the subject matter. From the SE email announcing the beta: "The first questions set the tone for the site. If you ask high quality, expert-level questions, you'll build a site that attracts the experts and pros who will make it really successful. But if you ask beginner questions, survey questions, or social-conversation questions, experts and pros will not be interested." $\endgroup$ Apr 15, 2020 at 18:45
  • $\begingroup$ @KennSebesta fair enough, in my opinion this wasn’t a beginner question as it isn’t within the scope of what is usually done in Betaflight, but I appreciate where you’re coming from and I’m happy to agree to disagree $\endgroup$ Apr 15, 2020 at 18:47
  • $\begingroup$ I'd +1 you if SE supported that! This is about voting to establish the direction for the site, not about saying that a question is "good" or "bad". I personally find that this question is overly specific and so it doesn't contribute to the general body of knowledge I'd like to see on SE.Drones. I fully respect that others will see it differently and it's the consensus which wins out. $\endgroup$ Apr 15, 2020 at 18:52

2 Answers 2

12
$\begingroup$

There are multiple ways to enable servos in BetaFlight, but since you need only one servo it is recommended to use SERVO_TILT.


For servo to work you need a free pin on your board and this pin must have timer function.

  • Go to Configuration tab in Betaflight Configurator and enable SERVO_TILT and hit "Save and Reboot" enter image description here

  • Then setup the switch you want to use on your transmitter and in Betaflight. Let's say it was AUX4. Make sure it shows in the Receiver tab and that the signal is received.

  • Then go to the CLI tab and type resource (resource list for older BF) and hit Enter. What you're looking for is resources with MOTOR or PWM function. For example on my board there are 6 MOTOR outputs. I assume you fly 4-motors copter and you also have some spare MOTOR pads.
    You need to remember the MCU pin and MOTOR number and of an output you want to use (C09 and MOTOR 5 for me).
    enter image description here

  • Then you need to type:
    resource MOTOR 5 NONE
    resource SERVO 1 C09
    save
    Use your own MOTOR and MCU pin number instead of 5 and C09!
    This will remap MOTOR5 pad to be able to work with PWM Servos.
    Servos numbering in CLI starts from 1

  • After reboot you can go to the CLI tab and type resource again to make sure everything worked as expected.
    enter image description here

  • Go to the Servos tab in Configurator and hit the checkbox with with your AUX channel on Servo 0 row (AUX4 for me). If you can't see the servos tab check "Enable Expert Mode" on the top right. Save.
    Servo numbering on the Servos page starts from 0. So Servo 1 from CLI tab is Servo 0 here.

enter image description here

  • You can now power on transmitter and enable the live mode on the Servos tab.
  • Go to the Motors tab (remove props if you have LiPo connected!). There are servos output there.
    If you switch the switch you set to AUX channel you should see Servo 1 output to change the value.
    enter image description here enter image description here

  • Now you've remapped MOTOR 5 pad to act as a servo output. You can connect your servo's signal wire to it and find any spare +5V and ground pads for it.

  • If the servo moves automatically as the quadcopter moves check that the CAMSTAB mode is disabled. The screenshot below shows it active, which you won't want if trying to manually control the servo. CAMSTAB enabled


If you don't have any spare MOTOR or PWM pad you can remap LED_STRIP 1 resource if you're not using it for LED. Here's the guide how you can do this: https://youtu.be/jiD6aC0l1VQ

If you need more than 2 servos to control check Sources for how to use Channel Forwarding instead.

Sources:
1: https://github.com/betaflight/betaflight/wiki/Servos-&-SERVO_TILT-for-3.1
2: https://github.com/betaflight/betaflight/wiki/CHANNEL_FORWARDING-for-3.1
3: https://youtu.be/jiD6aC0l1VQ
4: https://youtu.be/cHi1fKP1LRI
5: https://oscarliang.com/betaflight-resource-remapping/

$\endgroup$
5
  • $\begingroup$ This is an excellent and well explained answer, thank you very much! $\endgroup$ Apr 15, 2020 at 17:49
  • $\begingroup$ Nicely done! You put a lot of detail into this! $\endgroup$
    – QuadMcFly
    Apr 15, 2020 at 17:51
  • $\begingroup$ I've just gone through this method and ran into a problem. The servo is moving based on the angle of the quadcopter. E.g. as the quad tilts forward the servo moves. I think my issue was that the CAMSTAB was set to full range under Modes, which enabled it. $\endgroup$ Apr 27, 2020 at 3:41
  • 1
    $\begingroup$ @DanielBallinger thanks for the edit! I didn't know that myself! :) $\endgroup$ Apr 27, 2020 at 7:08
  • $\begingroup$ Thanks for the detailed help. I have a question (i'm not familiar with betaflight): once it is done, how to connect this pin that acts on the servo to the user's app (or other means of piloting the drone)? $\endgroup$ Mar 13, 2022 at 18:31
2
$\begingroup$

What you're looking for is Betaflight servo control. It's a bit tricky because the pad you use to drive the servo signal has to have it's own timer. The LED control function requires a timer, so using the LED pad is typically the most reliable method, but you can check the betaflight resource information to find other pads that have a timer available.

Beyond that you'll need to remap the pin resource via the "resource" command in CLI from whatever function you're stealing it from to a SERVO resource (starting with 1 and moving up if you have additional servos). You'll need a pad with a dedicated timer for each servo, though, so keep that in mind.

Once that is done, enable expert mode in betaflight and go to the Servo tab. There you can assign the servo to the correct transmitter channel.

For a full walkthrough, check out Bardwell's video on servo setup in Betaflight here. For more details, check out the Betaflight Wiki here.

$\endgroup$
1
  • $\begingroup$ Excellent answer, thank you very much! $\endgroup$ Apr 15, 2020 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.