How to calibrate more than one LEGO Mindstorms EV3 Light/Color sensors at a time

Would you like to resolve all the problems with the light/color sensors that you have? And to make all of them work in a predictable, stable way even when using more than one MINDSTORMS colour sensors. 

When using Color sensors it is important to calibrate them depending on the light conditions in your venue. In this way, the calibrated sensor will show values between 0 and 100 independent of the light conditions. But using the default EV3 colour calibration available in the colour sensor block could lead to unpredicted problems that are difficult to track and resolved especially when used with multiple Color sensors. So in this series of tutorial we implement the calibration ourselves discussing the principles of colour sensor calibration.

  • #632
  • 04 Oct 2017
  • 4:25

We have more than one sensor. Each sensor could have a different calibrated value. But when changing the ports on which these calibrated sensors are attached a few problems could arise. We are taking a different approach. Implement the calibration on our own. 

How does the program behave at the end

The whole calibration process consists of the following steps

Initialization

It happens right after the robot is started. It is the first thing to do

Finding of Min and Max raw values

We find the values and we store them in an array that is later used to get the values.

Getting a value depending on the calibrated Min and Max

We get the raw value and find the percentage this value represents between the Min and Max.

Blocks Package for Advanced Calibration of LEGO Mindstorms EV3 Color/Light sensors

This package contains the three blocks used in the advanced calibration section of the FLL course.

The blocks contained are:

  • InitiArray block
  • CalibrateMinMax
  • GetCalibrateValue 

Example program for using the Advanced Calibration Blocks Package

This is the example program using the blocks available at  Blocks Package for Advance Calibration of LEGO Mindstorms EV3 Color/Light sensors. The program makes the robot find the minimum and maximum values and to calibrate the current sensor value depending to the min and max.

 

English

When using color sensors it is important to calibrate them depending on the light conditions in your venue. In this way the calibrated sensor will show values between 0 and probably 100 independently of the light conditions in the venue. But using the default EV3 color sensor calibration available in the color sensor block could lead to some very unpredicted problems that are difficult to resolve and mostly difficult to track down especially if you are using a number of color sensors like 2 or 3. So, in this series of tutorials we'll implement the calibration ourselves discussing the principles of color sensor calibration. At the end we'll have 3 blocks that we can import in the EV3-G software and we'll have a program for calibrating and stopping on a black line. The program works like this.

The sensor is calibrated, the robot stops at the black line and we also show some of the values of the different sensors - the minimum and the maximum to discuss the calibration. So, let's dive in and start with a few very simple steps. We have more than one sensor on our robot. Each sensor could have a different calibrated value but when changing the boards of these calibrated sensors we could have some problems. And these are problems that are difficult to track down. We are taking in this series of tutorials a different approach and we are implementing the calibration on our own. How does the program behave at the end? At the end we have a program and we start a program that calibrates and then stops at the next black line. Of course, after the calibration we could use this calibrated value to follow a different line or to align to a black line. But for this example we'll just stop at this black line. Our whole program consists of 3 blocks. And you can find the blocks in the course attached, you can download them, import them directly in your EV3-G software. The whole process is the following. First, we initialize an array with some values and this happens right when you start the robot. Then we move for about a second to calibrate - to see the maximum and the minimum value and then we start looking for a minimum value. Again, the program - calibrating, stopping at the black line. So, the blocks are in the course. You can download then and use them directly in your programs. Look at the code of the blocks, try to understand it. If you have any comments, do a comment below the video and we'll try to answer and now let's dive in implementing the different blocks. This is the program that we have at the end. And we have a block for initializing an array and in this array we store the different values for minimum and maximum for the different sensors. Then we move forward for about a second and while moving we calibrate the minimum and maximum value for each sensor and after a second we stop. Then we move forward and detect the value of the third sensor. And if this value is less than 90%, this means that we are just starting with black - we stop. Again, this program could be achieved with a lot of different blocks and a lot of different programs but the goal of this tutorial is to give you an idea how to do an advanced calibration how to implement the calibration yourself so that you can track the problems of having more than one sensor that need to be calibrated.