Getting Crazyflie 2.1 to work out of the box

Discussions about quadcopters/multi-rotors
sean112
Beginner
Posts: 16
Joined: Thu Nov 14, 2019 1:51 am

Getting Crazyflie 2.1 to work out of the box

Post by sean112 »

Hello all,

Just got my Crazyflie 2.1 with multi-range deck and flow deck. I have assembled everything and the two decks. I have also ran the update_all_project.sh from the VM.

I tried to fly it around with the multirange_push.py, it seems to drift. I have then realized I have not updated the firmware. After I updated the firmware with cfclient to 2021 June version I think, I tried to run multirange_push.py again and it cannot take off. I tried to adjust the battery to balance the weight.

The little debugging I did afterwards is tried to check the cfclient. The state estimation of crazyflie is blowing up when resting on the ground. Either X,Y, or Z escapes to 100 and EKF supervisor resets the states. I am assuming since Z is always increasing (as it is resting on the ground), PID does not realize that the drone is not taking off.

I am wondering is there any steps that I have missed? And I guess what steps should I take to make it more stable.

Here are the assembled crazyflie in the attachment.

Sincerely,
Sean
Attachments
Image from iOS (7).jpg
Image from iOS (8).jpg
kristoffer
Bitcraze
Posts: 629
Joined: Tue Jun 30, 2015 7:47 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by kristoffer »

Hi, sorry to hear you have run into some issues!

Sounds like there might be a problem with the Flow deck.
Could you please post a dump of the console tab in the python client, after booting the CF and connecting to the client.
sean112
Beginner
Posts: 16
Joined: Thu Nov 14, 2019 1:51 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by sean112 »

Here are the console output:

Code: Select all

ESTKALMAN: State out of bounds, resetting
SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
SYS: Production release 2021.06
SYS: I am 0x383535303539470900210036 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_CORE: 2 deck(s) found
DECK_CORE: Calling INIT on driver bcFlow2 for deck 0
ZR2: Z-down sensor [OK]
PMW: Motion chip id: 0x49:0xB6
DECK_CORE: Calling INIT on driver bcMultiranger for deck 1
IMU: BMI088: Using I2C interface.
IMU: BMI088 Gyro connection [OK].
IMU: BMI088 Accel connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
SYS: About to run tests in system.c.
EEPROM: I2C connection [OK].
STORAGE: Storage check [OK].
IMU: BMI088 gyro self-test [OK]
DECK_CORE: Deck 0 test [OK].
MR: Init front sensor [OK]
MR: Init back sensor [OK]
MR: Init up sensor [OK]
MR: Init left sensor [OK]
MR: Init right sensor [OK]
DECK_CORE: Deck 1 test [OK].
SYS: Self test passed!
STAB: Wait for sensor calibration...
SYS: Free heap: 16360 bytes
STAB: Ready to fly.
When I turned it on today it actually seems pretty stable, yaw is drifting slightly. I then played around with it (handheld) and it went out of bound again. Rebooting does seem to solve the problem this time, CF is still stable while I am writing this post. Yesterday rebooting did not solve this problem.

Edit:
Since it was somewhat stable I tried to take off using cfclient, it seems pretty stable for 5 seconds and slowly starts to lower to the ground. When it touches the ground it immediately starts to rise around 2.5m, that's when I hit land on cfclient and catches it. Now CF's state estimate values are not stable again, and rebooting does not seem to fix the issue.
kimberly
Bitcraze
Posts: 1034
Joined: Fri Jul 06, 2018 11:13 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by kimberly »

Hi!

The console output shows that the deck is correctly detected at startup. Are you sure that its flying over a textured, non black and reflective surface?

So with the behavior that you mentioned and the fact that it loses height, might be that the deck loses connection with the crazyflie midair. Your pictures do show that the decks assembled the right way, but perhaps a way that you can check this, is to use the plotter tab and check if the crazyflie stops getting measurements of motion.deltax/y mid air if you control the crazyflie with an controller if you have one.

You could also double check if the multiranger is working in combination with the flowdeck as they are using the same i2c port. The plotter value is called range.(direction)
sean112
Beginner
Posts: 16
Joined: Thu Nov 14, 2019 1:51 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by sean112 »

Happy New Year!

I am back from the New Year break. I was not able to log data since the state estimation is not stable sitting on the ground.

