SparkR

← All projects

Robotics · System integration / Mar–Jun 2026

A wheel-legged robot, from structure to control

Built

Code & models (PID) ↗

RoboBachelor is the PID open-source edition of SparkR, with STM32 firmware, mechanical models and build guides. This case study also covers my VMC-LQR development.

My contribution

Independent mechanical, electronics & control development

I designed and built SparkR’s mechanical structure, custom electronics and embedded controller, bringing the platform from CAD and PCB design to assembly and balance tuning.

Project goal

I developed SparkR as a compact wheel-legged platform for mobility and visual inspection in confined spaces. The rescue-inspection use case shaped the design: a small body, folding leg geometry, efficient rolling and an onboard camera view for the operator.

Design choices

Compact similar-linkage legs

Use two driven inputs per side to control effective leg length and angle, with a driven wheel at the end of each leg.

Model-based balance control

Run IMU-based state estimation, VMC-LQR and PID control on STM32, with motor feedback and commands carried over CAN.

Build the whole electrical path

Integrate the battery, custom power-distribution and CAN boards, sensors, motors and FPV video into one physical platform.

A wheel-legged mechanism at 20 cm scale

Each side uses a similar-linkage mechanism with two joint actuators and a direct-drive wheel. The linkages translate the two joint angles into effective leg length and leg angle, giving the body adjustable support geometry while preserving wheel-based motion.

The compact arrangement concentrates the driven joints near the body. This reduces the lateral space needed for the leg mechanism and keeps wiring close to the chassis. I compared the packaging and kinematic tradeoffs of conventional serial legs, parallel legs and the similar-linkage arrangement before developing the latter.

The revised hardware uses four DM4310 geared joint motors and two JC4310 wheel motors. Joint reduction helps provide the holding torque needed for a two-wheel balance platform. The frame combines a lightened acrylic base with 3D-printed parts where the load path permits them.

CAD and kinematic layout of the SparkR similar-linkage leg, showing the driven linkage geometry.
Similar-linkage leg geometry and its kinematic layout.

From sensors to motor commands

The real-time controller runs on an STM32F405-based RoboMaster A board at a 1 ms period. IMU measurements and motor feedback provide the body and joint state used by the balance controller.

Attitude estimation combines accelerometer and gyroscope information. The LQR formulation uses body pitch, pitch rate, longitudinal position and velocity, while the VMC layer connects the virtual leg geometry to joint actuation. CAN links the embedded controller to the joint and wheel motors.

I started with PID-based control to bring up the hardware, then developed the VMC-LQR balance controller as the mechanism, communication and state estimation came together. Remote-control input and FPV video provide an operator interface alongside the balance loop.

  1. Sense

    IMU measurements and motor position / speed feedback

  2. Estimate

    Body attitude, angular motion and wheel-based motion state

  3. Control

    VMC-LQR balance control and PID loops

  4. Actuate

    CAN commands to joint and wheel motors

Power, wiring and the operator view

I designed the power-distribution and CAN hub PCBs in EasyEDA and handled fabrication, soldering and system wiring. Bringing those connections onto dedicated boards made the motor, controller and sensor interfaces easier to assemble and debug.

The revised platform uses a 6S LiPo battery. Motor power and the lower-voltage electronics are arranged around the chassis layout, with a compact FPV camera and video transmitter providing the remote view. This electrical integration was developed together with the mechanism so that board placement and cable routing fit the assembled robot.

The integrated prototype

The assembled platform brings the mechanism, custom electronics and balance controller together. The gallery shows the physical build and motion on an indoor floor and an outdoor wooden deck.

The integrated prototype
Prototype characteristicValue
Expanded dimensions (length × height × width)Approximately 200 × 200 × 240 mm
Mass, including battery2.3 kg
Joint / wheel motors4 geared joint motors / 2 wheel motors
Balance-control frequency1 kHz
Average level-floor speed2.2 m/s
Obstacle traversalApproximately 7 cm
RuntimeApproximately 35 minutes

Development

  1. First integrated hardware

    The initial version used direct-drive joint motors and a heavier frame, at about 3 kg. Holding the robot upright required high continuous motor current and exposed a joint-heating problem.

  2. Actuator and mass revision

    I moved the joints to geared DM4310 motors and revised the battery and frame. The resulting platform weighed 2.3 kg, with less holding-current demand at the joints.

  3. Electrical integration

    Power-distribution and CAN PCBs, soldering and cable routing brought the motors, sensing and controller into a serviceable assembly.

  4. Balance tuning

    Controller bring-up progressed from PID toward the STM32 VMC-LQR implementation, followed by communication, estimation and physical-platform tuning.

Project highlights

One integrated system

I carried SparkR through mechanical design, custom electronics, embedded communication and balance control, with the physical prototype and motion footage shown below.

Gallery

SparkR on a table with its motors, wheel-leg mechanisms, control electronics and wiring visible.
SparkR prototype with its wheel-leg mechanisms, electronics and wiring.
Indoor-floor and outdoor wooden-deck motion, in a 26-second silent edit.

Future directions

A future direction is to explore reinforcement learning as a residual correction on top of the existing VMC-LQR controller, with simulation and hardware work developed around that model-based foundation.

  • STM32
  • VMC-LQR
  • PID
  • IMU
  • CAN
  • EasyEDA
  • PCB
  • FPV

← Explore other projects