Hi all!
Long story short, I'm trying to control a servo (standard 9g) with the crazyflie, specifically moving it into certain positions once it reaches a specified altitude, and I'm wondering how I'd go about outputting the PWM signal from the crazyflie? I know the basic theory behind PWM signals and how they're suppose to work, but my googling hasn't yielded much about how to output the signal using python (or how to on a crazyflie for that matter!).
Thanks, I appreciate any help!
Controlling a servo/Outputting a PWM signal on the CF2
-
- Beginner
- Posts: 1
- Joined: Fri Nov 21, 2014 7:51 pm
Re: Controlling a servo/Outputting a PWM signal on the CF2
Hi and welcome!
Things aren't as neat as it should yet but you can have a look at the buzzer example and code. It outputs PWM signal on the expansion part for the sound. Should be to hard to use as a base for a servo output.
Things aren't as neat as it should yet but you can have a look at the buzzer example and code. It outputs PWM signal on the expansion part for the sound. Should be to hard to use as a base for a servo output.
-
- Member
- Posts: 45
- Joined: Mon Jan 13, 2014 4:12 am
Re: Controlling a servo/Outputting a PWM signal on the CF2
Hi,
I would like to know if you have any progress.
I tried adding another motor to the set of motors, using TX2, but the servo does not move so much. Seems the frequency of the PWM that is used to control the thrust uses different frequency (328 kHz) as the normal servo (50 Hz, I guess).
I would like to know if you have any progress.
I tried adding another motor to the set of motors, using TX2, but the servo does not move so much. Seems the frequency of the PWM that is used to control the thrust uses different frequency (328 kHz) as the normal servo (50 Hz, I guess).
Re: Controlling a servo/Outputting a PWM signal on the CF2
I would recommend using this tutorial for your code
http://stm32f4-discovery.com/2014/05/st ... -tutorial/
It shows you how to use the timers and set up the PWM signal at a specific frequency and send out a signal of required pulse width
Regards
Vivek
http://stm32f4-discovery.com/2014/05/st ... -tutorial/
It shows you how to use the timers and set up the PWM signal at a specific frequency and send out a signal of required pulse width
Regards
Vivek
-
- Member
- Posts: 45
- Joined: Mon Jan 13, 2014 4:12 am
Re: Controlling a servo/Outputting a PWM signal on the CF2
I finally figured it out that the BRUSHLESS mode works the same as the signal for servo motor, so I just created another motor in BRUSHLESS mode and use this to control the servo.