Vehicle does not drift inside of Loiter Radius


We are using a skid steer boat. The main task of the boat is to stay as precisely as possible at a predefined position. This works excellent as long as there is some light or strong wind which pushes the boat always to the leeward edge of the Loiter Radius.

But if there is absolutely no current and no wind we expected the boat to switch off both motors as long as it is inside of the Loiter Radius. Our LOIT_RADIUS = 5 m, and LOIT_TYPE = 1.

We noticed that the boat moves very slowly from the edge of the Loiter Radius towards the Loiter Center and continues in the same direction until it reaches the edge of the Loiter Radius on the opposite side.

Do we misinterpret the information “Vehicle will drift when within this distance of the target position” when we expect the motors to be switched off?

Any help is appreciated

@SUI1271, txs for the report. Maybe we should update the description for Loiter… from a peek at the code it seems that it doesn’t actually just drift while within the Loiter radius. Instead it tries to maintain its heading and also a forward-back speed of zero (i.e. it tries not to move forwardward or backwards).

I expect the vehicle’s motors won’t turn off completely because it will use them for the heading control and speed. I wouldn’t expect it to drif towards the opposite edge of the Loiter radius unless the ESCs/motors aren’t capable of spinning in reverse or unless the ESC deadzone is large or the speed controller’s I-term has been set to zero…

Thanks for the detailed response. The motors are capable of spinning in reverse and the controller’s I-term is not set to zero, but the ESC deadzone might be large. We got better results when SERVO1_TRIM is set to 1400 (instead of 1500) (while SERVO1_MAX = 1900, SERVO1_MIN = 1100). The same settings of course for SERVO3 but we are not sure if this is the right approach.

@SUI1271, it could be the right approach. It may also be necessary to increase MOT_THR_MIN which is not well documented on the wiki but it allows you to increase the deadzone but the single number applies to all motors. Unfortunately we don’t have SERVOx_DZ parameters yet.

I think it would be good to test with MP’s Motor Test page. What we want is for a low throttle output (like 1% or 2%) to cause the motors to spin slowly, and of course 100% should cause the motors to spin very quickly.

As a side note, it looks like MP will have an enhancement in the next version which will allow testing the motors reverse speed. This will be very useful in cases like this.