Line Follower Help (car steering - not skid steering) w/ PID

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Line Follower Help (car steering - not skid steering) w/ PID

Post by ricardocrl »

Hello all,

First of all I appreciate all the possible help! This is a very important thing for me.

I'm designing a car with front wheel steering and trying to use a PID controller to follow a line edge.
Besides being my first time doing a PID, I know the basics, but I'm into troubles to get something satisfactory. I'm afraid that it has also a lot to do with the building configuration of the steering.

Now some details.
Pictures of the car and steering:
- http://dl.dropbox.com/u/2616967/CIMG1874.JPG
- http://dl.dropbox.com/u/2616967/CIMG1875.JPG
- http://dl.dropbox.com/u/2616967/CIMG1876.JPG

The best I can achieve at the moment is to follow a straight line in a slow velocity and with veeery wide curves. I have to keep the Proportional part very low not to cross the line to the opposite side. But with the Proportional constant low I can't follow a narrow curve. Even if I increase the Integral constant, to get effect over relatively narrow curves, it will oscillate a lot(!!) and very easily cross the line in straight lines.

In the meanwhile, I'm ignoring the D part, because I can't get fast responses enough from the steering to get any valuable work from Differential part.

I'm doing it in NXC, with the new position regulation functions. The regulation time was lowered to 10ms, but it doesn't help. The PID steps are around every 10ms.

I have some guesses (and almost certainties) about some of reasons of this issues. But I would like to get opinions from you. Here they are:
- when we apply a decision of whether to turn right or left, the response is never immediate. An example: if the wheels are turned to the left and the NXT senses the line, the controller decides to go right to get out of the line. Then it will take time to get the wheels actually turned to the right. During the time the wheels are turning, the sensor already crossed the line, or.. went much further into the line. This case is never an issue with skid steering: once you apply different velocities, you are already compensating the error. I think this is the biggest issue!;
- The color sensor is too far from the steering wheels;
- The pivot point of the steering of each wheel is not in the centre of the wheel, which makes the car moving while turning, describing a curve that actually goes against the correction of the error.

Of course, this steering solution is not helping, but I'm quite restricted to use it. I would like to know from you if you think that the configuration maybe a big issue or if you think it should still work quite good. I don't even find anything similar on the net (line follower with front wheels steering).

Appreciate all your attention and thanks in advance!

Kind regards,
Ricardo
rghansen
Posts: 67
Joined: 12 Oct 2010, 17:44

Re: Line Follower Help (car steering - not skid steering) w/ PID

Post by rghansen »

Although PID controllers are very useful for dealing with lag-less, linear problems, following the edge of a line with a fixed color sensor is not one of these problems. A color sensor can only deliver a linear response to an edge over only a very narrow range which is much to small to be quickly tracked given the slow, non-linear response of the steering system.

I would deal with this problem in one of two ways. One is to buy a line tracker sensor like http://www.mindsensors.com/index.php?mo ... AGE_id=111. This would provide you with a much wider, more or less linear sensor signal. From what I've read in the forums, this device makes line tracking so easy that it has been banned from some line tracking competitions.

A somewhat more complicated solution which you can do without buying new hardware is to sweep your color sensor back and forth across the line using a servo motor. This will provide you with a nice linear steering command 5 to 10 times a second which should allow you to track the line at reasonable speeds.
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Re: Line Follower Help (car steering - not skid steering) w/ PID

Post by ricardocrl »

Thank you for the input, rghansen!

Within the constraints I have for the size of the car, I cannot really go for a solution like an extra servo to sweep around the line. The mindsensors seems a good improvement.

After reflecting a bit, I decided to try a similar version of my robot, but with skid steering. It's a huge difference in the behaviour! It works pretty well with almost exactly the same program, with the propper PID values. As we see many projects on the net about line following with an NXT, the quick response from the NXT/servos is pretty enough. This showed me that the steering design really was the main issue.

I just wish a good luck if someone whats to try line following with front steering. :-)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Line Follower Help (car steering - not skid steering) w/ PID

Post by mattallen37 »

ricardocrl wrote:I just wish a good luck if someone whats to try line following with front steering. :-)
IIRC, Steve did it with the RCX.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
nxtreme
Posts: 246
Joined: 29 Sep 2010, 03:53
Location: 192.168.1.2

Re: Line Follower Help (car steering - not skid steering) w/ PID

Post by nxtreme »

mattallen37 wrote:IIRC, Steve did it with the RCX.
And almost broke the 2 m/s "speed of sound" limit too, if I remember correctly ;).
One King to rule them all, One King to find them,
One King to bring them all and in the darkness bind them
On Earth where Shadows lie.
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: Line Follower Help (car steering - not skid steering) w/ PID

Post by hassenplug »

Yes, it can be done. Here are a few random links:

Our "Indy" racing event - not really car-steering:


Big Rig - one of my favorite:


Two robots, one with front-steering


And, a pretty fast front-steer robot



The biggest problem (as I see it) with your design was the steering. You pointed out the pivot location for the front wheels. If the pivot had been in front of the axle, it would have worked better than your version, where the pivot (where the wheel is attached to the frame) is behind the axle.

With your design, turning the wheels "towards" the line causes the light sensor to move away from the line.

Another issue is the overall length of your car. Because it's so long, it will have a very poor turning radius, so following short turns would be hard.

Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Re: Line Follower Help (car steering - not skid steering) w/ PID

Post by ricardocrl »

Holly yes! I didn't think that changing the position of the pivot would cause the opposite behaviour. That must be making the difference! Very smart look at it! :-))

Even already aborting the solution I'm really glad to find exactly the "little" mistake in the design. It's very annoying to leave an idea not understanding exactly why. Thank you Steve!

Cheers!
rghansen
Posts: 67
Joined: 12 Oct 2010, 17:44

Re: Line Follower Help (car steering - not skid steering) w/ PID

Post by rghansen »

hassenplug wrote:Yes, it can be done. Here are a few random links:
Our "Indy" racing event - not really car-steering:
Big Rig - one of my favorite:
Two robots, one with front-steering
And, a pretty fast front-steer robot

Steve
Those were very impressive videos. Could you provide some additional information about at least some of those models, especially the front steering ones?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests