unit5: simulation / visualization (update)

26
7

Hi,

as per usual I wanted to see what i have just learned in action. I have quickly recoded my A* algorythmn, which i showed off last week, to work "cell by cell" in order to get a non smooth path innately. In addition a safety distance to walls was added. The resulting path (green), is then smoothed (blue).

The car was configured to have a gaussian steering error with a variance of 20% of the current steering and a first order steering lag (PT1) with t=0.2 (95% of desired steering is reached after 5t = 1sec). Since the car has errors now, i can't drive the path exactly (like I did last week), instead the tools we have just learend about have to be used.

PID Settings were: kP: 0.1, kI:0.05, kD:3000. They are guessed (no Twiddle).

P only-VIDEO youtube.com as you can see the car goes mad really fast. At some point the overshoot is so big that it will continue to go in circles because the error stays greater than 0.

PID-VIDEO: youtube.com
It is interesting to see how the PID controller works. When the car is on the very top, before the last sharp turn, it drives paralell to the path. I have found out that this is caused by the integral value. While this error isn't good, it drives overall better with an I-Term. Either it's something you have to accept, or maybe my parameters are just horribly wrong :D

UPDATE: I uploaded the new version to the download page, futhermore I finally made a twiddle code which gave me better values for the pid control. The "run()" function of the twiddler simulated an entire run throught the course shown below (blue line), and summed up the suqare of all errors, just like the one we used in class.

PID-VIDEO2: youtube.com without PT1 lag, without any errors and with the values gained fromt he twiddle code. While the car stays on the path better on average, I have to say it would be a little bit shaky inside this car :P

Screenshot:
screen

asked 19 Mar '12, 15:12

Philipp%20Reitter-1's gravatar image

Philipp Reit...
3.3k161918
accept rate: 16%

edited 01 Apr '12, 15:30

This deserves a bump! Great job!

(19 Mar '12, 18:46) Gundega ♦♦ Gundega's gravatar image

What happens if you reduce the steering error? 20% sounds really really high.

(19 Mar '12, 19:40) Matt Bradley Matt%20Bradley's gravatar image

In the P-only video I kept thinking that your robot was drunk.

Thanks for the outstanding demos! Maybe you should talk to Sebastian about a job at Udacity?

(20 Mar '12, 09:30) MCN MCN's gravatar image

Thanks for the amazing simulations. Good job.

(20 Mar '12, 10:00) Bharathi Bharathi's gravatar image

Just found this. This is great!

(01 Apr '12, 15:44) peteMcC peteMcC's gravatar image

3 Answers:

That is really amazing. Imagine if you had used twiddle to nail those restraints. Imagine, also, if you could incorporate your path optimizer (green line) to stay an average distance away from walls on adjacent sides, then did the rest.

Then again, these vids show the importance of the ID in PID.

Very impressive.

link

answered 19 Mar '12, 15:27

tonio337's gravatar image

tonio337
382213

Why does robot move in a circle by P controller? It even moves back. Why?

link

answered 20 Mar '12, 07:27

Tran%20Duc%20Hieu-1's gravatar image

Tran Duc Hieu-1
2.6k132744

because the steering angle is only calculated off the CTE. At some point the car is facing the track but there is still error so the steering continues.

(20 Mar '12, 08:34) Philipp Reit... Philipp%20Reitter-1's gravatar image

awful! Amazing! Have you tried to combine this with the partial knowledge of the map as shown last week? And to use twiddle as well? Can you give us also this week's code?

link

answered 20 Mar '12, 10:12

Roberto%20Scordino-4's gravatar image

Roberto Scor...
89921232

i uploaded the new code and added twiddle, i will try to combine everything i have simulated so far next week, when in class we put everything together too. stay tuned!

(20 Mar '12, 15:51) Philipp Reit... Philipp%20Reitter-1's gravatar image
Your answer
Question text:

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5,185
×133
×101
×57
×36
×23

Asked: 19 Mar '12, 15:12

Seen: 1,004 times

Last updated: 01 Apr '12, 15:44