Basic question about cf2 about servo

Firmware/software/electronics/mechanics
Post Reply
Zhang_sai_CN
Beginner
Posts: 2
Joined: Mon May 14, 2018 7:33 am

Basic question about cf2 about servo

Post by Zhang_sai_CN »

Hello everyone,
thank you for visiting this page at first.To be honest, i'm unfamiliar with something like cf2 or other singlechip. To finish a project ,i must realize a function using cf2. The object i want to achieve may not be difficult for experts like u. I have already succeed in flying with cf2 with flow deck. What's more, i would like to add two servos to it and control their movement.several problems are listed as follow:
Q1: Does such requirement only can be fulfilled by adding an bigquad deck and plug the servos into bigquad? Is there another way to achieve this goal such as coding in the firmware to change io and weld the wire of servo on the basic deck? Any detailed example including code is welcomed.
Q2: I can't classify the directory of firmware cause there are so much file in the firmware and i'm too slow to read every file. If i want to generate a pulse at specific frequency and output this pulse to a certain pin, what's my step to code.
Q3: How to use the python lib to control cf2? that is exactly what i want to know currently. pleased describe the detail process of operation or example because i know not much about python.thank you sincerely.
please forgive me for having such stupid questions because i had limited knowledge in this filed. Gratitude to you.
Best regards
Zhang Sai from CN
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Basic question about cf2 about servo

Post by tobias »

I'll do my best to get you up and running but some parts might be a bit difficult without good MCU programming knowledge.

Q1: Just adding the BQD is not enough but with some trweeking it could be used. Or just use a prototype deck and solder wires to the used pins.
You should probably make a deck driver for this and the basics can be found here.

Q2: What kind of pulse do you want? I guess similar to what the motor driver can generate?

Q3: Have a look at the STEM getting started. Is this what you are looking for?
Zhang_sai_CN
Beginner
Posts: 2
Joined: Mon May 14, 2018 7:33 am

Re: Basic question about cf2 about servo

Post by Zhang_sai_CN »

Thanks for replying.
I have got a BQD. Now my question is that how to control two servos through the BQD? do you know anyone have done this job before?
Is there any possibility that i can control servo with python script?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Basic question about cf2 about servo

Post by tobias »

To check if the current motor driver works I have an idea.
  1. Connect a servo to e.g. the motor 1 port. You also need to supply 5V to one pin which is marked with this.
  2. Power up the board using the 5V that was connected. I think now the servo should move to one side.
  3. Connect to the CF2 through the cfclient.
  4. Open the parameter tab.
  5. Find parameter-set "motorPowerSet"
  6. Set the parameter "enable" to 1. This will force manual control of the motor outputs.
  7. Now test different values 0-65535 on parameter "m1". The servo hopefully then moves around
This will verify that the motor driver can be used. Next would be to alter the motor driver to build a servo interface.
Post Reply