Mikehamer's non-linear controller

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
4rzael
Beginner
Posts: 4
Joined: Fri Apr 21, 2017 1:52 pm

Mikehamer's non-linear controller

Post by 4rzael »

Hello,

I need, for a project I'm working on, to control multiple crazyflies (5), to have them follow given trajectories, etc...

I am currently using ROS with LPS nodes in TDoA mode as tracking systems, but I cannot get a drone to hover with precisions better than +-50cm, and it is even worse when the setpoint moves (naive trajectory implementation).

I saw that mikehamer made a quaternion based controller which seems very great and appropriate to do so.

The problem is that I don't get how to make it work.

* Is the quaternion controller compatible with mgreiff trajectory generation tool ?

* Is the current code (new-controller firmware) compatible with TDoA, and if so, what flags should be used at compile-time

* Is there an example ROS launch (or best, a repository) file I could use in order to have one drone hovering at a given position using this controller ? On the firmware issue about the new controller, this code https://gist.github.com/mikehamer/1d3e7 ... 2804dcdba5 is given, but I don't get what ROS nodes should be run with it.

Thanks for your help
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Mikehamer's non-linear controller

Post by arnaud »

Hi,

You are trying very experimental code. I will try to answer the best I can.

One note first: we found out recently that the PID controller did not have the I coefficient set for Z, setting some value there helps dramatically the height control.

Are you seeing different results with TDoA and TWR?

Now for your questions:

* Yes, for FOSDEM we have used mgrieff trajectory generation tool with Mike's controller.

* As far as I know it should be compatible. For a more recent merge you can look at the code we used for ICRA: https://github.com/bitcraze/crazyflie-f ... /icra-2017

With the compile flags (in config.mk)

Code: Select all

CONTROLLER         ?= new
POWER_DISTRIBUTION ?= cf2
Mike's controller is enabled. Though this branch also contains our demo code but by default it should not be running.

* This code is supposed to run with Mike's fork of the ros driver. I am not aware of a launchfile tha has been publically shared and unfortunatly I do not have it anymore on my computer. The script can be launched instead of the controller script in the ros demo launchfiles.
SlouchyCat
Member
Posts: 30
Joined: Mon Oct 10, 2016 3:56 am

Re: Mikehamer's non-linear controller

Post by SlouchyCat »

Hi 4rzael and arnaud,

I am also interested in making crazyflie hover accurately using ROS with new non-linear controller. Can I just enable the new controller in make file and start the hover launchfile in ROS driver provided here?

https://github.com/bitcraze/lps-ros

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

Re: Mikehamer's non-linear controller

Post by arnaud »

The new controller still requires a fork of the ROS Crazyflie driver, you can find more information in this github ticket message: https://github.com/bitcraze/crazyflie-f ... -273224981
SlouchyCat
Member
Posts: 30
Joined: Mon Oct 10, 2016 3:56 am

Re: Mikehamer's non-linear controller

Post by SlouchyCat »

Thanks Arnaud! It really helps!
Post Reply