Crazyflie 2 with GPS

Firmware/software/electronics/mechanics
jackemoore
Member
Posts: 75
Joined: Mon Apr 06, 2015 6:47 pm

Re: Crazyflie 2 with GPS

Post by jackemoore » Thu Jul 21, 2016 5:15 pm

Hi,

I made a provisional imu calibration tab in cfclient for the gyro, accelerometer, and magnetometer sensors.
CalibrateTab.jpg
The layout of this tab was for feasibility purposes only, unfinished and coded at the xml level. The function imu9Read() in module imu_cf2.c was modified to setup the log_groups for the sensors and the log_group in compass.c provides the data for displaying the compass calibration factors/parameters.

The sensor values are taken with the crazyflie in a stationary position on a level surface and the mod column is the rss value of the x,y,z components.

Typically, the mod value for the gyro should be within 0.0 and 1.5. If greater than this, it needs re-calibration. The mod value for the accelerometer is typically between 0.98 and 1.02. Outside of this a re-calibration might be in order. For the compass raw values, they typically should be between -500 and +500, and the mod value between 750 and 2250. This assumes the unit of measure is gauss for the magnetic flux density. All of the above ranges are what DJI uses in their flight controllers.

Sensor data provided by the crazyflie is collected in the cfclient using callbacks from the API through QT signal/slots. The amount of logconfig data requested in the calibration tab is bumping against the memory that is currently set aside or available for obtaining log blocks from the crazyflie on port[5].

Best regards,
Jack

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

Re: Crazyflie 2 with GPS

Post by tobias » Mon Jul 25, 2016 9:45 am

That looks really great!

As for the logging getting filled up, it might be possible to trade for precision by using FP16 (16bit floating point).

jackemoore
Member
Posts: 75
Joined: Mon Apr 06, 2015 6:47 pm

Re: Crazyflie 2 with GPS

Post by jackemoore » Sun Sep 18, 2016 3:12 pm

Hi,
Two new branches have been added to the repository http://Github.com/jackemoore/New-GPS-Additions that support the latest updates for the GPS deck drivers, Compass, Compass Calibration, AltHold Mode, PosHold Mode, Attitude Roll, Pitch & Yaw, PC Cflcient FlightTab, GPSTab, GPS OpenStreetMap & XBox-360 Controller.

Branch gtgps-9 (2016.09.17) is for the GlobalTop Titan-2 GNSS receiver with Ceramic Patch Antenna and Branch dkgps-9 (2016.09.18) is for the uBlox Max M8c Pico Breakout GPS receiver with Chip Antenna.

These latest updates are still a work-in-progress development.

Best regards,
Jack

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

Re: Crazyflie 2 with GPS

Post by tobias » Mon Sep 19, 2016 2:36 pm

I think we are soon getting to the point were we could get the kalman filter working with the GPS. What about we slowly try to merge it all in to the main branch though pull request?

Mitteau
Expert
Posts: 175
Joined: Fri Jan 29, 2016 6:00 am

Re: Crazyflie 2 with GPS

Post by Mitteau » Sun Jul 16, 2017 6:23 am

Hello!
I tested the compiled firmware with the option heighthold+kalmann, as mentionned in the wiki. I did not see a real progress compared to the standard filter.
But it seems that I lost stability in the measured data. After a crash, artificial horizon continue to slightly move a little bit. Is it linked to the kalmann? I do not know.
In the version I use (2017-04), without kalmann I think, cf2 has a perfect attitude stability.
Jean-Claude

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

Re: Crazyflie 2 with GPS

Post by arnaud » Mon Jul 17, 2017 12:40 pm

Hi Jean-Claude,
Are you using a GPS in your test with the Kalman filter? Without any extra sensor the Kalman filter will not do much good since it does not use the pressure sensor (yet ...).

Mitteau
Expert
Posts: 175
Joined: Fri Jan 29, 2016 6:00 am

Re: Crazyflie 2 with GPS

Post by Mitteau » Tue Jul 18, 2017 7:59 am

My GPS chip is out of service, so it is not to be considered. My configuration was cf2+buzzer deck+z-ranger deck. I tested with firmware compiled with Kalmann option and without. In case of Kalmann there is a slight and low drift around 0 position after the end of a large motion.
Jean-Claude

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

Re: Crazyflie 2 with GPS

Post by arnaud » Tue Jul 18, 2017 8:41 am

Ok, without position information, the current implementation of the Kalman filter will not correct roll/pitch with other info than the gyro, it explains that you are seeing a wrong roll/pitch after a crash. Also be careful that the Kalman filter does not use the pressure sensor, this means that if you are over the detection range of the ZRanger VL53 sensor (about 1.2M if I remember well the settings), then you loose height tracking completely and the crazyflie height is going to drift.

Mitteau
Expert
Posts: 175
Joined: Fri Jan 29, 2016 6:00 am

[SOLVED] Re: Crazyflie 2 with GPS

Post by Mitteau » Tue Jul 18, 2017 1:39 pm

Clear, thank you.
Jean-Claude

Post Reply