Servo deck - an easy way to add a servo to your Crazyflie #1208
Replies: 3 comments 4 replies
-
Awesome! thanks for sharing this in the community 😄 |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the hard work! So excited that this is now officially a feature. |
Beta Was this translation helpful? Give feedback.
-
Hello @matejkarasek Thank you for sharing this. Where and How can I set the desired angle? I was thinking that I can integrate in the controller_pid.c by including servo.h. Then, call the servoInit() in controllerPidInit(), call servoTest() to controllerPidTest() and use the function servoSetAngle() in the controllerPid()? Could you guide me so that I can add it the Flapper drone? |
Beta Was this translation helpful? Give feedback.
-
Servo deck
Many people (including us) would like to add a servo to their Crazyflies (or Flappers...) e.g. for a gripper. Based on several discussions here (#1005, #729, ...), we recently implemented a "servo_deck" (bitcraze/crazyflie-firmware#1340), which allows to connect a single servo to your Crazyflie and control the servo's position via the parameters' framework.
It is not a hardware deck, but rather a driver, so you may need to do some soldering in combination with the prototyping or breakout decks, or use the BigQuad deck. Still, this should make integration of servos much easier.
In any case, this deck is experimental and you should be aware that you may damage your Crazyflie, so please proceed with caution and only if you know what you are doing.
How do I enable the deck?
To enable this functionality, you have to force "bcServo" by adding the following lines in your defconfig:
If you need to force multiple decks, just separate them by a colon, e.g.
CONFIG_DECK_FORCE="bcServo:bcUSD"
Where do I connect the servo?
By default, the deck assumes the servo signal is connected to TX2/PA2. You can also change the mapping to a different pin to avoid conflicts with other decks you may also like to use.
The available options are TX2 (default), IO2, IO3, RX2, MOSI and IO1 (this last option only works on Bolt 1.1).
To use a non default pin, add an extra line in the defconfig, e.g.:
To power the servo, on the standard Crazyflie 2.1 you can use the VCOM and GND, this will power the servo directly from your battery (max 4.2 V). This also works on the Bolt, where VCOM is 5V when powered by 2S or higher-voltage battery, just pay attention that VCOM current is then limited to 400mA (which could be reached easily when the servo is stalled…).
You can use the expansion or prototyping decks and solder the servo wires to it.
Another option is to use the BigQuad deck where servo-compatible connectors are already installed (M1 -> TX2, M2 -> IO3, M3 -> IO2, M4 -> RX2, or even CPPM -> MOSI) and you just need to provide power to the deck. In this case, you may need to disable the OW memory of the Big Quad deck such that the Big Quad deck driver is not initiated or adjust the firmware to only force the Servo deck driver.
Servo in power distribution
This PR is meant for "addons" and so it is not meant to be used in the power distribution. If you need a servo that will be used for attitude control, please check the flapper platform for inspiration: bitcraze/crazyflie-firmware#1132
Beta Was this translation helpful? Give feedback.
All reactions