How alenshaju12/toby works
What this project is (type + purpose)
Toby is a small robotics system (hardware + software) for a Raspberry Pi Zero W–controlled quadruped driven by 8 hobby servos through a PCA9685 PWM servo controller, with a local “remote control” script that sends commands to the Pi.
From the repo:
• Mechanical CAD/print artifacts: 3D Models/*.STL, Assembled Model.STL
• Robot-side runtime scripts (on the Pi): Code on Raspberry pi/*.py (forward/sit/standup/stop/wave…)
• Local controller: mainl.py (run on your laptop/desktop; uses paramiko per README → SSH remote execution)
• Servo calibration / low-level control: servo.py (calibrate servos to 90°)
Local Control Plane (Operator side)
• mainl.py
• Dependency: paramiko (SSH client)
• Responsibility: prompts user, maps commands (“walk/sit/standup/wave/stop”) to remote actions on the Pi
Robot Compute Plane (Raspberry Pi Zero W)
• Folder: Code on Raspberry pi/
• forward.py, sit.py, sitdown.py, standup.py, stop.py, wave1.py
• Likely responsibility: motion routines (sets multiple servo angles over time)
Actuation Plane (Servo control + motors)
• servo.py (calibration / servo positioning helper)
• Hardware: PCA9685 servo controller (I2C in, PWM out)
• Hardware: 8x MG90 servos
• Mechanical: printed legs/body (*.STL)
• Power source (battery / 5V supply)
• Separate power domains (common in servo robots): servo power vs Pi power, shared ground
The minimum accurate runtime flow is:
Pi runs one of the motion scripts (e.g., forward.py)
4. Motion script uses an I2C library (commonly Adafruit PCA9685 driver) to send I2C commands to PCA9685
Servos move legs → robot changes pose/gait
• Local PC →(Wi‑Fi/SSH)→ Raspberry Pi
• Raspberry Pi →(I2C)→ PCA9685
• PCA9685 →(PWM x8 channels)→ Servos
• Servos →(mechanical linkage)→ Legs/Body (3D printed)
“setup/calibration” flow:
• servo.py is executed on the Pi to set all servos to 90° before assembly/calibration.
• mainl.py (Command Console / Remote Controller)
• uses Paramiko (SSH)
• sends “walk/sit/standup/wave/stop”
• Motion scripts (run on Pi):
• Code on Raspberry pi/forward.py
• .../sit.py, .../sitdown.py, .../standup.py, .../stop.py, .../wave1.py
• Calibration/servo utility:
• servo.py (90° set / calibration)
• PCA9685 Servo Controller (I2C target)
• 8x MG90 Servos (PWM inputs)
• 3D Printed Frame & Legs (from 3D Models/*.STL, Assembled Model.STL)
• Power subsystem (battery/regulator) and separate rails
• Operating system on Pi (Ubuntu per README)
• SSH service on Pi (since remote execution is core)
Don’t overthink it: maximize components
For this repo, the “as many components as possible” interpretation is:
• Treat each motion file (forward.py, sit.py, etc.) as its own component (because each is a separately invoked behavior).
• Split “servo control” into two components:
• “Motion routine (angles over time)”
• “Driver/adapter to PCA9685 (I2C write)”
Even if the driver is embedded in the scripts today, showing it as a conceptual component makes the architecture clearer and more reusable.