An open-source 2-axis delta robot.
The great thing about delta, is it only uses 2 small servo motors, but it has a quite a large workspace.
Configure config.h
Carefully adjust the values based on your robot's physical dimensions and the specifications in your servo motor datasheets.
Incorrect configuration will lead to self-destruction!
#include <delta.h>
#include <Servo.h>
Delta delta;
void setup() {
Serial.begin(9600);
// CAREFUL: This will move the servos to the home position
// with no control over speed!!
delta.begin();
}
void loop() {
delta.setSpeed(50); // Speed in mm/s
// Move to (x, y) in mm.
//
// This will return `false` if
// - the position is out of bounds
// - getting there would cause a collision.
delta.moveTo(100, 200);
delta.setSpeed(200);
delta.moveTo(-50, 300);
}
moveTo
is blocking, so let me know if you need a non-blocking version.
Turn off the power to the servos before uploading!
Uploading can interfere with the PWM signals and cause the servos to go crazy until the robot is destroyed.
In future versions, I'll add an upload button, which will detach the servos before uploading.
- 1x Arduino
- 1x 5V 3A power supply
- 2x Standard servos with metal servo horns (Amazon)
- 9x 624Z bearings
- 15x M4 locknuts
- 4x 16mm M4 screws
- 8x 20mm M4 screws
- 1x 25mm M4 screw
- 1x 30mm M4 screw
- 1x 35mm M4 screw
- 4x 10mm M3 screws
Currently, the inverse kinematics uses acos
, which can be inaccurate for acos(1-)
and acos(-1+)
. It would be better to use atan2
instead.