Friday, December 7, 2012

Why do robotics?

As I was promoting VEX to some 8th and 9th graders I got a question that caught me off guard.  Simply put, I was asked "How or why would playing with robots help me get into school or get a job?"

The question made me wonder how people really look at middle school and high school robotics. 

Here is my response:

Robotics is simply a mechanical and software medium on which to work as a team to solve problems.  Working together to solve problems is a skill that seems so easy yet is elusive for many.  Learning how to communicate with teammates, learning how to LISTEN to teammates.  Learning how to fail in front of teammates and then learning how to watch someone fail but then learn from the experience.  All of these are skills which are key life skills.  You learn this at VEX, USFirst or even playing basketball, Boy Scouts or Girl Scouts.

Below is a link to a video which may or may not help connect the dots for you.  To me, it lets one see raw new technology before its full utility or usefulness is understood.  Just as the mouse was developed in a XEROX research lab but was used in an unexpected way by Apple, this MIT video shows something that is being explored as a team.  Along the way they developed some unexpected technology.  Note his frequent use of WE.  I bet there was a team of programmers as well as electrical and mechanical engineers working on this concept.  Same thing in VEX or First LEGO League.  Some kids program, some build, some stratagize.  It is doing it together so that the "sum of the parts is greater than the whole" that is so important.


Wednesday, March 7, 2012

Yappin' Yodas at Hopkinton Library display case info

Hi.  We are the Yappin' Yodas.  A neighborhood First Lego League team from Hopkinton.  Last year we competed in our third season.  The 2011 competition was called FOOD FACTOR.  We had a lot of fun and wish to help other kids our age have just as much fun as we have over the past three years.

So, we put together some fun LEGO pieces from the past few years for you to enjoy.

The best place to learn more about First LEGO League is their website which can be found HERE.

Wednesday, December 21, 2011

Impressive programming and design

The video above is simply amazing.  Let's face it, humans can find learning how to ride a bike a challenge.  Why?  There are a lot of things happening at the same time that are all inter-related.  Steering, pedal force varies by where you are in the rotation and can vary on either side.  In short, it is very complex.  Riding a bike uses  the human's "inner ear" for balance control.  The robot uses a gyro to manage balance.  In short, this is very impressive programming.  And, it uses that silly PID we are going to learn someday.

Anything is possible!

Tuesday, December 20, 2011

NXT...and what is a "brick" anyway?

I get calls this time of year asking about what is what.  I will make a breif summary and then get into the details.

Retail.  Currently the retail model is LEGO item 8547 which is LEGO Mindstorms NXT 2.0.  Three years ago there was LEGO item 8527 which was LEGO Mindstorms NXT 1.0.  The "hardware" such as the controller or "brain", motors pieces etc are the same.  The KEY difference is the Software which is faster and more robust than 1.0.  And, the light sensor was replaced with a color sensor.  After three years and 7th out of 50 teams, we used the older light sensor.  In short, the hardware is all the same but it is nice to have the NXT 2.0 software.

Where to find them?  Fast but full price, the LEGO store at the Burlington Mall in Massachusetts.  Use Froogle.com.  Or, buy used from eBay or Craigs list.  At risk for used stuff could be, missing important parts like a motor, wires, sensors, original SW disk, USB Cable.  Or, a controller (aka brick, aka brain) that had a battery leak.  I am here to help share my knowledge so ask.  But, I am not suggesting I am an expert.

More info.

If you really get going with LEGO Mindstorms NXT and plan or want to get a FLL team going, I would strongly encourage one to find the Education set, LEGO item 9797.  The big benefit, it comes with a rechargeable battery and charger.  Sure, it might have a few extra pieces but not critical.  It also comes in a sorting tub and tray.  You will have to buy a tackle box with a retail kit as the box it comes in is useless.  My point, you get more for your money even though it costs a little more.

