[ANSWERED] speed control of individual motors

Post here to get support
Post Reply
johnny
Beginner
Posts: 12
Joined: Sat May 13, 2017 10:10 pm

[ANSWERED] speed control of individual motors

Post by johnny »

Hi,

I am interested in developing control algorithms for the crazyflie 2.0. I want to see whether it is possible to control the speed of each motor individually or is it only possible to send roll,pitch,yaw angles as commands? I am looking to work on the low level control of the software. Also, how do you send commands? Through wifi from a laptop running ROS in Ubuntu?

Thank you,
John
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: speed control of individual motors

Post by arnaud »

Hi,

The motor control is currently implemented in a module called 'power_distribution', it runs from the stabilization loop: https://github.com/bitcraze/crazyflie-f ... zer.c#L129

There is a debug mode to control individual motor using the param subsystem, though this is intended for debug and diagnostic purpose (for example there is an implementation of propeller vibration test using these params): https://github.com/bitcraze/crazyflie-f ... #L102-L108. Currently the only implemented setpoint packets contains attitude rate at the lowest level (ie. roll/pitch/yaw rate).

The communication to Crazyflie is using either Bluetooth LE or a 2.4GHz custom radio link. Bluetooth LE has too much latency and too little bandwidth for research work but the 2.4GHz radio link is quite capable, on computer we have the Crazyradio dongle to communicate with Crazyflie. We use a protocol on to of the radio we called CRTP: https://wiki.bitcraze.io/doc:crazyflie:crtp:index

The radio link has a quite low latency, about 1 to 2ms, however it would be a challenge to implement a stable very low level algorithm (ie. for attitude rate) off-board. It has been attempted before but I do not know of any success in achieving stable flight this way. I would suggest to implement the control algorithm onboard, for doing so you will have to create a new controller file that implements the stateController function: https://github.com/bitcraze/crazyflie-f ... zer.c#L128. See this blog post for some info on how the stabilizer loop is implemented: https://www.bitcraze.io/2016/05/positio ... -firmware/.
johnny
Beginner
Posts: 12
Joined: Sat May 13, 2017 10:10 pm

Re: speed control of individual motors

Post by johnny »

Hi,

Thank you for your excellent reply.

I think I will end up sending high-level control commands, as you mentioned roll,pitch, etc.

Will it be possible to attach vicon markers on the crazyflie though to estimate its pose from a vicon motion capture system? I am not sure if it is possible because its payload is only 15 grams and may not even lift from the floor.

john
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: speed control of individual motors

Post by arnaud »

For anyone passing-by, the Vicon marker discussion continues in your other thread: viewtopic.php?f=3&t=2437&p=12323#p12323
johnny
Beginner
Posts: 12
Joined: Sat May 13, 2017 10:10 pm

Re: speed control of individual motors

Post by johnny »

Dear arnaud,

Thank you. Could you please let me know about the frame that I am talking on my latest post? It is very critical as I need to decide today if I will proceed with purchasing or not.

john
Post Reply