Sensor Calibration

Discussions and questions about the Crazyflie Nano Quadcopter
AAtef92
Beginner
Posts: 8
Joined: Wed Dec 05, 2018 6:12 pm

Sensor Calibration

Post by AAtef92 » Tue Jan 22, 2019 11:04 am

Hello Everyone,

Starting the crazyflie on a flat surface gives wrong reading for the actual values of Roll/Pitch/yaw values.

Roll: ranging from -0.2 to -0.7
Pitch: ranging from 0.5 to -0.5
Yaw: ranging from 0 to -0.02

Those are the actual readings without the crazyflie even leaves the ground yet, these of course leads to heavy drifting while only using thrust.
any suggestions?

Update:

I added graphs for the pitch/roll/yaw in 3 minutes of time while the drone is in complete stationary. As you guys can see there is an increase in angles with no clear reason especially in "roll" angles.
pitch_roll_yaw.jpg
For the position using LPS with 8 anchors, it looks fine. I have a standard deviation of 0.0079, 0.0067,0.0099 for X,Y,Z respectively
position.jpg
What do you guys think?

Thank you!
Last edited by AAtef92 on Thu Jan 24, 2019 9:37 am, edited 1 time in total.



tobias
Bitcraze
Posts: 1916
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Sensor Calibration

Post by tobias » Tue Jan 22, 2019 2:58 pm

It is hard to make it drift little without using some external stabilizer such as the flow deck. How stable to you hope to get it? Minimizing vibrations is something that helps.

AAtef92
Beginner
Posts: 8
Joined: Wed Dec 05, 2018 6:12 pm

Re: Sensor Calibration

Post by AAtef92 » Tue Jan 22, 2019 3:22 pm

Thanks for your reply, i am using loco positioning system with 8 anchors, TDoA 2 mode.
issuing it python commands to hover or go up a certain height is not working as intended if at all. The drone goes up and drift badly in a random direction.
It bashed the wall a lot, but nothing broken, could that affect the crazy readings i am getting for the sensors?
I also checked the propellers or balance and starting the drone facing x-axis.

tobias
Bitcraze
Posts: 1916
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Sensor Calibration

Post by tobias » Wed Jan 23, 2019 8:30 am

If you are using the LPS it should not drift away. To me it sounds like it does not get any position lock. How does the position look like in the Loco tab in the cflient? This behavior could also happen if a joystick is used which doesn't output 0 since velocity mode is used to control with a joystick.

AAtef92
Beginner
Posts: 8
Joined: Wed Dec 05, 2018 6:12 pm

Re: Sensor Calibration

Post by AAtef92 » Wed Jan 23, 2019 9:19 am

1- the position is correct in the loco tab when it is stationary and even when i move the drone by hand to verify the tracking.
2- drifting occurs when I use the xbox controller or when i use the python script, but it worth noting that it often get stuck at "wait_for_position_estimator" function from the "autonomousSequence.py".

so my question is, is it the reason of the fluctuating readings from the gyro? or it can be noise in the room, that the drone cant calculate a precise location? what do you suggest?

Thanks!

tobias
Bitcraze
Posts: 1916
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Sensor Calibration

Post by tobias » Wed Jan 23, 2019 1:47 pm

The fluctuating values can be expected because of the noise from the positioning, the question is how much. Have you tried flying manually without the LPS, just to check that there is no problem with the CF2. It could also be some miss-configuration of the LPS, the wait_for_position_estimator hints that.

AAtef92
Beginner
Posts: 8
Joined: Wed Dec 05, 2018 6:12 pm

Re: Sensor Calibration

Post by AAtef92 » Wed Jan 23, 2019 1:57 pm

yes I tried, and without LPS it is even more bad.
I made sure that propellers are balanced and battery is tucked tight.
1- Can it be unbalanced motors?
2- how LPS can be miss-configured if I get approximate correct location on cf-client?
3- you mentioned controlling it with joystick may cause errors with velocity mode, can I change the mode from cf-client?

Thanks

tobias
Bitcraze
Posts: 1916
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Sensor Calibration

Post by tobias » Thu Jan 24, 2019 12:32 pm

The drift you see is small and comparing it to a CF2 I have here it looks normal. I'm leaning towards that it is something with the scripts or that the joystick is none zero. What script have you tried?

1. Unbalanced motors will make it a bit more "nervous" when flying with the LPS but it should not make it drift away. In the cflient console tab there is a "propeller test" button. Try this to check the state of propellers/motors.
2. If the e.g. the anchor positions are set wrong the position can behave strange.
3. The joystick can currently only control the CF2 with velocity mode. With scripts it is a different thing though, Have you tried this script?

AAtef92
Beginner
Posts: 8
Joined: Wed Dec 05, 2018 6:12 pm

Re: Sensor Calibration

Post by AAtef92 » Fri Jan 25, 2019 3:04 pm

1- I tried "autonomousSequence.py" and "motion_commander_demo.py" and both lead to painful wall crashing :/
2- I reflashed the anchors and verified their locations, everything is fine except "z" reading is kinda off, as the position is esimated "0.3" above ground while it is stationary on the ground, so I am working on further calibrating it.
3- yeah i tried it and the copter drifted and hit the wall.

tobias
Bitcraze
Posts: 1916
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Sensor Calibration

Post by tobias » Mon Jan 28, 2019 1:54 pm

hmmm, tough one...and you are sure you have the CF2 pointing in the LPS positive X direction when you power it on?

You said it is drifting when you fly the CF2 manually (without loco deck), are you able to control it at all? Could you post the cfclient console output after connecting to the CF2 with the loco deck. Maybe that can tell us something.

Post Reply