Hey Guys!
I spent a lot of time on a 7 segment servo controlled clock for my office recently which I finally finished. It works great but am somewhat disappointed that whenever the time changes (every minute) the servos that move go full speed and are really loud + distracting. I'm therefore trying to slow down the servo movements to bring the noise down a bit.
I know there are a variety of methods for slowing them down, but am not sure what the best may be to cut the speed for each in this specific script. I spent a lot of time dialing in each of the 28 servos to face the right way and last thing I want to do is jeopardize that.
The script seemingly uses SetPWM within the "showdigit" function (~70% down) plus variables to set each servo. Any suggestions for how to address would be fantastic. Below is a snippet of the part which sets the servo followed by the complete code if you wish to view...
void showdigit(byte i, byte digit, int w) { // parameters: i = digit position (0,1,2,3), digit = number, w = delay avoiding high power draw
int pulse;
byte servonum, a, segmentposition;
for (byte j = 0; j < 7; j++) { // show the 7 segments
servonum = j + (8 * ((i == 1 || i == 3))); // add 8 if position is 1 or 3 because 1 ands 3 digits start on pin 8 of the PCA
segmentposition = mapchar[digit] [j]; // segment should be low or high?
if (servoreverse [i] [j] == 0) {
pulse = servopulse[segmentposition]; // for a normal (not reverse) servo assign pulse low or high
}
else {
pulse = servopulse[!segmentposition]; // if servo works reverse, assign contrary
}
pulse = pulse + servofinetune [i] [j]; // add the fine tunning to the servo
switch (i) { // switch for both PCA controllers
case 0: case 1:
servoHours.setPWM(servonum, 0, pulse);
break;
case 2: case 3:
servoMinutes.setPWM(servonum, 0, pulse);
break;
}
delay(w); // delay in between movement of contiguous segments, so we can do waves oleeeeeeee.
}
}
ServoClock_OTA_Ease_092322.ino (11.1 KB)
Thanks!