Project

General

Profile

Actions

Bug #457

open
SB

Strange desired attitude while stop()

Bug #457: Strange desired attitude while stop()

Added by Szymon Bielenin 4 months ago. Updated 24 days ago.

Status:
Feedback
Priority:
Normal
Assignee:
-

Description

Description

The problem was spotted during the real flights just before landing. I was stopping NHFC, MANEUVER and ROTORCRAFT in a different order than usual (rotorcraft.stop() was not first), and the drone went crazy - full throttle on one or 2 motors - leading to a few rotations etc. Below, I sum up when the problem occurs and when it is not present. I was using the most recent versions of all components.

Hipotesis

  1. The problem is not in the Maneuver since the issue occurs after Maneuver stops publishing the desired state (check plots below).
  2. NHFC, when it is stopped, comes back to some internal state which is overwritten if Maneuver is stopped before therefore there is no issue while nhfc is stopped after maneuver.stop()

To replicate

Order of services logs and results
nhfc.stop()
rotorcraft.stop()
maneuver.stop()
Drone arrive to the landing position and then goes crazy (one or 2 motors go full throttle). Logs show that nhfc desired attitude is not zero, even though the estimated attitude has not changed (also, there is no error in the position)
rotorcraft.stop()
nhfc.stop()
maneuver.stop()
Motors are properly killed and drone lands (drops from ~20cm above the ground). However, the logs show that the NHFC desired attitude is not flat (the drone is basically stable), but instead it asks for very aggressive roll/pitch angles.
rotorcraft.stop()
maneuver.stop()
nhfc.stop()
Motors are properly killed and drone lands (drops from ~20cm above the ground). Logs show that the desired attitude is not crazy - just the reaction of an attitude error due to free fall
maneuver.stop()
nhfc.stop()
rotorcraft.stop()
No crazy behaviour - drone lands properly

Plots

NHFC vs POM

When NHFC is stopped before MANEUVER and ROTORCRAFT we can see a strange peak in NHFC's desired attitude (other desired states remain constant):

When the ROTORCRAFT and MANEUVER are stopped before NHFC it behaves correctly:

MANEUVER vs POM

Maneuver is not stopped but it has already finished publishing desired state. Then the crazy NHFC behaviour occurs:

Workaround

Always stop rotorcraft first, so there is no possibility to execute potential unsafe commands. Stopping Maneuver first seems also to work.


Files

NHFC_issue.png (170 KB) NHFC_issue.png Szymon Bielenin, 2026-02-16 11:28
NHFC_issue_ok.png (153 KB) NHFC_issue_ok.png Szymon Bielenin, 2026-02-16 11:28
NHFC_issue_MANEUVER.png (156 KB) NHFC_issue_MANEUVER.png Szymon Bielenin, 2026-02-16 11:53

GC Updated by Gianluca Corsini 4 months ago Actions #1

I cannot understand this sentence

NHFC, when it is stopped, comes back to some internal state which is overwritten if Maneuver is stopped before therefore there is no issue while nhfc is stopped after maneuver.stop()

Moreover, considering this statement

When NHFC is stopped before MANEUVER and ROTORCRAFT we can see a strange peak in NHFC's desired attitude (other desired states remain constant):

if `nhfc` is stopped, then its change of desired attitude (even if not desirable) should not affect the drone state, since this component is stopped, and `nhfc` should not be sending commands to the robot anymore.
This could be investigated better by looking at a plot with the commanded and measured rotor velocities. I would expect to have no commanded velocities there.

In the 3rd plot (MANEUVER-vs-POM), I don't get which components are running in the range between the two vertical red bars, and what is happening after the second one where the robot really goes crazy.

Another thing: it would be interesting to see if this issue is replicable with another robot, e.g., the old mikrokopter-based quadrotors.

AM Updated by Anthony Mallet 4 months ago Actions #2

On Monday 16 Feb 2026, at 12:29, Gianluca Corsini wrote:

if `nhfc` is stopped, then its change of desired attitude (even if
not desirable) should not affect the drone state, since this
component is stopped, and `nhfc` should not be sending commands to
the robot anymore.

This is not true, nhfc::stop stops servoing and outputs a hovering
command on the last servoed position.

I can have a look to this, not before Feb. 24 though. What would help
are the log files to see what's going on in terms of timestamps and
also to see what was the last output from maneuver.

GC Updated by Gianluca Corsini 4 months ago Actions #3

This is not true, nhfc::stop stops servoing and outputs a hovering

command on the last servoed position.

Ah right, it makes sense :)

AM Updated by Anthony Mallet 4 months ago Actions #4

state: feedback

So far I could not reproduce any problem (in simulation).

I have been testing a `nhfc.stop()` while maneuver was executing a
'maneuver.goto()' and the behaviour is as expected, nhfc stop servoing
on maneuver trajectory and hovers quietly at the position where it was
stopped.

Same with `nhfc.stop()` when maneuver is otherwise idle and reached
it's desired position.

So I would need more feedback to better understand the issue. In
particular the log files for the weird behaviour would be helpful.

AM Updated by Anthony Mallet 4 months ago Actions #5

  • Status changed from New to Feedback

AM Updated by Anthony Mallet 24 days ago Actions #6

Please check the last released
version 2.5

With the addition of the reset() function (49840daf), the
control intergral term can be reset when the robot is not flying.

Let me know if that closes the issue.

Actions

Also available in: PDF Atom