speed2csv.py

Speed Sequence Generator

Features

  • Generates CSV speed sequences for continuous rotation servos

  • Supports 3 speed profile types:

    • Smooth (s): Triangular profile (0 → target → 0)

    • Pulse (p): Immediate step to target speed

    • Constant ©: Linear ramp (default)

  • Precise 20ms frame timing

  • Input validation (-100 to 100 range)

Usage

python speed2csv.py -s "S1 S2 S3 S4 S5 S6" -t DURATION_MS -o OUTPUT.csv

Command Syntax

  • -s: Space-separated speed values with optional type suffixes:

    • Format: [value][type] (e.g., 50s, -30p, 80c)

    • Default type: c (constant)

  • -t: Total duration in milliseconds (minimum 20)

  • -o: Output CSV file path

Example

# Generate complex movement
python speed2csv.py -s "100s -50p 80c 30s 0 -20p" -t 500 -o complex.csv

Output CSV Format

S1,S2,S3,S4,S5,S6
100.00,-50.00,80.00,30.00,0.00,-20.00
...