a question about yaw control in firmware

Discussions about all things Bitcraze
Post Reply
lwisle
Beginner
Posts: 7
Joined: Thu Oct 28, 2021 7:57 am

a question about yaw control in firmware

Post by lwisle »

hello!
I know the coordinate system is different from normal system.But when I modify controller_pid.c,I find that in line 114,it is:control->yaw = -control->yaw.
If I set mode.position x\y\z = modeAbs,the mode.yaw should be modeDsiabled. If I use PID controller,I find:

1. attitudeControllerCorrectAttitudePID(): state->attitude.yaw and attitudeDesired.yaw become rateDesired.yaw.
2. attitudeControllerCorrectRatePID(): rateDesired.yaw and sensors->gyro.z become yawOutput.
3. attitudeControllerGetActuatorOutput(): yawOutput becomes control->yaw.

I think those data are actual date,and control->yaw can be used derictly.But then,
4.control->yaw = -control->yaw;

I don't know why use minus sign here,because from PID controller_yaw i get actual desired yaw,and then i get real attitudeDesired_yawrate.
Could you tell me why there need a minus sign?Thanks!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: a question about yaw control in firmware

Post by kimberly »

Just a quick info, there is an duplicate issue here: https://github.com/bitcraze/crazyflie-f ... issues/884

I'm not sure if that is from you @lwisle, but please take a look at that github issue. We haven't looked at it yet.
Post Reply