Naviqbot AGV with EQSP32 controller connected to a Python MQTT supervisory application displaying real-time position tracking and telemetry on a laptop

Design Objective

Scope of this application note: this document covers a single-vehicle system operating in a controlled environment with a fixed, pre-defined path. Topics outside this scope (multi-vehicle traffic management, fleet orchestration, functional safety certification, and dynamic path replanning) are not addressed. The design is intended as a complete starting point for straightforward AGV applications and as an architectural reference for more complex ones.

This application note describes the architecture and implementation of a magnetic-guided automated guided vehicle built from a minimal set of components. The design target is industrially relevant performance: reliable track-following, autonomous fork selection, precision docking at a charging station, and remote supervisory control, without map-based localization, external infrastructure, or high-cost sensors.

Magnetic guidance is the correct technology choice when the vehicle operates on a fixed or semi-fixed path in an environment where floor markings are acceptable. It eliminates the computational overhead and integration complexity of laser SLAM or visual odometry, produces deterministic behavior, and scales predictably. The trade-off is path flexibility: changes require physical modification of the floor tape. For the large class of AGV applications where route changes are infrequent, this is not a practical limitation.

EQBot AGV on a warehouse floor: Naviq MTS160 magnetic sensor at the front, EQSP32 MicroPLC controller, dual-channel motor controller, and 48 V lithium battery pack
The EQBot AGV: MTS160 sensor at the front, EQSP32 controller, dual-channel motor controller, and 48 V lithium battery. All real-time communication runs on CAN bus.

Guidance Principle

Track following is performed by a single Naviq MTS160 magnetic guide sensor, mounted 20-30 mm above the floor. The sensor measures three quantities on every cycle:

The outputs of the predictive steering and the lateral offset correction are summed and fed to a differential drive mixer, which converts the scalar steering demand into independent left and right wheel speed commands. This two-term structure gives the controller both path-following stiffness (from the lateral offset term) and smooth curve entry (from the predictive term), without requiring any ahead-of-time knowledge of the track geometry.

Block diagram of the two-term AGV guidance algorithm: predictive steering from MTS160 track-angle measurement summed with lateral offset correction, feeding into a differential drive mixer that outputs independent left and right wheel speed commands
Guidance algorithm structure. The angle measurement drives the predictive steering term; the lateral offset drives the proportional correction term. Both are summed and fed to the differential drive mixer to produce independent left and right wheel speed commands.

The track-detect signal is a hard safety input, not a soft flag. When the MTS160 reports no tape, the EQSP32 forces motor commands to zero in the same control cycle. There is no software timeout or debounce delay on this path.

Marker-Based Routing

All routing decisions are encoded directly onto the floor using discrete magnetic markers. No map, no localization system, and no external coordination server are required. The marker vocabulary covers three functional types:

Marker type Placement Function
Left routing marker Before a fork Select the left branch at the upcoming fork
Right routing marker Before a fork Select the right branch at the upcoming fork
Left routing marker Before a merge Ignore the right-side track when it merges; continue on the current path
Right routing marker Before a merge Ignore the left-side track when it merges; continue on the current path
Navicode (value = 1) Before the docking segment Trigger speed reduction and activate point-marker detection mode
Point marker (magnetic disk) At the charging contact position Provide millimeter-level longitudinal position fix for precise stopping
AGV track diagram showing fork and merge path selection: a left magnetic marker before a fork routes the vehicle left; a right marker routes it right; the same markers placed before a merge suppress the incoming branch on the corresponding side
Fork and merge routing. Before a fork, a left marker selects the left branch and a right marker selects the right branch. Before a merge, a left marker ignores the right-side incoming track and a right marker ignores the left-side incoming track.

Navicode markers are sequences of left and right markers that encode an unsigned integer up to 16 bits. Value 1 is reserved as the docking approach trigger in this application. The scheme is field-reconfigurable: changing a route requires only repositioning or adding markers on the floor, with no firmware modification.

Navicode encoding diagram: a sequence of left and right magnetic markers is read by the MTS160 and decoded as an unsigned integer, allowing stations and zones to be uniquely addressed on the track floor
Navicode encoding. A sequence of left and right markers is read by the MTS160 and decoded as an unsigned integer. Value 1 triggers speed reduction and activates point-marker detection mode for the docking approach.

Point markers use a different magnetic profile (disk geometry rather than tape) that the MTS160 recognizes as a distinct signal type, providing longitudinal position resolution that the continuous tape cannot offer. This is what allows repeatable stops at the charger contact without relying on odometry accumulation.

Point marker diagram: a circular magnetic disk flush with the floor at the charging station contact position, producing a distinct signal profile that the MTS160 uses for millimetre-precision longitudinal stopping independent of odometry drift
Point marker at the charging station. The disk geometry produces a distinct signal profile that the MTS160 distinguishes from continuous tape, enabling repeatable millimeter-level stops independent of accumulated odometry error.

