RobArt – Software
Die Software-Architektur von RobArt.
Architektur-Übersicht
┌─────────────────────────────────────────────────┐
│ iOS/macOS App │
│ (Bluetooth, SVG-Editor, Steuerung) │
└────────────────────┬────────────────────────────┘
│ Bluetooth
▼
┌─────────────────────────────────────────────────┐
│ Raspberry Pi │
│ (SVG-Parsing, Koordination) │
└────────────────────┬────────────────────────────┘
│ Serial
▼
┌─────────────────────────────────────────────────┐
│ Arduino │
│ (AccelStepper, Echtzeit-Steuerung) │
└─────────────────────────────────────────────────┘Arduino Firmware
AccelStepper Library
Für präzise Schrittmotor-Steuerung wird die AccelStepper-Library verwendet:
#include <AccelStepper.h>
AccelStepper stepper1(AccelStepper::DRIVER, STEP_PIN1, DIR_PIN1);
AccelStepper stepper2(AccelStepper::DRIVER, STEP_PIN2, DIR_PIN2);
AccelStepper stepper3(AccelStepper::DRIVER, STEP_PIN3, DIR_PIN3);
void setup() {
stepper1.setMaxSpeed(1000);
stepper1.setAcceleration(500);
// Analog für stepper2, stepper3
}
void loop() {
stepper1.run();
stepper2.run();
stepper3.run();
}Kinematik – Omnidirektional (3 Räder)
Die drei Räder sind im 120°-Winkel angeordnet. Für Bewegung in x/y-Richtung und Rotation ω:
v₁ = vₓ + r·ω
v₂ = -0.5·vₓ + (√3/2)·vᵧ + r·ω
v₃ = -0.5·vₓ - (√3/2)·vᵧ + r·ωArduino-Implementation:
void setVelocity(float vx, float vy, float omega) {
float v1 = vx + RADIUS * omega;
float v2 = -0.5 * vx + 0.866 * vy + RADIUS * omega;
float v3 = -0.5 * vx - 0.866 * vy + RADIUS * omega;
stepper1.setSpeed(v1 * STEPS_PER_MM);
stepper2.setSpeed(v2 * STEPS_PER_MM);
stepper3.setSpeed(v3 * STEPS_PER_MM);
}SVG Path Parsing
Unterstützte Befehle
| Befehl | Beschreibung | Parameter |
|---|---|---|
| M/m | MoveTo (Stift hoch) | x, y |
| L/l | LineTo (Linie) | x, y |
| C/c | Cubic Bézier | x1, y1, x2, y2, x, y |
| Q/q | Quadratic Bézier | x1, y1, x, y |
| Z/z | ClosePath | - |
Beispiel-Pfad
<path d="M 10 10 L 50 10 L 50 50 L 10 50 Z" />Erzeugt ein Quadrat: Start bei (10,10), Linien zu den Ecken, zurück zum Start.
G-Code Unterstützung
Zusätzlich zu SVG unterstützt RobArt G-Code:
| G-Code | Beschreibung |
|---|---|
| G00 | Schnelle Positionierung (Stift hoch) |
| G01 | Lineare Interpolation (Stift unten) |
| G02 | Kreisbogen im Uhrzeigersinn |
| G03 | Kreisbogen gegen Uhrzeigersinn |
iOS/macOS App
Die Companion-App bietet:
- Bluetooth-Verbindung – Automatische Erkennung von RobArt
- SVG-Editor – Grafiken erstellen und bearbeiten
- Live-Vorschau – Zeichnung vor Ausführung prüfen
- Manuelle Steuerung – Joystick für direkte Bewegung
- Kalibrierung – Assistenten für Hardware-Setup
Raspberry Pi Software
Der RPi übernimmt:
- Bluetooth-Kommunikation mit App
- SVG/G-Code Parsing und Validierung
- Pfad-Optimierung (Reihenfolge, Kurvenglättung)
- Befehlsübertragung an Arduino via Serial
Socket.IO Integration (Optional)
RobArt kann alternativ über den Collab Server gesteuert werden:
{
"type": "draw",
"path": "M0,0 L100,100 L200,0"
}