Hi @Leonardthall ,
thank you for getting back to us.
my eventual aim is to make precision landing work with moving targets. For this, when I enable the usage of the Kalman filter with PLND_OPTIONS
as 1, the targets of position and velocity controller make the drone go very aggressive, which results in the loss of target when the target is always stationary.
but if I start with a very gradual increase in the velocity of the target, the drone is able to track it, but if I suddenly stop the target from, let’s say, 2m/s, the drone is not able to respond fast enough to this change and results in losing of the target.
Further, I also tested out using the Kalman filter but set PLND_OPTIONS
to 0, which translates to giving only position targets to the position controller and zero targets for both velocity and acceleration, I came across a really weird observation.
I see that the input_pos_vel_accel_xy()
commands WP_NAV acceleration, which might be because the desired target that we send is really not optimized or smooth, even after processing it through the Kalman filter. Somehow I see changing WPNAV_ACC has a very much effect on the magnitude of acceleration being commanded to achieve a target position.
I made this observation for 2 cases:
- WP_NAV_ACC low(20cm/s2) [ good performance]
- WP_NAV_ACC normal(100cm/s2)[very bad performance]
I observed the following things by comparing the two cases with logs:
a. tracking by PID rate controller is good for the commands given to it for each case.
b. the heartbeat kind of behaviour(high-frequency inputs) to the rate controller is present in bad cases.
c. The good case had a very smooth rate target, while the other cases show very aggressive rate inputs given to the drone,
I think the aggressive inputs given in the case of normal accelerations had an effect on the system, and subsequently, the filtered position targets from the Kalman filter itself contained some oscillations, which led worsening of the overall behaviour of the system.
PL.tPx represents the original target given to position controller by Precision Landing without applying any input shaping stuff to it…
its the argument passed in the input_pos_vel_accel_xy
function
Plots for WPNAV_ACC low
Plot for WPNAV_ACC normal
furthermore, the WP_NAV_ACC is only used with input shaping.
but I found that the acceleration target for the normal case is much greater than the acceleration target for the low acc case.
WP_NAV_ACC low
WPNAV_ACC normal
the higher target acceleration might be the reason behind the greater target angular rates, which only comes from increasing WPNAV_ACC.
Further, remember that all the above observations were made for static targets.
Lastly, we cant have WPNAV_ACC as low as 20cm/s2, as that is too low. The drone won’t ever be able to catch up with moving targets if the maximum acceleration is this low.
Further, there was also this weird observation:
though TPN(target position generated by position controller for itself) is very smooth, TVN(target velocity generated by position controller for itself) is not.
the good case(WPNAV_ACC = 20cm/s2):
the bad case(WPNAV_ACC = 100cm/s2):
also, @Leonardthall could you please please help us understand what input shaping is doing?
for both (WPNAV ACC cases of 20cm/s2 and 100cm/s2) there was no change wrt to the initial distance between the drone and target in horizontal plane. Why did the controller generated TPA so high to cover such small distance?