Rover S-Curves alpha testing

@Yuri_Rage , @amilcarlucas thanks, I’ll try the latest version. I’ll try it first on a rover and then on a boat.

1 Like

Hi everybody. I tried to configure the rover on version 4.3. Problems arose with the connection of ESC BlHeli32 and Servo. Attached files. The servo does not work at all, and Blheli sometimes managed to start. Could you tell me what is wrong in the parameters.

I tried autopilot on 4.3dev. This is the first attempt, but it may be useful. Since the rover is small (16 scale, Traxxas ), there were difficulties with overcoming “obstacles” in the field.
I have a question. At the moment when the rover bumped into a bump (obstacles) and could not pass it, he seemed to be trying to accelerate sharply, how is it configured?

P.S. Next time I will try to test on a normal surface (asphalt) and the mission to do more (distances between points

My setup
Pixhawk 2.4.8
Bl_Heli32
FrSky x4r

Hi @McKey,

Txs for giving it a try.

Re the strong acceleration, this will likely be I-term build-up in the speed controller. So when the vehicle gets stuck the PID speed controller will notice the vehicle isn’t reaching it’s target and it will try harder and harder. It could be helpful to reduce ATC_SPEED_IMAX from 1.0 to something smaller (perhaps 0.2) but it depends a bit on the situation, it may not help.

Any chance you could provide the .bin log file? This has much more detail than the tlog.

@rmackay9 thanks, I’ll reduce the parameter a little.

Some very good S-curves tests on 4.3.0-dev!

But than I turned on obstacle avoidance. I am using the OAK-D-IOT-75 camera of Obstacle Avoidance. Showing up correctly in proximity view in mission planner but even when running auto I have some very strange behaviour when I use Obstacle Avoidance. Any ideas?

It seems it is avoiding things that are not there, proximity seems a bit jumpy but always over 2meters.

Logs and params:
http://autodiscovery.co.uk:8088/index.php/s/kC3kyTGgJNC8b2H

I also experienced some erratic behavior with fence avoidance and BendyRuler early in the alpha testing stages. I have had OA disabled since and intend to test again soon, now that SCurve nav has matured slightly.

@kisdia,

Ah, very interesting that you’re using the OAK-D. That’s on my list to try as well.

I haven’t checked the logs yet but it might be interesting to test with Rover-4.1.5 to see if it acts the same or not. The reason is just that this would clarify if it’s an issue with the SCurves change or an existing issue. I suspect it’s the former… but in any case, knowing this would cut the area of investigation in half.

Anyway, txs again for testing and one of us will peak at the log. FYI @rishabsingh3003

1 Like

@rmackay9, I finally got to the bottom of my waypoint disappearance! I had a complex OpenTX mix that put SaveWP as one of 3 potential functions on a single momentary switch. It was defaulted to HIGH, meaning that, with the the default disarmed behavior of SaveWP (RCxOPTION=7) clearing the mission, as soon as I booted, SaveWP went HIGH, and the mission was wiped out.

Fixed up the mix, and no more waypoint vanishing!

Back to SCurve testing, or more like tuning at this point!

I finally figured out what was causing my rover to have compass issues. Missionplanners compass screen always overwrites the “compass learn” parameter with 0 or 1. My rover drives well with EKF learning (2) active, but everytime I opened the compass screen it got overwritten and the rover drove of to the horizon. I must say, scurves is a great improvement over the L1 controller. My testing parking lot has a lot of obstacles and with L1, a solid GPS fix and careful planing, it was still hit and miss (pun intended) to get a waypoint mission finished. Today, I did a simple 4 waypoint mission with speeds up to 4m/s. I increased PSC_P up to 4 and the rover drove along the mission several times without hitting anything or deviating of the course. Really great!
It still hesitates a bit after pivot turns, but I did not have time to figure that out today.

So I was using a branch of this for obstacle avoidance with OAK-D-IOT-75: ardupilot_depthai_scripts/IOT/obstacle_avoidance at master · rishabsingh3003/ardupilot_depthai_scripts · GitHub
I changed if for rover changed the areas of interest and some other bits in the ESP code.

And behaviour is also not great in stable version so maybe it is not the S-Curves. I am pretty sure the problems are because of the OBSTACLE_DISTANCE_3D messages, so I want to change the code to use just OBSTACLE_DISTANCE instead. I will report back after the tests with S-Curves + OA.

P.S.: 4.3.0 works great both on Skid-steer and acerman steer, getting really good results after tuning. Video: http://autodiscovery.co.uk:8088/index.php/s/fgCjcsMTT2mHHTm

1 Like

@rmackay9, I think I’ve discovered the root cause for the oscillation that is exacerbated by increased PSC_VEL_D values on my machine.

During a long mowing/tuning session today, I noticed that I did get very nice straight line results by increasing the D term. However, there was always a pronounced oscillation exiting pivot turns that of course worsened with increased PID gains.

My mower has free-spinning caster wheels on the front, which are always mis-aligned with the direction of travel after a pivot turn. The slight “kick” to one side caused by those casters re-aligning with the direction of travel seems to be enough to set up that oscillation.

There is a happy ending though - after REALLY dialing in every tuning parameter under the sun, I was able set PSC_VEL_I and PSC_VEL_D to VERY low values (0.05 and 0.01, respectively), and still maintain 10cm or better crosstrack error.

It took a lot of work, and a lot of playing with the steering rate gains and ATC_STR_ANG_P vs pivot turn rate and acceleration, but I think I’m pretty happy with the overall tune now.

Additionally, a lot of the perceived delay after pivot turn completion was resolved by re-examining the acceleration tuning values and setting them to a compromise between aggressive maneuvering and smooth handling.

Parameters of note:
ATC_SPEED_P,0.4
ATC_SPEED_I,0.2
ATC_SPEED_D,0
ATC_SPEED_IMAX,1

ATC_ACCEL_MAX,1.25
ATC_DECEL_MAX,1.5

ATC_STR_RAT_MAX,75
ATC_STR_ACC_MAX,90
ATC_STR_ANG_P,2.3

ATC_STR_RAT_FF,0.225
ATC_STR_RAT_P,0.125
ATC_STR_RAT_D,0
ATC_STR_RAT_I,0.125
ATC_STR_RAT_IMAX,1

ATC_TURN_MAX_G,0.2 – While the Rover is technically capable of much greater than this, I found that decreasing it made for nicer “cut” corners.

CRUISE_SPEED,1.4
CRUISE_THROTTLE,45

WP_ACCEL,1.25
WP_JERK,0
WP_PIVOT_ANGLE,45
WP_PIVOT_DELAY,0
WP_PIVOT_RATE,50
WP_RADIUS,0.2
WP_SPEED,1.6

PSC_POS_P,0.5
PSC_VEL_P,2.25
PSC_VEL_I,0.05
PSC_VEL_D,0.01
PSC_VEL_IMAX,1

1 Like

Excellent Yuri! Congrats! Once I get my new guidance system assembled, I’m going to start with your parameters. Sincere Thanks for sharing. Onward!

@kisdia,

Really great stuff. Thanks for giving the OAK-D a try and confirming that the object avoidance issues appear not to be directly SCurve related.

I’m keen to try the OAK-D on my boat later this year and although I tried following Rishabh’s blog I didn’t get very far before getting distracted by other things.

Very nice looking rovers. It’s interesting to see that the lead vehicle at least uses the Mars Rover style steering.

I have been dying to try this S-Curves feature as it is going to make a world of difference to what we do as shallow inland water cartographers (FishTec HD Fishing Charts).
Unfortunately all our boats (AIMy) have been busy on projects so I had to build a new boat, then the horrific KZN floods hit us and as a result today was the first day to get the new boat on the water.
AIMy is a 3.2m delta design with a 2.5hp four stoke outboard motor capable of 20kph.

My first test was not great at all, but then Randy was kind enough to spare me some of his very precious time and in a video call helped get some ‘baseline’ parameters.
All I can say is “WOW!”
Thank you Randy.
I’m sure there are a lot of tweaks to fine tune it, but for now I am absolutely blown away.

Here is the log - Dropbox - 00000163.BIN - Simplify your life

5 Likes

Wow, that track looks awesome!

1 Like

@John_Easton,

Wow! fantastic track. Well done!

1 Like

Managed to get down to the dam today to test an actual mapping mission - DISASTER!!!

How is this even possible?

LOG - Dropbox - 00000020.BIN - Simplify your life

1 Like

I feel with you. I am not doing anything important with my rover, so it does not really matter, but it behaves differently everytime I take it out…

1 Like

My early days of aerial mapping with dji drones and DroneDeploy App used to be the same - I lost 4 drones from just “losing the plot”. Thank goodness they sorted that out.
It is still early days for Rover 4.3 but I’m sure dev will get there.