Project Overview
Goal: Use LEGO Education SPIKE Prime to build a small robot that walks (or wobbles) by exploiting body shape, flexible joints, and simple motor motions — inspired by the Wobbledogs game where walking emerges from body parts and physics. This project mixes mechanical design, sensors, and programming. You will design interchangeable legs and bodies, program basic gaits, and run experiments to see how changes affect motion.
What you will learn
- How body shape, joint stiffness, weight distribution, and actuator timing create different gaits
- Mechanical design techniques for modular, testable robot parts using SPIKE pieces
- Basic control strategies in SPIKE (Scratch or Python): oscillating motors, timing, and simple feedback
- Running experiments: changing parameters, measuring results, and improving designs
Materials (SPIKE Prime kit + extras)
- LEGO SPIKE Prime Hub
- At least 1–2 Large Motors (better: 2 for left/right)
- Beams, connectors, pegs, angled pieces (to make legs and cams)
- Flexible elements: rubber bands, small shock-absorbing pieces or Technic pins that allow some play
- Extra small weights (coins, small fishing weights) or spare LEGO plates to change center of mass
- Flat test surface and measuring tape (to measure distance and time)
Design concept — how this relates to Wobbledogs
- Wobbledogs creates locomotion by varying body parts and letting physics do the rest. Do the same: build a flexible body with legs attached in ways that allow passive bending and sliding.
- Actuators (motors) act like muscles. Instead of precise leg control, use simple cyclic motor motions (rotation back and forth) to create rhythmic gaits.
- Make parts modular so you can quickly swap leg lengths, joint stiffness, and weights to run controlled experiments.
Simple build plan (step‑by‑step)
- Base body: Build a low, rectangular body using beams to hold the SPIKE hub and to provide attachment points for legs. Keep it rigid enough to mount motors but allow some vertical compliance (one or two flexible connectors).
- Leg pairs: Make two leg assemblies (left and right). Each leg assembly has two segments: an upper 'hip' beam and a lower 'foot' beam connected by a pin that allows rotation. Use rubber bands for springiness at the joint if possible.
- Motor mounting: Mount a motor so it turns a cam or crank. The cam converts rotary motion into an up/down or forward/back rocking motion of the hip. If you have two motors, one can drive the left legs and the other the right legs, or drive front/back pairs.
- Feet: Use flat studs or small plates as feet. Add friction tape or rubber if the robot slips too much. Small angled feet can change how it grips and pushes off the ground.
- Center of mass: Add small weights (or LEGO plates) to the front or rear to change pitch and how legs contact the ground.
- Modularity: Make it easy to swap leg lengths and stiffness by using long/short beams and different rubber band tensions.
Basic walking idea
Rotate the motor(s) back and forth so the hips rock. The timing and amplitude of that rocking, combined with leg geometry and friction at the feet, will produce a gait. Small asymmetries (different leg lengths or slightly offset cams) produce turning or wobble — like in Wobbledogs.
Programming: simple control strategies
Two basic approaches:
- Open‑loop cyclic control: run motors with a fixed amplitude and speed. Best for exploring how physical design affects movement.
- Closed‑loop adjustments: use the hub’s IMU (gyro/tilt), or a distance/color sensor, to modify timing or amplitude and stabilize motion (advanced).
Example (SPIKE‑style pseudocode)
Note: The code below is example-style to show logic. Use SPIKE Scratch blocks or SPIKE Python API in your environment; functions and exact names may vary.
# Pseudocode for alternating left/right rocking
loop forever:
motor_left.run_for_degrees(+AMOUNT, SPEED)
motor_right.run_for_degrees(-AMOUNT, SPEED)
wait(SHORT_DELAY)
motor_left.run_for_degrees(-AMOUNT, SPEED)
motor_right.run_for_degrees(+AMOUNT, SPEED)
wait(SHORT_DELAY)
# Parameters to vary:
# AMOUNT: motor rotation degrees per half-cycle (controls stride amplitude)
# SPEED: motor speed (controls gait frequency)
# SHORT_DELAY: small pause to let body settle between half-cycles
Example experiment script idea
- Set AMOUNT = 30°, SPEED = 40 -> run for 10 seconds and record distance
- Change AMOUNT to 60°, run again
- Change leg length and repeat both tests
- Record which combination gives the farthest distance in the fixed time
How to measure results (simple science method)
- Measure a fixed time interval (e.g., run each trial for 10 seconds) or a fixed number of cycles.
- Measure distance traveled (use tape on the floor or mark start/end points).
- Record parameters: AMOUNT (deg), SPEED, leg length, joint stiffness, weight position, surface type.
- Repeat each condition 3 times and take the average — to reduce random variation.
- Make a table or graph of results to compare.
Troubleshooting tips
- Robot just spins in place: check foot friction — add rubber or change foot angle. Also try asymmetric motor timing.
- Little or no forward motion: increase stride amplitude (motor degrees) or increase weight on front/back to change how feet push off.
- Too bouncy or unstable: stiffen joints (remove rubber bands or add support) or reduce motor speed.
- Motors stall: reduce amplitude/speed or use two motors to split load.
Extensions and challenges
- Evolutionary parameter search: write a simple program on a computer that randomly picks motor amplitude, speed, and phase offset; run each set and log distance. Keep the best parameter sets and mutate them to evolve better gaits.
- Add sensors: use the IMU to keep the robot upright (closed‑loop stabilization) or a distance sensor to follow a wall.
- Make a creature generator: design several body templates (long legs, short legs, tail weights) and test which template performs best on different surfaces.
- Try different surfaces: carpet, tile, wood. See how traction affects the best parameters.
Project checklist for a 15‑year‑old
- Plan a simple body and leg design that’s easy to modify.
- Decide whether to use one motor (simpler) or two (more control).
- Write a basic cyclic control program and test it.
- Design and run controlled experiments changing one variable at a time.
- Record results and iterate — small design changes often have big effects.
Final advice
Start simple. The magic of Wobbledogs is emergent behavior from simple components. Focus first on a reliable, repeatable test setup, then explore creative, unusual shapes. Keep notes so you can learn from each change. Have fun experimenting!
If you want, tell me which SPIKE pieces and motors you have and I can sketch a specific parts layout and give you an example program tailored to your exact hardware (Python or Scratch).