The four marker types above are the complete vocabulary of this navigation system. The following two diagrams show what that vocabulary can produce when combined on a real track layout.

AGV track layout plan showing the full magnetic tape path with left and right routing markers at junctions, a Navicode address strip before the docking approach, and a point marker at the charging station contact point
Track layout with all marker types in place: routing markers at forks and merges, a Navicode sequence before the docking segment, and a point marker at the charging station contact.
Multi-segment AGV travel path generated automatically by simple floor marker rules: fork selections, route sequencing, speed reduction on docking approach, and millimetre-level stopping at the charging station � all without map software or route programming in firmware
The resulting travel path. Fork selections, route sequencing, speed reduction on approach, and millimeter-level docking are all produced by markers on the floor. No map, no localization algorithm, and no route programming in firmware is required.

System Architecture

AGV system architecture block diagram: Naviq MTS160 magnetic guide sensor, EQSP32 MicroPLC, and Roboteq dual-channel motor controller interconnected on a 500 kbit/s CAN bus; Wi-Fi provides the MQTT supervisory uplink independently of the real-time guidance loop
System architecture. The MTS160, EQSP32, and dual-channel motor controller are connected on a 500 kbit/s CAN bus. Wi-Fi provides the supervisory uplink. All real-time guidance runs on the CAN bus regardless of Wi-Fi state.

The three primary subsystems communicate over a 500 kbit/s CAN bus backbone:

Wi-Fi connectivity on the EQSP32 carries MQTT telemetry and supervisory commands. Loss of Wi-Fi does not interrupt the guidance loop or safety functions. The CAN bus continues operating and the vehicle follows its track regardless of wireless state.

Power and Wiring

The power architecture uses two rails:

All real-time data, including sensor output, motor commands, and encoder feedback, travels on the CAN bus. A second MTS160 can be connected on the same bus for rear-facing guidance or reverse operation without additional wiring infrastructure.

Additional I/O used by the EQSP32:

Functional safety note: this design does not address compliance with ISO 3691-4 or any functional safety standard. The single ultrasound obstacle sensor provides basic detection along the forward travel axis and is not rated for any safety integrity level. Applications in environments with personnel, uncontrolled cross-traffic, or regulatory safety requirements will need additional sensing (laser scanner, safety-rated 3D camera, or equivalent) and a certified safety function assessment. The EQSP32 provides the control platform; safety architecture is the responsibility of the system integrator.

Firmware Execution Model

The firmware is organized around a fixed-period main loop executing every 5 milliseconds, complemented by asynchronous CAN message processing.

main loop structure (simplified)
// 5 ms periodic task
void controlLoop() {
    readAnalogInputs();          // battery voltage, etc.
    readDigitalInputs();         // run/stop button
    stateMachine();              // transitions on cmd / sensor / marker events
    guidanceAlgorithm();         // lateral + predictive steering -> wheel speeds
    applySpeedRamps();           // acceleration / deceleration limiting
    sendMotorCommands();         // CAN frame to motor controller
    updateLEDs();                // state-encoded visual indication
}

// CAN ISR -- runs on frame arrival, not on 5 ms boundary
void onCANReceive(CANFrame frame) {
    if (frame.id == MTS160_GUIDANCE_ID) updateGuidanceData(frame);
    if (frame.id == MOTOR_ODOMETRY_ID)  updateOdometry(frame);
}

// MQTT runs at a slower fixed interval, independent of control loop
void telemetryTask() { publishState(); processCommands(); }

CAN frames are processed immediately on arrival via interrupt. Guidance data is updated as soon as the sensor transmits, rather than waiting for the next 5 ms boundary. This reduces sensor-to-actuator latency to the CAN frame propagation time plus the interrupt service latency, both bounded and deterministic.

MQTT telemetry publication and command ingestion run at a separate, slower fixed interval and execute in a lower-priority task. They do not share execution time with the control loop and cannot introduce jitter into the 5 ms period.

Open-source firmware for this AGV design is available from Naviq.

State Machine

Vehicle behavior is governed by a finite state machine. Transitions are triggered by operator commands received over MQTT or the physical Run/Stop input, by sensor conditions (track loss, obstacle detected, battery low), or by marker detection events (Navicode, point marker).

AGV finite state machine diagram with six states: Idle, Run, Approach, Docking, Charging, and Fault; transitions are triggered by operator commands, sensor events (track loss, obstacle, battery low), and marker detection (Navicode, point marker)
Vehicle state machine. Safety-critical transitions (track loss, obstacle, battery low) are handled at the state machine level, not in application code. The Fault state requires an explicit operator reset.

Supervisory Software

The EQSP32 publishes telemetry over MQTT at a fixed interval, including:

A Python-based supervisory application running on a PC consumes this telemetry to provide real-time position visualization. The track geometry is defined as a 1:1 scale DXF file representing the physical tape layout. A preprocessing script (nodefinder.py) parses the DXF, identifies path nodes (line endpoints, arc transitions, junctions), and produces a CSV of node coordinates. A separate file (travel_path.xlsx) defines the ordered node sequence for the specific route, allowing multiple routes to be defined against the same DXF without modifying the firmware.

The supervisor application loads both files, renders the track, and uses the traveled distance from MQTT telemetry to interpolate the vehicle position along the node sequence. The moving position indicator updates in real time. The supervisor also provides a basic control interface for issuing Run/Stop commands over MQTT.

Encoder odometry accumulates drift over time, particularly through wheel slip or tight curves. The marker system provides a natural mechanism for periodic resynchronisation: when the EQSP32 detects a Navicode or a point marker, its position along the route is known precisely. The controller can reset the odometry reference at each such event, bounding the drift to the distance between consecutive markers rather than allowing it to accumulate over the full route length. This keeps the supervisor's position estimate accurate without requiring any additional localisation hardware.

Importantly, the supervisor does not participate in real-time control. All guidance, safety, and motion decisions remain on the embedded controller. The PC application can be closed, disconnected, or restarted without affecting vehicle operation.

Python supervisory desktop application: AGV position indicator moves in real time along a DXF track layout rendered to scale; side panel shows live MQTT telemetry � vehicle state, tape offset, traveled distance, battery voltage, and obstacle distance
The Python supervisory application. Track geometry from DXF, position interpolated from MQTT odometry telemetry. Telemetry panel shows vehicle state, tape offset, traveled distance, battery voltage, and obstacle distance.

VDA5050 note: the current telemetry implementation uses custom MQTT entity names. The EQSP32 MQTT handler and JSON entity manager are fully capable of accommodating VDA5050 mission and state structures with appropriate topic mapping. A follow-on revision of this application note will expand on this with a VDA5050-compliant interface example covering mission state, order updates, and AGV status synchronization with orchestration software.

Vehicle in Operation

The following video shows the AGV running on a test track with fork selection and automatic docking at the charging station.

Video thumbnail: EQBot AGV running on a test track with the Naviq MTS160 magnetic sensor, performing fork selection and automatic docking at the charging station
Watch the AGV in operation

Why the EQSP32 as the AGV Controller

The architecture described here can in principle be implemented on a range of platforms, including Linux single-board computers, industrial PCs, or conventional PLCs. In practice, the EQSP32 was selected because it resolves several constraints that are problematic on those alternatives:

Native CAN bus

CAN hardware and protocol stack are built in. On Linux-based SBCs, CAN typically requires a USB adapter with non-deterministic latency. On most PLCs it is a costly option module.

Hard real-time execution

FreeRTOS provides deterministic task scheduling and bounded latency. Timing jitter on the sensor-to-motor path directly affects lateral tracking error and curve performance.

Fast power-on to operational

The EQSP32 reaches full operational state within a few seconds of power-up. Linux-based systems require extended boot and service initialization, which affects behavior after power cycling.

Bare-metal peripheral access

Direct microcontroller access enables microsecond-resolution pulse measurement for the ultrasound sensor and simultaneous 800 kbit/s LED data streams, without degrading the navigation loop.

External Wi-Fi antenna support

An external antenna port allows the antenna to be mounted on the vehicle exterior, providing substantially better range and reliability than internal antenna designs in reflective industrial spaces.

Cost-to-function ratio

Native CAN, hard real-time control, Wi-Fi, and rich I/O in a single device at a fraction of the cost of an equivalent industrial computer or high-end PLC with comparable I/O.

Conclusion

A magnetic-guided AGV with fork selection, precision docking, obstacle detection, and MQTT supervisory interface can be implemented with three primary components: the Naviq MTS160 sensor, the EQSP32 controller, and a dual-channel motor controller on a CAN bus backbone. The design produces deterministic guidance and safety behavior without map-based localization, external infrastructure, or complex software frameworks.

The marker encoding scheme keeps routing logic on the floor rather than in firmware or a server, making route changes a physical operation rather than a software deployment. All safety-critical functions (track-loss inhibit, obstacle stop, low-battery state) are handled by the embedded controller and cannot be degraded by Wi-Fi outage or supervisory software failure.

Component Role Reference
Naviq MTS160 Magnetic guide sensor (position, angle, markers) naviq.com
EQSP32 Central controller, guidance algorithm, state machine, Wi-Fi/MQTT erqos.com
Roboteq SBLG2360 Dual-channel brushless motor controller with encoder feedback roboteq.com

Ready to evaluate the EQSP32 for your AGV platform?

Datasheet, I/O reference, CAN bus guide, and interfacing documentation available. Ships worldwide.