Description

Smart Servo MS-12A is a new-generation smart servo developed by Makeblock. It surpasses traditional servos mainly in easy control, large rotation angle, continuous rotation, and compatibility with various accessories. Smart Servo MS-12A can be used to assemble multi-joint robots such as humanoid robots, multi-legged spider robots, and mechanical arms. Its continuous rotation allows you to build structures such as controllable rotating platforms and wheel drivers.

In combination with compatible software, Smart Servo MS-12A can record actions and perform complex movements without programming. Besides, it works well with Makeblock programming software, such as mBlock 3, mBlock 5, and the Makeblock app. It also supports Arduino programming.

Specifications

ParameterDescription
SKU95080
ModelMS-12A
MotorIron core motor
GearAll-metal gear (gear ratio 1:305)
BearingBall bearing
Exterior materialPA
Installation holeM4 Brass rivet nut
Depth: 6mm
Spacing: 16mm
Servo hubProviding 4 M4 threaded holes, which can be used to fit the servo on a servo bracket or another part
Mounting bracketAluminium alloy
Providing holes of diameter 4mm and spacing 16mm
Can be fit on Makeblock and Lego parts with screws
Size48 x 24 x 41 (mm)
Weight72g
Communication Full-duplex serial port UART
Speed0.18s/60°, 7.4v
Servo resolution4096
Torque12kgf.cm
Angle0–360°, continuous rotation
IndicatorRGB LED (programmable in light color and brightness)
ConnectorIN (Red); OUT (White)
Operating voltageDC 6V–12.6V
Position feedbackMagnetic encoding
Current at locked rotor2A
Operating temperature0℃–80℃
ProtectionAgainst overcurrent, overvoltage, overtemperature, and undervoltage
Dead bandwidthNo deadband
FeedbackPosition, speed, temperature, current, voltage
Service life90,000 times
Compatible mainboardMe Auriga, MegaPi Pro, and NovaPi

Features

  • Compatible with various hardware accessories
  • Continuous rotation
  • Supporting actions recording
  • Smart protection: protection is automatically triggered when overtemperature or overcurrent occurs
  • Supporting Arduino programming, for which an Arduino library is provided
  • Supporting mBlock 3 and mBlock 5, which are intended for users of all ages
  • Supporting Python programming on Raspberry Pi

    Structures and dimensions

    1.jpg

Connection

image.png

Examples


image.png
image.png

Servo zeroing

Description

Servo zeroing literally refers to setting a servo to its zero position. Smart Servo MS-12A is delivered with a default zero position. Unlike traditional servos, Smart Servo supports 360-degree rotation, so you can set its zero position on your own.

Steps

The following describes how to set the zero position on Smart Servo MS-12A by using mBlock 3 when it's connected to mBot Ranger. The way of setting the zero position on mBlock 3 is similar to that on mBlock 5. Set the zero position on mBlock 3

Note:

  1. Disconnect Smart Servo from the power supply and manually set it to the target zero position and state; alternatively, set it to the target state through software.
  2. Connect Smart Servo to the main control board first and update its firmware.
  3. Connect the main control board to an external power supply and then turn on its power button to supply power to the servo (the indicator of the servo is normally on in blue when is is powered on). Servo zeroing can't be done if the servo is not powered on.
  4. Set the servo to its zero position on the software.

    Programming

    You can program the servo in the block-based, C, C++, or Python language. Block-based programming is easy to learn and can be mastered by most of the users. Whether you are a greenhand or an experienced master of programming, you can soon have a good command of basic knowledge on block-based programming.

    Different from block-based programming, traditional C, C++, and Python programming may be a choice for those whom have learned C or Python or other programming languages.

    The following describes how to program Smart Servo MS-12A when it is connected to MegaPi Pro.

    Block-based programming—mBlock

    Configuration

  5. Download the version of mBlock 5 applicable to the system running on your PC; read mBlock 5 Online Help to undertsand the UIs and basic operation of mBlock 5.

  6. On the Devices tab, connect MegaPi Pro to mBlock 5 and then find the blocks for Smart Servo MS-12A in the Power category.

    Blocks

    BlockFunction
    **Parameter**: sets the sequence number of the servo, ranging from 1 to 6
    **Function**: sets the servo to its zero position.
    **Parameter 1**:** **sets the sequence number of the servo, ranging from 1 to 6
    **Parameter 2**: sets the power, ranging from –100 to +100
    **Function**:sets the power of the servo.
    **Parameter 1**: sets the sequence number of the servo, ranging from 1 to 6
    **Parameter 2**: sets the servo to a degree (an Integer).
    **Parameter 3**: sets the speed (0–50 r/min).
    **Function**: sets the servo to rotate to the specified degree at the specified speed.
    **Parameter 1**: sets the sequence number of the servo, ranging from 1 to 6
    **Parameter 2**: sets the degrees the servo is to rotate (an Integer).
    **Parameter 3**: sets the speed (0–50 r/min).
    **Function**:sets the servo to rotate the specified degrees at the specified speed.
    **Parameter**: sets the sequence number of the servo, ranging from 1 to 6
    **Function**: obtains the current, voltage, speed, degree, or temperature

