Notifications
Clear all
Topic starter
2025-10-27 7:32 pm
Hello everyone. I learned so much about programming in Arduino through DroneBot. I am currently working on a 6 DOF aluminum robotic arm and simply want to learn how to make the movements very smooth despite using servo motors with power ratings of only 11 kg to 45 kg.
2025-10-27 8:35 pm
Topic starter
2025-10-27 9:46 pm
The following if part of the sketch I used:
// Move a servo to a given angle instantly
void moveServo(uint8_t channel, int angle) {
pwm.setPWM(channel, 0, angleToPulse(angle));
}
// Jerk-limited 7-segment S-curve motion profile
void sCurveMoveServo(uint8_t channel, int fromAngle, int toAngle, int durationMs = 2000, int steps = 200) {
int stepDir = (toAngle > fromAngle) ? 1 : -1;
float totalDist = abs(toAngle - fromAngle);
for (int i = 0; i <= steps; i++) {
float t = (float)i / steps; // 0 → 1
// Quintic polynomial: smooth position, velocity, acceleration, jerk
float s = (10 * pow(t, 3)) - (15 * pow(t, 4)) + (6 * pow(t, 5));
int angle = fromAngle + stepDir * (s * totalDist);
moveServo(channel, angle);
delay(durationMs / steps);
}
}
This post was modified 6 months ago by DroneBot Workshop
THRandell reacted