Getting started with the Z-ranger deck

The Z-ranger deck

The Z-ranger deck V2  contains a VL53L0x Time-of-Flight (ToF) laser-ranging sensor and has a 1-wire memory which enables the Crazyflie to automatically detect the Z-ranger deck. The sensor can measure the distance up to 2 meters from the Crazyflie to the ground. The deck can be only be installed on the bottom of the Crazyflie. For more information about how to mount an expansion deck please see the Getting started with expansion decks tutorial.

To be able to use the Z-ranger deck V2  you need to update the Crazyflie to the latest firmware. For more information on how to update the firmware, see the update firmware in the Crazyflie section in our Getting started with the Crazyflie 2.X tutorial.

Using the height-hold mode

To use the Z-Ranger deck you need to use the Python client and set up a connection with your Crazyflie. For more information go to the Getting started with the Crazyflie 2.X.

  • In the client, go to Assist mode and choose Height-hold mode in the drop-down menu. Also make sure that the assist mode button is configured.
Z-ranger deck tutorial
  • Place the Crazyflie 2.X on the floor in an area with lots of floor space for flying, then press the assisted mode button on the gamepad to activate the height-hold mode. The Crazyflie will now take off and hover at a height of 40 cm.

  • To control the Crazyflie use roll/pitch as normal and use the thrust to change the height-hold set-point. Releasing the height-hold button will de-activate the mode and the thrust input will work as normal (i.e you will have to give thrust for the Crazyflie not to drop).

  • Each time height-hold mode is re-activated the set-point is reset to 40 cm.

User-interface guide

Below is a short explanation of the user-interface.

Z-ranger deck tutorial
  1. Set-point height (in meters)
  2. Height error (in meters). I.e difference between the set-point and measured height.
  3. Set-point height (in meters)
  4. Measured height (in meters)

Measurement details

When the sensor measures the distance to the ground it will not use a single point. Instead the detection will use a cone (see below) where the sensor will report the closest detection. This means that the higher the Crazyflie is the larger the area of detection. For instance this could be an issue if the Crazyflie gets close to a wall, then it will report the distance to the wall instead of the floor.

Z-ranger deck tutorial

Flight video using Z-ranger and height-hold mode