Search
About

Damien works with students and teacher from around the world, bringing the effective use of technology to the classroom.  

LEGO MINDSTORMS
Damien is a member of the MCP (Mindstorms Community Program), a small group of experts who collaborate with LEGO to make the MINDSTORM product better.

VEX IQ Robotics
Damien is a member of the VEX IQ Super User group, a small group of experts who collaborate with VEX to make the VEX IQ platform a better product 

 

Books

Teacher Resource Books

Global Map

See where the DomaBot and RileyRover is being used around the world

« New Book! VEX IQ with RobotC Graphical | Main | EV3 Linefollowing robot via Bluetooth »
Tuesday
Dec222015

Testing the Tumblebug (EV3 and VEX IQ)

So the title sounds awfully dry, but this is a project I've been meaning to do for a very long time.  A few years back one of my boys received a 'Tumble Bug' toy for Christmas.  It's a pretty simple thing, you put the balls into the mouth and they tumble down and come out either the left foot or the right foot.  

Being an engineer the second thing I thought of (right after "how do I turn that annoying sound off!?") was "I wonder how statistically fair it is?"  ie.  Does the ball come out the left foot / right foot with a 50% probability?

This would make a great experiment to run in class, not just with the Tumble Bug but all different types of kids toys.  Skip forward a few years of me telling my wife not to throw it out even though our boys have out grown it, and having a little spare time this week now that school has finished.

I've used both the LEGO EV3 and VEX IQ systems to demonstrate the approach I used.  

For the EV3, I put together a program in both EV3-G and RobotC that uses two Ultrasonic Sensors placed either side of the Tumble Bugs feet.  As a ball rolls past, the EV3 recognises a ball has rolled past and increments a variable.  

For the VEX IQ, I had trouble getting the Ultrasonic sensor to detect the balls as they rolled past.  A combination of the curved surface and fast rolling ball was too much for it to recognise.  Instead I used the Colour Sensor in Proximity Mode which worked perfectly.

A little bit of maths figures out the percentages and then displays them on screen.  Full breakdown of how it is done as well as code download is after the video.

Hardware Setup

Not much to this one, just the EV3 Brain with 2 Ultrasonic Sensors and the VEX IQ Brain with 2 Colour Sensors.


 

EV3-G Code

Each foot waits until the ball rolls past (reading less than 10 cm) and then increments the variable associated with that foot as well as the total count.  It then updates the screen (setup as a My Block in this example) and waits for the ball to roll away.  Repeat as much as you want.

click for larger version

Update-display My Block 

click for larger version

 

RobotC Code  (EV3)

This is essentially the same as the EV3-G version but with one small difference.  I used sequential IF statements in RobotC and Task Splits in EV3-G.  No idea why, both approaches would work for both software environments.

 

 

RobotC Code (VEX IQ)

Do it yourself

Here are the files I used

EV3-G - Tumblrbug.ev3
EV3 RobotC -  EV3_tumblrbug.c
VEX IQ RobotC -  tumblrbug_VEX.c

Results

So I ran the test over 50 cycles with each setup to see what I got.  

VEX IQ - Left 26%, Right 74%
LEGO EV3 - Left  33.3%, Right 66.6%

So there was a definite bias towards the right side of the toy.

What I love about doing these sort of extended investigations in class, is that rather than being a final conclusion, this now opens up a huge range of other questions and scenarios that you can test.

  • Why was there a difference?
  • Was the table level?
  • Do the different balls have an impact?
  • Does the placement speed in the mouth affect the results?

Please have a go your self and see what results you can come up with.

EmailEmail Article to Friend

Reader Comments (2)

Great stats experiment. Better than flipping a coin. But, I think you might have a typo in the VEX IQ results. Or, I should have put on my reading spectacles! Cheers, Wayne

December 24, 2015 | Unregistered CommenterWayne

Whoops, thanks for picking that up :)

December 26, 2015 | Registered CommenterDamien Kee

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>