Programming Approach of client

Firmware/software/electronics/mechanics
Post Reply
RyanMco
Expert
Posts: 159
Joined: Tue Apr 09, 2019 6:15 am

Programming Approach of client

Post by RyanMco »

Alright
Last edited by RyanMco on Fri Aug 23, 2019 8:08 pm, edited 5 times in total.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: HEIGHT MEASUREMENT developing

Post by arnaud »

Hi,

The height measurement is done in the z-ranger deck driver and pushed into the estimator:
https://github.com/bitcraze/crazyflie-f ... er2.c#L146

When using the flow, the kalman filter estimator is used. The height measurement is entered in the kalman filter by the function kalmanCoreUpdateWithTof:
https://github.com/bitcraze/crazyflie-f ... ore.c#L538

Eventually the kalman filter generates an estimated pose including the current estimated height.

Then, the controller, outputs motor control in order to get the current estimated height closer to the desired height setpoint. The height PID is generating a velocity setpoint to get closer to the height setpoint there:
https://github.com/bitcraze/crazyflie-f ... pid.c#L190.

Similarly there will be a velocity PID that calculate the needed mean thrust to get closer to the wanted velocity setpoint:
https://github.com/bitcraze/crazyflie-f ... pid.c#L217


This should give you enough pointer to follow a bit how the height control is achieved when using the flow deck.
Post Reply