Oh ok, I have never tried that. I will do what I can from a hardware perspective, then make the final adjustment on SERVO1 MIN & MAX
Great.
Another thing to be aware of…
Your steering tune will probably work well for one cruise speed, but at any other speed there will be some error and potentially overshoot or undershoot.
This will probably be most evident by changing the TURN_MAX_G parameter. For example, it looks like at 4m/s, your turn max g is about .15 m/s^2. That is just the mathematical acceleration of a boat turning at a 35m radius at 4 m/s. Because lateral acceleration is proportional to the square of the speed, if you increase speed to 8m/s, you’ll be turning at 0.6m/s (4 times the lateral acceleration, but the same radius). Without changing TURN_MAX_G, your new turn radius will probably be 70m, and I doubt you want that.
Makes sense Nate. Missions are generally carried out at between 3m/s for sidescan and 5m/s for general bathymetry
I agree with Nate on a few things but disagree on a few others.
Most importantly I agree with Nate though that the ATC_STR_RAT_FF is probably too low. So maybe increase it from 0.8 to 1.2. I would leave P where it is because it’s already quite high at 1.0. I think leaving the ATC_STR_RAT_FILT at 5 is also fine.
I also agree that TURN_MAX_G should be increased from 0.1… but I’d say 0.3 is probably a better number - 0.7 seems too high to me. In the graph below we can see the desired lat accel (in red) vs actual lateral acceleration (in green). The flat top on the red line shows TURN_MAX_G is limiting the turn rate and the green line does eventually reach it so we know the vehicle can do more than 0.1G… how much more I’m not totally sure.
The TURN_MAX_G parameter is really only used to apply a maximum limit on the desired lateral acceleration so it’s not something you need to tune but it’s best to set it to something close to what the vehicle can achieve.
I’m not yet very familiary about how the NAVL1_DAMPING affects performance so taking Nate’s suggestion of putting it back down to 0.7 could be fine (I don’t know) but I’d focus on getting the steering control better first.
What is a little odd is that the vehicle is not slowing down for the corners. This may be because the TURN_RADIUS is set to 15m. Could you try reducing this back to 2m even though that is unrealistic for the boat?
The CRUISE_THROTTLE should probably be raised from 5% to 14%. CRUISE_SPEED is 4m/s. By the way to change the speed that a mission is executed at, it’s best to modify WP_SPEED instead of CRUISE_SPEED.
I think it should be possible to get the steering control to work for almost any speed without re-tuning. I have not specifically tested this, and I do think there are issues below 1m/s, but above that I think it should be possible to get a tune that works at many speeds. The reason is that we have compensation for the expected response built into the motors library.
I have loaded these new parameters and will be testing again tomorrow, Thank you.
1 - What setting tells the craft to slow down when approaching a waypoint?
2 - What setting tells the craft by how much to reduce throttle when approaching a waypoint?
After briefly searching the parameters and docs, I do not see a feature that allows slowing down for waypoints.
I find this prop steer issue very interesting. The vectored thrust with a single screw also.
JohnE,
it calculates how much it should slow down primarily using:
- ATC_ACCEL_MAX (maximum forward/back acceleration). If this is set low, the vehicle will accelerate and declerate more slowly. This will mean it will start decelerating farther away from the waypoint.
- the higher of WP_OVERSHOOT (how far from the line between waypoints the vehicle is allowed to stray) and TURN_RADIUS.
- TURN_MAX_G (the maximum expected lateral acceleration of the vehicle). If this is set low, it will calculate that it needs to slow down more in order to make the turn without straying too far from the line.
EDIT: by the way, I worry we will see a return of the wobbles at corners… I think the cause is actually the speed controller. we may need to lower ATC_SPEED_FILT from 10 to 5 and ATC_SPEED_P from 0.05 to 0.02 but I’m really not sure.
NateE,
The code that does the maximum speed calculation is here and here.
Randy,
Here are those settings from yesterday (4 Sep) at work …
Smoother steering and throttle but a slight sacrifice on accuracy.
Plan …
Actual …
Compared …
No erratic throttle or steering …
I also worked on the mechanical setup on the steering an have managed to get the turning equal and circle down to 16.2m at 14kph
Those results look impeccable compared to the issues you were having before! Can we see a log from that mission you had? By analyzing some of the math, we might be able to make a few more tuning recommendations. Off the bat, I would recommend setting your WP_RAD to your turn radius (8 or 9m). That will make your right angle turns about perfect with very little overshoot. Unfortunately your acute turns will not fare so well as you’ll be too deep in the corner before your craft tries to get on the next flight line. I don’t know your path requirements, but maybe you would consider a grid instead of a corridor to get more efficient and avoid acute turns.
In addition, you have a slight wobble off of the straight lines, and I’d like to see what may be causing that. It doesn’t look terrible, but getting it better would always be great.
@rmackay9, I understand the TURN_MAX_G now! Thank you! By decreasing it, the controller will demand a slower turn.
Now to turn to physics, @Fishton claims a 16.2m turn diameter (8.1m radius) at 14kph (3.9m/s). By physics, that means acceleration = v^2 / r = (3.9^2)/8.1 = 1.87m/s^2. Gravity =9.8m/s^2, so via division, the TURN_MAX_G should be set to 0.2 to get a safe turn.
My question to @rmackay9 is about look-ahead. If I understand the current rover code, the demand for a slower speed will only happen AFTER a waypoint has been reached and a lateral acceleration has been demanded. For a thrust-vectoring vehicle on water, that would cause problems quite quickly because the thrust reduction would actually cause less steering force when in reality we want to turn tighter.
Looking OK. If you’ve got a dataflash log that’ll be good.
The wavering around the line is most likely a navigation controller not being aggressive enough.
@Naterater,
The rover/boat will both slow-down before the waypoint and if it strays too far off the path.
We’ve got support for “vectored thrust” in Rover (wiki) so if tuned correctly it should adjust the steering angle based on the motor thrust. I think we should be able to see if this is working well by looking at the STER logs when the speed is low. In earlier logs (with the earlier boat) this was working OK.
By the way, there is a code improvement we could make to the Vectored Thrust code… it compensates for steering but it doesn’t handle the loss of forward thrust by having the motor off at an angle… so steering control should be good, but throttle control suffers in corners.
Thank you Nate and Randy, I will get the log out of the boat as soon as it gets light as the boat is still on the trailer in the yard.
Nate,
I use grid for general bathymetry (purely depth data to create a topography type chart).
However, for SideScan sonar, parallel lines to the shoreline is required, and the closest tool we have for this option is corridor.
Here is the log Randy …
@Naterater, can you explain this: “The CRUISE_THROTTLE should probably be raised from 5% to 14%. CRUISE_SPEED is 4m/s. By the way to change the speed that a mission is executed at, it’s best to modify WP_SPEED instead of CRUISE_SPEED.”
Why is it better to use WP_SPEED? Does WP_SPEED use the CRUISE_SPEED / CRUISE_THROTTLE mapping?
WP_Speed is just originally intended to be used for the automatic missions. I believe it will still use the mapping of the other parameters, for example:
if Cruise_Speed is 10m/s and Cruise_Throttle is 50%,
WP_speed = 5m/s then the throttle applied will be approximately 25% during automatic modes.
It also allows you to change the speed in automatic missions without changing the cruise_throttle setting every time.
Ahh, so you use CRUISE_x to set your best linearised mapping for throttle to speed, then WP_SPEED to actually set your default mission speed.
Thanks!
I have not been on the water for a while due to other projects, but here is the result from yesterday:
How I dream of this test earlier this year, it only happened once! No hardware change, no settings change, and it would never do it again.
Can we look at logs again? Did you make any of the changes that we mentioned above?