Rover-3.4.0-rc1 released for beta testing!

https://drive.google.com/drive/folders/1DgI5x6mjv9Ljb8tM9SHWzEgVwFWXigw6?usp=sharing_eil&ts=5b277d0e

You’ve set SERVO3_FUNCTION to RCIN3, which means your servo 3 will ALWAYS follow your RC input, rather than being linked to the throttle.

Why did you change it from the default?

Given the proximity of the pixhawk to the ESC and motor, I would try it with COMPASS_USE2 set to 0 to disable the internal compass.

1 Like

I kinda remember a problem I had a few years ago where the boat was fine in manual mode but would steer the wrong way in assisted modes. I had to reverse the SERVOx output in the parameter list and then also in my transmitter. After that all was good IIRC. Not sure if the rover is turning wrong or throttling wrong. Could be a possibility.

1 Like

Krasimir,

Nice looking car.

The advice from @mroberts and @David_Boulanger is good I think. the SERVO3_FUNCTION should remain as “70” and then it’s likely that:

  • the channel 3 input needs to be reversed which can be done by changing RC3_REVERSED or it can be changed in the transmitter (most transmitters allow reversing the channel)
  • the SERVO3_REVERSED should be changed. It should be possible to test that the steering and throttle are moving in the correct direction using the mission planner’s motor’s page.

@rmackay9
@David_Boulanger
@mroberts
Thank you all! I changed SERVO OUTPUT 1 = Reverse. Now everything works perfectly. Thanks!!!

2 Likes

@rmackay9 Hi Randy, I think I’ve found a corner case in the acceleration limiting code:

// use previous desired speed as basis for accel limiting
float speed_prev = _desired_speed;

// if no recent calls to speed controller limit based on current speed
if (!speed_control_active()) {
    get_forward_speed(speed_prev);
}

// acceleration limit desired speed
float speed_change_max;
if (fabsf(desired_speed) < fabsf(_desired_speed) && is_positive(_throttle_decel_max)) {
    speed_change_max = _throttle_decel_max * dt;
} else {
    speed_change_max = _throttle_accel_max * dt;
}
return constrain_float(desired_speed, speed_prev - speed_change_max, speed_prev + speed_change_max);

You base the new desired speed on the previous desired speed. If you end up in a situation where the desired speed can’t be achieved, you can end up with the system getting “behind”.

It’s potentially worst with Rovers using brakes - if you pull back in ACRO, you end up commanding a negative speed, which will never be achieved but will apply the brakes (which is good). However, your desired will eventually drop to a substantial negative value. When you go to accelerate again, you’ll have to accelerate through all that “negative” speed, giving you a big lag.

You could get the same thing if you’re slowing down by just backing off throttle (in a boat for example) - your desired could drop well below your current speed, then it will have to ramp up before it actually response.

The same thing could happen if you were going up a hill - you give it throttle, and the desired ramps up above the current speed. If you try to decelerate (and you have a moderate decel rate) you wont actually slow down until your target speed drops back below your current speed.

I think the answer is to work out whether your current speed is closer to your new target speed than the “old” desired speed was, and if so, jump the previous target to your current speed.

based on the current code:

if desired_speed<current_speed && speed_prev>current_speed then  // decel below current speed 
    speed_prev=current_speed // bring "previous speed" down to current
    apply deceleration as normal to "speed_prev"

if desired_speed>current_speed && speed_prev<current_speed // accel above current speed
speed_prev=current_speed /// bring previous speed up to current speed
apply acceleration as normal to “speed_prev”

I’ll try to generate a log on Friday in SITL.

@mroberts,

Nice investigation. I think your suggestion sounds pretty good. A similar thing can happen during pivot turns if the ATC_RAT_ACC parameter is set too low actually.

I think if we implement this change, one thing we need to be careful of is sudden changes in the throttle output.

I just had a quick look at the AR_AttitudeControl::get_throttle_out_speed() and it looks like we’re not limiting the acceleration when the motors are hitting their upper or lower limits. If we did this it would probably reduce the problem in cases where we can’t reach the maximum speed even though the throttle is at 100% (or -100%).

@rmackay9 Regarding Boat Loiter; is there any possibility a new parameter could be added to allow specifying that the boat turns so the bow faces the WP rather than the least angle method used at the moment? Most boats prefer to face bow to the weather and have reduced maneuverability going aft, so this would be a fantastic thing to be able to specify.

Thanks again for all the amazing developments!

Russ,

Yes, that could be added relatively easily although I can’t immediately promise when it will be done. I’ve created an issue here for it.

2 Likes

Fantastic, thanks! It’s great to see rover advancing so quickly over the last few months.

1 Like

Hi,
I made videos of my “Drone Benchy”

Loiter Mode: https://youtu.be/UbM0OTlL_JE
Auto Mode:https://youtu.be/sw-9Mngs2cc

Enjoy!

1 Like

@RainFly,

Txs for the video, looking good! very cute boat and it moves pretty quickly for it’s size.

Hello Rainer. Can you give a picture of the boat’s control (steering) and the full list of parameters.Thanks.

@rmackay9
Hello Randy
I want to ask about a problem that happens to my boat with a loiter mode. After switching to loiter mode, the action is executed from 2 to 3 cycles for about 180 seconds, then goes to “sleep” a throttle. What is happening?


Krasimir,

It looks like the vehicle is trying to backup towards the point but can’t. Is it possible this vehicle cannot reverse?

If this is the case then we’ve got this issue on the to-do list to resolve the issue. Once added this parameter will allow you to specify that in Loiter, the vehicle should always face the waypoint instead of trying to backup towards it.

@rmackay9
Hello Randy
The vehicle moves reverse and forward. The new data shows that it first goes reverse to the point. Then he changes the movement forward and finally falls back to sleep throttle again.


Krasimir,

My guess is that these ESCs suffer from a configuration issue in which the pilot needs to hold the throttle at zero for a moment before pulling it into reverse. It’s mentioned here on the wiki.

So you can test if this is the issue by putting the vehicle in Manual mode, push the throttle stick up so the motors spin forward, then pull the throttle all the way down without stopping. I suspect you’ll find the motors do not go into reverse.

I’m guess a bit but from the logs, it appears that although the throttle output to the motors is very low, the vehicle is not backing up.

@rmackay9
Thanks Randy!

@rmackay9
@David_Boulanger
Hello Randy.
Thanks once again for the suggestions / pieces of advice !!! I replaced the ESC controller so it could possibly work in F / B mode and now everything is OK. I would like to share the results I achieved with the settings done on some of the parameters by which I secured a straight line motion of the boat during mission to a certain point/target. The boat has a length of 3.3 m. and a weight of about 190 kg. including the payload. I attach photos, a video clip, and the data report. I would like to apologize in advance for the incompleteness of the steering mechanism, but once I have a prototype that is already running I will put on something more shiny. I would much appreciate your opinion on the parameter ATC_STR_RAT_I = (800).