- edited description
How to drive my servo with servo lib
Hi @John Maloney ,I have a servo,it works with frequency 50Hz (period 20MS) and using pulse width 0.5MS - 2.5MS to rotate it 0 -300 degrees. How could I control it with MicroBlcoks servo lib.Thanks.
Comments (10)
-
reporter -
reporter - edited description
-
reporter I got it. I map (-150 150) to (-90 90) with the servo block, it works.
-
reporter Now I can rotate it, but I can not change it’s rotation speed with the servo speed block. How can I change rotating speed.Thanks.
-
reporter Maybe the rotation speed depends on the structure of the steering gear itself.
-
reporter Thanks.
-
repo owner Hi, Tom. Glad you figured out how to control the servo angle.
There are two types of servos. An angle (or "position") servo can be moved to a specific angle. It moves as fast as it an then stops when it reaches the desired anagle.
A"continuous rotation" servo is like a motor: it turns continuously at a speed based on the parameter. Negative values make it turn in the opposite direction.
The two types of servos use exactly the same control signal (frequency 50Hz (period 20MS) and using pulse width 0.5MS - 2.5MS) but interpret the pulse width in different ways: as a angle for the position servo and as a power level for the continuous rotation servo.
You can control the speed of a rotation servo by breaking the total turn angle into a bunch of smaller angles and moving to each intermediate position in a loop, using a "wait" block to get the desired speed.
-
repo owner - changed status to open
-
reporter OK,Got it. Thanks for your quick reply.
-
repo owner - changed status to resolved
- Log in to comment