-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fw_pos_control_l1: apply pitch setpoint offsets centrally #11845
Conversation
b8da480
to
3f4c577
Compare
Since this PR will require testing I'm going to pull #11373 in as well. |
71fc55d
to
a44b2fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change breaks for users who were relying on the takeoff pitch field in QGC to set up their mission. That it is now being ignored comes unexpected. This would need to be coordinated with a QGC release. I would instead let the parameter override the mission parameter if it is non-zero.
If ignoring the existing mavlink parameter is unacceptable then we'd need more than a coordinated release to prevent potential confusion. How about we reject the mission upload if the field isn't 0 (or NAN) with a warning? |
That’s fine with me. |
803285a
to
9c974dd
Compare
@dagar SITL build failure |
Needs to be limited to FW only (and has a typo).
|
9c974dd
to
3608b20
Compare
To understand the change in basic terms. If we have the following assumptions: Pitch offset of negative 11 degrees (fw_psp_off) Qgc takeoff pitch is set to 12 degrees. Then expected pitch should be 21 degrees from the autopilots perspective (+11 for compensating from the negative psp offset and +10 for takeoff). and the qgc takeoff pitch is ignored. I’m assuming minimum pitch takeoff is is ignored although that doesn’t really matter since it would likely be so much higher. What about the max pitch? Is that going to need to be increased? Am I understanding this correctly? |
@ryanjAA Yes, although you would not be told by QGC that you need to set takeoff pitch to 0 and adjust it via the new param. |
Ok thanks, so it only will work if the takeoff pitch is 0 (in qgc mission planning) when creating and uploading the mission (from @dagar note above). I assume the mission simply wont upload (from above). I'll give this a try in SITL. |
Actually, this is an important point to discuss. In current master there's a rather confusing mix of some of these pitch angle parameters being applied relative to FW_PSP_OFF, and some treated as absolute. In the fixedwing position controller we have the following user configurable pitch settings in degrees.
Plus
I would propose that all of these should be interpreted absolute, and not relative to FW_PSP_OFF. The FW_PSP_OFF parameter is then simply the expected pitch trim at cruise. @ryanjAA @Antiheavy your input here would be greatly appreciated. |
3608b20
to
9cd9703
Compare
This is basically what the parameter description says, so I guess that makes sense. https://github.com/PX4/Firmware/blob/20f870137b66c61df0ba0dcd6a96a8deab01f92e/src/modules/fw_att_control/fw_att_control_params.c#L433-L446 Can someone describe how FW_PSP_OFF is actually used in the controller? |
A related question is: does FW_PSP_OFF add on top of the absolute limits, such as "FW_P_LIM_MAX"? I think the answer is it should be allowed to add to the absolute limits, since it is an offset. The use case I image is you have a fixed wing design where you'd like the lifting surfaces pitch datum to be different than the avionics system pitch datum. |
Those limits are absolute. That's the change that created the different interpretations. #7098 At this point I think I could go either way as long as it's consistent and documented. |
@LorenzMeier @dagar this would be a good candidate for 1.10 if we can bring it over the fence? FYI @Kjkinney |
} | ||
|
||
// return 0 to prevent stale tecs state when it's not running | ||
return 0.0f; | ||
return _parameters.pitchsp_offset_rad; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment above will need to be updated
This came up during the dev-call October 9th, 2019. @dagar can you please rebase? looks like we need some test flight cc @Antiheavy |
@RomanBapst @sfuhrer perhaps we could talk this one through briefly on the next dev call? It shouldn't technically be that difficult, I just want to make sure we're all on the same page. |
@dagar Do you have anything here that is not right? It all makes sense to me, I strongly agree to specify pitch limits globally always and also respect them always regardless of any offsets. |
Yes, let's get this over the line. |
Closing in favor of #16792 |
From #11785.
The pitch and pitch limits are shifted by the pitch setpoint offset before sent into TECS. This was being done inconsistently only for position and loiter setpoint types.
Related #7098