How to control a servo motor from a PC

 
 
 

   Servo motors are one of the most useful devices in any control and automation project. Unlike DC motors they do not simply go round and round at a specified speed. Put simply, they go “where they are told”. By that I mean you can specify to what angle the rotor should go to with respect to the stator. It will go there at maximum speed and it’s full torque and stay there when it gets Controlling a Servo from a PC made easy using a USB adaptor boardthere. This makes servos very useful for positional oriented control systems. Often they are fitted with belt drives or pulleys with cords to convert the rotational position control into a linear one.
    In this guide we will be using a MotorBee USB adaptor board to operate a 6v DC servo so that the position it goes to is interactively controlled by a windows slider control on the PC screen.
DC servo

Connecting the Servo to MotorBee
    The first step is to connect the Servo to the MotorBee. This part is surprisingly simple and uses a standard 10-way ribbon cable assembly. The 10-way IDC socket on the ribbon cable plugs into PL3. Only two cores of the ribbon cable are needed for this connection (i.e. cores 5 and 6).


The connection arrangement is shown below

how to connect a servo motor to a PC

   As you can see the servo uses core 5 (i.e. pin5 on PL3) for its control signal and core 6 (pin 6 on PL3) for a ground reference. Although the MotorBee is powered directly from its USB connection, the servo requires a separate 6v power supply. This is connected directly to the servo (as shown above) with the ground being common to the MotorBee.

Connecting the MotorBee to the PC
    A standard USB lead is used to connect the MotorBee to a free USB port on the PC. MotorBee does not require any special drivers for windows. These drivers are already part of Windows (WinXP or later) and when connected for the first time Windows will automatically configure it for use.

The servo is now ready for PC control.

Using MotorWay Software
    MotorBee is supplied with MotorWay software, which is designed to do much more than just control a servo, but for our purposes we will focus on its servo control part. Installation of the software is very straightforward requiring only a click of the “Next” button on a few pages to install the software into its default directory etc..
   When you run MotorWay you will be presented with a control screen as shown below.

free application software for controlling a servo from a PCmanual control of a servo via a usb port
                                   Main Screen                                                   Servo Slider Control

    There are five vertical slider controls on this screen. Four are for DC motor control and the fifth is for control of an attached servo. The one on the far right is all we need to use.
    Simply move this slider up and down and the servo will respond by moving over its full range of travel.

   
         
   

!!!  You are now using a PC to control of a servo  !!!

   
                   
   

Motorway is also capable of implementing a sequence control system based on moving the servo to different positions at different times according to a pre-configured sequence. The supplied manual explains how to do this in more detail.

   
                   
         
                   
 

.        .

 
 

© Copyright pc-control.co.uk 2008