86
Master thesis Title: The conception and the implementation of control system for servomotor with application of local area network Authors: Promoter: Bartłomiej Bełko prof. dr hab. inż. Zygfryd Głowacz Mateusz Ćwikła Course: Electrical Engineering Faculty of Electrical Engineering, Automatics, Computer Science and Electronics Department of Electrical Machines Cracow, 2010

Belko&Cwikla

Embed Size (px)

DESCRIPTION

cnc

Citation preview

  • Master thesis

    Title:

    The conception and the implementation of

    control system for servomotor with application

    of local area network

    Authors: Promoter:

    Bartomiej Beko prof. dr hab. in. Zygfryd Gowacz Mateusz wika

    Course: Electrical Engineering

    Faculty of Electrical Engineering, Automatics, Computer Science and Electronics

    Department of Electrical Machines

    Cracow, 2010

  • 2

    Aware of criminal liability for making untrue statements I declare that the following

    thesis was written personally by myself and that I did not use any sources but the ones

    mentioned in the dissertation itself.

    .................................................................

    .................................................................

    (readable signatures)

    We would like to thank our promoter,

    dr hab. in. Zygfryd Gowacz for his insights and overall help with our work on this thesis.

  • 3

    Contents

    1. Introduction ........................................................................................................................ 5

    1.1. Preface ......................................................................................................................... 5

    1.2. Aim of this thesis ......................................................................................................... 5

    2. Servomotors ....................................................................................................................... 6

    2.1. Description of servomotors ......................................................................................... 6

    2.2. Basic concept of controlling servomotors. .................................................................. 8

    2.3. Parameters characterizing servomotors ..................................................................... 9

    2.4. Various types of servomotors ................................................................................... 11

    2.5. Few history facts about servomechanisms ............................................................... 15

    2.6. The areas of servomotors usage .............................................................................. 18

    2.7. The pros and cons of using servomechanisms. ......................................................... 22

    2.8. How to select a servo to fit Your application ......................................................... 23

    3. Stepper motor control methods ...................................................................................... 24

    3.1. Stepper motors overview .......................................................................................... 24

    3.2. Stepper motor control ............................................................................................... 25

    3.3. Unipolar and Bipolar stepper motors ........................................................................ 26

    3.4. Stepping modes ......................................................................................................... 28

    4. Design of our controller to work with servomechanisms ................................................ 32

    4.1. Aims of our design ..................................................................................................... 32

    4.2. Controller schematics ................................................................................................ 32

    4.3. Description of parts and their tasks - External overview .......................................... 34

    4.4. Description of parts and their tasks - Interior ........................................................... 37

    5. Local area network (LAN), OSI and TCP/IP model ............................................................ 51

    5.1. Characteristic of Local area network ......................................................................... 51

    5.2. Ethernet specification ................................................................................................ 51

  • 4

    5.3. OSI model .................................................................................................................. 52

    5.4. TCP/IP Model ............................................................................................................. 54

    6. LPT port description ......................................................................................................... 55

    6.1. History ........................................................................................................................ 55

    6.2. Signals definition ....................................................................................................... 56

    6.3. LPT program access ................................................................................................... 59

    7. Description of C# language and our application .............................................................. 60

    7.1. .NET framework and C# language ............................................................................. 60

    7.2. Description of our application ................................................................................... 61

    7.2.1. Methods, functions, events and classes used in step_server: ........................... 61

    7.2.2. Methods, functions, events and classes used in client_socket_gui: ................. 63

    7.2.3. Lpt.cs class .......................................................................................................... 64

    7.2.4. Namespaces ....................................................................................................... 65

    7.3. Code of server and client programs .......................................................................... 66

    8. Conclusions & summary ................................................................................................... 86

  • 5

    1. Introduction

    1.1. Preface

    A servomotor (also called as or servo) is an electromechanical device that uses error-sensing

    feedback to correct the performance of a mechanism. The term correctly applies only to

    systems where the feedback or error-correction signals help control mechanical position or

    other parameters. For example the car's cruise control uses closed loop feedback, which

    classifies it as a servomechanism.

    Important fact is, that servomechanism may or may not use a servomotor in its design. An

    example of this, could be a household furnace. The furnace which is controlled by

    thermostat is a servomechanism, however there is no motor being controlled directly by the

    servomechanism. In our work, we are using servomotor as an object of exploration and we

    will be generally concentrating on the motor devices.

    Usually, servos operate on the principle of negative feedback, where the control input is

    compared to the actual position of the mechanical system as measured by some sort of

    transducer at the output. Any difference between the actual and wanted values (an "error

    signal") is amplified and used to drive the system in the direction necessary to reduce or

    eliminate the error. This procedure is one widely used application of control theory.

    In other words servomotor is device that has an output shaft. This shaft can be positioned to

    specific angular positions by sending the servo a coded signal. As long as the coded signal

    exists on the input line, the servo will maintain the angular position of the shaft. As the

    coded signal changes, the angular position of the shaft changes.

    In practice, servos are used in radio controlled airplanes to position control surfaces like the

    elevators and rudders, automatic machine tools, satellite-tracking antennas, automatic

    navigation systems on boats and planes, and antiaircraft-gun control systems. They are also

    used in radio controlled cars, and of course, robots. Servomechanisms were first used in

    military fire-control and marine navigation equipment. Many autofocus cameras also use a

    servomechanism to accurately move the lens, and thus adjust the focus. A modern hard disk

    drive has a magnetic servo system with sub-micrometer positioning accuracy.

    1.2. Aim of this thesis

    The aim of this thesis is to write program used to control servomotor in Windows XP

    network environment concretely in local area network environment. The program will

    utilize the potential of LPT port. Program written as a result of this work will then be used for

    educational purposes to demonstrate the work of servomotor.

  • 6

    2. Servomotors

    2.1. Description of servomotors

    The term servomotor does not really apply to the motor itself, but rather the way in which

    the motor is used and controlled. In a position servomotor application, the idea is to hold

    the target load (generally attached to the motor shaft through a series of gears for speed

    and torque adjustment) in a given position.

    Servos are constructed from three basic pieces, a motor, a feedback device, and a control

    board. In hobbyist environments the feedback device is typically a potentiometer (variable

    resistor). The motor, through a series of gears, turns the output shaft and the potentiometer

    simultaneously. The potentiometer is fed into the servo control circuit and when the control

    circuit detects that the position is correct, it stops the motor.

    Figure 1 Examples of servomotors

    In industrial environments the potentiometer can be also a hall effect sensor monitoring

    passing teeth on a metal gear, an encoder (optical or magnetic) mounted directly to the

    motor, or any other such sensor which can provide position feedback of the motor shaft or

    connected portion of the gear train.

    It is also possible to determine motor shaft position by counting the commutation pulses on

    the terminals of the motor. Some drivers have current re-copy capability, which allows a

    fraction of the load current to be output through a reference resistor and measured with an

  • 7

    analog-to-digital converter (AC/DC). In this way, it might be possible to monitor the load

    current and detect variations in the load current which correspond with the commutation of

    the brushes in the motor. However, this method requires additional software and hardware

    complexity which do not justify their inclusion, given that encoders are just as effective and

    much simpler to implement.

    The typical servo varies most in its internal mechanics from other servos and this is generally

    the difference between hobbyist and industrial servos. The servo mechanism subsystems are

    the motor, the gear train, the potentiometer, the electronics, and the output shaft bearing.

    The gears also vary from servo to servo. Inexpensive servos have plastic gears that will wear

    out after less than 100 hours of use. More expensive servos have metal gears which are

    much more durable. The potentiometer is the feedback device and often the first thing to

    fail in servos. If it gets dirty, or the contacts get oxidized, the servo will fail to work properly,

    sometimes by "jittering or hunting" since the feedback is inaccurate, or turning completely

    to one side and drawing lots of current since the servo doesn't know where its output shaft

    is pointing.

    Figure 2 Cross-section of servomotor

  • 8

    The last subsystem is the output shaft bearing. Cheap servos invariably have a plastic on

    plastic bearing that will not take much load. Medium priced servos generally have metal on

    metal bearings that stand up better under extended use and expensive servos have ball

    bearings which work best (see also figure 8).

    Servomechanisms have a very wide range of applications and are used in hundreds of

    numbers devices. On the next figure, presented is one example of the huge usability of

    servomotor. The servo is part of stamping press. Connected directly to the crank, it provides

    precise accuracy and reliability, which improves the critical areas of press performance

    (more interesting examples of servomotor usage are presented in chapter 2.6 of our work).

    Figure 3 Cutaway of stamping press including servomotor in it's design

    2.2. Basic concept of controlling servomotors.

    There is basically two types of controlling methods of servomotors: using open-loop and

    closed-loop system.

    An open-loop system operates with no feedback from the object being controlled. This is

    sort of a fire and forget approach to control. An input stimulus is provided and the

  • 9

    controller commands the system to go to a particular location, speed, and hopes that the

    system responds accordingly. There is no information from the system under control to

    indicate that it even received the command.

    The key to a closed-loop control system is the introduction of feedback. If speed is being

    controlled, a measure of the current speed is provided back to the controller, allowing it to

    adjust its commands as the system responds to the commands. Likewise is true with

    position. We can compare it to gymnast on a balance beam. They are constantly

    commanding their muscles to adjust the pressure and position of their feet to maintain a set

    position. This is done based on inputs from vision, sense of balance, and even tactile

    feedback from contact with the beam itself. This is a perfect example of a closed-loop

    system.

    The performance of a closed-loop system is partially a function of the speed at which the

    feedback is returned to the controller. This closing of the loop will always take a set amount

    of time, and the longer that time is the less responsive the controller will be to fast changing

    conditions. For example, if the gymnasts are very tired they are not able to perform as

    adeptly due to slow response to the feedback received and as conditions change more

    rapidly they are more likely to fall off the bar.

    Depending on the performance requirements of the application, either a closed-loop or

    open-loop control system can be used to control motor position, speed, or other similar

    application.

    Servos are controlled by sending them a pulse of variable width. The parameters for this

    pulse are that it has a minimum width, a maximum width, and a repetition rate. These values

    are not standard but there are conventions that are generally accepted. The convention is

    that a pulse of approximately 1500 s (1.5 ms) is the neutral point for the servo. Given the

    rotation constraints of the servo, neutral is defined to be the position where the servo has

    exactly the same amount of potential rotation in the counter clockwise direction as it does in

    the clockwise direction. It is important to note that different R/C servos will have different

    constraints on their rotation but they all have a neutral position, and that position is always

    around 1500 s.

    2.3. Parameters characterizing servomotors

    In general, the servos are "active" devices. Thus this means that, when commanded to move

    they will actively hold their position. In other words, if a servo is commenced to the neutral

    position and then an external force is used to push against the servomechanism (supposedly

    through the mechanical linkage), it would result in actively resist being moved out of that

    position.

    The maximum amount of force that the mechanism can utilize is the torque rating of the

    servomotor. The typical value of this quantity is about the equivalent of 1kg at 1 inch away

  • 10

    from the shaft of the servo motor. Like in every similar cases, the servomotors can't hold

    their position forever. The generation of position pulse must be repeated after a specific

    amount of time, in order to instruct the mechanism to stay in the desired position. The

    maximum value of this time, which can pass before the device will stop holding its position is

    called the command repetition rate. Typical values for the command repetition rate are

    chosen from the range of 20 to 30 ms. Of course the pulse can be repeated more often (in

    shorter time ranges) than these boundaries, but it can't be generated less often. When the

    settled timeout expires and there still hasn't appeared another pulse, then servomechanism

    de-energizes the motor. In this state it can be manually pushed out of its position and later it

    will not return to the commanded position, as it normally should.

    Other case is when the pulse sent to the device is less than 1500 s. The servo positions and

    then holds its output shaft for some number of degrees anti-clockwise from the neutral

    point. Secondly, when generated pulse is wider than 1500 s, then the opposite effect takes

    place. As a result of above facts, we can say that the minimal width and the maximum width

    of pulse that will command the servomotor to turn into the desired valid position, are

    functions of each servo. On the world market, there are of course different brands, and even

    different servomechanism of the same specific brand, which are specified with different

    maximums and minimums. But generally, the typical ranges were set so that minimum pulse

    will be about 1000 s wide and the maximum pulse will be 2000 s wide. However, these

    are just guidelines and every case of usage should be individually established on the servos

    of ones use. Especially if there is a need to command the servomotor over its maximum or

    minimum rotation, it could occur in use of the maximum amount of current, resulting in

    unsuccessful attempts to achieve that position.

    Another parameter which describes and varies different servomechanisms is called the slew

    rate. This attribute is a time which takes the device from changing from one position to

    another. The worst case of the slewing time value is when the servo is holding at the

    minimum rotation and then it is being commanded to change to a maximum rotation. Such

    operation can take several seconds when performed on very high torque servomotors (to

    compare, the typical time of this action takes less than two seconds).

    Sticking friction of the actuator is another very important parameter which describes and

    differs each servomotor devices. When the actuator is at rest, there is need of using an extra

    force in order to initiate motion of the mechanism. After a while, when the actuator begins

    to move, there is also an unwanted possibility that it may suddenly perform a slight jump

    (which depends on how tight the mechanical tolerances of the actuator are). In each case

    while we are determining response times required for the control systems, this rapid rate of

    change should be considered, to avoid problems of usage.

    The last property which we should describe is the ratio of output movement to feedback

    data acquisition. This attribute also highly affects the accuracy and response of the control

    system. To show it on example, consider a basic actuator, where the motor and output shaft

  • 11

    has been joined by a series of gears and the potentiometer (used as a feedback mechanism)

    is connected to another gear in the system. So the ratio of movement parameter of the

    output shaft to the movement of the potentiometer shaft is required to relate rate of

    change of the actuator output to the rate of change of the feedback.

    2.4. Various types of servomotors

    There are numerous types of servos available on the market. This devices have a wide

    variety of very different applications. Because of this, their types vary widely in case of form

    and configuration. First important division criteria is the difference between the hobbyist

    and industrial servomotors, where the internal mechanics are the reason of varying one

    servos from others. Of course different servomotors are varied in case of their precision,

    speed, and strength. When looking further into different types of servomechanisms, and

    using the construction and working principle as the criteria of division, we can specify three

    main groups of servomotors used in modern servo systems:

    - The AC servo motors, which are based on induction motor designs;

    - The DC servo motors, second group which is based on DC motor designs;

    - The AC/DC brushless servo motors, the last group which is based on synchronous

    motor designs.

    Figure 4 Different types and subtypes of servomechanisms

    The AC servo motors are basically a two-phase, reversible, induction motors, which are

    modified for different servo operations. Those types of motors are used in applications

  • 12

    which requires rapid and accurate response characteristics. In order to obtain such

    characteristics, these devices have small diameter, high resistance rotors. The small

    diameter property of AC servos, provides a low inertia for fast starts, stops, and reversals

    motions. The high resistance property, provides nearly linear speed-torque characteristics

    which is very useful in accurate servo motor control.

    The induction motor types, which are designed for servo use, are wound with two phases

    physically at right angles or in space quadrature. In case of this motor types, a fixed or

    reference winding is being excited by a fixed voltage source, while on the other side the

    control winding is excited by an adjustable or variable control voltage (which comes usually

    from a servo amplifier). This type servomotor windings are usually designed with the same

    voltage/turns ratio. This keeps at balance both the maximum control phase signals, and the

    power inputs at maximum fixed phase excitation. The important issue is that the inherent

    damping of servo motors decreases, while the ratings increase. The servo motors are

    designed to have a reasonable efficiency at the sacrifice of speed-torque linearity.

    DC servo motors are mostly a very high performance devices. They are designed to meet

    demanding requirements of industrial motion control. Those servomechanisms can be

    supplied with many electrical and mechanical options in order to fit various needs and

    applications. Some of the options which are available can be: tachometers, encoders,

    brakes, shafts, windings, mountings, speeds or connectors. Dc servomotor characteristics

    include inertia, physical shape, costs, shaft resonance, shaft configuration, speed, and

    weight. Although these type of motors have similar torque ratings, their physical and

    electrical constants differ.

    The DC servomotors are normally used as prime movers in computers, numerically

    controlled machinery, or in any other applications where there is need of quick and accurate

    start and stop motions. DC servo motors are designed to have lightweight, low-inertia

    armatures which can respond quickly to excitation-voltage changes. Other important

    property of these motors is, a very low armature inductance, which results in a low electrical

    time constant (the typical ranges are from 0.05 to 1.5 ms). This values of time constant

    improves servomotor response to command signals. Servomotor devices also includes a

    permanent-magnetic, printed-circuit, and moving-coil (or shell) DC servo motors. The rotor

    of a shell DC servo motor is combined of a cylindrical shell of copper or aluminum wire coils.

    This coils are rotating in a magnetic field in the annular space, between a magnetic pole

    pieces and a stationary iron core. This types of servomotors features a field, which is

    provided by cast of Al-Ni-Co (aluminum, nickel, cobalt) magnets (where magnetic axis is

    radial). The DC servos usually have two, four, or six poles.

    The brushless servomotors as the name implies, are servomotors designed to operate

    without brushes. More thoroughly, it means that the commutation which normally is

    provided by the brushes, now must be provided electronically. The electronic type of

    commutation is provided by switching transistors on and off at appropriate times. Figure 5

  • 13

    shows three sets of transistors that are similar to the transistors in the output stage of the

    variable-frequency drive (the transistors are connected to the three windings of the motor).

    Figure 5 Conceptual schematics of transistors connected to the motor

    The below figures shows three examples of the voltage and current waveforms which are

    sent to the brushless servomotor in order to power it. The main attribute of the brushless

    servomotor is that it can be powered by either AC voltage or DC voltage.

    Figure 6 Trapezoidal EMF and square-wave current

    Figure 7 Sinusoidal EMF and square-wave current

  • 14

    Figure 8 Sinusoidal EMF and sinusoidal current

    First presented figure shows a trapezoidal EMF (voltage, Electro-Magnetic field) input and a

    square wave current input (figure 6). Second one presents a sinusoidal waveform for the

    input voltage and a square wave current waveform (figure 7). Last one shows a sinusoidal

    input waveform and a sinusoidal current waveform, this type of input and sinusoidal current

    waveform are the most popular voltage supplies for the brushless servomotor (figure 8).

    The next, one of the most usable, type of motor used in nowadays servo systems is the

    PM motor type (permanent magnet). In this case of device , we can use AC voltage or the

    DC voltage type for the field winding of the permanent magnet.

    Figure 9 Construction elements of PM servomotor

    The permanent magnet servomotor is similar to the other PM type of motors. The figure

    above shows a cutaway diagram of this type of machine. As we can see the housing, rotor

    and stator are very similar to their correspondents in other permanent magnet motors. On

    the other hand, major difference with this type of device is that it may have a gear

    reduction, which is enabling it to move larger loads more quickly from a stand still position.

  • 15

    This permanent magnet motor is equipped also with an encoder or resolver (built directly

    into the motor housing). Such solution ensures that the motor will be indicating the position

    or velocity of the motor shaft, more accurately.

    It would be worth to mention also a special type of stainless steel servo motors. This motor

    types are also directed for the motion control industry. The AC brushless servo motors are

    designed for motion control applications which requires wash down and very high hygiene.

    It finds applications in industrial markets such as: food processing, pharmaceutics, liquid

    processing and many others. This motor types may be used in very harsh, corrosive

    environments They may be applied in harsh, corrosive environments. They are designed as

    waterproof and can withstand up to 1500 psi (pounds per square inch) wash down

    conditions.

    Slightly different branch of servomechanisms are RC servos. This are hobbyist remote

    control devices, which are typically employed in radio-controlled models, where they are

    used to provide actuation for various mechanical systems such as the steering of a car, the

    flaps on a plane, or the rudder of a boat. Of course they are also very useful in many kinds of

    small robotics experiments (because of small size and low purchase costs). This servomotors

    have built in motor, gearbox, position feedback mechanism and controlling electronics. They

    servo can be easily controlled to move into any positions, just by using simply pulse

    controlling.

    2.5. Few history facts about servomechanisms

    The word "servo" comes from the Latin statement "servus". This can be translated to English

    as: servant, slave or helper. More recent origin of the word is believed to come from the

    French statement Le Servomoteur which means a "slavemotor". First person to use this

    statement was believed to be J. J. L. Farcot. In 1868 year he used it to describe hydraulic and

    steam engines for use in ship steering.

    In the machine devices industry, the servo drives were generally an auxiliary drives.

    Nonetheless, this situation has changed over the years, and nowadays the main drives are

    also implemented using the servo technology. So we can say that the terms "servo drive"

    and "dynamic drive", now means one and the same thing. This statements are always

    referring to the AC permanent-field synchronous motors, along with their associated control

    systems.

  • 16

    Figure 10 James Watt (1736-1819)

    Looking back into time, we find that James Watts steam engine governor, has been

    generally considered as the first powered feedback system in the world. The windmill fantail

    could be an earlier, less mechanized, example of automatic control. But the lack of any

    amplifier or gain in its architecture, it is usually not considered as a servomechanism. On the

    other hand, the first feedback position control device was the steering device of a ship. This

    device was used to position the rudder of large ships based on the position of ships wheel.

    This type of technology was used for the first time on the ship "SS Great Eastern" in year

    1866. The steam steering engines, generally found on the ships of that times, had the

    characteristics of a modern servomechanism. This included an input part, an output, an error

    signal, and part used for amplifying the error signal, so the negative feedback would drive

    the error towards zero.

    Figure 11 Windmill structure with a fantail

  • 17

    Figure 12 UNIVAC computer from the year 1951

    Invented and built later, electrical servomechanisms required a power amplifier. In times of

    World War I, there were seen the development of electrical fire-control servomechanisms,

    which used an amplidyne (usually an AC motor driving a DC generator) as the power

    amplifier. Vacuum tube amplifiers were used in the UNISERVO tape drive (primary I/O

    device) for the UNIVAC I (UNIVersal Automatic Computer I) computer.

    In the modern years, the servomechanisms are using a solid state power amplifiers, usually

    built from MOSFET or thyristor devices. On the other hand, the small servos may use power

    transistors.

    When looking more into history, for many years the only one type of control for large

    currents, was through SCRs (The Silicon-Controlled Rectifier - this are true rectifiers: they

    only allow current through them in one direction). Because of this, the early servomotors

    were generally a DC motors. Later in the future, the transistors became capable of

    controlling larger currents and also switching those large currents at higher frequencies.

    That was the when the AC servomotor became used more often. It's worth to mention that

    early servomotors were specifically designed for servo amplifiers. Nowadays we can use a

    class of motors which is designed for applications that may use a servo amplifier, and also a

    variable-frequency controller. Because of this fact, we can use a motor in a servo system in

    one application, and also in a variable-frequency drive in another application.

    When designing a device as a servomotor, we must made some changes from any motor

    which must include the ability to operate at a various speed-ranges without overheating,

    especially to work at very low speeds for long periods of time without overheating. Second

    important change is the ability to operate at zero speed and also the skill of retaining

    sufficient torque to hold a load in position. The older types of servomotors had a cooling

    fans, included in their construction that were connected directly to the motor shaft. But

    because of this, when the motor were running at low speeds, the cooling fan didn't move

    enough air to cool the mechanism. In later years, newer models of servos have a separate

  • 18

    fan mounted on them, so that have provided optimum cooling air for the motor. This cooling

    devices are usually powered by a constant voltage sources, so they are able to turn at

    maximum RPM (revolutions per minute) - this is performed at all times regardless of the

    speed of the servomotor.

    Interesting fact in case of servomotors is that, some companies also calls any closed-loop

    system as a servo system, even if it does not use a stepper motor. Coming from this fact, we

    are able to call simple AC induction motor (connected to a velocity controller) as a

    servomotor.

    2.6. The areas of servomotors usage

    Servomotors are used in many different applications, a few of them are presented below:

    a) Automotive market:

    - Power mirror positioning (fig. a)

    - Power seats positioning motors

    - Power door and trunk lock

    mechanisms

    - Windshield wiper motors

    Fig. a Car mirror moved by using a

    servo

    Fig. b Switch used to position car headlights

    - Power sliding door, sunroof,

    and convertible top actuators

    - Headlight positioning and

    leveling actuators (fig. b)

  • 19

    b) Industrial markets:

    - proportioning valves for gasses and

    liquids

    - paper and materials handling

    equipment (fig. c)

    - sheet metal processing (fig. d)

    - HVAC ventilation control

    - satellite-tracking antennas (fig. e)

    - automatic navigation systems on boats

    and planes

    Fig. c Paper production assembly lines

    in factory

    Fig. d A punching machine used in metal

    processing industry. Includes a servomotor

    turret punching press in its elements

    - antiaircraft-gun control systems

    - robotics (fig. g, k)

    - military fire-control and marine

    navigation equipment

    - hard disk drives (fig. f)

    - assembly equipment (fig. g, h)

    Fig. e Moving mechanism of a satellite

    TV set. Servomotor is the main part

    which is enabling the physical

    movement of the satellite dish. The

    small motor is mounted to the

    feedhorn, the part which is pointing at

    the face of the dish. The servomotor

    used in this type of device has an

    integrated circuit in it, along with

    many other static electricity sensitive

    components (what makes the device

    exposed to damage done by lightning)

  • 20

    Fig. f Hard Disk Drive. The servo system

    included in this device must be able to

    perform a track following (which means

    achieving a precise positioning of the

    read/write head on a desired track) and track

    seeking (a fast transition from one track to

    another target track)

    Fig. g Robotic assembly apparatus.

    This device includes an integrated

    vision system, which can give assembly

    robots more capability for jobs that are

    difficult to automate

    Fig. h Servo Assembly Press. Device which

    includes an array of servo assembly presses

    which are developed in order to meet the

    specific requirements in various industrial

    applications. An notching-type presses

    includes also the hydraulic and PLC based

    technologies

    Fig. i X-Y Table. This devices are motorized

    linear slides with linear motion based in

    bearings which are driven by a drive

    mechanism (i.e. servomotors)

    - laboratory equipment

    - coil winders

    - X-Y tables (fig. j)

    - factory automation

    - insertion machines

    - ick and place (fig. k)

    - converting equipment

  • 21

    Fig. j "Pick and place" robot type. This

    devices are usually called SPP (Servo

    Pick and Place), and can be provided

    by any combination of servo horizontal

    and servo vertical units.

    Fig. k Tablet machine, common apparatus

    used in pharmaceutical industries

    c) Household and consumer

    market:

    - pharmaceutics (fig. l)

    - packaging systems

    - food handling/processing

    - bakery machinery

    - beverage equipment

    - meat/dairy processing

    Fig. l Radio controlled toy helicopter

    - entertainment equipment

    (powered, remotely

    controlled volume controls)

    (fig. e)

    - measuring & dispensing

    - autofocus cameras

    - labeling equipment

    - woodworking

    - RC (radio controlled) toys

    d) Heating, Ventilation, and Air

    Conditioning (HVAC) vent controls

  • 22

    2.7. The pros and cons of using servomechanisms.

    To shortly sum up the knowledge of servomechanisms, we can say that many applications

    place high demands on modern drive technology, which is mostly based on:

    - Positioning accuracy

    - Speed accuracy

    - Torque stability

    - Overload capability

    - Dynamic performance

    The nowadays servo drives are drive systems that show a dynamic and accurate response

    over a wide speed range. They are also capable of coping with various overload situations.

    In general, the main advantages of using servomotors in our applications includes:

    - Excellent dynamic performance

    - Excellent speed holding

    - Wide speed range

    - High positioning accuracy

    - Static torque (speed is zero)

    - High overload capability

    - Wearless commutation

    - Lower moment of inertia through the use of unwound rotors

    - Simpler cooling, as power loss occurs in the stator rather than the rotor

    - Greater efficiency, as there is no loss caused by the excitation winding

    On the other side, there are only few significant disadvantages:

    - Relatively high system cost

    - Sensor expenditure

  • 23

    - Some servomotor types are thermally inefficient, because the heat must

    dissipate through the external magnets

    - The brushed motor types requires maintenance, as the brushes will wear off with

    time and needs replacement

    - Increased control complexity could also be viewed as an disadvantage

    2.8. How to select a servo to fit Your application

    When we stand before a problem of choosing proper servo motor type which would bring

    the most benefit to our application, the first selection approach is to choose a servo motor

    large enough for the machine that has already been in the designing phase. The second step

    would be to select the best available servomotor with a specific feature and then build the

    system around it. Later step would be studying the servo performance and our system

    requirements - and then meet the two requirements. The final servomotor system design

    would finally meet our performance specifications reliably.

    Selecting different servomotor requirements may include such parameters as: control of

    acceleration, speed, and position to very close tolerances. This means that when we are

    designing a servo, we must define the whole system carefully, establish the servo motor's

    performance specifications, determine critical areas, and set up tolerances. This would be

    the only moment when we will be able to propose an adequate servo system and choose a

    servo motor type for it. Selecting the motor for initial installation or for a replacement, we

    must consider parameters like: rated power, rated speed, rotor inertia and for maintenance

    purposes even the motor weight and size. Another approach to select a suitable servo to fit

    our needs would start with the consideration if whether the motor will be used for

    continuous duty or intermittent duty (we need to select device that can produce proper

    amount of continuous stall torque). The second rating which should be thoroughly

    considered is the amount of peak torque. Finally the maximum continuous AC input power

    and the rotor inertia would be the later properties which we should take under

    consideration.

  • 24

    3. Stepper motor control methods

    3.1. Stepper motors overview

    One of the types of Servomotors is the brushless type - the stepper motor (also called step

    motor). This device is synchronous electric motor that can divide a full rotation into a large

    number of steps (so the name implies). Stepper motors are constant power devices, as the

    motor speed increases, on the other side, the torque decreases.

    Describing more thoroughly, we can say, that stepper motor is an electromechanical device

    which converts electrical pulses into discrete mechanical movements. The shaft (or spindle)

    of the motor rotates in discrete step increments when electrical command pulses are

    applied to it in the proper sequence (sent from the user of the device using an appropriate

    control gear). The motors rotation has several direct relationships to these applied input

    pulses. The sequence of the applied pulses is directly related to the direction of motor shafts

    rotation, the control methods would be described further, later in this chapter. The speed of

    the motor shafts rotation is directly related to the frequency of the input pulses and the

    length of rotation is directly related to the number of input pulses applied. In industry we

    can differ three basic stepper motor types, those are:

    Variable-reluctance (VR motors)

    Permanent-magnet (PM motors)

    Hybrid step motors

    Figure 13 Cross section of the Hybrid motor.

    The variable reluctance motors type, have a plain iron rotor and they operation is based on

    the principle that minimum reluctance occurs with minimum gap, hence the rotor points are

    attracted toward the stator magnet poles.

  • 25

    The permanent magnet motors use a permanent magnet in the rotor. They are operating on

    the attraction or repulsion between the rotor magnet and the stator electromagnets.

    The last type, which are hybrid stepper motors, as the name implies, they are using

    combination of the Permanent-magnet and Variable-reluctance techniques in order to

    achieve maximum power, while the sizes of the devices itself are slightly smaller than the

    other types.

    3.2. Stepper motor control

    Main advantage in the Stepper motor usage is, that the motor's position can be controlled

    very precisely. This is obtained without any feedback mechanism, as long as the motor is

    carefully sized to fit the application it would be working with. One of the most significant

    advantages of a stepper motor is its ability to be accurately controlled in an open loop

    system (this means that no feedback information about position is needed). This type of

    control eliminates the need for expensive sensing and feedback devices such as optical

    encoders. The actual position of motor is known simply by keeping track of the input step

    pulses.

    When describing the traditional motor types, it comes to a series of coils which are

    automatically switched on and off by a set of brushes in contact with the commutator. Once

    power is applied, the motor runs itself at a speed proportional to the voltage and the load.

    Main difference here would be, that the stepper motor has no commutator. Instead, there

    are five or six wires coming out of the motor - one wire for each coil (there are usually four

    coils) and one or two common ground wires. Because of this, we must apply power from one

    coil to another in the proper sequence when we want the motor to be turned on. In order to

    obtain the maximum torque, two coils are always on at any time.

    Figure 14 Cross section of the Variable Reluctance motor.

  • 26

    Picture presented above, shows that stepper motors have multiple "toothed"

    electromagnets arranged around a central gear-shaped piece of iron. The electromagnets

    are energized by an external control circuit, such as a microcontroller. In order to turn the

    motor shaft, first of the electromagnet is given power. When it's powered up, it makes the

    gear's teeth magnetically attracted to the electromagnet's teeth. When the gear's teeth are

    aligned to the position of first electromagnet, they are slightly offset from the next

    electromagnet. Next step then would be powering the next electromagnet and turning the

    first one off. At this time the gear rotates slightly to align with the next one, and from there

    the process is once more repeated. We call each one of these slight rotations simply, as

    "steps" (and where an integer number of steps would be meaning the motor's full rotation).

    Control of the motor in that way, means that it can be turned by a very precise angle.

    3.3. Unipolar and Bipolar stepper motors

    When it comes to the VR motor types, they usually have three windings. When we want to

    put the motor in motion, it is needed to power each of the windings in the correct order. In

    order to change the direction of the motor rotation, we need to change the windings

    powering up order. When windings are powered in the sequence: A, B, C, A, B, C, A, ... It

    means the rotation in one direction. And powering sequence of: A, C, B, A, C, B,... means on

    the other hand, the rotation in opposite direction. Change of the sequence could be

    obtained, for example by changing the positions of two ends of the winding. Despite the

    differences in the work principles, the PM and Hybrid motors, could be also controlled in the

    way described above.

    Figure 15 The Bipolar motor with two windings.

    Although in reality, the PM and HB motors have several poles, they contain only two

    windings which are divided into sections. In this chapter we are presenting only a simplified

    model with two windings, but it is sufficient for further analysis and descriptions. As we

    know, the engines have to produce a rotating magnetic field. This can be obtained by

    changing the direction of current in the windings. Next figure shows a method of control,

    when two transistor bridges are used . This is often called as "H bridge" (also a full-bridge),

    because of its similarity to the letter H.

  • 27

    Figure 16 Bipolar motor - the "H" transistor bridge.

    In the transistor bridges, are also used different transistor types (MOSFET N, MOSFET Q,

    NPN, PNP, "Darlington pairs"), but usually they are either bipolar transistors NPN, or

    MOSFET N transistors. Although this method of control allows users to operate the motors

    using their full capabilities, the realization is not the easiest one. Because each of the eight

    transistors has to be operated separately. In order to simplify the controller, a winding with

    a branch in the middle can be used instead. In this simplified controller, currents are flowing

    in the same direction, which is why engines with split windings are called Unipolar motors.

    Figure 17 The Unipolar motor with two split windings.

    Figure 18 Unipolar motor transistor bridge.

    The motor currents (in successive cycle phases), as shown in the next figure, are flowing in

    both directions, so these devices are called Bipolar motors.

  • 28

    Figure 19 Bipolar motor control - Wave Drive.

    Figure 20 Unipolar motor control - Wave Drive.

    Above figure presents the way in which the magnetic field changes are obtained for both

    types of motors. The undoubted advantage of unipolar type is the ease of motor control - it

    only requires four MOSFETs along with simple sequence generator. The bipolar type of

    motor requires a more complex controller. However, it has also an important advantage. In

    unipolar motor, as shown in earlier figures, half of the windings are working alternately, so

    the rest of them is always not used, which reduces the peak performance of the machine. In

    the bipolar motor full winding is working and the full potential of the motor can be

    exploited. Bipolar control gives better results, especially for small and medium working

    speeds, the torque is then increased by around the 30-40%.

    3.4. Stepping modes

    The figures presented in following chapter are related with simple Permanent Magnet motor

    with one pair of rotor poles. Although the Hybrid motor works in different way, and a typical

    PM motor has more poles, presented rules applies to all motor types, PM and HB.

    The following are the most common drive modes, which we will describe:

    Wave Drive (1 phase on)

    Full Step Drive (2 phases on)

    Half Step Drive (1 & 2 phases on)

    Microstepping (Continuously varying motor currents)

    We have stated earlier, that unipolar motor shows weaker performance in comparison to

    the second type, because one winding of each pair is always unused. The problem of control

  • 29

    is also related to this fact. Figure 21 shows that in every step of the cycle, only one of the

    two motor windings is powered in the bipolar motor type. The second one is always unused.

    Even worse situation presents the unipolar motor, where, as shown in the same picture, only

    25% of all windings are used (of course, it means that the engine is not fully exploited). This

    mode of control is called the Wave Drive (and it is also so-called Full Step drive). Contrary to

    the first impressions, there is a very good way to use all of the bipolar motor windings. Next

    figure shows this very clearly, when comparing it to the previous figure.

    Figure 21 Bipolar motor control - Full Step Drive.

    This time, at every stage of the cycle, both of the windings are powered up. Also there is

    nothing wrong in this process, as the rotor poles are not lining up opposite to the poles of

    the stator, but only halfway between them.

    In the unipolar motor, we can power up two of the four coils, which improves engine power

    and torque also.

    Figure 22 Unipolar motor control - Full Step Drive.

    Each of the two presented above control methods, for both bipolar and unipolar motors, are

    used in practice. We are calling it Full Step Drive method, but to distinguish it from the first

    described method (which is also a Full Step control method) we call that method a Wave

    Drive.

    The more often used method of control in contrary to the previous ones, is the Half Step

    Drive. This control type is a combination of the two methods previously discussed. Driving

  • 30

    sequence and location of the bipolar and unipolar motors are shown on the following

    pictures.

    Figure 23 Bipolar motor control - Half Step Drive.

    Figure 24 Unipolar motor control - Half Step Drive.

    When we alternately power up one and then two windings, the rotor poles are setting at

    either in front of the stator, or in the middle between them. Even tough, the motor

    performance is somewhat worse than in the Full Step Drive (because both windings are not

    constantly powered), the Half Step Drive has also significant advantages. Typical waveforms

  • 31

    of the unipolar motor control, for the Full Step and Half Step Drives are shown in the

    following figure.

    Figure 25 Unipolar motor control waveforms - Full Step (right) Half Step (left) Drive.

    When we want to change the direction of rotation, most of the time it can be done by

    changing the driving sequences. In simple applications, it can be easily done by replacing the

    tip of A +, A- of the one windings pair.

  • 32

    4. Design of our controller to work with servomechanisms

    Figure 26 Bi-Polar Stepper Motor used with our controller.

    4.1. Aims of our design

    The general idea of our work is to create program in C# language in order to steer the

    servomotor in MS Windows based computer systems. But the second and also very

    important part of our work, was designing and creation of a controller which would be

    connected directly to the PC class computer via the LPT port. The servomotor itself would be

    connected to the controller inputs. Our main goal was to prepare such device, which would

    give the user ability to steer motors of different power values. The potentiometer included

    in controllers architecture, would allow changing the voltage of motor winding from 5 Volts

    up to 12 Volts (so the higher power motors could also be controlled). In this chapter we

    present the schematics of our controller. Also we describe each part used in its design and

    the goals and parameters of these parts. During the work on building the control gear, it was

    tested on different PC sets and with the use of 5 Volt, Bi-Polar Stepper Motor.

    4.2. Controller schematics

    In order to start working on real parts, we needed to draw appropriate schematics for our

    controller. To make the job much easier, we have used the "EAGLE" software from the

    CadSoft Computer company.

  • 33

    The "EAGLE" program is a layout editor, easy to use tool for designing printed circuit boards

    (PCBs). This program consists of three main modules: Layout Editor, Schematic Editor and

    Autorouter. In our work we have worked mostly with the Schematic Editor part of the

    program. This have allowed us to create a board from previously prepared schematics.

    Following are presented the final versions of the schematics on which we based the

    construction of our control gear. The schematics are divided into two parts, mainly because

    of the space it required. The first "power" section, consists of executive power elements (i.e.

    control module, Schottky diodes and controlled power supply).

    Figure 27 The "power" part of schematics. (Circuit scheme of "power board" driver)

  • 34

    Figure 28 The "logic" part of schematics. (Circuit scheme of "logic board" driver)

    4.3. Description of parts and their tasks - External overview

    To have better visualization of the whole controlling device and the parts which were

    included in its design, we are presenting detailed pictures of our finished and completely

    functioning control gear.

    Figure 29 External view of the controller: Front.

  • 35

    Figure 30 External view of the controller: Rear.

    Description of the elements seen on the pictures:

    1. Electrical network switch with diode. This is simple switch, used to turn on/off our

    controller from the electrical network. This part contains a diode inside (diode elements are

    described more thoroughly later on). Diode element is lit when the controller is turned on

    (the switch is pressed down, on the "I" position).

    2. The output pins of L298 controller. The exact pin numbers are (from the left): 2; 3; 13;

    and 14. This outputs were connected with the shell of the controller. Because of this, the

    connection of any Bi-Polar Stepper Motor is easy and there is no need to interfere with the

    interior parts of our device. The L298 part is described in following chapters.

    3. The potentiometer knob. The potentiometer device is described in the next chapter. On

    the picture, presented is only an ordinary, plastic knob connected with the potentiometer, in

    order for the user to regulate the voltage which is supplying the stepper motor coil. The

    range of the voltage is between 5V to 12V.

  • 36

    4. LED diodes (Light Emitting Diodes). This LED's are used as status diodes, on schematics

    they are marked exactly as (from the left): LED1 through LED8. Each diode represents each

    of the transistors. When diode is lit, the appropriate transistor is in conducting. This parts

    are simple semiconductor light sources. The LEDs are emitting light, when an electric current

    passes through them. When a diode is forward biased (switched on), electrons are able to

    recombine with holes within the device, releasing energy in the form of photons. This effect

    is called electroluminescence and the color of the light (corresponding to the energy of the

    photon) is determined by the energy gap of the semiconductor. The LEDs are usually small

    sized (less than 1 mm2), and integrated optical components are used to shape its radiation

    pattern and assist in reflection.

    When connecting the LEDs to a PCBs, we had to connect it the correctly, the diagram may be

    labeled "a" or "+" for anode and "k" or "-" for cathode. The cathode is the short lead and

    there may be a slight flat on the body of round LEDs. It should also be remembered that

    LEDs can be damaged by heat when soldering, but the risk is small unless you are doing it

    very slowly. No special precautions are needed for soldering most LEDs. The color of an LED

    is determined by the semiconductor material used to build it. All the LEDs connected in

    series pass the same current so it is best if they are all the same type.In our control gear, the

    diodes are connected in two ways. In one way, they are used when connected directly to the

    buffer. Second case is when they are connected to the logic gate outputs (through the

    resistor 2.2 which reduces the current).

    Figure 31 Symbol and example view.

    5. The DIN8 socket. This socket is used to plug in the LPT cable. The steering signals from the

    computer LPT port are sent via cable connected to this socket. This part is the "male" 8 pin

    type of DIN connector. This socket is a connector that was originally standardized by the

    German national standards organization (as the name implies, DIN stands for: Deutsches

    Institut fr Normung). Generally there are DIN standards for a very large number of different

    type of connectors. In the trade of consumer electronics, when using the term "DIN

    connector", it is referring to a member of a family of circular connectors used for analog

    audio signals (which were initially standardized by DIN).

  • 37

    The plugs (the "male" type of connectors) consist of a circular shielding metal skirt

    protecting a number of straight round pins. There are seven common patterns, with any

    number of pins from three to eight. The construction of plugs of the DIN family of

    connectors feature a 13.2 mm diameter metal shield (along with a notch that limits the

    orientation in which plug and socket can mate). Connectors of the same form which are

    different from each other only in their pin configuration, exist and have been standardized

    originally in DIN 41524 (3- and 5-pin), DIN 45322 (6-pin at 60), DIN 45326 (8-pin), DIN 45329

    (7-pin), and other standards for a range of different applications. These connectors have

    been used in analog video applications and for digital interfaces such as MIDI or the IBM

    PS/2 computer keyboard and mouse cables (but nowadays replaced with the USB

    connection types).

    Figure 32 The DIN8 diagram.

    6. Electrical Fuse 0.5A. This is simple fuse, used for security reasons (to avoid high

    overcurrents, in our case we used the 0.5 amperes type of fuse). The main threats for our

    device can be: short circuits, overload or device failure (which are the often reasons for

    excessive currents). Fuses are a type of sacrificial overcurrent protection devices. The main

    component, is a metal wire or strip, which melts when the flowing current value surpasses

    the rated current - IN (a maximum current that the fuse can continuously conduct without

    interrupting the circuit). When the wire melts, the circuit in which the fuse was connected is

    interrupted. A fuse interrupts excessive current, in order to prevent the further damage

    which can be caused by overheating or even fire.

    7. Power cord (also: line cord, mains cable). This is a simple, commonly used cord/cable

    that temporarily connects our control gear to the distribution circuits of an electrical power

    source (simply by connecting the plug to a wall socket with standard 230V from the local line

    voltage).

    4.4. Description of parts and their tasks - Interior

    The internal view of the control gear could also be seen on the pictures presented later in

    this chapter. The electrical power is supplied from external network via power cord, directly

    to the switch with LED diode, and then to the toroidal transformer (the parts were described

    in the earlier chapter).

  • 38

    Figure 33 Examples of toroidal transformers.

    The transformer used in our device is TST 50/003 model. The voltage of typical Polish power

    networks are 230 Volts and 50 Hertz frequency, the transformer is capable in changing

    electric power to AC 12 Volts/50 Hertz. Later the transformer distributes power to each of

    the power elements (as included on the schematics).

    Figure 34 The interior view of our control gear.

  • 39

    Most of the elements have been soldered on one of the two separate circuit boards (as can

    be seen on the above pictures). The following is description of each part and the goals they

    fulfills in our control device. Parts are marked with appropriate characters, as can also be

    seen on the earlier presented pictures. The descriptions:

    A. Toroidal transformer. Toroidal transformers are built around a ring-shaped core, which

    helps eliminating air gasps. The primary and secondary coils are often wound concentrically

    to cover the entire surface of the core. This minimizes the length of wire needed, and also

    provides screening to minimize the core's magnetic field from generating electromagnetic

    interference.

    Main advantages of this transformers are that, it's more efficient than the cheaper

    laminated E-I types for a similar power level. More advantages over the E-I types are:

    smaller size and lower weight of toroidal transformers (about half of the E-l type), they also

    generates less mechanical hum, have lower exterior magnetic field (about one tenth), low

    off-load losses (making them more efficient in standby circuits), single-bolt mounting, and

    they are available in greater choice of shapes. The model of transformer used in our device is

    TST 50/003.

    Its particular properties are following:

    Power: 50W Voltage: 12V Current: 4.1A Dimensions: 85 x 35 (diameter x height) B. PCB - Printed Circuit Board. We are using them of course, to mechanically support and

    electrically connect electronic components. These boards are using conductive pathways,

    tracks or signal traces etched from copper sheets laminated onto a non-conductive

    substrate. Main advantage of the PCBs is their inexpensiveness, and that they can be very

    highly reliable. On the other hand, this boards requires much more layout effort, and the

    initial costs can be higher, compared to either the wire-wrapped or point-to-point

    constructed circuits. But they are much cheaper and faster for high-volume production, and

    in our work this type was the most convenient to obtain and use.

    C. Potentiometer (Cannot be seen on the picture, it's hidden under the steel plate).

    Generally this part is a three-terminal resistor with a sliding contact that forms an adjustable

    voltage divider. This is a passive element of a circuit and in our case it is used as a control

    input for the electronic circuit. This device is constructed with a resistive element formed

    into an arc of a circle, and a sliding contact (wiper) travelling over that arc. The resistive

  • 40

    element of this part is made using a terminal at one or both ends, it can be flat or angled.

    Commonly it is made of graphite, but many other materials may be used instead. The wiper

    part is connected through another sliding contact, directly to another terminal.

    Because the motor which we have used to test our control gear, was to work with 5 V

    voltage, the potentiometer have given us the ability to change the voltage on the motor

    windings between the values of 5V to 12V.

    D. Heat sink. This is very common component which transfers heat generated within a solid

    material to a fluid medium, such as air. It is used to cool down our controller (especially the

    Dual Full-bridge driver). A heat sink uses its extended surfaces to increase the surface area in

    contact with the cooling fluid (air). Generally this object transfers thermal energy from a

    higher temperature to a lower temperature fluid medium. The most common heat sink

    material is aluminium.

    Parts soldered on the heat sink (in order to transfer the heat masses from the parts and

    avoid overheating):

    E. L298, Dual Full-bridge driver.

    In our control gear we are using the Multiwatt15 model labeled - L298N, which is an

    integrated monolithic circuit in a 15-lead Multiwatt packages. This driver is a high

    voltage/high current dual full-bridge driver. It is designed to accept standard TTL logic levels

    and drive inductive loads such a stepping motor - which is the object of our control work, or

    other devices like relays, solenoids. This part contains two "enable" inputs, used for enabling

    and disabling the device independently of the input signals. The emitters the lower

    transistors of each bridge, that are also embedded in the driver, are connected together and

    they can be used by the corresponding external terminal for the connection of an external

    sensing resistor. Also this drive contains an additional supply input, which helps the logic to

    work at a lower voltage values.

    Other properties for the L298, are following (presented are maximum possible values):

    Operating Supply Voltage: 46V Total DC Current: 4A Low saturation voltage. Overtemperature protection. Logical "0" Input Voltage, up to 1.5V (High noise Immunity)

  • 41

    Figure 35 The block diagram of Dual Full-Bridge Driver.

    F. The voltage stabilizer is an electronic device able to deliver relatively constant output

    voltage while input voltage and load current changes over time. This device is a subtype of

    voltage regulators. Many voltage stabilizers regulate the voltage using a shunt regulator such

    as a Zener diode (described thoroughly in following chapters), avalanche breakdown diode,

    or voltage regulator tube. Each of these devices begins conducting at a specified voltage and

    will conduct as much current as required to hold its terminal voltage to that specified

    voltage. The power supply of this parts is designed to only supply a maximum amount of

    current that is within the safe operating capability of the shunt regulating device. The

    LM78T05 - the 3 A version, this is a voltage stabilizer used in our circuit. It main advantage is

    that when it is starting to overheat it would automatically reduce the current flow. The

    output voltage given in our case is stabilized 5 V. We have used this element over the

    LM7805 - 1 A part, which must have been used along with an external power transistor.

    G. TIP142 transistor. This part is the Darlington power transistor, it is designed for general

    purpose amplifier and low frequency switching applications. This part has monolithic

    construction with BuiltIn BaseEmitter shunt resistor.

  • 42

    Particular properties are following: Power: 125W Voltage: 60-100V Current: 10A

    Figure 36 Darlington Complementary Silicon Power Transistor - dimensions schematic.

    Darlington transistor (also called Darlington pair). This part is a compound structure

    consisting of two bipolar transistors. They can be either integrated or separate devices,

    which are connected in such a way that the current amplified by the first transistor, would

    be then amplified further by the second one. Using of this kind of configuration gives us a

    much higher current gain, than the value which we could have obtained by using each

    transistor taken separately. Also in the case of integrated devices, they are taking less space

    than two individual transistors because they can use a shared collector. In our case the NPN

    transistors are used as the pair.

    When we consider a typical modern device, it has a current gain of 1000 or even more. In

    that case only a small base current would be needed to make the pair switch on. But this

    advantage of high current gain, comes with several drawbacks. One of the drawbacks is the

    approximate doubling of base-emitter voltage. Since there are two junctions between the

    base and emitter of the Darlington transistor, the equivalent base-emitter voltage would be

    the sum of both base-emitter voltages. Second important disadvantage of the Darlington

    pair is its increased saturation voltage. The output transistor is not allowed to saturate (for

    example, when its base-collector junction must remain reverse-biased) because its collector-

    emitter voltage is now equal to the sum of its own base-emitter voltage and the collector-

    emitter voltage of the first transistor, both positive quantities in normal operation. When

    the used collector currents are equal in values, this drawback would mean an increase in the

    dissipated power for the Darlington transistor over a single transistor. Also a drawback is fact

    that the Darlington pair has more phase shift at high frequencies than a single transistor and

    hence can more easily become unstable with negative feedback.

  • 43

    Parts included on the first PBC:

    Figure 37 The interior view of the controller: Logic elements.

    1. Schottky Diode (sometimes referred to as the surface barrier diode or hot carrier diode).

    The Schottky diodes, called also a "Schottky Barrier diodes" (this diodes uses a metal

    semiconductor junction as a "Schottky Barrier"), are an electronics components with wide

    usage in radio frequency (RF) applications (as a mixer or detector diodes), but also they are

    used in power applications as a rectifier. Usefulness as a rectifier is obtained because of its

    low forward voltage drop, which leads to lower levels of power loss compared to ordinary

    PN junction diodes. This parts are one of the oldest semiconductor devices in existence (as a

    metal-semiconductor devices, its applications can be traced back to before 1900), but

    nowadays they are still used in various of applications of high tech electronics. This type of

    diode is characteristic because of its very low forward-voltage drop (Schottky diode voltage

    drop is between approximately 0.150.45 volts in comparison to other diodes 0.61.7 volt

    voltage drop). Because of this fact, Schottky Diode provides higher switching speed and

    better system efficiency. We are using this type of diode in our controller in order to avoid

    overvoltages and power surges in times of stepper motor switching (The Dual full-bridge

    driver lacks this kind of protection).

    Figure 38 Schottky Diode symbol and example view.

  • 44

    2. Resistors. One of most commonly used parts in electronic industry. They are used to

    restrict the flow of electric current. Energy is used up as the voltage across the component

    drives the current through it and this energy appears as heat in the component. Resistor

    values are normally shown using colored bands. Resistance is measured in ohms, the symbol

    for ohm is an omega: . Most of resistors have four bands, where first two are the number

    of digits and the third indicates the number of zeros. Fourth band is used to shows the

    tolerance (precision) of the resistor. In our control gear we are using the 2.2/10W type of

    resistors. They are used in order to reduce the current on engine windings (coming from the

    driver module).

    Figure 39 The resistor color code, symbol and example view.

    3. L298, Dual Full-bridge driver. (This part was described in earlier chapter)

    4. LM723CN, Voltage regulator. This is an electrical regulator designed to, as it name

    implies, automatically maintain a constant voltage level. The electronic voltage regulators

    are operating by the ability of comparing the actual output voltage to some internal fixed

    reference voltage. Any difference of the obtained value is amplified and used to control the

    regulation element in such a way as to reduce the voltage error. This process gives us form

    of a negative feedback control loop, so when increasing the open-loop gain, it tends to

    increase regulation accuracy but on the other hand it reduces stability.

    In the circuit of LM723 regulator or LM78T05 voltage stabilizer, the Zener diodes were used.

    While using it along with sufficient reverse voltage, we can experience on the p-n junction

    (formed by joining p-type and n-type semiconductors together in very close contact) effect

    of rapid avalanche breakdown along with conduction of current in the reverse direction.

    Valence electrons (electrons in the outermost shell of an atom) which break free, when they

    are influenced by the applied electric field, can be accelerated enough that they can knock

    loose other electrons. This is causing more subsequent collisions, which quickly become an

    avalanche. During this process, very small changes of the voltage are causing very large

  • 45

    changes in current. The breakdown process is dependent on the applied electric field. This

    means that when we are changing the thickness of the layer to which the voltage is applied,

    the zener diodes can be formed, which break down at voltages from about 4 volts to several

    hundred volts.

    Zener diodes are generally used to maintain a fixed voltage. The zener diode uses a p-n

    junction in reverse bias to make use of the zener effect, which is a breakdown phenomenon

    which holds the voltage close to a constant value called the zener voltage. This type of

    diodes are widely used as voltage reference and as shunt regulators to regulate the voltage

    across small circuits. Zener diodes can be distinguished from other ordinary diodes by their

    code and breakdown voltage that are printed on their shells. In our circuit we are using (fast)

    zener diodes in order to reduce the overvoltages.

    Figure 40 Current characteristic for zener Diode, symbol and example view.

    5. Graetz Bridge (diode bridge). Simply putting, a diode bridge is an arrangement of four

    diodes in a bridge configuration. The essential feature which diode bridge provides, is that

    the polarity of the output is the same, regardless of the polarity at the input. The diode

    bridge circuit is also known as the Graetz circuit after its inventor, physicist Leo Graetz. The

    part used in our controller is RS606 (6A, 600V, RoHS - which stands for: Restriction of

    Hazardous Substances).

  • 46

    Figure 41 Graetz bridge: voltage characteristics, circuit and part overview.

    Main use of this part in our control gear is to rectify the voltage. This bridge is used as full-

    wave rectifier (which is an electrical device that converts alternating current (AC) to direct

    current (DC), in process known as rectification). Full-wave rectifier are converting the whole

    of the input waveform, into output waveform which has constant polarity (which could be

    either positive or negative). Four diode bridges used as full-wave rectifiers, converts both

    polarities of the input waveform to DC (direct current).

    6. Electrolytic Capacitor. Generally, capacitors (earlier named: condenser) are a passive

    electronic components consisting of a pair of conductors separated by a dielectric

    (insulator). The way of work for capacitor is when there is a potential difference (in voltage)

    across the conductor pair, the static electric field is developing in the dielectric, which stores

    energy and produces a mechanical force between these conductors.

    An electrolytic capacitor, which we are using in our control gear, is a type of capacitor that

    uses an electrolyte (ionic conducting liquid), as one of its plates. This helps to obtain a larger

    capacitance per unit volume in comparison to other types of capacitors. Electrolytic

    capacitors are polarized, which means that they must be correctly connected into the circuit.

    There are two designs of electrolytic capacitors; axial where the leads are attached to each

    end and radial where both leads are at the same end. The values of capacitance and voltage

    rating, are always printed on the capacitor shell. In our control gear, the capacitors are used

    as filters in order to reduce the pulsation of current. We are using parts of C = 4700F

    capacitance values. Capacitance is a single constant value, measured in farads (F). It is

  • 47

    characterizing an ideal capacitor and it is the ratio of the electric charge on each conductor

    to the potential difference between them.

    Figure 42 Capacitor overwiev.

    Parts included on the second PBC:

    Figure 43 The interior view of the controller: Power elements.

  • 48

    1. Three-state logic (also written as: tri-state or 3-state). In the field of digital electronics

    this device allows the output ports to assume a high impedance state in addition to the

    fundamental states (the 0/1 levels), by effectively "removing" the output from the circuit.

    Because of this, multiple circuits are allowed to share the same output line or lines (i.e. bus -

    which is set of parallel wires). For example computer systems often use a bi-directional data

    bus to allow convenient connection of memory and other devices to the registers of the

    processor data path. Bi-directional means that devices connected to the bus can either take

    input from the bus, or put output on the bus. In order for this to happen without outputs

    colliding, three-state buffers are used. The bi-directional bus allows us to connect many

    separate devices that have three-state outputs to the same set of wires, and then use logic

    to select which devices will communicate to each other.

    Figure 44 Symbol and truth table.

    In case of automatic switches, their states are either on-state (the logical "1" or 5 Volts) or

    off-state (logical "0", or 0 Volts). But in order to be either 5 or 0 volts, an output has to be

    connected, through the logic gate circuit, to either the 5V or 0V (ground) power supply leads

    of the gate. For a logic circuit output to prove it usefulness, it must be able to switch

    between those two voltage states and the pass current. That is, if an output is 5V, it needs to

    be able to pass some current to drive the inputs of the other gates to which it is connected.

    Analogically, when the output is 0V, it needs to be able to "sink" current, in order to operate

    the circuits it is tied to. The "cut wire" state is a third state, neither 1 nor 0, that is very

    useful in many computer-based designs. This additional state is also called "high

    impedance", because of the fact that current will not be able to flow either into or out of an

    output that is in this state. The high impedance state can also be viewed as that the circuit is

    having a very high resistance attached. We can shorten it to "High Z" (as marked on the

    picture above), because Z is a common symbol for impedance (general term for resistance to

    current flow).

    Generally, the whole concept of the third state ("High Z") is to effectively remove the

    device's influence from the rest of the circuit. If more than one device is electrically

  • 49

    connected, putting an output into the High-Z state is often used to prevent short circuits, or

    one device driving high (logical 1) against another device driving low (logical 0).Three-state

    logic can reduce the number of wires needed to drive a set of LEDs, as it was used in our

    control gear. We are using the three-state buffer to separate the LPT port from the part

    which controls the LED diodes set.

    2. DIL20 socket (DIL stands for: Dual In-Line). This is a double-Row 2x10 pins socket. When

    considering the ICs (chips), we know that they are easily damaged by heat when soldering

    and their short pins cannot be protected with a heat sink. Instead of that, we can use an IC

    holder, which is strictly called a DIL socket. This type of socket can be very safely soldered

    onto the circuit board. When all soldering is completed, the IC is pushed into the holder. IC

    holders are only needed when soldering so they are not used on breadboards.

    Part's particular properties are following: - raster: 2.54mm - contacts: tinned - current: 1A/pin -contact resistance: 30mW max -size: 7.62 mm x 25.40 mm

    3. 7404 TTL (cannot be seen on the picture, hidden under the PCB plate, connected with

    DIL20 socket). The NOT gate, it is a logic gate (which performs a logical operation on one or

    more logic inputs and produces a single logic output) which implements logical negation. In

    other words this part is very common electronic circuit that produces an inverted version of

    the input at its output. Other simple name for it is an inverter. The principles of this gate are

    that, when the input variable is A, the inverted output is known as NOT A. Usually we can

    also mark this as A', or , as shown at the outputs (presented on figure below). The output

    Q is true when the input A is NOT true, the output is the inverse of the input: Q = NOT A

    The NOT gate can only have one input.

    Figure 45 Symbol and truth table.

  • 50

    4. Resistor (0.15 ). Second type of resistors used in our work, but with slightly lower value

    of resistance. This parts are used to reduce the current in the circuit containing the power

    supply. If current overcome the value of 4A, the power supply would be cut off.

  • 51

    5. Local area network (LAN), OSI and TCP/IP model

    5.1. Characteristic of Local area network

    A local area network (LAN) is a computer network covering a small physical area, like a

    home, office, or small group of buildings, such as a school, or an airport. The defining

    characteristics of LANs, in contrast to wide-area networks (WANs), include their usually

    higher data-transfer rates, smaller geographic area, and lack of a need for leased

    telecommunication lines.

    Early LAN cabling had always been based on various grades of coaxial cable, but IBM's Token

    Ring standard used shielded twisted pair cabling of their own design, and in 1984 StarLAN

    showed the potential of simple Cat3 (Category 3) unshielded twisted pairthe same simple

    cable used for telephone systems. This led to the development of 10Base-T (and its

    successors) and structured cabling which is still the basis of most LANs today.

    Nowadays the most popular standard used in Local area networks is for sure Ethernet

    standard (described below) with Category 5 twisted pair cabling and Wi-Fi standard. LANs

    may have connections with other LANs via leased lines, leased services, or by tunneling

    across the Internet using virtual private network technologies (VPN). Depending on how the

    connections are established and secured in a LAN, and the distance involved, a LAN may also

    be classified as metropolitan area network (MAN) or wide area networks (WAN).

    5.2. Ethernet specification

    Ethernet is a family of frame-based computer networking technologies for local area

    networks (LANs). The name comes from the physical concept of the ether. It defines a

    number of wiring and signaling standards for the Physical Layer of the OSI networking model

    as well as a common addressing format and Media Access Control at the Data Link Layer.

    Ethernet is standardized as IEEE 802.3. The combination of the twisted pair versions of

    Ethernet for connecting end systems to the network, along with the fiber optic versions for

    site backbones, is the most widespread wired LAN technology. It has been in use from

    around 1980 to the present, largely replacing competing LAN standards such as token ring,

    FDDI, and ARCNET.

    From this early and comparatively simple concept, Ethernet evolved into the complex

    networking technology that today underlies most LANs. The coaxial cable was replaced with

    point-to-point links connected by Ethernet hubs and/or switches to reduce installation costs,

    increase reliability, and enable point-to-point management and troubleshooting.

  • 52

    5.3. OSI model

    The Open System Interconnection Reference Model (OSI Reference Model or OSI Model) is

    an abstract description for layered communications and computer network protocol design.

    It was developed as part of the Open Systems Interconnection (OSI) initiative. In its most

    basic form, it divides network architecture into seven layers which, from top to bottom, are

    the Application, Presentation, Session, Transport, Network, Data Link, and Physical Layers. It

    is therefore often referred to as the OSI Seven Layer Model.

    A layer is a collection of conceptually similar functions that provide services to the layer

    above it and receives service from the layer below it. On each layer an instance provides

    services to the instances at the layer above and requests service from the layer below. For

    example, a layer that provides error-free communications across a network provides the

    path needed by applications above it, while it calls the next lower layer to send and receive

    packets that make up the contents of the path. Conceptually two instances at one layer are

    connected by a horizontal protocol connection on that layer. There are several protocols

    dedicated for each layer, for example Internet Protocol (IP) is a protocol designed for

    network layer and Transmission Control Protocol (TCP) for transpo