I have the latest ArduPilot board /EM406 GPS in a RC car, v1.0 software, RTL set to 1, code uploaded successfully, 'OUT2' to steering servo, 'IN2' from Rx Steering channel, GPS lock on, MUX LED illuminates to indicate the autopilot is switching correctly, etc

I control the car to some distance (200ft or so) from me ('home') and flick the switch and then the car turns to the left and keeps on doing so in a never-ending circle? With RTL set to 0 it does the same seemingly ignoring the waypoints?

Anything I'm overlooking or suggestions as to what might be wrong? Is there an easier way to quickly test that the navigation function is working?

BTW, should the altitude be set to 0 on a ground vehicle or should it be ignored?

Views: 197

Reply to This

Replies to This Discussion

I think that a RC car has a very tight turning radius, essentially turning around in a small diameter's circle, and thus GPS cannot pick up the speed vector effectively enough.

Yes, I think Dimitris is right. We've never used it on a car. Try setting the PID Max/Min gains to a very small number (5, say) and see if that makes a difference.
What radius turn should I aim for? With the PID Max/Min currently set to +15/-15 the circle is +/-10m (30ft).
I'll go try it
There is a definite limit to what movemnts your Ardupilot can detect, given the GPS resolution.
That is why an Ardupilot plane would need supplimental sensors (sonar, etc) for autonomous landings.

I have noted on another thread that an autopilot using GPS is not suited to an R/C car,

Perhaps a quarterscale nitro running on a large track with no sharp turns would work (?)
Yes, I know there are some users who do not require higher resolution for landing using the ArduPilot but those are usually lighter, forgiving airframes that can withstand landing with plus or minus a meter or two accuracy.
The basic code worked fine for me in a RC truck. It is a crawler so it only goes a few mph.

I did not run the throttle through AP but I did plug a servo into Out 1 so that AP would see a load on that pin. This kept me from having to mod the code that looks for status on that pin or the altitude hold. This servo did not do anything except function as a dummy load. In 1 was not connected to anything.

For WP mode I decreased the WP window from 30m to 10m so that I could use a smaller distance between points. Be aware that in WP mode it will cycle through your points then go to the RTL point (WP0) then start over. So you need to boot the AP in a location that the car can run through as part of the route of your WPs if you want to let it cycle multiple times.

In RTL mode it would always return and it would eventually establish a circle around the point. Sometimes it would over correct and cross through the circle. This usually resulted in the circle switching directions. (CW vs CCW) With some PID tuning it would probably be possible to always remain in a circle.
Thanks Wendell, that helps a lot. What size were your turning circles and did you mod any of the code to change that?

An unrelated question, the little button on the AP, what does that do?
The little button is a reset, to manually reset the board if you need to restart the code. We never use it (unplugging the power does the same thing) but people seem to want them with Arduino-compatible boards, so we included it to maintain full compatibility.
I started with the defaults. The circle had roughly a 15-20 foot radius. Later I briefly played with increasing the steering gain and the p value. Don't watch the individual servo movement to closely at first. The 1 Hz updates can make the path look very rough when you watch closely but if you are watching from a distance the path will look smoother. Once you are familiar with how it responds as a system you can start looking at how the elements respond. Just change one thing at a time with the gain or PID and see how the response changes. You can then get an idea of how each item changes things. The nice thing about a car is that you can quickly make changes, upload it, and test it. While the actual values that drive a car will not translate directly to a plane, the concepts that you will see in action should allow you to tune the response system in a plane in less time. A friend that is also playing with these joined me during lunch in a park near our office and we went through several tests in much less time and space than it would take to do the same tests with a plane. Also since we could see the car up close it was possible to see how things were working much better than you can in a plane. Think of it as a magnifying glass for watching how AP steers.
Excellent, thanks. I'll try it out today, I think not having the dummy servo might be my problem as there was no response from the AP other than the MUX turning on and off.

Thank you too Chris, what happens when the AP gets to a bit of code that it can't understand or execute, does it stop or go on to the next bit of code? Also is there any visual indication of an error on the AP such flashing LED's etc?
Uh, no. ArduPilot is like any other computer. If you write code that doesn't make sense, it either won't compile or it will crash/freeze/otherwise not work right. Just like Windows!

Like most embedded computers, Arduinos run code straight on the hardware. It's not interpreted or scripted.
Ok it works,... sort of, it's not very precise of course but I did get the car to change direction and attempt to RTL. Will try tomorrow in a plane but it does seem to be functioning correctly

Using the dummy servo seemed to be the answer as well as letting the car sit in one place for about 1 min even after the AP indicated a GPS lock.

Chris, how soon after that indication can one go, does the GPS have to find the maximum number of satellites for max effectiveness?

Reply to Discussion


© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service