V0.2 Software

Back to PLOT BOT
Go to V0.2 Hardware

Goals

  1. Organize the code into abstract layers
  2. Implement linear interpolation

Embedded programming

Layers

Layer Role (abstract) Input → Output
1. G-code & Intent Describes what motion is desired, independent of hardware G1 X100 Y200 → Target pose + path type
2. Interpolation Converts geometric intent into a time-parameterized reference Target pose → Trajectory x(t), y(t), θ(t)
3. Correction Aligns reference motion with estimated actual state Trajectory + pose estimate → Body velocity (Vx, Vy, ω)
4. Mecanum kinematics Maps body motion into actuator commands → (Vx, Vy, ω) Motor commands (ω1..ω4)

Interpolation

Formula: Position(Time) = Start + (Total change) * Time

P0 = (x0, y0)
P1 = (x1, y1)

P(s) = (1 − s)·P0 + s·P1
P(s) = P0 + s·(P0 - Y0)

x(s) = x0 + s·(x1 − x0)
y(s) = y0 + s·(y1 − y0)

Ref:

Mecanum kinematics

Files

Arduino
Processing