Technical Thursday #042
We appreciate robots that have a broad range of applications while being effective in their assigned task. Reliability and precision is key when designing a line following robot, and we carry a sensor that is up for the task! The RoboteQ MGS1600 is a magnetic guide sensor which is capable of detecting and reporting the position of a magnetic field along its horizontal axis. The sensor is intended for line following robotic applications, using a magnetic tape to form a track guide on the floor. Here’s a video example of the MGS1600 with waypoint control: Magnetic line follower.
As shown, the sensor is able to detect 2-way forks and left or right markers given ample space from the center track. This is all done with millimeter resolution! It is highly advised to read through the datasheet for this device before proceeding with your design. Doing thorough research beforehand could save you from a mean headache down the road.
For first time setup and altering configuration settings, download the MagSensor Control Utility and connect the device to a PC via USB. This program can alter critical settings such as magnetic tape width, output mode, and min/max pulse width. The image below shows a setup configuration for basic applications:
The ultimate goal is to use the data output from the MGS1600 to scale the robot’s motor speeds. Within the run tab of the MagSensor Control Utility, the output can be observed while hovering a magnet along the sensor’s horizontal axis. With the example settings applied, the sensor will output a negative value along the left edge while transitioning to a positive value on the right. This position is determined by the peak amplitude of the detected magnetic field.
In turn, this data can be used to set up a simple proportional control algorithm to apply a correctional factor to the speed values given to a motor controller. This can be achieved by multiplying a control constant (Kp – this will need to be tuned in order to have a stable system) by an error value provided from the MGS1600, and adding the product to the default speed of your autonomous robot before sending the speed command to a motor controller. For a fully optimized system, a complete PID algorithm should be designed and implemented. However, that explanation warrants a separate Tech Thursday post.
Lastly, interfacing with the MGS1600 can be time consuming. In our video example above, the mecanum robot features an Arduino Mega receiving data from the mounted RoboteQ MagSensor. Below is the MGS1600 library used to communicate with the sensor though Arduino software.