Go Down

Topic: Need some help with servo MG996R (Read 569 times) previous topic - next topic

mafulynch

Hi, I am new to arduino and I am trying to learn how to use servos. I have a Tower Pro MG996R and I cant understand well how to use it. I have read in the forum that if I set

myservo.write(value);

with value between 0 and 90 it will rotate clockwise with different speeds, being 0 max speed
if value between 90 and 180 it will rotate counter clockwise with 180 max speed.

But if I set value on my arduino to anything between 0 and 83 it moves clockwise at the same speed and just starts to go slower with value between 84 and 86. From 87 to 90 it will stop spinning.

If value from 98 to or 99 it will spin counter clockwise at a slow speed. If I set it to anything between 100 and 180 it doesn't spin.

So my question is how am I supposed to use this servo? or is it broken?

this is the code I am using


Code: [Select]

#include <Servo.h>
Servo servo1;

void setup() {

  servo1.attach(9);
  servo1.write(180);
}

void loop() {

}

jremington

#1
Oct 25, 2018, 01:08 am Last Edit: Oct 25, 2018, 01:36 am by jremington
That servo requires 1.4 Amperes start up current, which will require a beefy power supply. At the very least, use a 4xAA battery pack with fresh alkaline cells, or better, a 5xNiMH AA pack (fully charged).

It will not work powered from the 5V pin of an Arduino, or from a USB connection and could even damage your equipment if you try. Be sure to connect the negative lead of the servo power supply to the Arduino ground.

mafulynch

Ok so I have it now on a new power supply and it does spin counter clockwise. But I still don't notice any speed difference between 0 ad 83. Is this supposed to be this way?
Thanks

jremington

#3
Oct 27, 2018, 04:47 am Last Edit: Oct 27, 2018, 04:47 am by jremington
Most hobby servos move at constant speed from one position to another. Check the servo data sheet or product page.

slipstick

Just to be clear...are you talking about a 360 degree continuous rotation MG996R? Not a conventional servo with positional control? The two things behave very differently.

To test it why not get a potentiometer and use the Knob example code? That way you don't have to keep changing the write() value and reloading the code.

Steve

Go Up