Skip to content
dontseyitPublic

About

ESP32 motion co-processor firmware for M5Stack AtomS3R + Atomic Motion Base

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

atomotion: Atomic Motion Module

A self-contained motion co-processor, first built as a ready-to-use, solder-free base for robotics projects. It drives four servos: two continuous-rotation servos act as wheels, and the other two pan and tilt the head.

Hardware

All parts come from the M5Stack product line, so they fit together without soldering.

  • Board: AtomS3R
  • Driver: Atomic Motion Base
  • Servos: 180 Servo Kit, 360 Servo Kit
  • Sensor: Ultrasonic Distance Unit (RCWL-9620), front-mounted

What it does

The module runs in one of two modes:

  • Driven by a host over UART. The host (the "brain") can be any MCU, SBC, or PC that speaks the protocol.
  • Standalone, through its own WiFi access point and web console.

The continuous servos are the left and right wheels of a differential drive, and the two 180 servos move the pan-tilt neck. A safety watchdog stops the wheels if drive commands stop arriving. Turning is closed-loop on the IMU, so a command like "turn left 60°" rotates a measured amount and stops, and straight driving holds its heading. The module also keeps a compass heading, a running estimate of which way the robot faces relative to where it was last zeroed (it doesn't know true north). The heading is zeroed at power-up or from the web console, and both the web console and the host receive it.

A front ultrasonic sensor gives the robot basic perception. The module streams the distance to the host, and an on-device obstacle guard stops forward drive by itself before the robot hits something. Reverse and turns still work while the guard is active, and you can tune the stop distance from the web console.

The AtomS3R screen shows a status panel with link state, battery %, voltage, live power draw, and charging state. The same battery telemetry goes to the host and the web console.

How to control it

Over UART, from a host: the host sends drive and neck commands and receives telemetry, including the turning state and the compass heading, over a compact framed protocol. HOST-INTEGRATION.md explains the commands, telemetry, and the rules a host has to follow. include/Protocol.h is the authoritative definition of the frame format.

  • Up to the host: UART on Port A (G1/G2), 3.3 V, 115200 8N1.
  • Down to the base: the AtomS3R is I2C master to the Atomic Motion Base (address 0x38). The base has four servo channels: S1/S3 drive the wheels, S4/S2 the neck.
  • Front sensor: the ultrasonic unit sits on the base's Port B (G7/G8, I2C @0x57). It has its own bus, so ranging never blocks the servo bus.

Standalone, over WiFi: with no host attached, the module starts its own access point and serves a small web console, so you can drive it from a phone without internet access. The console has a drive pad, a neck panel, a live IMU readout, and calibration panels for the wheels, neck, and turning. You calibrate live from the UI, and the settings are saved on the device without reflashing.

The web console is only active while the UART link is disconnected.

Topology and pins

host (brain), optional (alternatively via WiFi)
   │  UART — Port A (G1/G2), 3.3V, framed
   ▼
AtomS3R (this firmware)
   │  I2C master — SDA=G38 / SCL=G39 @0x38
   ▼
Atomic Motion Base ──► S1/S3: left / right 360° wheel servos
                   ├──► S4/S2: left / right neck SG90 servos (head)
                   └──► Port B (G7/G8): front ultrasonic unit (RCWL-9620 @0x57)

Build and configure

The project builds with PlatformIO (environment m5stack-atoms3r). Before building, copy include/secrets.example.h to include/secrets.h and set your WiFi AP password.

The code is split into small, swappable parts: the UART link, the WiFi/web console, the drive and neck outputs, and the motion controller, which owns closed-loop turning and the heading.

Project status

This is a DIY build for one specific robot. It isn't a plug-and-play library and isn't ready for general use yet. Expect to change pins, hardware, and tuning to fit your own chassis.

The design is still changing: the wheel servos may become motors, and the mechanics may change. Treat the specifics here as the current reference for a proof of concept, not a fixed spec.

About

ESP32 motion co-processor firmware for M5Stack AtomS3R + Atomic Motion Base

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages