Skip to main content

FLL EV3 Robot

This blog post is about our current EV3 robot we're planning to use in the 2023/2024 FLL competition. Some features: 2 large motors for steering. 2 medium motors for attachments.  2 colour sensors for picking up the white and black lines, also used for line squaring. 1 gyro sensor. To enable attachments to be changed as quickly as possible we're using gravity to keep the gears connected, i.e. you don't need to fasten anything to the robot. Every attachment has 2x 12 tooth double bevel gear (part 32270) which comes in contact with the 2x 20 tooth double bevel gears (part 32269) on the robot. The medium motors are horizontally aligned on the robots, but we use 12 tooth double bevel gears to convert that to vertical alignments. These in turn are connected to 20 tooth double bevel gears, and the attachments in turn connect to these 20 tooth double bevel gears with their 12 tooth double bevel gears.  The complete robot is modelled in Bricklink Studio 2 . You can download the rob...

FLL EV3 Colour sensors

The standard colour sensor block in EV3Lab unfortunately does not have the functionality to give you raw values for RGB values (Red, Green and Blue). This is a problem if you want to calibrate your colour sensors properly, i.e. look at the raw values of each component, and from these values derive if the sensor is seeing a specific colour you're interested in.

Fortunately, you can install a 3rd party sensor which gives you access to all these values. Please see EV3 Color Sensor RGB Block Enhanced – OFDL Robotics Lab Taiwan. Note: although third party plug-ins were not allowed previously in FLL competitions, from 2020 that restriction was lifted where any software can now be used to program the robot.

If you have multiple colour sensors, please use the same generation of colour sensors, because the RGB values can differ a lot between different generations for the same colour. You need to look at the code on the sensor itself to determine the generation. The code is in format 99N9, where the first 99 is the week number and the last 9 is the year number (from 2000). 

Our menu program has a section where it reads the RGB values from our 2 colour sensors and display them on-screen. We limit it to about 2 readings per second so you can properly see the values on screen. We use this to ensure the colour sensors are working properly, as well as to get values in order to calibrate our White / Black detection algorithms.

See below for an implementation we're using to identify if the colour is white or black. We pass in the colour sensor port number because we might be interested in different colour sensors at different times in our program. It outputs two logical values: one for black and one for white. 



In the implementation above for white we need a Red component of at least 100, Green component of at least 100, and Blue component of at least 50. Similarly for black we need a Red component less or equal to 50, Green component less or equal to 50, and Blue component less or equal to 30. Just note these values are for the specific generation of sensor we're using (xxN3) plus the height of the sensor above the map. Don't rely on these values but rather calibrate your colour sensors properly.

Once you have this component, it makes it easy to implement logic to move forward until it hits a white or black line. We have 2 sensors and we require both sensors to see the same colour. This also allows the robot to align itself against the line. We get the motor speed as input, and will move both motors independently with this speed until it hits the color on the specific sensor (sensors 2 and 3 in the implementation below). Note that you need to stop the motor as soon as the colour is reached, otherwise it won't align properly.

Move to white:



Move to black:


For proper line squaring you might need to do a couple of iterations - first move until you see white, then at a slower speed move until you see black, and even slower to move back to white. This is called line squaring and is a good technique to limit the uncertainty of your gyro sensor (see the section on gyro sensor for more information). Note that if you can both find a line in the X-direction as well as in the Y-direction it allows you to consistently position your robot with high precision on the mat.

Comments

Popular posts from this blog

Installing Lego Digital Designer (LDD) on Windows 10

If you're using Windows 10 18.09 or later and try to install Lego Digital Designer (LDD) 4.3.11 you'll probably get an installation error for Adobe Flash Player. However, there is an easy way around it: Download the installation file for LDD 4.3.11. Rename the .exe file to .zip. If you don't see the .exe extension in Explorer, go to "View - Options" on the Explorer menu, then under the "View" tab deselect the "Hide extensions for known file types". Open the zip file with Windows Explorer. Copy all files in the zip to another directory on your computer. In the new folder: Delete install_flash_player_active_x.exe. Copy OpenGLChecker.exe and rename it to install_flash_player_active_x.exe. Run LDDSetup.exe. In short the installer will execute install_flash_player_active_x.exe during the installation process, but all it does now is to execute the same logic as what OpenGLChecker does. In theory you can run any .exe that will not retu...

OpenWRT 3G connection checker & logger

A 3G connection is normally not very stable - so we need something to periodically check it & reconnect when needed. I also wanted a summary email at the end of each day with the total traffic per client. I'm using the following settings/scripts: Edit /etc/crontabs/root (create if not existing): # send stats & disconnect 3G at 23:00 everyday. # check the connection every 5 minutes between 5:00 and 23:00 and reconnect if needed # reboot at 5:00 if /tmp/stats.msg doesn't exist - will be sent in checkconnect */5 5-22 * * * /usr/bin/checkconnection 0 5 * * * if [ ! -s /tmp/stats.msg ]; then reboot ; fi 0 23 * * * /usr/bin/sendstats && ifdown wan The first line will run /usr/bin/checkconnection every 5 minutes between 5:00 and 22:59. Then at 23:00 the  day's statistics will be emailed and the 3G connection disconnected. The next morning at 5:00 it first checks if the email was sucessfully sent at 23:00, if so it will reboot the router (seems to be m...

Windows Hyper-V Server 2019

This post will explain how to use the free Hyper-V Windows 2019 Server version. This version doesn't come with any GUI interface as provided in the full Windows 2019 Server version. Instead it comes with a character interface, but with the help of some third party tools you can easily get a fully functional Hyper-V server for free. The following will be assumed: You have a dedicated server connected to a network and you want to install Hyper-V 2019 on this server to run Virtual Machines and/or act as a file server. You have physical access to this server to do the installation. You have another machine connected to the same network to do remote management, running a recent version of Microsoft Windows. You don't want to join a domain or use Active Directory. You can do this if you want to, but this is not included in this post. First you'll need to download the Hyper-V 2019 ISO from  https://www.microsoft.com/en-us/evalcenter/evaluate-hyper-v-server-2019 . You’ll...