-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Servo support #1340
Servo support #1340
Conversation
Wwu/add servo patch
Move Param and callback declaration Add angle capping and center around 0
Fix servo param group bug
Made Servo a driver and fixed its AF mapping.
Builds on top of what was shared in this discussion: https://github.com/orgs/bitcraze/discussions/1005 |
Hi! That's a great feature! We will need to find some time to review this and the coming weeks are a bit busy for us. Hopefully we will get to it soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks and very good contribution. I like that it has the same structure as the motor driver and that it is separated.
hi @matejkarasek, we'd like to test this out before merging so we need to find a bit of time somewhere, hopefully in the next few weeks |
Thanks, yes, that makes sense! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it with a servo with a crazyflie+breakout deck). I'm not sure if it is going correctly, since when I set an angle higher or lower than idle, it seem to not set to go to that position but keeps rotating. It is supposed to do that, or was it supposed to just go to an angle and stay there? Probably I'll need to adjust the other parameters but it is difficult to get the meaning of them.
The servo is supposed to go to the angle that you specify. How did you connect it? I now have a CF2.1 with a prototyping deck, and connected + to VCOM, - to GND and signal to PA2/TX2 and this works fine. My cf2_defconfig is:
The default settings should work for most standard servos, I will add the description for the params, sorry, forgot to do that... |
I know what went wrong. I had a servo that was configured for rate control, so that is why it didn't work as expected. I now tried a different one and it worked like a charm! So if you could add the doc to the parameters and change the initialization parameter to the deck group then it would be ready to merge |
Ah ok, well this assumes servo in position mode :) All the requested changes should be in the latest commit |
It includes all the important changes so I'll go ahead and merge it. Thanks @matejkarasek ! |
If you'd like, you can make a small mention in the show&tell in discussion to notify people on this feature :) https://github.com/orgs/bitcraze/discussions/categories/show-and-tell |
Awesome, thanks! Will post it there |
The functionality is described here: https://github.com/orgs/bitcraze/discussions/1208 |
This PR adds support for a single extra servo (on top of the existing 4 motors/actuators used in the power distribution).
Its position is controlled via parameter "servo.servoAngle".
It is implemented as a deck, which can be forced in the defconfig as:
The servo is meant to be powered from VCOM on the Crazyflie/Crazyflie Bolt (mind the current limitations) or by an external 5V supply, e.g. from an ESC when using the CrazyflieBigQuad deck.
The default signal pin is TX2, but can also be configured to RX2, IO1, IO2, IO3 or MOSI via following config:
The servo signal wire can be connected directly, or via the BigQuad deck (where servo compatible connectors are already available)