Mellinger references

Discussions about quadcopters/multi-rotors
Post Reply
fede_tiberti
Beginner
Posts: 13
Joined: Tue Apr 13, 2021 9:09 am

Mellinger references

Post by fede_tiberti »

Hi, I was using the Mellinger controller and I notice that with the command "send_zdistance_setpoint(0, 0, 0, 1)" of the commander class, the crazyflie has a rotation around z (yaw-rate different from 0).

How is this possible?
Has the Mellinger a different reference for the yaw-rate?

I have only the flow deck v2 for the position.
Moreover, I notice also that with the positionHlCommander class this effect disappears. I cannot use it, because I need a command to hold the crazyflie at a certain height (hover).
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Mellinger references

Post by kristoffer »

Hi!

Would it be possible for you to write some simple python code that reproduces this problem? It would help to understand what is going on

br
Kristoffer
fede_tiberti
Beginner
Posts: 13
Joined: Tue Apr 13, 2021 9:09 am

Re: Mellinger references

Post by fede_tiberti »

Of course:

Code: Select all

with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf:
        crazyf = scf.cf
        crazyf.param.set_value('stabilizer.controller', '2')
        cf_M = position_hl_commander.PositionHlCommander(crazyf, controller=2)
        h_in = 1.3
        cf_M.take_off(h_in)
        for i in range(10):
             crazyf.commander.send_zdistance_setpoint(0, 0, 0, h_in)
             time.sleep(0.1)
        cf_M.land(h_in)
The effect is in the for loop.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Mellinger references

Post by kristoffer »

Mixing the high level commander and other set points is not recommended. The idea is that the high level commander produces the set points based on some trajectory and that it should enable the user to focus on the trajectory instead of set points. I think your set points will compete with the set points from the high level commander which might cause unexpected results.

Anyway, a cleaner example would be

Code: Select all

    with SyncCrazyflie(uri, cf=Crazyflie(rw_cache='./cache')) as scf:
        crazyf = scf.cf
        # crazyf.param.set_value('stabilizer.controller', '1')
        crazyf.param.set_value('stabilizer.controller', '2')
        height = 0.3

        # Take off and fly
        for i in range(40):
            crazyf.commander.send_zdistance_setpoint(0, 0, 0, height)
            time.sleep(0.1)

        # land
        for i in range(5):
            crazyf.commander.send_zdistance_setpoint(0, 0, 0, 0.0)
            time.sleep(0.1)
I can confirm that I see the same problem, there is a yaw when using the Mellinger. Looks like a bug to me, reported in https://github.com/bitcraze/crazyflie-f ... issues/789
Post Reply