Example program

When the following program is executed, the first Smart Servo MS-12A connected to MegaPi Pro rotates to 30° within 1 second, then rotates to 120° within another second and repeat this whole process.
image.png

C/C++programming—Arduino IDE

Configuration

Makeblock-Library-master is required to control the motor in programming Smart Servo MS-12A. Refer to the following steps to configure the Arduino IDE.

IDE configuration

To program Orion with C/C++, you need Arduino IDE (click to learn about Arduino). Perform the following steps to configure the Arduino IDE:
1)Download and install Arduino IDE.
2)Download and install the CH340 driver required by Orion.
● Windows
● MacOS
3)Download Makeblock library from GitHub, see the GitHub page on how to download and use the library files.
4)Connect Orion to the computer with a USB cable, select the corresponding board (Orion is developed based on Arduino Uno) and the corresponding COM port, then select and upload the sample program in MakeBlockDriver and see how it is executed.

Function description

FunctionDescription
mysmartservo.begin(115200)
mysmartservo.assignDevIdRequest()
Sets the baud rate and initializes the smart servo.
mysmartservo.setRGBLed(index,R,G,B)Sets the color of the LED.
Parameter: servo number,R,G,B
R,G,B: 0–255
mysmartservo.setInitAngle(index)Resets the servo.
Parameter: servo number
mysmartservo.moveTo(index,position,speed)Sets the servo to rotate to the specified degree at the specified speed.
Parameter: servo number
Degree: an integer
Speed: –50–+50
mysmartservo.move(index,position,speed)Sets the servo to rotate the specified degrees at the specified speed.
Parameter: servo number
Degree: an integer
Speed: –50–+50
mysmartservo.setPwmMove(index,speed)Sets the servo to rotate at a specified speed modulated by PWM.
Parameter: servo number
Speed: –255–+255
mysmartservo.getSpeedRequest(index)
mysmartservo.getTempRequest(index)
mysmartservo.getCurrentRequest(index)
mysmartservo.getCurrentRequest(index)
mysmartservo.getAngleRequest(index)
Obtains the speed, temperature, current, voltage, or degree
Parameter: servo number

Python programming

Configuration

To program the servo, perform the following steps to configure a Python environment:

  1. Connect MegaPi Pro to Raspberry Pi; connect Me RJ25 Adapter to a RJ25 Port on MegaPi Pro; and connect Smart Servo MS-12A to Me RJ25 Adapter.
  2. Install the latest Makeblock library pip3 install makeblock --upgrade for Rasepberry Pi.
  3. Create a new Python file with the suffix ".py".
  4. Compile the Python file.
  5. Execute the Python file, for example, python123.py.

    Function description

    FunctionDescription
    SmartServo(port)Creates the object—Smart Servo
    Port: port, MegaPiPro.PORT5 (default)
    run(index,pwm)Sets the power
    Index: servo number; pwm: PWM Duty Cycle (–100–+100)
    move_to(index,position,speed)Sets the servo to rotate to the specified degree at the specified speed
    Index: servo number; position: the target degree; speed: rotating speed (1–50 r/min)
    move(index,position,speed)Sets the servo to rotate the specified degrees at the specified speed.
    Index: servo number; position: number of degrees to rotate; speed: rotating speed (1–50 r/min)
    set_zero(index)Sets the current position as the zero position.
    index: servo number
    set_led(index,red,green,blue)Index: servo number; red: red; green: green; blue: blue

Example 1

When the following program is executed, servo 1 on MegaPi Pro rotates at the speed of 10 r/min for 2 seconds and holds 1 second, and then rotates at the speed of –10 r/min for 2 seconds and holds 1 second. The process is repeated.

from time import sleep
from makeblock import MegaPiPro 
board = MegaPiPro.create()
smartservo = board.SmartServo()
while True:
    smartservo.run(1,10)
    sleep(2)
    smartservo.run(1,0)
    sleep(1)
    smartservo.run(1,-10)
    sleep(2)
    smartservo.run(1,0)
    sleep(1)

Example 2

When the following program is executed, servo 1 on MegaPi Pro rotates by 720 degrees at the speed of 50 r/min and then stops. The process is repeated.

from time import sleep
from makeblock import MegaPiPro 
board = MegaPiPro.create()
smartservo = board.SmartServo()
while True:
    smartservo.move_to(1,720,50)
    sleep(4)
    smartservo.move_to(1,0,50)
    sleep(4)

Purchase

Contact us if you want to take it home.

results matching ""

    No results matching ""