View unanswered posts | View active topics It is currently Thu Aug 21, 2014 4:49 am






Reply to topic  [ 13 posts ] 
implementing ILC in LEGO 
Author Message
Rookie

Joined: Tue Nov 08, 2011 11:25 am
Posts: 6
Post implementing ILC in LEGO
hello,
can anyone help us from where to start with implementing ILC in LEGO kit?

Thanks in advance,
G Hariprasad


Tue Nov 08, 2011 11:27 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: implementing ILC in LEGO
I am very bad on acronyms. What is ILC? International Linear Collider? ISDN Link Controller? Instruction Length Code? Intelligent LAN Control? Ion/Liquid Chromatography? It would help if you can provide more info on what you need help on.


Tue Nov 08, 2011 3:27 pm
Profile
Rookie

Joined: Tue Nov 08, 2011 11:25 am
Posts: 6
Post Re: implementing ILC in LEGO
Hello, Thanks for ur reply. ILC is iterative learning control. sorry for the short form.


Tue Nov 08, 2011 3:34 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: implementing ILC in LEGO
That still doesn't give me too much info. What is Iterative Learning Control and what problems do you have?


Tue Nov 08, 2011 3:38 pm
Profile
Rookie

Joined: Tue Nov 08, 2011 11:25 am
Posts: 6
Post Re: implementing ILC in LEGO
hello,
ILC is an algorithm and we need to implement it in a simple line follower robo constructed using LEGO kit. this is a project we are doing. I am looking for some detailed explanation of how to implement such thing. it is something like calculating the speed, mean deviation from the track and speed for each lap and changing the above mentioned parameters for next lap.


Tue Nov 08, 2011 3:46 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: implementing ILC in LEGO
From what I learned about ILC, it seems this is basically PID control. But your description seems slightly different.
http://en.wikipedia.org/wiki/Iterative_learning_control
Do you have some code that you are working on and need help with? Or are you not even started? If you have some code, please post it and ask specific question on what's not working. If you haven't started and want to figure out how to apply ILC to your line following algorithm, then you may need to explain what exactly you want to do.


Tue Nov 08, 2011 8:13 pm
Profile
Online
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3188
Location: Rotterdam, The Netherlands
Post Re: implementing ILC in LEGO
Quote:
can anyone help us from where to start with implementing ILC in LEGO kit?

You could start by making sure you fully understand the algorithm in question. I have a notebook I keep this kind of thing in. When I am sure I understand how it works, I start writing some code.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Nov 09, 2011 2:35 am
Profile WWW
Rookie

Joined: Tue Nov 08, 2011 11:25 am
Posts: 6
Post Re: implementing ILC in LEGO
@MHTS, Hello the same algorithm mentioned in the wikipedia has to be implemented. We have not written any code. We have a code written for a simple line follower robot. Just planning to implement the algorithm in the line follower code.

We need to make the robot run one lap in the test track once. calculate the speed, mean deviation from the track and time to complete the track. In the next lap we need to reduce the mean deviation and time taken and the speed must increase. This is our understanding. If this is wrong then please correct me.

Or if we are supposed to start from scratch also we are ready to do the same.

Thanks for your reply.


Wed Nov 09, 2011 8:10 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: implementing ILC in LEGO
It looks like ILC is like PID control but looking at the entire course to come up with the Ep (error) and to tune the input U(p+1) for the next iteration. I am not familiar with ILC, so I can't really help much unless I research the subject. But from what I understand from wikipedia, the first thing is to define what this error (Ep) is. So while you are running the course, you need to gather data to compute the Ep (for example, mean deviation as you said). Then the next thing is to figure out what is the U(p+1) parameter that you can tune that will affect the line following performance. That's the tough one. I suppose you can use PID control and the three PID constants (Kp, Ki and Kd) as the parameters that you can tune. For example, by measuring the time to target, you can tune Kp, by measuring the steady state error, you can tune Ki and Kd etc.
You may want to also read about PID control (http://en.wikipedia.org/wiki/PID_controller). In particular, there are ways to auto tune PID (e.g. Ziegler-Nichols method). In theory, you could write code to measure the oscillation period and to compute the three PID constants accordingly.
These are some of the ideas I have that may get you started. Good luck.


Wed Nov 09, 2011 2:17 pm
Profile
Rookie
User avatar

Joined: Sun Jan 02, 2011 1:57 am
Posts: 31
Post Re: implementing ILC in LEGO
so if i understand correctly here's kind of what you want to do?

with a line following robot, you should have a threshold value between the light and dark areas... lets start with 50 for example...

you basically are looking to take the actual read values for light and dark and then use that to more accurately measure the value of this threshold?

so lets say you take 50 as your starting threshold and then run around the track once and find that the average "Dark" value is 33 and the average "Light" value is 53. inorder to make your line follower more accurate, you can take the difference between these two averages and divide by 2 to find the new threshold value... so in this case it would be 43 as the new threshold value?

some questions come up though... are you looking to make this a faster process say... take the average of 5 checks and then recalculate the threshold?

or am i completely wrong in my assumptions?

_________________
Karan Hiremath
FTC Team 110- MFS Foxes
Co-Captain
Head Programmer
Builder
Electrical
Service Coordinator


Wed Nov 09, 2011 10:20 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: implementing ILC in LEGO
I think it's slightly more complicated than that. It is relatively easy to determine the threshold, just one sample of light and one sample of dark and take the average of them. However, if you want to improve your "lap time", you need to figure out what you spent your time on. One time saver is to minimize the "wiggling" of line following. This could be done by a fine tuned PID controller. Another way is to learn where the "curves" are and drive as fast as you could on straight line portion of the course and slow down appropriately if you learned from previous runs that a curve is coming up. If you combine both of these strategies, you could cut down your lap time substantially on your next run.


Wed Nov 09, 2011 11:46 pm
Profile
Rookie
User avatar

Joined: Sun Jan 02, 2011 1:57 am
Posts: 31
Post Re: implementing ILC in LEGO
well yeah he could be looking for a PID control but ILC itself is really more of a simpler feedback loop... its asking you to determine the error during the last iteration, which would be in this case the distance the ideal threshold would be from the current threshold, and then multiplying that by some factor and adding it to the new threshold... if you want to add motor power control into this, i would say use the current error value times the Constant (the K*ep term) as a motor step down and step up for the left and right motors. Then you can add in the determination for what values your robot should be driving straight. If i were doing that with this method, I would take the K*ep term and make that the upper and lower bounds of the straight range. although you may want some other constant if it seems to be driving straight for too large a value zone.

MHTS: generally for line tracking, your goal is to get that initial threshold value closer to what is actually being received, then figure out what i call the "safe zone" or the area of values for which your robot can drive straight and not have to do the "wiggling" you speak of... usually what i have tried to do is basically take the values collected for high and low then determine the center value and the top and bottom ranges during which time you can drive straight. i've generally done that by using PID to find the +- of the center value but what he's asking for seems to be slightly different... he's really not at all interested in the I and D terms... just the P term.

_________________
Karan Hiremath
FTC Team 110- MFS Foxes
Co-Captain
Head Programmer
Builder
Electrical
Service Coordinator


Thu Nov 10, 2011 2:36 am
Profile
Rookie

Joined: Tue Nov 08, 2011 11:25 am
Posts: 6
Post Re: implementing ILC in LEGO
Hello everyone,
We have been writing code in robotc to implement the ILC controller. Now we get this error displayed at the LEGO mindstorms kit.
pgmcnt:0000FF
line:7

Can anyone explain what is this error?


Mon Dec 26, 2011 11:31 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.