[SOLVED] z range sensor sampling period

Firmware/software/electronics/mechanics
Post Reply
y.choi
Beginner
Posts: 2
Joined: Thu Jun 22, 2017 5:33 am

[SOLVED] z range sensor sampling period

Post by y.choi »

Hello, I'm trying to control height of flie by PID controlling the z-ranger value
using the crazyflie ROS driver ( https://github.com/whoenig/crazyflie_ros )

However, It seems like that range.zrange value is logged and subscribed with period 100ms, i.e. 10Hz
It seems to be insufficient for control. How can I adjust the period of z range sampling? I guess the sampling rate spec of VL53L0X must not be 10Hz, it's too low
Last edited by y.choi on Thu Jun 22, 2017 3:31 pm, edited 1 time in total.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: z range sensor sampling period

Post by tobias »

Are you trying to do the PID regulation on the computer? The delay might be a problem.

I can't remember the fastest time the sensor can sample but it depends on the surface and environment. Think it is around every 30ms.
y.choi
Beginner
Posts: 2
Joined: Thu Jun 22, 2017 5:33 am

Re: z range sensor sampling period

Post by y.choi »

tobias wrote:Are you trying to do the PID regulation on the computer? The delay might be a problem.

I can't remember the fastest time the sensor can sample but it depends on the surface and environment. Think it is around every 30ms.
Yes. through PID control. Then how is the height hold mode in cfclient implemented? In the same environment, client works.

In the sensor spec, it says it supports up to 50hz in "fast mode". I can't figure out what it is. 10hz is too poor

-------------------
http://www.st.com/content/ccc/resource/ ... 279088.pdf

I found the sensor programming API, and now looking over it
now I looked it over and again look over the firmware source code. Is it right that already firmware is coded to get the measurement as fast as it can?

-------------------
I found my crazyflie ROS driver subscribes /range at period 100ms regardeless of surface and environments, and tryna find out why
-------------------
now I figured it out. In crazyflie_server.cpp, logblock frequency was set by start(frequency). Thanks
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: [SOLVED] z range sensor sampling period

Post by arnaud »

Does it mean that the log frequency was wrong? What change did you have to do to make it work?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: [SOLVED] z range sensor sampling period

Post by tobias »

The code as it is now is setup to take measurements with the vl53 as fast as possible.
xorb0181
Beginner
Posts: 1
Joined: Wed Sep 13, 2017 5:28 am

Re: [SOLVED] z range sensor sampling period

Post by xorb0181 »

@y.choi

How did you get the zrange value from CF firmware via ROS package by whoing?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: [SOLVED] z range sensor sampling period

Post by arnaud »

You can setup log block with the ROS package so you can setup a log block that gets the zRanger range and publish it as a topic at regular interval.
Post Reply