Page 1 of 1

Controlling a single motor

Posted: Wed Jun 14, 2017 10:49 am
by f-rower
Hello, I am very new to the development of the Crazyflie 2.0 quadcopter, and I am having a hard time understanding the code structure, as my background is more oriented towards engineering:

I need to be able to control a single motor from my pc to keep it at a desired number of rpm (none of the motors in particular), and was wondering what files I should modify to achieve this. I want to avoid the use of a joystick, as my current goal is not flying the quadcopter, and this would not allow for precise rpm control. I am using the Bitcraze VM for development.

Thanks very much in advance,

f

Re: Controlling a single motor

Posted: Thu Jun 15, 2017 8:23 am
by tobias
In the somewhat resent firmware release there are some parameters where you can hard set the PWM value to the motors. So from the cfclient you can go into the parameters tab and set e.g. the motorPowerSet->m1 value to e.g. 3000 to make it spinn when enable is set to 1.

Re: Controlling a single motor

Posted: Thu Jun 15, 2017 3:12 pm
by f-rower
That's great, thank you very much!

However, I was hoping on developing some code where a sequence of pwm values are automatically sent to the motor, without me having to go into the cfclient and changing them by hand. Any help with this?

Thanks very much,

f

Re: Controlling a single motor

Posted: Tue Jun 20, 2017 8:43 am
by arnaud
You can look at the Crazyflie lib example, you can write a python program that sets parameters: https://github.com/bitcraze/crazyflie-l ... am.py#L125