Problems with Assisted modes

Discussions about quadcopters/multi-rotors
kimberly
Bitcraze
Posts: 569
Joined: Fri Jul 06, 2018 11:13 am

Re: Problems with Assisted modes

Post by kimberly »

Could you indicate the actual full log variables you are looking at ? I will try to look at this myself this week if I have time.
cfnewbie
Beginner
Posts: 12
Joined: Wed Jun 17, 2020 8:51 am

Re: Problems with Assisted modes

Post by cfnewbie »

My quad can take off straight up and there is no yaw drifting, just that during mid flight the yaw reading changes with the quad's heading remains the same, thats when the swapping of roll n pitch control happens.
Attachments
Capture.PNG
Capture.PNG (3.58 KiB) Viewed 603 times
kimberly
Bitcraze
Posts: 569
Joined: Fri Jul 06, 2018 11:13 am

Re: Problems with Assisted modes

Post by kimberly »

Hi, my apologies but I would need to check this out next week. Currently I don't have access to the LPS system since I'm working from home. But bear in mind that I will only be able to test this out on a crazyflie since I don't have the same quad setup as you, so it might be hard to figure out exactly what is going on.

Do you have a picture of your quad, with a close up how the placement of the lps deck is done? Also make it face the positive x directly, (this can be checked by the lps tab or the stateestimate.x/y/z log plotter.
cfnewbie
Beginner
Posts: 12
Joined: Wed Jun 17, 2020 8:51 am

Re: Problems with Assisted modes

Post by cfnewbie »

May i know if there is yaw PID for position mode? Want to try to tune the value to see if it helps my current situation.
Attachments
Image1.png
kimberly
Bitcraze
Posts: 569
Joined: Fri Jul 06, 2018 11:13 am

Re: Problems with Assisted modes

Post by kimberly »

So I was able to test it out with a crazyflie 2.1 with a flowdeck and LPS deck in TDOA3. I tried two assist modes
  • Poshold, the pitch and roll have a different meaning here. Pitch forward and backward are positive and negative x-direction in the global world coordinate. Same goes for roll and the y-direction. If the drone turns 90 degrees, you get the sensation that this flips, which is indeed the correct behavior. Ofcourse if the heading estimate diverges, than the crazyflie has ofcourse a different perspective of what direction the x and y direction is in world coordinates than you have. This would not happen with a mocap system or with the lighthouse position system, since they have a yaw estimated integrated as well.
  • hover: here the pitch and roll commands from your joystick are translated in velocity commands in body fixed coordinates, so this is not affected at all by the yaw estimate. But maybe this is something you would rather want to use then, since it is a bit more natural for controlling the quad? I liked this mode a lot more
Just about a command you had earlier: The yaw target is done for deg/s, so it does not aim to get it back to 0 deg but to 0 deg/s which is any angle as long as the turning velocity is zero. Ofcourse, if the estimate is not that great it will drift (which is accelerated when you turn the quad a lot). This is then a yaw estimate purely estimated by the gyroscopes rotation rate integrated to absolute angle (since you are not using mocap or lighthouse positioning(, and this is not estimated by the magnetometer (this works poorly indoors).

You would need to study how the gyroscope and the state estimate behaves, since the state filter might need some updating for your quad, for which the plotter tab is much more handier for you then the flighttab visualization. Here is the cfclient api guide: https://www.bitcraze.io/documentation/r ... de_client/

About your last question, yes there is a PID for yaw and you can find it in this file in the firmware: https://github.com/bitcraze/crazyflie-f ... ntroller.c. The values can be adjusted in the parameter tab in cfclient (pid_attitude and pid_rate), but remember that the estimator also has something to do with the whole stabilization loop, which can be found here (kalman.mnGyro_yaw). See documentation for the stabilizer module (sensors to motors) here.
cfnewbie
Beginner
Posts: 12
Joined: Wed Jun 17, 2020 8:51 am

Re: Problems with Assisted modes

Post by cfnewbie »

Thanks Kimberly! After changing the yaw estimate the problem was solved.

By the way, as my quad fly past 1.5m in height, its vibration increases as height increases further slowly. The quad is still able to hold its position well. does this have something to do with attitude PID?
kimberly
Bitcraze
Posts: 569
Joined: Fri Jul 06, 2018 11:13 am

Re: Problems with Assisted modes

Post by kimberly »

I actually think it is the flowdeck, which right now is a bit over represented in the kalmanfilter. If it does not detect any motion it has the tendency to wobble.

Please keep an eye on this issue: https://github.com/bitcraze/crazyflie-f ... issues/608. Improvements are coming in soon.
cfnewbie
Beginner
Posts: 12
Joined: Wed Jun 17, 2020 8:51 am

Re: Problems with Assisted modes

Post by cfnewbie »

When flying in PosHold mode, if i hold the joystick at maximum pitch for a period of time, the drone will move forward at a steady pace at first, then follows by an uncontrollable pitch forward overshoot motion and the drone wont stop even after i released the stick. Is this behavior normal?
kimberly
Bitcraze
Posts: 569
Joined: Fri Jul 06, 2018 11:13 am

Re: Problems with Assisted modes

Post by kimberly »

No that is not normal. Is this with the Flowdeck? There have been improvements implemented in that issue that I mentioned, so you can try out that.
cfnewbie
Beginner
Posts: 12
Joined: Wed Jun 17, 2020 8:51 am

Re: Problems with Assisted modes

Post by cfnewbie »

Thanks Kimberly, tried the new flowdeck update, all problems solved!!
Post Reply