Older NXT bricks are fine.  They can be flashed with the current Firmware from LEGO Education.  The key thing to look out for is a brick that had a battery leak.  :(.

I also learned that if your brick makes sounds but the screen does not display, this is a known problem and I was able to get two of mine replaced with new units from LEGO.

Plastic?  All LEGO should be collected!  But, LEGO Technic pieces are heavily used.  Lastly, something many folks don't realize.  Once you master the software that comes with the NXT, called NXT-G, you can also buy educational software such as RobotC or even full blown LabView and use the controller with far more advanced software. 



Thursday, December 15, 2011

Interwoven Interests

One would have to categorize this blog as being somewhat "robotics centric".  At a meeting last night we heard about how youth should use this time to discover what they really enjoy.  What sparks a passion.  I agree.  What better time to sample everything out there.  Robotics was presented as one of those "entrees" to sample.  But, I think it goes much beyond that.

Robotics could be pigeon holed into geeks with motors and sensors pounding on the keyboard, writing in some unintelligible machine language.  That would be a shame!  IMO, it is really just a platform by which youth can start developing their curiosity and passion for problem solving.  Not to mention just good old fashioned patience and persistence.  Whether it is robotics or rowing, one must develop patience, persistence and vision.

Today I came upon an interesting stop motion video using real models, not CGI.  (See right video)  In watching this stop motion video, the complexity of how both the camera and the subjects had to move in a highly synchronized, multi-plane imaging technique blew me away.  And, due to my curiosity, I had to learn more.  Only after watching it a few time did I realize how much hidden (subliminal) messaging was happening and the amount of intellectual thought that went into making this clip.

It struck me as a collision of so many important skills which youth can explore today.  I guess the term used today is "multi-displinary".  Kids should realize that one passion might be instrumental in helping another person or group achieve their goal.  Everything is so intertwined today.  In this video, we see creative concepts, computerized model making, lighting, acting, team work, programming, digital art, scrip writing and so many more skills all collaborating to project a single message. (see right for how it was made)

The talents of so many diverse people were brought to bare on this 2 minute, 20 second piece of art I thought it was worth calling to the attention of others.  Whether it was the creative team dreaming up how the leaves would be off the trees after the factory or how the farmer's mustache turns grey by the end.  3 million hits later, it is a VERY powerful creation.  Using highly programmed "robotic" camera technology I might add.

Tuesday, December 13, 2011

Tip #2 for Toop 77 Robotics Merit Badge

Justin attacked his program tonight and he got most of it.  One thing about programming, it teaches you patience and problem solving.  A sensor can be thought of as eyes.  They are constantly providing a "feedback loop" to the brain.  We see a ball coming right at us, the body moves due to the eyes or "sensors" telling the brain "controller" what to do like "duck" or "stop".

In programming speak this means we must use a "loop" which is constantly getting feedback from the sensor.  Like 2000 time per second!  We are wanting the bot to sense if it is getting close to something.  Think of this as a Yes, I'm near or No, I'm far away.  This is also known as a switch, on or off.  Or, close or not close.  So, we put a switch inside the loop.  So, 2000 time per second the program is asking this switch are you close or not?  When it gets a YES, I'm close, stop the loop and wait for the next command.  In my sample, I use a sound block saying "object detected".  Why not, it is one of the sound options!

Here is where the tricky part comes.  How do you exit the loop or "get off the merry go round?  The only way I know how is to use a "logic loop" and a "variable".  Ya, not very intuitive but like any language, you have to learn something new.  And once you read this, you will completely get it and use it often in programming.

I create a variable called EndLoop.  Set the end loop to false outside the loop.  Put a "write to" variable right after you stop the motors in the switch which will instantly change the EndLoop variable from FALSE to TRUE. (remember, you set it to FALSE outside the loop)  Then, in the loop, have the EndLoop variable write the value to the logic loop using a wire.  So, when the EndLoop is true, stop the loop.  We can cover this Wednesday night for those of you who have had little to no NXT-G experience.


Sunday, December 11, 2011

VEX field trip update


More photos go HERE.

We drove down to Boston University Academy and found that not only did they have a VEX competition, they also had a FLL regional.  In one gym, at the same time.  In short, it was hard to get a handle on what was going on.  Very hard.  For the VEX field, if you were not standing at the edge of the field, you could not see what was going on even if you were 6ft tall.  Did not work well for spectators.  We got to the edge for one match.  To see some experienced competitors going at it look HERE.

We spoke with the kids and although they were busy fixing, altering their robots, they were less clear on the programming language being used.  Ultimately we concluded all teams were using a CORTEX controller and EasyC.  One coach showed us EasyC and it is much more like NXT-G.  No one that we could find was using RobotC or a C based language.

That said, it did not appear to be so advanced that middle school kids could not have fun competing with HS age kids.  Autonomous was less than advanced.  Bots often did not have the maneuverability to get to scoring elements.  Strategy did not seem that overwhelming either.

I think what was lacking yesterday was the celebration of the youth and recognition of both what failed and what worked.  Both are critically important means of learning.  VEX was second fiddle to FLL.

What next?  Not really sure.

EasyC vs. RobotC.

You can look at past posts to dig up info on RobotC.  Based on my research, EasyC may be easier than RobotC for kids who are not yet in love with figuring out a programming language.  No doubt learning RobotC based on THE most common and universal language, C, would be prudent.  But, for the casual kid and mentor, EasyC looks a little less intimidating.

At issue is the "portability" of the language you select accross all the possible controllers.  For a FLL team, you already have LEGO NXT controllers.  For a new VEX team, older PIC controllers are sufficient to get one's feet wet and are readily available with minimal to no investment. But, you would have to buy EasyC twice if you started with PIC.  The last competition said it was PIC ready but when I spoke to a knowledgeable coach, he said he doubted they would be able to handle PIC if we had show up with PIC bot.  In a perfect world you would just start with CORTEX and reduce potential down stream hassles.  An expensive way to start in the event the team does not find it of interest.




Langauge Options
Controller(s) NXT-G RobotC EasyC
NXT Y Yes $74 Not available
VEX PIC Yes $74 for both PIC/CORTEX Yes $75 PIC version V.2
VEX CORTEX Yes $74 for both PIC/CORTEX Yes $75 CORTEX Version V.4























Saturday, December 10, 2011

VEX Road Trip to Boston

For the first time in many many weeks, Justin and I have some "non scheduled" time.  So, why not drive the 75 miles down to Boston University Academy and see what this small VEX scrimmage is all about.

Take some notes, see what folks are doing and see if it looks like fun.  Hopefully it is not so small and informal that it is difficult to get a feel for the true event.  We hope folks will be willing to chat with us about VEX, as the competition would seem to be an early warm up for other major events.  One team from ME.  Something tells me they will be well sorted.  3 teams from a VoTech school in Fitchburg.  And a true middle school from Melrose.  Interesting that a Middle School team and a High School team will be both competing and working together as aliances.

This will also serve as one more step toward the BSA Merit Badge as one of the requirements is to attend a robotics competition.  Here is a list of other events in the region.  Our HS engineering teacher said I could just borrow a VEX PIC system and play if that is what would create some interest.  At this point, it is a one man band.  After today we should know the path forward.  I think it would be possible to field a robot for the Concord event in March.

Local VEX events   As of 12/2011, more will be added I am told.
12/10/11   Boston, MA (75 miles from Hopkinton, NH)
01/07/12   Worcester, MA (97 m)
01/14/12   North Conway, NH (97 m)
01/16/12   Boston, MA  (Monday) (75 m)
01/21/12   Thetford, VT (70 m)
02/25/12   Wilton, NH (37 m)
03/03/12   Worcester, MA (97 m)
03/10/12   Concord, NH (10 m)


FRC (First Robotics Competition) Schedule
Granite State Regional Manchester NH  Mar 1-3rd
North East Utilities Hartford CT Regional   Mar 29-31st

FTC (First Tech Challenge) Schedule
WAPAC Regional, Antrim, NH Mar 10th

Friday, December 9, 2011

Clearly some minds are wired differently than mine

I was looking for some tips on how to sum the error to add the I to my P.  (PID).  I came upon this video.  Why folks are worried about what parts he used to build it.  To me, it is the program that I cannot get my head around.  It looks like it is only capturing some of the 54 "color facets" that make up a Rubrics Cube.  It would seem to me you need each facet to solve the problem.  Interesting stuff!


Thursday, December 8, 2011

Tip #1 for Troop 77 Robotics Merit Badge

I am going to assume building the Five Minute Bot and adding the ultrasonic sensor was a no brainer.  The hardest part was finding 6 good batteries.

So.  Where to begin.  Well, you can actually use some math just to see that there is a reason you learn this stuff.  We call recall that Circumference = Pi * Diameter.  LEGO is kinda twisted and they actually put the diameter on the rubber tire.  In this case, the subject tire is a 56mm diameter.  So, some simple math tells you it is approx 176mm circumfrence.  So, how many of those fit into a meter?  Basic quick math.  You have to do that.  But, fractions of rotations gets messy when you have a much better tool at your disposal.

DEGREES!  Yup, you can control your robot by telling it how many degrees to go and get VERY accurate results vs. just random guessing.  So, we all know there are 360 degrees in a circle (rotation) so how many mm are there in a degree?

So, now you have this silly number but, you only have to use it ONCE.  Although the true number is smaller, let's just pretend it is .5mm.  If 1 degree turn of the tire is .5mm, how many degrees do we need to travel to complete 1 meter?  1 meter is 100 cm.  Or, 1,000 mm.  My math tells me 2,000 degrees.

In short, having demensions, math formulas you can figure a lot out before you even program.  This is helpful when an engineer needs to design something to explore the surface of Mars.  Too far out?  Did you know that Trinity College in CT is the center for developing robots to fight fires and reduce the risk to Firemen?

To demonstrate.  You should do the math.  But, if you want to travel 1 meter with 56mm diameter tires, you need to program the motor to go 2,045 degrees.....you just might find it traveled 1 meter.

Yup, all that math you learn can be used in the real world.  Let's hope I did it right!

Next:  Simple blocks.  You want your bot to move straight.  You want to use MOVE blocks when you want to make your bot go straight.  That is because the MOVE block makes sure both wheels turn the same amount.  Motor blocks are for single motor driven items. If you want to learn more see this YOU TUBE video.  Go to 6:55 if you want to get to the key point.

With this and other tips, you should be able to easily get to the soda can with your first program.

Good Luck!

Sunday, December 4, 2011

Withdrawal anyone? Top Ten Topics To Try To Test...

So, what do we want to do next other than enjoy the holidays?  Hopefully a bunch of NXT sets are in Santa's Sleigh and we can have some fun post holidays exploring things we wanted to understand but did not have the time during the season.

Here is a random list of 10 items.  Email me or comment on the blog if you have any particular item you want to pursue.

  1. Using FileAccess block to capture and create independent thresholds for each light sensor port and see what happens.
  2. Using the logging feature to capture the LS readings while hunting for lines or following lines....see what it tells us when we miss lines.
  3. Solve the BlueTooth issues.....that is no fun but we're stumped.
  4. Build a line follower that will be faster than our current PLF program.  Add the integral??  The Derivative?
  5. Explore other SW options for NXT controller to see if VEX or FTC would be cool.  They tend to use RobotC or EasyC. RobotC can be run on the NXT but at this point  EasyC seems to be exclusive to the VEX controller world.  EasyC is "graphical" similar to NXT-G so it is something to be reviewed.  I know zero about either.  I also read National Instruments is working to offer something between NXT-G and full blown LabView.
  6. Explore use of HiTehcnic sensors.  We have 1 Gryo Sensor and 1 Accelerometer Sensor.  Want to explore?  Just ask.  They are sitting in my box of LEGO stuff. Based on what the links say, it is clear one could play with these sensors and RobotC.
  7. Have a skills session for local teams at Maple Street with basic challenges up to a line follower competition.
  8. Go to a VEX or FTC meet.
  9. Work to make a standard joystick (game controller) drive an NXT as we see in the RobotC promo video.
  10. Have fun!
RobotC Reference links: (aka, extra reading and exploration)
One -  Using RobotC on NXT
Two -  RobotC overview, maybe the "...over 100 sample programs..." will help jump start NXT-G types?? 
Three - code to help "replicate" NXT-G blocks. 
Four -  RobotC and a Gyro to control precise turns. COOL compared to NXT!


NH States in review

As with every year we have gone to the States, it was filled with excitement and drama which will not be soon forgotten.  Driving to Manchester at 6 am, cloaked in darkness as the horizon just began to turn orange is an exciting way to begin the 12 hour day.  Of the 180 registered teams in NH, 50 teams were invited to States to vie for the chance to go to St. Louis to represent the New Hampshire.  Because there are over 20,000 FLL teams world wide this season, only an elite few are invited to the Global Championship. Read about FLL here.

We did our very best to compete with all our Gracious Professionalism and enthusiasm for those who toiled for 3 months over bright colored plastic pieces.  Writing code for a much under appreciated 32 bit controller which is managed by NXT-G 2.0, a simplified version of National Instrument's LabView.  When you look at what some teams are able to accomplish in 2 minutes and 30 seconds, it is truly amazing.

The Yappin' Yodas should be proud of their efforts as we ended up 7th overall.  Although those teams ahead of us were scoring more points than our theoretical perfect run, we still held our own with 166 points which was 32 points below our perfect score.  It is always harder at competition to do as well as you can at home.  Keep in mind the table makes up only 25% of your overall score.

16 trophies sat on the table as the day began to wind to a close.  Top teams walk away with more than one making it that more rewarding that this years team left with a coveted yellow LEGO trophy for First in Inspiration.  Maybe it was the ears, maybe it was helping others, or maybe just wanting to make sure everyone walked away feeling good after their table run.  The team was recognized for their effort by winning the Inspiration Award!  VERY exciting if not INSPIRING stuff!

For a peek into what our day was like, enjoy the Calder's video compiled from yesterday.

Next year's theme was announced as well.  Senior Solutions!  Become a follower of this Blog to get updates about FLL in Hopkinton/Contoocook.


Thursday, December 1, 2011

Want to go PRO*?

Sadly we will miss a local VEX competition that is being held on Saturday while we are at States.  I had hoped I could take our FLL team to a NH VEX event so you could see what else is going on out there.  I might add there is NO PROJECT.  Team members can tell me they want to try it and mentors will dig in and see what options are out there for you.

Here is a young person who started at 12.  Looks like fun. 

Joshua Wade
Josh sharing details of his bot
His robot in action with driver

Below is his bot in 100% autonomous mode, check out those ATLs! (advance to line)



Be the most you can be!  Always take the initiative!

* A reference to the NHPR radio segment the Yodas were on where one person indicated all FLL team members can become a pro.  Not something possible in athletics.  

Wednesday, November 30, 2011

PID (proportional integral derivative)

So, first, I will have to say I am as much a student of how to write a PID as everyone else on the team.  I self taught myself the P last year and attempted the I after States.  It ran but I did not get much of an improvement.  After reading the "PID How To" again, I am not sure I was doing it correctly.

Here is a nice link telling us how to do it.  I think the MATH junkies on the team should push me to make some time to try to get this done on some cold winter weekend.  We could use it next year! 

"PID How To"

You can Google PID and NXT and FLL and find tons of  info.  Too much really.  Here is a great job of writing a PID using NXT-G.  Past years I have looked at it and it was beyond me.  But, I suspect we have learned a lot more this year and might be able to use it to help us write the I part of code.

PID using NXT-G 2.0

A great video showing what a PID can do for a NXT if you know how to write the code.  Maybe some day I'll figure it out.  Hopefully one of you will beat me to it.  Maybe we should have a line following contest this winter.



More PID reference material.
One - You may not need a PhD but you need a Masters degree.  Not helpful for me.
Two - Interesting Stop Motion Video in Spanish with English subtitles.
Three

Table Lights and Kelvin as a new Measure.

It is no secret that the Yappin' Yodas have struggled with light sensors.  It has been a two year struggle and we are only just beginning to get some traction.  The list of variables and built in limitation with the NXT kit really makes it a challenge.

One area that this coach investigated is the lighting.  Each year we go to an event and the lighting on the table looks almost blue vs. the warm yellow at our house.  Last year at States, light sensor driven programs that worked flawlessly at home failed.  Folks are still sore over that.  But, to reinforce persistence, we still fight with them.

Further, for rookie teams they don't even suggest a light over the table for the home practice mat.  To me, if you are using light sensors, that is just one more variable when you get to the competition.  Supposedly, a well shielded light sensor will do well regardless of ambient light.  I am still from Missouri on that one.

I looked at the lamps used at Bishop Brady and I was told by a judge they were spec'ed by USFirst.  They were GE T8 32w Daylight 6500k.  Vs. our old lamps which were GE T12 Ecolux 40w Chroma which have a color value of about 5000k.  For $8 I was able to find a 6500k tube in T12 so that is what we use now.  If nothing else, we are trying to isolate the variables.

To learn more about Kelvin and temperature color go HERE. And if you really want to see the marketing science behind lighting, read this GE brochure.  If nothing else, it makes you realize there is real science behind EVERYTHING around you.

Tuesday, November 29, 2011

NHPR podcast from Bishop Brady re FLL.

I am sure this link at some time will expire but for now here it is if you want to share it with anyone.

NHPR "Word of Mouth" segment

Congrats Yappin' Yodas!

Coach

Score sheet for reference

I figure by putting here we can find it in the future....FAST!



Brain vs. Brawn in 13 seconds

After dinner I decided to dig up last year's MyBlock with our proportional line follower routine.  I opened Justin's "Baby Fish" and copied it to a blank or 'new' file.  I copied the loops from last years proportional line follower (PLF) and also pasted it to this new file.  Merged it together, re defined the variables as they don't copy, and POOF!  less than 5 runs to get things right and it worked three times in a row.  See video.

Notes:  
Original file lacked BURM.  Fixed.  Ahem!
Original file had very high power levels (90) causing wheel slip.  All reduced to 60. Ahem!
Changed the really long run from 1900 to about 1130 degrees...using the old NXT RB to test for the sweet spot.
I played with the gain value which was on .3.  Gain or "correction factor" is a difficult concept.  Recall last year we wanted to "cool" or "modulate" the correction factor?.   .4 was too sloppy and could lose the line.  .2 was kinda too wiggly as it fought to stay on the EXACT edge of the line.  I settled on .25 gain but .3 might have been a better number.  Upped the power from 20 to 30 on the PLF motor block so it would go faster along the line.  We might even go higher if you want to test it.  I was doing a quick and dirty proof of concept.  You guys can polish it up.
Changed the loop which contains the PLF logic to a 15 second loop which will hold it on the wall.
That's about it.

"Dry run" or "pre pen to paper" (or fingers to keyboard) considerations:  Aka, never "ready fire aim!"
I guess the pre engineering was deciding which sensor to use.  Since we calibrate P1, our preference should be to use P1.  There were two options for P1, either North or South edge of the line.  Based on the objective of not spilling the purple bacteria, the decision was easy.  Read, we got lucky.  But something smart folks look at first.  In theory, there were four options.  P1, North or South edge or P2, North or South edge.  Quick eyeball with the bot on the mat and viola.


Coach's Coaching Comments:
13 seconds of Brains vs. 7 seconds of Brawn.  I guess I don't understand the lack of interest in re-using earlier learnings.  You want to build upon what you learn every day whether robotics or life.  Even if you are not sure you learned it correctly, you MUST have the courage test your learnings.  Sometimes failing is the best way to learn.  To avoid testing what you have learned will cause you a great deal of heartache down the road.

Enjoy the video and be the best you can be! Maybe after States we can look at a more robust line follower and add I and D of PID.


Travails of the dreaded light sensors Part II

After you left last night I tried to get a good video to add to Part I.  But, after all of Max's work on the new ATB5 program, it would not work when put into Yoda11.  It would not work when put into PinkBaceria either.  But, by itself it would work.  I reviewed the code and could find nothing that would cause this problem.  I even posted on the FLL forum asking for help.  I will spare you the digital ink.  You can look it up if you want.

For some reason this morning I ran PinkBaceria without the rake attachment.  AND IT WORKED!  Huge HMMMMMMM?  I ran Yoda11 without the rake and it AGIAN WORKED!  Another big HMMMMMMM??  I again looked at the code and ArmDown has nothing to do with anything related to motor B or C or any sensor port.  It made no sense!

Have you figured it out yet???  What took me 3 hours to sort out is as clear as the nose on your and my face!

Think MECHANICAL!  Think GRAVITY.  Think about the LEVER or about the MECHANICAL ADVANTAGE the rake has on the bot if not 100% supported by the mat.  Stop blaming the program!!

Getting closer?


Well, it would seem that not 100% of the rake's weight was off the bot.  This pulled LS1 closer to the mat so it was not getting a good read.  MB_MAX is currently looking for something > 99 intensity.  A tad extreme but it does seem to be working off of the brown mat.  You can change it if you want.  We learned last year when the LS touches the mat, the reading is ZERO because the light generator is effectively turned off.  White mat touching the light sensor will still read ZERO.

So, see the video below.  Time to see if the Table attachment causes us similar pain.


Monday, November 28, 2011

Travails of the dreaded light sensors Part I

Let us review a bit.

We have a few things which are causing us headaches.  Headaches only because we have to REALLY use our grey matter.  AKA, use our brains.

Last year we followed a black and white edge.  Recall the proportional line follower and our desire to be at 50% intensity.  And, the lines we used to align to were surrounded by WHITE!  Well, this year things are different.

The two major killers for us this year are:
  • We are using the crude NXT-G calibration block which is limited to calibrating just one port.  All the other ports have to use the "master" port calibration.  We have seen this causes inaccuracies.  As info, we calibrate P1, P2 has to deal with whatever P1 read.
  • The mat has COLOR and the white and black areas are small targets relative to last year's lines and it therefore impacts the viability of our ATL (advance to line) strategy.
So, we really have to think outside the box.  I believe we assumed we could simply re-use last year's code and did not give much more thought to it.  Myself included.  But, when it failed to work, we need to LOOK and not just react in frustration.

What we have done:

Perhaps I helped a little bit too much, but I wrote a program to read BOTH intensity and raw light sensor readings from each light sensor (or port) to the display.  This was HIGHLY educational for the team.  The team could now SEE how some areas of the brown would give us 0 intensity.  Madness, but if you are willing to put up with the crude NXT-G calibration block, these are the cards you are dealt and we must learn how to play to win.

On Monday we found we could get 100 intensity light reading on brown for PinkBacteria.  So, we went for a "sniff for black first" strategy.  Today, we seem to find 15 intensity in brown.  HUH??!?!?!  This is still a bit concerning but tonight I feel like we were really watching and thinking, more than Monday.

Very odd stuff but I am not discouraged.  At least now we UNDERSTAND what is eating our lunch.  I can live with that much easier than resigning ourselves to being unable to understand or even correctly identify the variable causing us pain.  You need to understand this too! If you don't, ASK QUESTIONS!

As of tonight we have at least three options.

Option A (MB_ATB4):

This program sniffs for black first on brown.  We had black set at 20 intensity or lower.  It would find values less than 20 and turn one motor...Lost Advance To Black (LATB).  But....after tweaking the threshold down to 3, it works great for the brown, light blue and dark blue.

Option B (MB_ATB5) Now MB_Max

Because of he insanity we were having with 20 intensity failing, Max made a ATB5 which sniffs for white, like 90 intensity!  And then advance to black, etc etc.  It too worked well.

Option C (Use both depending on which works best on the various 'non white' backgrounds)

We may find that one or the other works better on the various backgrounds and use different MBs for each program.  Testing is required.

So, at the risk of making this way too confusing, we now UNDERSTAND what is going on. We may not like it but we understand.  If we were really good, we'd log the two sensors readings during the run and then analyze the data and use this to help us decide what threshold to use for match2.  My point, we need to watch what happens and know what to look for.

See Part II for more drama.

Tuesday, November 22, 2011

Memorable design concept

Before I deleted this video from GoogleDocs I thought I would post it on YouTube for the blog.  Simplicity in 9 seconds.  Great work guys, keep it up.  We called this the "Lunar Module" concept.  Who says indices are limited to being used only in base?


Brian Davis' excelent post

On the FLL forum I found a great post with video of programming tips from Brian Davis.  They are longish and likely just taken one at a time when you don't have distractions.  All sorts of nuggets.  Even some cool math!

Forum Link  (The appetizer)

Direct YouTube link (The main course)
 
The reward of good programming  (Dessert)



More than coach has time to digest at this red hot moment.  But I would like to know how he addresses the two light sensor calibration.  I have not taken the time to dig out that nugget.  Could be very useful to us if it is not overly complex.

Sunday, November 20, 2011

Blaue Ratte

This is how it's done by 6:30pm :P

Can we do this first instead of the fish?

-Justin

Take two....with a Move block replacing the motor block.  Using GOM Player you can see it is smoother.  And now we hit the ball on the way back just in case it is still there.

Breakthrough. MOVE vs MOTOR Block learning!



As I was helping a rookie team program, I went back to our favorite mentor, the Cougar Robotic's website, to ensure I was correct in one point.  But I found I was incorrect.  It was the old Move vs. Motor block discussion.  It has been the Yappin' Yoda's rule to always use a motor block when a single motor is being used to turn.  Yet I reviewed the Cougar Bot's presentation and they use a single motor Move block to affect turns.  Hummm #1.


We we believed the primary difference was....


Move blocks have an "internal" PID (Proportional Integral Derivative) correction formula and by use of rotation sensors on each motor, the Move block ensures both motors complete the specified degrees.

The Motor block does not have this correction and to avoid confusion, we always use a motor block when turning one motor and then switch back to a move block when we go straight driving both motors.



As I did more research I read what LEGO Engineering had to say and it seems they suggest use of the Move block when precision is your objective.  And if that is not enough of a "where have you been?", check out this beautifully presented piece on the difference between the two.  Hummm #2.



This just goes to show how we can all learn from each other, or in this case, "unlearn" what we have believed to be true and "relearn" a better approach.

So, which would be better in our Advance To Line program?  A Motor or a Move?  Hummm #3.


Mechanical advantage....and the Fridge Truck

Recall we had explored an option to LIFT the fridge truck with our motor.  In short, the cool magnet holder had promise but the motor did not have the torque needed to lift this heavy table element.  We opted to not explore gears given time constraint.

Well, Brain Davis had some simple gears that were of interest and might be usable without too much modification of our existing attachments.  We gave one a try and with a battery at 6.7 we accomplished the following lift.  It still needs some exploration.

Two useful resources for gears.
Worm gear casings
Tutorial on gears.....the above video uses a 12 driving a 20...what is the mechanical advantage???  (more than 1, less than 2)  How can we get more?

ATL and light sensor variability discussion

Advance to Line...or Advance to White (ATW) as we call it now.  The program relies on two light sensors.  It is important these two light sensors measure reflective values identically.  But, with any sensor, LEGO or otherwise, there will be variability.  Put two thermometers next to each other and tell me if they give exactly the same reading!

We have another obstacle which is the fact the NXT-G 2.0 software's built in calibration block only enables us to calibrate one port, one sensor.  So, if we calibrate P3, these values will be used for our second light sensor that may be plugged into P2.  That's not optimal.  So we have mfg variability and software with a limitation.

What other variables can you think of?  Ambient light, brown vs blue, non solid dark color, flash bulbs, battery power, solar flares????  Our challenge as engineers is to reduce the impact of variables on our robot.

Raw values vs calibration values in NXT-G.  I read that the light sensors have a raw value range of 0 to 1024.  Dark is 0 and bright is 1024.  Personally I have taken a brick and put in this little program with the brick connected to the computer and watched the reflection value.  I still get 0 to 100.  I put it up to a light bulb and I get the max value of 100.  If you can figure out RAW please let me know.  I am assuming the below test program ensures I get a "non calibrated" reflectance value.  Educate me if I am wrong.

(update:  OK, we figured out how to get RAW values.  You need to expand the data ports and you will find a 'intensity' which is based on a scale 0 to 100 and you will see RAW.  Use this raw data plug and output it to your screen and poof!  We now know where to get raw LS readings!)

Experiment on XMAS1.

Justin and I tested the calibration program we used at the last regional.  I have not examined it closely to ensure it is correct, that is your job.  But here are some results after testing on the brown to white in front of pink bacteria.

Uncalibrated (UNC)
             dark        light         Threshold
Left         52           63                57.5
Right       53           66                59.5
Post calibration block (CAL)
Left          0            78
Right       24           98
Variance  24           20

Add some new light sensor shades Justin and I made.....

Uncalibrated (UNC)
               dark     light          Threshold
Left           50           63                56.5
Right         57           66                61.5
Post calibration block (CAL)
Left            0           82
Right        14         100
Variance   14           18

I'm just reporting the data and I'm not going to draw any conclusions.  That is your job.  Due to some of the "oddness" it would be good to repeat the testing a few times and see if we get the same results.  I would caution that the current light sensor calibration program might say left sensor when it is actually right.  Thus you don't want to jump to the conclusion of why the bot tended to line up a little to the left before it went forward for pink bacteria.  You would want to dig into the calibration program and follow the wires on the bot before you start down that road.

Why the exploration or quest to understand?

Well, encourage all of you to practice thinking about what happened vs. just getting mad at what happened.  That is a VERY HARD skill to learn, just ask an adult!  Those who think about why things happen vs. just reacting to things that happen are going to do well in life.  Focus the anger and frustration at figuring out why something failed.  And, with Google, forums, books, built in help on sofware, mentors, I can assure you most problems can be solved if you put in the effort!

But do we have time?  I'd like to explore using the File Access block to store readings and calculate a threshold value for each light sensor port and eliminate one of our variables.  It is unclear to me that shielding the light sensors buys us that much on our home mat.  It might buy us more at the competition mat.  Hummmm.

Reference material for this post.
Brian Davis' excellent tips document on how to use File Access blocks.
Some forum discussion on independently calibrating light sensor ports.
(12/11)  Another reference item to explore using File Access block.

Here are the light sensor shields in place.  You can't even see when the orange light turns on.  The team can decide if the design could benefit from shading in the back.


Click on either picture for full size image.

A picture from below.  It would seem to be in the clear and relatively strong.  I am sure it can be made stronger.  It will change the weight distribution on the robot a little.  We'll have to see if it causes the robot to behave differently due to weight.