MGS1600GY: Precision Magnetic Track Following Sensor With Gyrosope
MGS1600GY: Precision Magnetic Track Following Sensor With Gyrosope
MGS1600GY: Precision Magnetic Track Following Sensor With Gyrosope
Precision
Magnetic
Track Following
Sensor with
Gyrosope
The sensor will detect and manage 2-way forks. It can be •• 160mm sensing width with 1mm resolution
instructed to follow the left or right track using commands •• Selectable, North or South on top, magnetic polarity
issued via the serial/USB ports, or using the state of two of track
digital inputs. All of the sensor’s operating parameters and •• Capable of detecting and managing 2-way fork/merges
commands are also accessible via its CAN bus interface.
•• Detection of magnetic “markers” of inverted polarity
at left or right of main track
In addition to detecting a track to follow, the sensor will detect
and report the presence of magnetic markers that may be posi- •• Three Axis MEMS Gyroscope with selectable range
tioned on the left or right side of the track. The sensor is equip- and better that 14-bit resolution
ped with four LED indicator lights for easy monitoring and •• Simple interface to most PLC brands and to micro-
diagnostics. computers
•• Direct and seamless interface to Roboteq motor controllers
The MGS1600GY has a 3-axis Gyroscope that can be used to
•• 100Hz update rate
provide additional stability and guidance to the vehicle.
•• Status LEDs for tape and marker detection
The sensor incorporates a high performance, Basic-like scripting •• Digital outputs for “tape present” and left/right marker
language that allows users to add customized functionality to the detection
sensor. A PC utility is provided for configuring the sensor, capturing •• Numerical Tape position data output on RS232 or USB ports
and plotting the sensor data on a strip chart recorder, and visualizing
•• Tape position on PWM output at 250Hz or 500Hz
in real time the magnetic field as it is seen by the sensor.
•• Tape position on 0-3V analog output
The sensor firmware can be updated in the field to take advan- •• CAN interface up to 1Mbit/s
tage of new features as they become available.
•• Built-in programming language for optional local pro- •• Delivered with 2 meters multi-conductor cable for all
cessing of tape and marker data connections
•• Easy configuration, testing and monitoring using •• Wide range 4.5V to 30V DC operation
provided PC utility •• 165 mm wide x 30 mm deep x 25 mm tall
•• Field upgradeable software for installing latest fea- •• -40o to +85o C operating environment
tures via the Internet
•• IP64 rated enclosure. Resistant to water splash
Reference Description
MGS1600GY Magnetic guide sensor with 3-axis Gyroscope, serial, USB, analog, PWM and CAN output
MTAPE25NR 25 mm wide magnetic tape for MGS1600GY with North top side. 50m (150ft) roll
MTAPE50NR 50 mm wide magnetic tape for MGS1600GY with North top side. 50m (150ft) roll
TABLE 1.
Operating height is up to 50mm when used with 25mm wide tape and 60mm when used with 50mm wide
tape. At greater heights, the magnetic field of the tape is weaker and the sensor will be less immune to noise.
For best results, operate at 20 to 30mm with 25mm tape and 20 to 40mm with 50mm tape.
Sensor Installation
The sensor must be mounted so that it is parallel with the floor and the magnetic track. Two mounting holes
are provided at both ends of the enclosure. When installing, allow room the accessing the USB connector
under the plug.
Power &
USB IO Cable
Left Marker
Power
Right Marker
Tape Detect
TABLE 2.
Important Warning
Only ground or float to the Power Down signal. Never apply a voltage higher than 5V to this wire. Product
damage can occur.
RS232 Connection
Serial communication with the sensor is done using the RxData (grey) and RxData (white) signals. The ground
wire (black or braid) must be connected in order to provide a reference to the RxData and TxData signal. Serial
communication will not work with microcomputers equipped with TTL-levels serial ports.
PWM Output
The PWM Output wire (blue) is always active. In default configuration, multiple pulses of variable widths are
used to carry all sensor information, including tape detect and marker position to Roboteq motor controllers.
The output can also be configured to carry the tape position by varying the duty cycle of a single, continuous
pulse from 50%, when the tape is centered to 25% and 75% duty cycle when the tape is at one end or the
other of the sensor. The PWM output is centered at 50% when no tape is detected.
Analog Output
The Analog Output wire (yellow) is always active and will give the tape position by varying the voltage from
1.50V, when the tape is centered, to 0 and 3V when the tape is at one end or the other of the sensor. The Ana-
log output is centered at 1.50V when no tape is detected.
•• 115200 bits/s
•• 8-bit data
•• No parity
•• No flow control
The baud rate can be changed to different values but only while the controller is connected to the configuration
PC utility via USB. Beware that once the baud rate is changed, it will no longer be possible to have the PC utili-
ty communicate with the sensor via the serial port until the speed is changed back to 115200 bit/s.
Track information
The presence and position of a magnetic track is output on the I/O connector, and/or transmitted via the serial
communication port or USB. When the sensor detects the presence of a magnetic track it will activate the
Track Present output on the I/O connector. The track position information is also output as a 0-3V analog signal,
and a PWM pulse of a user definable period and duty cycle range. The track detect and position are reported
on the RS232 or USB ports. The position is reported as a signed value, in millimeters, using the center of the
sensor as the 0 reference.
L=0, R=0
L=-0, R=50
L=-0, R=20
L=0, R=0
When approaching merges, the sensor will report a sudden spread of the left and right tracks, but will other-
wise operate the same way as at forks.
L=0, R=0
L=-0, R=20
L=-0, R=20
L=-0, R=50
L=0, R=0
FIGURE 5. Merge Management
Both track positions can be read via the serial port. Using the state of the Fork Left and Fork Right digital in-
puts, the sensor will send the left or right track information to the analog and PWM outputs, according to Table
3, below.
TABLE 3.
When both inputs are high or unconnected, the selected track will be based on RxData digital input if config-
ured, otherwise the selected track will be based on command received via the sensor’s serial/USB port, or set
using the sensor’s scripting language.
Marker Detection
Markers are pieces of magnetic tape that are affixed on the left or/and right side of the main track. To differen-
tiate them from the track, markers have opposite magnetic polarity. These markers can be used to inform the
AGV of special areas along the track, such as forks or merges ahead, high or low speed zones, charge stations,
etc. Markers must be positioned 15 to 30mm away from the edge of the main track for proper operation.
Sensor
15-30mm
North South North
The figure below shows example of a simple marker (i.e. marker present or absent) and 2 dimensional markers
where a pattern is used to encode more complex information. In this example, using the built in scripting lan-
guage, the sensor can be made to count the number of right markers while a left marker is present.
Track
}
High Marker Detection
Medium
Low Sensitivity
Marker
This mode is therefore dependent on the ambient magnetic field to be quite stable throughout the path of the
AGV, and that the zero level be calibrated. After calibration if no track or marker is present, the level should
hover around the 0 level. It is recommended to survey the site with the sensor around 25mm all around the
projected path to verify that there are no local disturbance by metal part in the floor.
If the zero level is higher in some areas, it may cross the Track detection threshold and detect a track where there
is none. This can be corrected by adding a correction that has the effect of shifting the entire field capture up or
down. Use the ZADJ configuration command to make this correction, as seen on Table 7. Configuration Com-
mands.
}
High Marker Detection
Medium
Low Sensitivity
Marker
Be aware that if the sensor capture is shifted too low, this could then trigger false Marker detections. This can
be alleviated by selecting a lower marker sensitivity level.
Track
Max
Track Detection Threshold
Min
This technique is therefore a lot less sensitive to variations to the ambient level. However, it does not permit
the use of Markers.
Gyroscope
The sensor is equipped with a built-in 3-axis MEMs Gyroscope. The Gyroscope provides an accurate measure-
ment of the rate of rotation along each of the sensors planes with three levels of resolution: +/-250 degrees/s,
+/-500 degrees/s and +/-2000 degrees/s. The Gyroscope can be used to provide added stability to the AGV. It
can also be used to make the AGV continue to move in a straight line, without guiding tape, between two mag-
netic tapes or magnetic pins.
The Gyroscope values can be read via USB, Serial or CANbus. The Z sensor value is also automatically transmit-
ted to a Roboteq motor controller, along with the magnetic sensor data, using a single wire and the MultiPWM
mode. Finally angle integration is implemented out of the gyroscope data, using ANG query and command. The
angle is given in degrees*10.
TABLE 4.
Gyroscope Calibration
The Gyroscope zero offset must be calibrated before it can be used. This is done by leaving the Sensor on a sur-
face (in any position) and make sure it does not move. Once it is in a stable position, click then the Gyroscope
Calibration button. The offset will be measured and stored into the Sensor’s EEPROM. You can verify that the
calibration was successful by monitoring the Gyroscope data in the chart recorder. A small amount of noise (ap-
prox. +/- 20) will show in the chart instead of 100 or more for an uncalibrated gyroscope.
Diagnostic LEDs
Since magnetic fields are invisible, the sensor is equipped with four LED indicator lights to help with setup and
troubleshooting. The LED positions are shown in Figure 2, on Page 4 of this Datasheet. The Power LED will be
lit when the sensor is on. The Track Detect/Track Position LED is a dual usage LED that will illuminate when a
track is present. The LED is bi-color and will gradually shift to red when the track is at the left of the sensor, and
to green as the track moves to the right. Two additional LEDs will turn on when left or right markers are detect-
ed.
Fork Left
Fork Right
Sensor
4.5V to 30V PLC
Analog or PWM
5V M
Roboteq
Sensor Motor
MultiPWM
5V Controller MM
Roboteq
Sensor Motor
MultiPWM
Controller M
FIGURE 13. Roboteq Motor Controllers Interfacing
USB
Sensor PC
Interfacing the Sensor to PCs or Microcomputers
Interfacing the sensor to a PC requires a simple USB connection. The sensor will be powered via the 5V pres-
ent on the USB.
USB
Sensor PC
USB
Sensor PC
If no USB is available, interfacing can be done using the PC or Microcomputer RS232 port and a separate 4.5V
to 30V power supply.
MicroBasic Scripting
The MGS1600GY features the ability for the user to write programs that are permanently saved into, and run from
the sensor’s Flash Memory. This capability is the equivalent of combining the functionality of a PLC or Single Board
Computer directly into the sensor. The language is a very simple, yet powerful language that resembles Basic.
Scripts can be simple or elaborate, and can be used for various purposes. For example sensor data manipulation
and conversion, two dimension marker processing, or even the full motion and steering control for a simple line
following robot. See the Microbasic manual for details on the language.
When the calibration takes place, an integrity test is executed in order to detect if any of the 16 IC sensors has
failed. If the test detects an error, a respective message is printed, the LEDs flash and the bit 8 MGS is set. If
this happens make sure the sensor is not close to any magnetic field and retry sensor calibration. If the prob-
lem remains, then most probably the sensor is broken.
To quickly calibrate the sensor, take a piece of carton and attach four markers at equal intervals within
the range of the length of the sensor (16cm). Put the carton under the sensor (as close as possible) and
power up the sensor. When the Tape Detect LED illuminates green, remove the carton. The Tape Detect
LED turns red during the calibration. IF the Tape Detect LED start flashing green every 1 second then the
calibration is over and the sensor is ready to be used.
Note: Begining with v3.0 of the MGS firmware, the Field Sensor Calibration has been implemented within
the firmware.This applies only to firmare v3.0 and later.
Each time a query is executed, it is stored in a history buffer and may therefore be automatically repeated
at a periodic rate using the # character with the following syntax:
TABLE 5.
TABLE 6.
Configuration Commands
These commands are used to read or modify sensor configuration parameters. They begin with the ~ character
for reading and the ^ character for writing. Table 7 shows the list of supported configuration commands.
However, it is easier and preferable to use the PC utility menus for inspecting and changing configurations. If
changing manually, remember to save the new configuration to flash with the %EESAV. Otherwise, the sensor
will revert to the previously active configuration next time it is powered on.
TABLE 7.
Maintenance Commands
These commands are used to perform maintenance functions on the sensor. They begin with the % character.
Table 8 shows the list of supported configuration commands.
TABLE 8.
CANbus Communication
The sensor supports the following four CAN protocols:
RoboCAN: a simple meshed networking structure to exchange commands and queries with any other Roboteq
motor controller or sensor.
RawCAN: a low level structure that allows to build and parse CAN frames using the MicroBasic scripting
language
MiniCAN: a structure that borrows CANOpen’s TPDO and RPDO mechanisms for sending and capturing frames
with fixed content.
CANOpen: an industry standard system ensuring interoperability with other vendor’s PLCs and devices (this
feature is available begining with firmware v3.0 and is not available in older versions of the firmware.).
Details on these protocols can be found in the separate Roboteq CAN Communication manual.
The structure and content of the TPDO and RPDO frames is the same in both MiniCAN and CANOpen and is
shown in the table below.
CANOpen Bits:
Bit8 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1
Sensor - - - Right Left Tape Tape
Failure Marker Marker Detect Cross
MiniCAN Bits:
Bit8 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1
Sensor - - - Tape Right- Left Tape
Failure Cross Marker Marker Detect
In CAN Open the sensors Real-time Commands and Queries are mapped as shown in the Object Dictionary
below. Configuration commands are not directly accessible via CANOpen.
Data
Type &
Index Sub (Hex) Entry Name Access Command Name
Runtime Commands
0x2005 01 to 10 Set User Integer Variable n S32 WO VAR
0x2015 01 to 32 Set User Bool Variable n S32 WO B
0x2017 00 Save Config to Flash U8 WO EESAV
0x2018 00 MicroBasic Run U8 WO BRUN
0x201A 00 Follow Left track U8 WO TX
0x201B 00 Follow Right track U8 WO TV
0x2020 00 Set zero calibration level for magnetic sensors U8 WO ZER
TABLE 10.
Data
Type &
Index Sub (Hex) Entry Name Access Command Name
Runtime Queries
0x2106 1 to 10 Read User Integer Variable n S32 RO VAR
0x210F 00 Read Dominant Track S8 RO T
0x2115 01-10 Read User Bool Variable n U8 RO B
0x211D 01 Read Track Detect U8 RO MGD
0x211E 01 Read Left Track S16 RO MGT
02 Read Right Track
03 Read Selected Track
0x211F 01 Read Left Marker U8 RO MGM
02 Read Right Marker
0x2120 01 Read Status U16 RO MGS
0x212D 01 -10 Read Raw Sensor N U32 RO MRS
0x212E 01 -10 Read Zero Adjusted Raw Sensor n S32 RO MZ
0x2131 01 Read Gyro X S16 RO GY
02 Read Gyro Y
03 Read Gyro Z
0x2138 01 Read Cross Tape Detection U8RO MGX
USB Communication
Use USB only for configuration, monitoring and troubleshooting. USB is not a reliable communication method
when used in electrically noisy environments. Further, communication will not always recover after it is lost without
unplugging and replugging the connector, or restarting the controller. RS232 is the preferred method of communi-
cation when interfacing with a computer. USB and CAN are able to operate at the same time on the MGS1600GY.
Connecting to a computer via USB will not disable the CAN interface.
Sensor Characteristics
TABLE 11.
Electrical Characteristics
TABLE 12.
TABLE 13.
TABLE 14.
Gyroscope Specifications
TABLE 16.
Scripting
TABLE 17.
TABLE 18.
6.5
4.0
6.5 25
10.0 10.0
165.0
5.0
30.0 25.0
25.0
82.5
FIGURE 17. MGS1600GY top view and dimensions
6.5
4.0
6.5 25
10.0 10.0