Servers by jDrones

Steering Boat Not following the Waypoint exactly? Heading angle error too big

pixhawk
mission-planner

(rmackay9) #21

Yu_Chen,

Rover-3.4.2 is the latest official/stable version so I think it is best to stick with this until the vehicle is working well. 3.5.0 has started beta testing but by moving to it you would be potentially exposing yourself to software issues with the new version. When we hit issues it would muddy the waters - we would wonder, “is it a configuration issue or is it a software bug?”


(Yu Chen) #22

I see it, will stick to the old version which is more reliable. thanks! :slight_smile:


(Yu Chen) #23

Hi Randy, and David, @rmackay9 @David_Boulanger

I tried to adjust the position of the external GPS and compass to the center of gravity by changing the offset, as its hard to change the design of the boat. Some other info about the boat: the model of the ESC is Airbot Wraith32 Plus, and the motor provided is from a company’s official supply,(the model is BlueRobotics T200-Thruster-R1) where they also provided the hull for us. We need to mount the control system by ourselves in order to get it autonomous, that’s why we choose pixhawk and ardurover, trying to achieve it.
As you suggested, I modified the parameters in the ArduRover, and here is the current setting:

For this test, I mainly observed the manual and acro mode. Here are some behaviors of the boat which it’s hard for me to understand:

  1. In manual mode, generally it works very well. But when I turn the steering stick to the most right, the circle it makes is bigger than that when I turn the steering stick to the most left. Below is how it looks like:
  2. In Acro mode, it also happens that when I turn the steering stick to the most right, the circle it makes is much more bigger than that when I turn the steering stick to the most left. Below is how it looks like:

And sometimes it seems that I do not move the stick at all, the boat will move automatically to draw big circle(to the right side) by itself in Acro mode. That is really strange.
Here I attached the log for your info:

log 000011.bin: purely manual mode, to make the boat turn right/left by controlling the steering stick only
log 000012.bin: manual and acro mode. Sometimes in acro mode, the boat will drive itself even though I did nothing to the controlling stick.
log 000013.bin: mostly in testing the acro mode. Can see the big right turning circle and small left turning circle.

Here I also attached my RC configuration, it this range correct?

As I observe this strange behavior, and also in acro mode, when I change the mask to “steering” to observe the pid, the desired pid is always zero… and when I went back to see the log, the desired turn rate is also zero… So how could I tune the rate in acro mode? I would appreciate any help and direction about it. Thank you!


(David Boulanger) #24

Your ATC_STR_RAT_FF should not be 0. The throttle range of 1300 - 1700 could be right. I don’t know about your ESC’s. Although a range of 1100 - 1900 is more typical.


(David Boulanger) #25

@Yu_Chen. I just looked up you ESC’s. What is the reason for having your throttle range from 1300 - 1700? That’s only ± 200. And then if you take 70% of that because of your throttle max you only have ± 140 PWM working your motors.


(Yu Chen) #26

Hi David, thanks for the input, here is my thoughts:

  1. Your ATC_STR_RAT_FF should not be 0.

I understand ATC_STR_RAT_FF is important, but is tuned based on the actual turn rate & turn rate desire I guess. However, the value of turn rate desired is just zero all the way. So I am not sure how to tune in in the current stage. :frowning:

  1. The throttle range of 1300 - 1700 could be right. I don’t know about your ESC’s. Although a range of 1100 - 1900 is more typical.
    I just looked up you ESC’s. What is the reason for having your throttle range from 1300 - 1700? That’s only ± 200. And then if you take 70% of that because of your throttle max you only have ± 140 PWM working your motors.

Could having a small throttle range from 1300-1700 protect the motor from over heating? I think that’s the initial reason that me and my friend to set it for such a range, just to make the motor safe. We didn’t expect it could cause other problems. Yep, but now it seems that the boat is running under power, so we should change it to the typical range 1100-1900? We will do it in the next experiment.

And what is my ESC’s pwm range?(if you get it) Sorry we are still exploring this mission planner interface and haven’t found it… Thanks!


(Yu Chen) #27

And one more thing David and Randy,
I look at the RC signal in the log 000011.bin in detail, and noticed that the right side motor’s RCIN & RCOUT seems working reasonably(in the 1st figure below). However, for the left side motor’s RCIN & RCOUT, it seems got things wrongly. The RCIN1(shown in red color in the 2nd figure below) do not have input. Could you please help me take a look at these two graph? Thank you!


(David Boulanger) #28

Your throttle max is designed to keep the boat from over heating the ESC’s if its needed. Its possible have such a small PWM range and then factoring in your throttle max is really hurting you I think. Regarding your log 11, I’ll look at it again, you need to remember RC1 IN should be steering and RC3 should be throttle ( I think ). RC1 and RC3 OUT are a combination of the 2 inputs when using differential steering. I think I’ve explained that properly. Please change your throttle range to 1100 - 1900 and set ATC_STR_RAT_FF to 1 and ATC_STR_RAT_P and I to .2 during your next test and see if you see an improvement.


(Yu Chen) #29

Hi David,

Thanks for the advice. I adjusted the parameters accordingly based on your input. I will definitely give it a try in the Acro mode, but now I noticed a problem in the manual mode ---- that the boat cannot go straight in manual mode if I run it in enough long time in a big pool. (I am not sure whether this is a root cause that the boat cannot function well in acro/steering mode?)

