A Two Wheel Gimbal Motor Powered Robot



This is a robot that I've been playing with for a few months. It moves by turning its wheels against a pendulum weight and controlling its speed using feedback from a tilt sensor. It was inspired by a video taken at the 2020 Consumer Electronics Show (CES 2020) featuring Samsung's Ballie robot. Their robot was apparently all hype and never materialized into a product, but looked like a fun project to attempt.

I experimented with several kinds of motors: DC gearmotors, geared stepper motors, and finally gimbal motors. The geared motor versions had fairly serious problems due to dead zones and backlash which made accurate steering impossible when the wheels needed to reverse directions in order to turn.

The gimbal motor version, although requiring much more complex motor-control software, had none of those problems and produced the best results.

The robot is controlled by an ATMEGA2560 using an Arduino Mega electronics board with a hand-built motor driver board stacked on top. An XBee radio transceiver communicates with another XBee mounted on a remote joystick to provide steering. A 3 cell 1500MAh LiPo battery powers everything.

Software

The software stack, including bootloader, was written from scratch (avr-gcc only, no ".ino" code here!) Code for the motor driver leaned heavily on information and examples from the Simplefoc project, a group of people interested in "F)ield O)riented C)ontrol" of high efficiency electric motors.

A Pololu "MinIMU-9 V2" gyroscope, accelerometer, magnetometer package is used to sense the robot's orientation. The measured gyro rates are integrated to yield a tilt angle, which is then drift-corrected using the accelerometers. A feedback loop then drives the motors fore and aft, working against the pendulum in an attempt to neutralize the measured tilt angle. Adding an offset to that angle using the joystick causes the motors to "chase" the tilt angle, driving the robot along the desired path.

Body

The body was designed using Blender, sliced using Cura, and printed in PLA using an Ender3 Pro.

Shaft Rotation Sensor

A gimbal motor consists of a stationary set of coils (the stator) and a rotating set of magnets (the rotor). The rotor is steered by sending current through the coils to generate magnetic fields at right angles to the fields of the magnets. The rotor's position is measured using an AS5048B magnetic rotation sensor chip along with a rotating magnet attached to the motor shaft. The magnet is disk shaped but is magnetized along a diameter rather than along its axis. Thus it's field rotates along with the motor shaft. The orientation of this field is measured by the AS5048B using 4 hall sensors and converted to a digital signal that can be read using the ATMEGA's two wire interface (TWI).

Here's the rotation sensor assembly (shown face up), magnet mount, and gimbal motor:

Motor Driver

For propulsion I used a pair of iPower GM5208-12 gimbal motors. Each of the two motors is driven by the ATMEGA using its PWM (pulse width modulation) interface through an LM6234 driver chip which converts the ATMEGA's 5 volt low current signals to high current 12V pulses that power the motor coils from the LiPo battery.

I designed the motor driver circuit using the application notes provided by the chip manufacturer (AMS):

Initial testing was done using jumper wires on a breadboard:

Then the design was hardwired onto an Arduino "proto shield":

Here's the completed board:

Final Assembly

It's a tight fit:

Results

Running around the living room and kitchen: VIDEO   (That thumping sound in the background is our mantle clock. The robot itself is completely silent.)

With lidar sensor and simple autonomous navigator: VIDEO  

Source code: DOWNLOAD

Stl files: DOWNLOAD


Page last updated 15 Jan 2022 Derek Lieber