Skip to content
Adaptive AgroTech NetworkUniversity of Southern Denmark · SDU Drone Center
Course2026
← Practical Motor Control for Robotics | ESP32 & PLCModule 09

Control a Robot Hub Motor with ESP32 and Modbus RS485 | Lecture 09

InstructorDr. Redmond R. Shamshiri
AffiliationAssistant Professor of Robotics · University of Southern Denmark (SDU)
Study time35 minutes
Watch & study

Lecture video

Open on YouTube ↗

Video unavailable here? Watch on YouTube. Captions and playback speed are available in the player.

Study companion. These editable notes, worked examples and exercises supplement the source material. They are not a verbatim video transcript or a reproduction of the book.

Study Control a Robot Hub Motor with ESP32 and Modbus RS485 | Lecture 09. Use the accompanying model, numerical example and practical task to connect the topic to a measurable engineering result. Notes are original supplemental material, not a transcript.

Learning Objectives

  • Explain the role of registers, transactions and byte order in the engineering system.
  • Calculate the worked quantity with consistent units.
  • Design a measurement that can reveal an implementation failure.

Study guide

Original companion notes. These notes support the topic of this lesson. They are not a transcript or a claim about the exact contents, hardware settings or examples in the video.

Lesson focus: Control a Robot Hub Motor with ESP32 and Modbus RS485 | Lecture 09

Define the input, measured output, units and pass/fail condition before running the experiment.

Registers, transactions and byte order

Modbus transports coils and registers; the device manual defines their meanings, scaling and access rights. A displayed register label may be one-based while the protocol address is zero-based. A successful response does not prove that the engineering interpretation is correct.

Model, units and assumptions

\[y=s\cdot r+o,\qquad t_{poll}\geq t_{request}+t_{device}+t_{response}+t_{margin}\]

r is decoded register data, s is scale and o is offset. Polling time includes communication and device processing. For multiregister values, verify word order as well as byte order from the manufacturer.

Worked engineering example

A documented speed register uses 0.1 rpm per unit. Raw 1234 means 123.4 rpm. Reading the adjacent register by an address-offset mistake may still return a valid reply, so check a known physical value.

Practical task and evidence

Apply the following procedure to the topic of this lesson: Control a Robot Hub Motor with ESP32 and Modbus RS485 | Lecture 09.

  • Create a register map with protocol address, datatype, units, scale and read/write permission.
  • Read a known constant before issuing any write command.
  • Test timeout, exception reply and reconnection with outputs inhibited.

Submit: a diagram or interface table, a short timestamped dataset, the calculation with units, and a paragraph explaining the largest observed limitation.

Check your understanding

Question. Raw signed register value is −250 with scale 0.01 A/unit. What current is displayed?

Show worked answer

−2.50 A, provided the two’s-complement interpretation and signed-current convention match the manual.

Extension. Change one assumption in the model and explain which measurement would reveal that it no longer holds.

Summary

Registers, transactions and byte order: keep units, assumptions and timing explicit. Check the numerical model against an independent observation before using it in a larger system.

Suggested Reading & Resources

  • Reading
    Modbus Organization protocol specifications

    Primary documentation or original technical reference; check the version used in your lab.

    Open ↗