Page 1 of 1

[Solved] Z-coordinate issues

Posted: Wed Jul 25, 2018 3:42 pm
by snyderthorst
Hello,

I am trying to get the CF to take off on its own (without any commands from a computer). I have implemented code that will send setpoints to the commander based on a timer, but the CF doesn't take off because it seems to think that it is at 2.6 meters when it sits on the ground at 0 meters (z coordinate). I am using the latest version of the LPS node firmware and CF firmware and am using TDoA mode for position finding.

Re: Z-coordinate issues

Posted: Tue Aug 21, 2018 7:19 am
by kristoffer
We have got a few similar reports from other users but have not fully understood what the cause is, but we think we might have found the problem now.

It seems as there has been some code in the kalman filter that limits the state to positive Z only (most likely used during development and never removed). We usually configure our LPS systems with the origin on the floor and this never caused us any problems. On the other hand, if the coordinate system origin is configured to be above the floor the kalman filter will be forced to find some other (false) minima instead of the correct negative Z solution. It is also possible that a reflective floor makes it even worse.

We have removed the limitation in https://github.com/bitcraze/crazyflie-f ... issues/361. Please update the firmware and let me know if it solved the problem.

Re: Z-coordinate issues

Posted: Tue Aug 21, 2018 4:29 pm
by snyderthorst
Unfortunately, that has not solved the problem. The CF still thinks it's way above where it actually is.
CF_z_issue.png

Re: Z-coordinate issues

Posted: Wed Aug 22, 2018 6:59 am
by kristoffer
What happens if you put the CF at other positions in the space? Is the estimated position wrong in other locations as well?

Re: Z-coordinate issues

Posted: Wed Aug 22, 2018 4:59 pm
by snyderthorst
Yes, it is definitely working better now. When I move it to different positions in the room, it does seem to find it's lock. Now it seems, though that flight is unstable. I'm not sure if this is still the z-axis issue or not. It seems like the CF takes off and then hits its setpoint, stops, but then thinks it's still at that altitude. I have noticed that as it flies towards the center, it seems to lose the z-axis lock and cuts motors which causes instability. Below is an image of the room configuration and I linked a youtube playlist of takeoffs from various positions in the room that show this behaviour.

https://www.youtube.com/playlist?list=P ... PgPuLKzJC2


Room Configuration
Room Configuration

Re: Z-coordinate issues

Posted: Thu Aug 23, 2018 6:11 am
by kristoffer
Thanks for the videos!

In your second video there is a screen shot of the client and it looks as the Crazyflie does not get packets from all the anchors (three of the small boxes at the top right are red). This is most likely why the kalman filter has a hard time finding the position, it simply does not get enough data.

The first step to solve this type of problem is usually to check anchor placements. In your case I think it looks fairly good, maybe try to move the anchors up 10-15 cm from the floor. On the other hand it looks like a wooden floor and it should not have a strong impact on the radio propagation.

The second option to try is to increase the transmit power of the UWB radios. You can use the https://github.com/bitcraze/lps-node-fi ... x_power.py script to modify the power settings. The settings are transmitted to the anchors using the Crazyflie as a bridge, move the Crazyflie close to all the anchors while running the script. When the settings has been received by an anchor it will reset automatically, so this is a good indication that the update is successful. Just watch the blinking of the LEDs until they all blink the same way as when pressing the reset button. This solution is not stellar and sometimes it takes a while for a successful reception. (There should really be a way to configure this via the USB serial port but we have not got around to implement it)

Re: Z-coordinate issues

Posted: Fri Aug 24, 2018 4:15 pm
by snyderthorst
I implemented everything and it's working very well now! Thank you!