On another crazyflie I got my hand on, I was able to run the push demo successfully. The take off was very stable. Then I tried to follow this tutorial (https://www.bitcraze.io/documentation/r ... ing/build/) to familiar myself with developing on cf2. And for some reason firmware on master branch was not building correctly, so I checked out the latest release (tag/2021.06). make was clean, and I ran make cload. Now the cf2 state estimation is not stable sitting on the ground again. I am wondering if flashing the 2021.06 release was what caused this stability issue? My previous cf2 was pretty stable before I tried to update the firmware. Or maybe I am missing some steps after flashing the new release?

Edit: When I use Complementary estimator, the state estimation seems pretty stable, but KF is not stable. Through cfclient, I tried to look at the z-ranger reading is constant (sometimes 20mm, sometimes 0 mm). And deltaX and deltaY seems to be accurate. Actually, all the logging variable under range seems to be constant with different values (up gives a reading of 2200 mm). Thus, I performed an experiment where I covered the top range sensor during boot up, and the reading for that sensor changes to 0. The reading did not change when I remove my hand. It seems like the range readings only happens during boot up, but does not get updated.

Sincerely,
Sean
kimberly
Bitcraze
Posts: 1034
Joined: Fri Jul 06, 2018 11:13 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by kimberly »

Hi!

Hmmm this seems indeed a bit weird... So let's try to investigate further!
  • The other Crazyflie you used, was it's firmware updated or if not, could you see in the console which firmware that was?
  • Did you use the same flowdeck that wasn't working before on the other crazyflie as well?
What you could also do, is to connect to the Crazyflie and copy the content of the cfclient's 'help'>'about'>'debug' tab, then we should also have all the information about your system as well.
sean112
Beginner
Posts: 16
Joined: Thu Nov 14, 2019 1:51 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by sean112 »

This is the debug information:

Code: Select all

Cfclient
Cfclient version: 2021.6.1.post32+33058df
System: linux
Python: 3.7.10
Qt: 5.15.2
PyQt: 5.15.6

Interface status
radio: Crazyradio version 0.53
UsbCdc: No information available
udp: None
prrt: No information available

Input readers
linuxjsdev (0 devices connected)

Input devices
None

Crazyflie
Connected: radio://0/80/2M
Firmware: 2c81a405e2a (MODIFIED)

Decks found
bcFlow2: rev=A, adr=0D1D528E000000F3
bcMultiranger: rev=E, adr=0D496B8E00000076

Sensors found
AK8963: 0
LPS25H: 0
BMP388: 1

Sensors tests
MPU6500: 0
AK8963: 0
LPS25H: 0
I cloned crazyflie-firmware and make cload to flash the new crazyflie. I modified firmware to change the LED light as documented here: https://www.bitcraze.io/documentation/t ... velopment/

I am not using the same flow deck as before. With this current flow deck I was able to stabilize well, until I flashed the firmware (without the LED light modification) above.
kimberly
Bitcraze
Posts: 1034
Joined: Fri Jul 06, 2018 11:13 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by kimberly »

Ah great, thanks for the information!

Just to make sure everything is going correctly, I advise you to install according to these instructions throught the cfclient. Then we know for sure that everything is good and fresh.

Also I see that the crazyflie has both the multiranger and the flowdeck. We have heard of problems with that before, so could you try to see if the crazyflie flies with the flowdeck alone (no multiranger), with the latest release 2021.06? You can probably try out the command based flight control panel on the flightcontrol tab for that (#6 here.

And one last question as I couldn't see that yet from the debug information, which version of Ubuntu are you using? 20.04 or 18.04 ?
sean112
Beginner
Posts: 16
Joined: Thu Nov 14, 2019 1:51 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by sean112 »

Ok, just did a firmware update using the cfclient (2021.06 using 18.04) after I took off the multiranger. Using the cfclient commands, I was able to take off, and fly. The state estimation seems reasonable. So I guess it might be the issue that both multiranger and flowdeck are present on the cf, though I was able to get it working previously with the exact same hardware.

Is there any solution to use both deck at this moment?
kimberly
Bitcraze
Posts: 1034
Joined: Fri Jul 06, 2018 11:13 am

Re: Getting Crazyflie 2.1 to work out of the box

Post by kimberly »

I'm not exactly sure, but there have been some reports of weird building issues with using 18.04 and using 'make all' which we are still trying to figure out. Since the firmware upgrade through the cfclient has not been build on your machine, as it was already prebuild, there are perhaps no problems there.

I need to discuss internally as these issues with gcc compilers are not really my expertise :) , so I'll come back to you. In the mean time, could you verify if the multiranger and flowdeck combo works with the prebuild release firmware upgrade from the cfclient?
Post Reply