2

I just got a I2C PWM hardware module. I would like to use it to control some servos.

I found here and there that servos uses a 50Hz PWM, if the pulse is 1ms it will go to 0° and 2ms will make it go to 180°.

Is it the same for all servos? I also read that if you go below 1ms or above 2ms you will break the servo gears.

Mine are 'T & R SG90 servo 9 g micro servo'

Thanks.

sliders_alpha
  • 275
  • 1
  • 2
  • 11
  • Link to datasheet? (In your question - not in the comments.) Note that servo is a general term and can include hydraulic, pneumatic, vacuum, etc., as well as micro and can vary in size from micro to huge. – Transistor Oct 21 '17 at 19:34
  • 2
    Traditional RC hobby servos do behave approximately as you describe, though the exact timing details vary between designs, so this is unanswerable without an engineering data sheet. The key is usually the pulse width and not the repetition rate, though there can be some sensitivity to that especially far from the traditional 50 Hz. Generally you won't break gears by briefly commanding a servo past its endpoints - just return to a central value promptly if you hear it straining. If you want to be extra safe you can limit the power supply current while exploring the timing limits. – Chris Stratton Oct 21 '17 at 19:36
  • Unfortunatly there is no datasheet, it's those ones : https://goo.gl/9T2qAB

    Oh so I have to experiment to find the true range of my servo

    – sliders_alpha Oct 21 '17 at 20:24

2 Answers2

4

The SG90 is a very common sub-micro analog servo size, it is made by multiple manufacturers and is one of the cheapest (though cheap implies not that reliable).

Analog servos all typically state 1.5 mS/50Hz as the home (center position) 1mS is extreme left, and 2 ms is extreme right travel. The 50 Hz frame rate is not absolute, many will work just fine between 50 - 75 Hz. If you stop sending frames, the servo goes into free mode (no drive to servo motor) and as soon as you send frames it locks at its position sense.

If the analog servo is modified for continuous motion they are 1.5 ms stationary/stopped 1 ms fast reverse/ant-clockwise and 2 ms fast forward/clockwise

The typical analog servo has 180 degree span for 1 - 2 ms, but most will go somewhat further ...ie <1 ms and >2 ms. The SG90 has a very small and delicate plastic gearbox, it's easy to strip the gears (I have destroyed a bunch over the years).

There are also many servos that can span more than 180 degrees using the 1 - 2 ms signal. This is a good place (ServoCity) to see all the features available over a range of servos.

Jack Creasey
  • 21,729
  • 2
  • 15
  • 29
-1

You need a 20ms period (50Hz) and a variable duty cycle from 900µs to 2ms to set the direction of the servo. You may change it fast as you want. Simple PWM is used where the duty cycle sets rotation target position limited by Servo speed indicated by no load response time 0.16 sec? To 60 degrees and slower with more current if fully loaded by stall/ start current then declining rapidly to idle.

Tony Stewart EE75
  • 1
  • 3
  • 54
  • 185