Below attached in the picture illustrate about this issue:
image

RC1_IN is controlled by the throttle stick, RC3_IN is controlled by the steering stick. Here I only control the throttle stick to make it go straight. The direction of RC1_OUT and RC3_OUT are different, because the left&right propellers are opposite(one clockwise, one counter clockwise) . Theoretically, if the boat goes straight, the two (average) values should be symmetric with respect to 1514, which is the default value if there is no signal. However, in this case, for the left motor: average value of RC1_OUT is 1232(as shown in the graph), so the difference = 1514-1232 = 282. For the right motor: average value of RC3_OUT is 1768, so 1768 - 1514 = 254. which means the left motor always gives more power when it moves forward, so it has a trend to turn right. There is a discrepancy between the left and right motors. Can I adjust some offset parameters to solve this problem? @David_Boulanger @rmackay9
Here I attached the log :slight_smile:


(David Boulanger) #30

I will take a look at the log later. I have counter rotating thrusters also but I chose to switch wire on one of the ESC’s so that the PWM OUT is high on both to go forward and low to go in reverse. I think it makes it easier ready my logs. At least for me. Its only a difference of 28 between the 2 thrusters so that doesn’t sound really bad and I don’t think 2 thrusters would ever be the exact same. If you get a chance post a parameter list of your current setup. Its easier for me than finding them in you log._


(Yu Chen) #31

Hi David, here attache is the param listparam1208.param (11.7 KB)
and the screenshot of the basic params for my last time testing, where I adjusted accordingly based on your and Randy’s advice. Please let me know if I missed anything. Thank you~


(David Boulanger) #32

Looks good get it out on the water.:grinning:


(David Boulanger) #33

@Yu_Chen . Get that boat on the water today. If anything play with increasing the steering FF and the P and I with it a bit. Try like you have it and then try FF 1.5 and P and I at .3 and see if it improves. maybe higher. The only thing I see that is suspect is throttle max is less than cruise throttle. But I don’t think that will hurt your testing much. You may want to put throttle max up to 80. I hope it steers better for you and you have good news.:grinning:


(David Boulanger) #34

@Yu_Chen. Did you give it a try this weekend?


(Yu Chen) #35

Hi David, I switched the ESC wire for better comparison and reading as you did before. And I arranged a session to give it a try this weekend. Hope everything will go well! Btw, you suggest I “increasing the steering FF and the P and I with it a bit. Try like you have it and then try FF 1.5 and P and I at .3 and see if it improves. maybe higher.” Is it in manual mode? or Acro/Steering mode? Coz last time I even notice it have some problems in manual mode(cannot even go straight as shown in the picture). Thank you! @David_Boulanger


(David Boulanger) #36

I was referring to in Auto mode. try a simple mission and then repeat it with slightly higher numbers


(Yu Chen) #37

Hi David, @David_Boulanger

It works! :grinning: Here attached is one of the latest missions, where we make it to follow 4 points which formed a rhombus. However, its trajectory is a S shape. And I find that there is a big difference between the desired turn rate and the actual turn rate, and not sure what causes this problem. :confused:

Here attached is the latest configuration, is waypoint radius = 2 meters sounds reasonable?

Here I also attached thelog00041.bin

Below is a graph which shows a steering mode, when I make it to go straight. We can see it is quite straight. But in Auto mode it has the problems - the trajectory is a S shape.

Here attached is the log00037.bin

Hope you could take some time to help me take a look. Please let me know if there is any additional information needed. :slight_smile: :pray:


(David Boulanger) #38

Your making progress!! I’ll look at the logs with in the next 24 hours. I’m very busy today. This is good to see.


(David Boulanger) #39

Actually your Yaw Vs. Des Yaw is starting to look much better. It still needs a little work though.

It looks to me that you need to slow the CRUISE_SPEED down to .75. Your RCOUT continues to be at its maximum just trying to go at Cruise Speed. Also you may want to try to set SERVO1 and 3 MIN and MAX to 1100 and 1900 instead of 1200 and 1800.


(Yu Chen) #40

Hello David, @David_Boulanger

Thanks for the suggestions. I followed your advice and did a test again. I decreased the CURISE_SPEED to 0.7, and first tried to increased the SERVO 1& 3 range to 1100 and 1900, but the boat will suddenly disarm itself and lose connection with the controller. So for safety reasons, I adjusted it back again to 1200-1800. Previously it also happened, not sure why… Have you faced this kind of problem before? But anyway, I reduced the CRUISE_SPEED to 0.7. If I put the pwm range to 1200-1800, this ‘self-disarmed’ problem do not have anymore, and it is quite safe.

I tried to adjust the FF gain based on observing the “pidachieved”, “piddesired” from the “Tuning” checkbox, but it seems that the pidachieved can never reach the piddesired(even no much changes), though I increased it to the upper limit. But based on observing the trajectory of the boat, it seems FF=1.5 is quite good. And I find with I = 0, provide relatively good results.

From the log, we can see that the yaw performance still not good, and the desired turnrate and actual turnrate still need to improve, but not sure how to?(I try to follow the wiki, but does not work that much) Here I post some observation which I think would be helpful for tuning?


Here I uploaded the log, if possible, you could suggest me a good parameter? Thank you! and I will give a try again today or tomorrow. :slight_smile: