Hi. I am using the ServoEasing library and PWM to control a GoBilda servo.
Whenever I go from one position to another, let's say from 0 to 180° or 20 to 110° (which should be perfectly perpendicular), the servo will move 10-15 degrees less than it is supposed to.
I was wondering, if this could be due to the fact that the servo has a motion range of 189? It is marketed as 180 degrees however. I could technically add about 10 degrees to my target positions, but I am not looking for a quick fix.
I am using a 6V external power supply.
Use the Arduino Servo library and this test sketch to find the end limits and mid point of your servo. Hold the servo in your fingers so you can feel if it hits an end limit and starts jerking or "growling".
/*
Try this test sketch with the Servo library to see how your
servo responds to different settings, type a position
(0 to 180) or if you type a number greater than 180 it will be
interpreted as microseconds(544 to 2400), in the top of serial
monitor and hit [ENTER], start at 90 (or 1472) and work your
way toward zero (544) 5 degrees (or 50 micros) at a time, then
toward 180 (2400).
*/
#include <Servo.h>
Servo servo;
void setup() {
// initialize serial:
Serial.begin(9600); // set serial monitor baud rate to match
// set serial monitor line ending to "NewLine"
servo.write(90);
servo.attach(9);
prntIt();
}
void loop() {
// if there's any serial available, read it:
while (Serial.available() > 0) {
// look for the next valid integer in the incoming serial stream:
int pos = Serial.parseInt();
if(Serial.read() == '\n'){} //skip 1 second delay
pos = constrain(pos, 544, 2400);
servo.write(pos);
prntIt();
}
}
void prntIt()
{
Serial.print(" degrees = ");
Serial.print(servo.read());
Serial.print("\t");
Serial.print("microseconds = ");
Serial.println(servo.readMicroseconds());
}
I would like to see an annotated schematic showing how you connected this in your project and how it is powered, be sure to show all power sources and links to the hardware items such-as the servo so we can get the needed technical information. Your description is like saying I have a yellow car and I want to know the millage.
No, the servo controller isn't necessary. I successfully used other GoBila servos with PWM before (which have a 360 degree range of motion however) and could perfectly control it to move to the desired angle.
I still assume this might be related to this servo's 180 vs 189 range of motion but I haven't found a solution yet.
Sorry... i was thinking 360 degree servo Have you verified this is not their typographical error? I imagine they making a 10 degree dead zone for "stop" angles so you can be certain of stopping.
Have you tried adjusting the minimum and maximum pulse width initializing the object? Does the servo have any min/max PW printed on it? (I see your writing, just verifying how you git the values)