• No results found

Development of Servo-Units for a Compliantly Actuated Quadruped Prototype

N/A
N/A
Protected

Academic year: 2022

Share "Development of Servo-Units for a Compliantly Actuated Quadruped Prototype"

Copied!
117
0
0

Loading.... (view fulltext now)

Full text

(1)

MASTER'S THESIS

Development of Servo-Units for a Compliantly Actuated Quadruped

Prototype

Florian Fischer 2016

Master of Science (120 credits) Space Engineering - Space Master

Luleå University of Technology

Department of Computer Science, Electrical and Space Engineering

(2)

Master Thesis

Development of Servo-Units for a Compliantly Actuated

Quadruped Prototype

by

Florian Christoph Fischer

W¨urzburg February 2, 2016

(3)

Abstract

This master thesis deals with the development of servo-motor-units as part of the quadruped project at the Institute of Robotics and Mechatronics, German Aerospace Center (DLR). To be able to perform highly dynamic motions such as jumping, the servo-motor-units of a quadruped robot require to produce high torque and velocity peaks on the one hand while being of compact size and light weight on the other hand. This is achieved by means of taking an off the shelf servo- motor-unit and replacing the electronics by a custom electronics which requests the maximum power of the motors. The developed servo-motor-unit provides a compact powerful motor with a good position sensor and a real-time USB link. The firmware enables to command the motor with a frequency of 1 kHz. The frequency of control loop and the communication can be set independently from each other. In a second part the development of an automated test system for motors is described. The measurements showed that performance factors and the efficiency of the developed servo-motor-unit are almost on the same level of a high-end motor, specially designed for application in robotic systems.

It is interesting that the servo-motor-unit is almost as efficient as a high-end robot motor, but is about factor 10 cheaper.

(4)

Table of Contents

1 Introduction 1

1.1 Motivation . . . 1

1.2 State of the art . . . 2

1.3 The Quadruped project . . . 4

1.4 Detailed problem description . . . 7

2 Theory of electric motors 8 2.1 Definition . . . 8

2.2 Different motor types . . . 8

2.2.1 AC Motors . . . 9

2.2.2 DC Motors . . . 10

2.3 Comparison of DC motors . . . 10

2.4 Brushed DC Motors . . . 12

2.5 Selection of a brushed DC motor . . . 15

2.5.1 Requirements . . . 15

2.5.2 BlueBird BMS-2514 . . . 16

2.5.3 SAVOX SV-1270TG . . . 16

3 Controlling of a DC motor 18 3.1 Definition . . . 18

3.2 Control strategies . . . 18

3.3 System identification . . . 21

3.4 Implemented control loop . . . 24

4 Development of the electronics 26 4.1 Requirements concerning the electronics . . . 26

4.2 SuperModified V3.0 for servo motors . . . 26

4.3 Electronics development on the basis of an ATmega328 . . . 27

4.4 Electronics development on the basis of an ATmega32u4 . . . 29

4.4.1 Short introduction to USB . . . 29

4.4.2 USB for real time communication . . . 31

(5)

4.4.3 Main components . . . 32

4.4.4 ATmega32u4 . . . 32

4.4.5 Functioning of the AS5048A . . . 33

4.4.6 Functioning of the H-bridge 34931 . . . 33

4.4.7 Prototype Board . . . 34

4.5 Mechanical parts . . . 35

4.6 Board development . . . 37

4.6.1 Tools . . . 37

4.6.2 General PC board layout . . . 37

4.7 Circuit diagram . . . 39

4.7.1 Sensor circuit board . . . 39

4.7.2 Micro-controller circuit board . . . 41

4.7.3 Motor driver circuit board . . . 46

4.8 Layout of the PCBs . . . 48

4.9 Manufacturing and assembly . . . 51

4.9.1 Populating of the boards . . . 51

4.9.2 Assembly of a motor . . . 52

4.10 Firmware . . . 54

4.11 The quadruped . . . 59

5 Performance test of the motor 60 5.1 Reasons for the measurements . . . 60

5.2 Goals of the measurements . . . 60

5.3 Measuring objects . . . 61

5.4 Development of a testbed . . . 62

5.4.1 Measuring shaft . . . 62

5.4.2 Load motor . . . 62

5.4.3 Test objects . . . 63

5.4.4 Data acquisition system . . . 64

5.4.5 Fastening system . . . 69

5.4.6 Final test system . . . 70

5.5 Measurements and results . . . 70

(6)

5.5.1 Performance measurement . . . 70

5.5.2 Stall torque measurement . . . 75

5.5.3 Application test . . . 76

5.6 Evaluation of the results . . . 78

6 Conclusion and outlook 79 A Appendix 89 A.1 Matlab scripts . . . 89

A.2 PC boards . . . 97

A.3 Testbed . . . 107

B Eidesstattliche Erkl¨arung 108

(7)

List of Figures

1 Illustration of Spirit with the rocker bogie suspension [11] . . . 1

2 Mount Sharp [12] . . . 2

3 MIT Cheetah v.2 outdoors[23] . . . 3

4 BigDog[28] . . . 4

5 Series elastic actuator[78] . . . 5

6 CAD sketch of a single leg of the quadruped[78] . . . 6

7 Overviews of different motor types . . . 8

8 Structure of an AC motor . . . 9

9 Circuit of a DC motor[40] . . . 14

10 Velocity-torque characteristics . . . 15

11 SAVOX SV-1270TG[43] . . . 16

12 Performance test of a SAVOX SV-1270TG motor and the results . . . 17

13 Block diagram of the transfer function for a DC motor . . . 19

14 Current control loop block diagram . . . 20

15 Velocity control loop block diagram . . . 21

16 Cascading control loop block diagram for a DC motor . . . 21

17 System identification of a SAVOX SV-1270TG motor . . . 23

18 SuperModified V3.0 [48] . . . 26

19 Prototype board . . . 28

20 Hall effect element and sketch of position sensor . . . 33

21 Circuit of H-bridge and diagram of motor driver . . . 34

22 Prototype board for two motors . . . 35

23 Picture of the motor as well as CAD drawings of the motor and the magnet holder 36 24 AS5048A sensor circuit . . . 39

25 SAMTEC plug and used pinout . . . 40

26 Pinout of external connector . . . 41

27 Different USB ports [63] . . . 42

28 Power supply circuit of the micro-controller . . . 42

29 ESD and EMI protection circuit . . . 43

30 Oscillatory circuit . . . 44

(8)

31 LED HSMF-C114 circuit . . . 44

32 SAMTEC socket and used pinouts . . . 45

33 Power supply circuit of the H-bridge . . . 46

34 Motor terminal and voltage divider . . . 46

35 Feedback circuit . . . 47

36 GUI of PADS Layout . . . 48

37 Both sides of the sensor board . . . 50

38 CAD drawing of the stack . . . 50

39 Final production of the PC boards . . . 52

40 Ready populated PC boards . . . 52

41 Final asembled motor . . . 53

42 Quadruped during jumping test . . . 59

43 GUI of the Elmo Application Studio II . . . 64

44 Simulink model of the test system . . . 67

45 State machine of the testbed logic . . . 68

46 CAD drawing of the holding system . . . 69

47 Final test system . . . 70

48 Performance diagrams of the tested motors . . . 72

49 Stall torque diagrams of the tested motors . . . 75

50 Diagrams of the application tests . . . 77

51 Further diagrams of the application tests . . . 107

(9)

List of Tables

1 Estimated values of the system identification . . . 23

2 Different USB data transfer modes . . . 29

3 Structure of a PC board . . . 49

4 Technical data of TMHS 306 . . . 62

5 Technical data of SENSO-Wheel SD-LC . . . 63

6 Peak efficiency . . . 73

7 Maximal mechanical power . . . 73

8 Different efficiency due to different supply voltage for the SAVOX SB-2231SG motor . . . 74

9 Efficiency without and with logic power consumption . . . 74

10 Power consumption of the logic unit . . . 74

11 Electrical Work during different jumping sequences . . . 78

(10)

1 Introduction

1.1 Motivation

A three-stage Delta II rocket was launched from Cape Canaveral Air Force Station on 10th of June 2003. This rocket transported Spirit to the Mars where it landed on 4th January 2004.

It was one of two rovers of the Mars Exploration Rover Mission which were developed by NASA.

The mission goals were the exploration of the climate, nature and geology of the surface of Mars and the search for water [8]. The terrain on Mars has a rough, rocky surface and presents a special challenge for mobile robots. To manage these conditions each rover have six wheels each with an integrated motor mounted on a rocker-bogie suspension.

Figure 1: Illustration of Spirit with the rocker bogie suspension [11]

Classical four wheeled vehicles are able to get over vertical obstacles with a height equal to the height of the axis of their wheels. The rocker- bogie system ensures that in rough, uneven ter- rain all six wheels stay on the ground which can be seen in figure 1. The height of the obstacles which can be overcome with this construction de- pends on the lengths of the suspension, the pos- sible angle and the diameter of the wheels. In case of the mars rover it is more than the diam-

eter (250mm) of the wheels [9]. The mobility of the the rovers was highly increased with this construction. Figure 2 was taken by Curiosity, another rover on Mars on 9th September 2015 [8] [12]. It shows the higher regions of Mount Sharp. The possibility to reach the top of such a mountain with a rover even with its improved mobility is without question very small. Finding an appropriate path to the top through this rough and steep area is a challenging task with uncertain success for a wheeled vehicle. To explore such terrain, different locomotion ideas and systems have to be developed.

In 1990, the NASA already thought about using legged robots for the exploration of Mars [1].

At the moment they are working on a humanoid robot called Valkyrie which should land on Mars before humans do and prepare the landing side [13] [14].

Not only on distant planets but also on earth there is a broad field of operating range for legged

(11)

Figure 2: Mount Sharp [12]

robots. According to estimates, 80% of the land mass on earth is not accessible for wheeled vehicles [15]. Legged vehicles can be an option to reach these areas. But also in the case of natural disasters like earthquakes and avalanche, where the infrastructure for cars and trucks is normally destroyed, such vehicles could be used. With legs you are almost independent from the lay of the land. But the main issues right now are the energy consumption and the efficiency. One of the most famous walking robots needs ten times more power to walk than a human [17][16].

This must be improved before legged robots can be used in a wider field. For the exploration of planets this is necessary, because a higher energy efficiency means a bigger operation range of the robots. It also simplifies the power supply, e.g through solar panels.

1.2 State of the art

A lot of institutes worldwide are investigating the field of legged robots. The ´Ecole poly- technique f´ed´erale de Lausanne (EPFL), the Biomimetic Robotics Lab at MIT, the Autonomous systems lab at Swiss Technical Institute of Technology (ETH) in Zurich and Boston Dynamics rank among the leading institutes and companies in this field.

The EPFL is working on a compliant quadruped robot called Cheetah-Cub. It has four legs, which are powered by eight servo motors of the type Kondo KRS2350 ICS. Referring to the de- scription of the institute the “robot’s leg configuration is based on a spring-loaded, pantograph mechanism with multiple segments”[18]. The complete robot has a weight of one kilo and is

(12)

able to reach a maximum speed of 1.42 m/s. Until now different gait patterns like walk and trot have been implemented in this robot and were tested in different terrains. The result was a self-sable and self-stabilizing locomotion. Further research showed that the kinematic pattern for “in-air” stepping which means the leg is not exposed to gravitational or inertial forces has a lower complexity than the pattern for ground locomotion. The complexity of the “on-ground”

kinematic is comparable to the one of small animals [19][20].

Figure 3: MIT Cheetah v.2 outdoors[23]

The Biomimetic Robotics Lab at MIT is also working on a quadruped. As the name implies, their robots called MIT Cheetah version 1 and 2 are inspired by a cheetah. The robot is shown in figure 3. Their robot weighs 33 kg and can run at 6 m/s. Due to the usage of “large gap diam- eter motors, regenerative electric motor drivers, single-stage low gear transmission, dual coaxial

motors with composite legs, and the differential actuated spine”[21], the power consumption could be reduced to 973 W. This is on the same level like running animals of the same size. To stabilize the robot and for a stable trot the following three control strategies are implemented.

A programmable virtual leg compliance reacts on external disturbance and supports the self- stabilizing. The usage of a tunable stance-trajectory design should increase the impulse of the foot ends while running. The last control strategie enables a modulation of the gait pattern con- sidering the feedback. For the verification of the control parameters a simulation based on the behavior of the cheetahs was implemented. The “MIT Cheetah achieved a stable trot-running gait in the sagittal plane”[22]. Similar experiments with an tail for the improvement of maneu- verability were performed with good success [24].

The ETH in Zurich is also working on legged robots. Their four-legged robot StarlETH which means “Springy Tetrapod with Articulated Robotic Legs” weights 23 kg, can carry a payload of 10 kg and can reach a maximum speed of more than 0.56 m/s. The robot is powered with Maxon EC-4pole 200 W motors with a harmonic drive gearbox with a transmission ratio of 100/1. The control is based on joint force and position. Every leg has 3 degrees of freedom and in the latest version the robot is able to walk and trot powered by on-board batteries. This project is still ongoing [25][26].

(13)

The former projects are all done by universities. The most successful and advanced legged robots are build by the American company “Boston Dynamics”. Their ‘BigDog is the best known robot of this company and the youtube video [27], showing the robot in action, has more than 16 millions views.

Figure 4: BigDog[28]

This reveals the big interest in legged robots and the technologically advanced approach. BigDog weights about 109 kg, is about 1 m tall, 1.1 m long, and 0.3 m wide. It is powered by a water-cooled two stroke engine with about 11 kW which drives a hydraulic pump. Each leg has four hydraulic actuators, every one of them consists of low friction hydraulic cylinders, pow- ering the joints. The complete construction is

shown in figure 4. The trot velocity is about 2 m/s but during tests a maximum speed of 3.1 m/s was reached. The robot is able to carry 154 kg payload on flat terrain, can climb slopes up to 35° and its longest operation distance was 6.2 km [28][29].

1.3 The Quadruped project

The German Aerospace Center (DLR) is also working in this field with projects like TORO and c-Runner. TORO is a humanoid robot, based on the lightweight construction robots of the DLR. The c-Runner project tries to imitate the movement of the human leg. New walking algorithms based on the human locomotion are examined in both projects [30].

In classical robots, the interface between an actuator and the mounted load should be as stiff as possible. The new approach to improve the efficiency of robots is the usage of a concept called

“series elastic actuators” (SEA)[31]. This system is composed of a motor and a spring shown in figure 5. The shaft of the motor on the right side is fixed to a spring. The link on the left side is connected to the motor via the spring in the middle. The reduced stiffness of the interface based on the spring “offers a number of advantages, including greater shock tolerance, lower reflected inertia, more accurate and stable force control, less inadvertent damage to the environment, and the capacity for energy storage”[31].

(14)

Figure 5: Series elastic actuator[78]

“Utilizing the natural oscillation of the elastic ac- tuation can lead to efficient locomotion. However finding a matching combination of joint stiffness and actuator input is challenging as these robots share the properties of underactuated and hy- brid dynamic systems” [32]. Not only a match- ing combination but also new control algorithms for cyclic walking have to be developed. Match-

ing hardware has to be build as well in order to prove these new theories. For this purpose the quadruped project, a pet-sized, four legged, jumping robot, was initiated by DLR. The main task is the verification and test of new control algorithms and therefore the requirements of the robot has to meet changes due to the progressive development and improvement of the algorithms.

This requirements high standards concerning the flexibility of the development of the hardware platform. Continuous improvements have to be implemented and therefore a rapid prototyping approach was chosen for this project.

The quadruped project was started in May 2014 with the development of a single leg. Until April 2015 the team designed a leg, which was manufactured by a 3D printer. It was mounted on a boom for experimental purposes and first tests with a new algorithm were performed. The boom is a mounting device which allows the leg to jump and to move in a circle. Figure 6 shows the CAD sketch of the single leg version in April 2015 which consists of the following components:

1. Housing of the leg, printed with a 3D printer 2. Servo motor for the knee

3. Spring of the SEA for the knee (ends of the spring are cut of in the finished model) 4. Servo motor for the hip

5. Spring of the SEA for the hip 6. Transmission belt

7. Upper leg, printed with a 3D printer

(15)

8. Lower leg, printed with a 3D printer , bent upwards 9. Position sensor on link side

Figure 6: CAD sketch of a single leg of the quadruped[78]

A more detailed description of the used motor is given apart from the short techni- cal overview. Due to the rapid prototyping approach, the commercial off-the-shelf servo motor HerkuleX DRS-0201 was used. This servo motor is specially designed for the us- age in robots with the following features:

ˆ Dimension: 45 mm(W) x 24 mm(D) x 31 mm(H)

ˆ Weight: 60 g

ˆ Input voltage: up to 12 V DC

ˆ Stall torque: 2.4 Nm at 7.4 V

ˆ Maximum speed: 0.147 s/60° at 7.4 V

For the communication the servo motor supports a full duplex UART Serial protocol with a maximum data rate of 0.667 Mbps. It is possible to connect up to 254 motors in a row to one communication port. The main advantages of this servo motor are the different driving modes.

The servo can be operated in position mode, in which a position is commanded or in rotation mode, in which a continuous rotation is performed. To ensure a smooth and accurate control, a position sensor with a resolution of 0.325° is implemented. Critical situations like overheating or overload can sometimes occur during the operation. To protect the motor against these situations, a current and temperature control takes care that the motor stays in its operational conditions.

For the usage in the quadruped, the firmware of the integrated ATmega8 chip of the motor was modified and the two motors of the leg are connected via a serial connection to a Arduino Micro board. This Board collects additional information from position sensors which are mounted on the boom and is connected to a PC with Linux RT via USB. To enable the control of the

(16)

servo motors with Simulink models a special interface for Matlab Simulink was developed. The control loops of the motor are timed with 1 ms and synchronized with a specially designed data transmision protocol. To achieve a correct timing, the communication speed was set to the maximum of 0.667 Mbps.

After all these adaptations it was possible to command and control the leg with the help of control algorithms modeled in simulink.

1.4 Detailed problem description

Until April 2015 several test were performed and some problems were disclosed. An ATmega8 micro-controller has 8 KB of programmable flash memory, 1 KB of SRAM and 512 bytes EEP- ROM [33]. The adapted firmware should be able to run the control loop and handle the com- munication with a rate of 1 kHz. In the control loop, a PID position controller was realized.

Due to the time restriction only integer calculation instead of float operations could be per- formed. Only a simple (low order) filter was implemented due to memory constraints. The limited memory aggravated the development of the firmware software and it came to a lot of uneasy compromises. The communication over the serial link with 0.667 Mbps turned out to be a little unstable as well. In case of longer jumping sequences a grave problem occurred. The motor lost performance rapidly and stopped completely in the end. It turned out that the motor was not able to dissipate the heat and lost the performance due to overheating. At a certain temperature the overheating protection was triggered and turned the motor off. Further tests showed that this type of motor was not able to provide the required power over longer periods of time. The following investigations revealed that there is no commercial product which meets the requirements.

The main task of this thesis is the development of servo units for a compliantly actuated quadruped. Thereby, an existing servo unit should be taken as a basis of which the integrated electronics should be removed and replaced by customized electronics. Software concepts for the control and communication should be investigated and a reliable solution should be implemented and tested on the micro-controller of the servo electronics.

(17)

2 Theory of electric motors

2.1 Definition

An electric motor is defined as “a device that converts electrical energy to mechanical torque.”[34]. Common electric motors work on the principal of the Lorentz-force, the force which acts between a magnetic field and a moving charge. The force of a magnetic field on current-carrying windings is used to generate a rotation in electric motors.

Figure 7: Overviews of different motor types

2.2 Different motor types

There are a lot of different types of motors, which can be roughly divided into two categories:

the DC and AC motors. These main groups are distinguish by the used type of electrical power.

While DC motors are working with a DC voltage, AC motors need an alternating voltage for operation. A rough overview is given by figure 7.

In almost all motors, the following components can be found:

ˆ Stator: stationary part of the motor, consists of windings or permanent magnets;

ˆ Rotor: moving part of the motor, shaft provides mechanical power, usually carries con- ductors or permanent magnets which interact with the magnetic field of the stator;

ˆ Windings: usually copper coiled around a soft magnetic core, windings are used in stators and rotors depending on the kind of motor;

ˆ Air gap: gap between the stator and the rotor, should be as small as possible;

ˆ Commutator: kind of electrical switch, takes care that the appropriate winding is powered to produce a current flow in the required direction;;

(18)

Figure 8: Structure of an AC motor [35]

The structure of an AC motor with some of the described components can be seen in figure 8.

After this short overview of the most important parts of a motor, a short description for the most used motor types is given. There are several other motor types but either their dissemination is limited or they are only used for special applications and so they can be neglected in this context [36][37][38].

2.2.1 AC Motors

The function of an AC motor is based on a rotating magnetic field. The field is produced by a poly-phase rotary current or with the help of capacitors. This group of motors can further be distinguished into synchronous and asynchronous motors.

In synchronous motors the magnetic field of the rotor is given by permanent magnets or by current-carrying windings on the rotor. The rotor orientates itself towards the magnetic ro- tation field of the stator and follows the field. This happens with the same angular velocity of the rotating field, between the rotor and the stator exists a synchronicity. Hence the name synchronous motor. The velocity of the rotor depends on the frequency of the magnetic field of the stator, so changing the frequency would result in a velocity change of the rotor and thereby also the shaft.

The other big group is the one of the asynchronous motors. Here the rotor is a squirrel-cage rotor which means that the windings are shorted. The rotating magnetic field of the stator induces a potential in the windings on the rotor which results in a current flow. As a result of

(19)

this current flow, a magnetic field is caused. The magnetic fields of the rotor and the stator lead to a force on the rotor and therefore to a rotation. The angular velocity of the rotating field of the stator and the rotor differs, hence the name asynchronous motor. This kind of motor can mostly be found in home appliance where it is directly connected to the power grid. It is low-maintenance, cheap in the production, but due to the fixed frequency of the line voltage the velocity cannot be straightforwardly varied. For dynamic applications complex control methods are required [36] [3].

2.2.2 DC Motors

DC motors work also on the principal of the Lorenz force, but here the stator produce a stationary magnetic field due to permanent magnets or current-carrying coils. The rotor consists of a set of insulated windings —mostly made out of copper— of a soft iron core to concentrate the magnetic flux. The endings of each armature coil are connected to the commutator. When a DC voltage is applied to a set of armature coils the rotor orientates on the magnetic field of the stator. Without the commutator the rotor would stop. But by means of the commutator the next set of armature coil is powered and thus the rotor keeps moving. The commutator connects the rotating coils to the power supply through brushes. The brushes are usually made out of graphite. In some cases the brushes are enriched with metal like copper or molybdenum.

The velocity is controlled by the applied voltage and the torque by the current which is pushed into the coils.

A special type of a DC motor which is often used, is the electrically commutated DC motor which is also called brushless DC motor. The working principle of a synchronous motor. The rotor of this type of motors usually consists of permanent magnets and the stator carries a set of coils. The coils are powered with an AC voltage through a voltage inverter and the rotor orientates with respect to the rotating magnetic field produced by the coils [36] [2] [39].

2.3 Comparison of DC motors

The choice of the appropriate motor type depends on the application. In our case the motor is used to drive a mobile robot. Therefore the motor is powered by a battery, thus with DC voltage. So the use of a DC motor offers itself. Otherwise an additional DC/AC converter would be necessary.

(20)

Regarding the size of the robot, a smaller motor powered with low voltage is sufficient and there- fore a common power supply can be realized for the electronics and the motors. In robotics, motors are mainly used to drive to certain positions and to stay there instead of rotating con- tinuously. In order to meet these requirements the motor has to be regulated. A brushed DC motor (BDC) and a brushless DC motor (BLDC) are under considerations for the quadruped robot. Both motor types can be regulated and should be able to fulfill the requirements. Both motor types are compared now, to make an educated decisions:

Brushless DC Motor Advantages:

Having no the brushes, this kind of motor has no parts which can be worn out. There- fore the motor is maintenance-free and has a long lifespan. It is also highly efficient due to the missing friction of a commutator and the possibility of building a smaller rotor because of the not required coils in it.

Disadvantages:

Brushless motors require an electronics which produces an AC electric signal for the coils. Without this, the motor cannot move. For the correct timing of the signal, a closed-loop controller is necessary and the adjustment requires complex control theo- ries. Due to a convenient electronics, the motor prices up.

Brushed DC Motor Advantages:

A brushed motor is easy to operate and to control. Simply applying a DC voltage and the motor rotates. The velocity is controlled by the applied voltage and so the motor can be easily adjusted by the usage of a pulse width modulated (PWM) signal. As there is no need for a complex electronics the motor is quite inexpensive.

Disadvantages:

The brushes constitute the main disadvantage. They wear out due to the friction that is caused between them and the rotating commutator and need to be replaced after some time. So the motor has to be maintained and the lifespan is limited. This leads to higher costs for the upkeep. The brushes also originate electromagnetic interference

(21)

which are feed to the power supply. This can damage or disturb other electronics on the same power supply. Ionizing sparks can occur between the brushes and the com- mutator. This leads to restrictions of the operational area. For example in any medical or explosion-prone environment brushed motors are forbidden.

At first glance a brushless motor always seems to be the better choice. But in the case of the quadruped project the disadvantages of a brushed motor are relativized. The quadruped is a prototype to prove concepts and not designed for permanent use. The maintenance and the lifespan are therefore secondary in this comparison. The tests are performed in a lab, so the restriction of operational areas is irrelevant. It could become relevant in the future if the robot was to be used in such environments but right now the main goal of the project is the research in the field of control theory and algorithms. The disadvantage of electromagnetic interference (EMI) is not a trivial matter, but with appropriate countermeasures EMI can be reduced. On the other hand the disadvantage of the brushless motor can not be neglected. Due to the electric commutation, the effort to control a brushless DC motor is much higher than the effort to control a brushed DC motor. Finally this is the vital point. The rapid prototyping concept of the project necessitates a flexible development which is easier to achieve with a brushed DC motor [36][37][38][39].

2.4 Brushed DC Motors

After a decision has been made in favour of a brushed DC motor this section wants to provide further information about the formulas behind such a motor. As already mentioned, the Lorenz force F is the fundamental principle and is described for a wire with length l carrying the current I in a magnetic field B by following equation:

→F = I(−→ l ×−→

B ) (1)

The magnetic field is given by

B = φ/A (2)

where A is the area of the coil and φ is the magnetic flux with physical unit Weber.

(22)

Then the torque τ for a multiturn coil is

τ = kTφI sin α (3)

kT is a constant, which depends on the coil geometry, while α describes the angle between B and the normal of the plane of the coil. Is the wire straight aligned with the magnetic field α = 90π/2 and so sin α = 1 . The mechanical power of motor is equal to the product of torque and angular velocity (ωm in rad/sec):

PM = ωMτ = ωmkTφI (4)

The rotation of the armature leads to an induced voltage Ubin opposite direction of the rotation.

This back emf voltage is given by

Ub = kaφωm (5)

where ka is a constant based on the geometry and the magnetic properties of the motor. The electric power dissipated by the machine is given by the expression

Pe= UbI (6)

In an ideal case, the mechanical power is equal to the electrical power PM = PE and therefore ka= kT. The equation

ka= kT = pNc

2πNp (7)

describes the constants ka and kT while p is the number of magnetic poles, Nc is the number of conductors per coil and Np is the number of parallel paths in the armature winding. For further consideration, the electrical circuit of a DC motor has to be taken into account as well.

Figure 9 shows the field circuit and the rotor circuit. The field circuit produces the magnetic field of the stator and can be neglected assuming that a permanent magnet is used. Motors in the performance class which will be used for the quadruped project are usually equipped with such permanent magnets. The circuit on figure 9 (left) shows the coils with a resistance Raand the induced back EMF voltage Ub. When the current varies the inductance of the coils La also

(23)

Figure 9: Circuit of a DC motor[40]

has to be considered. The following formula can be derived directly from the circuit:

Ua= IaRa+ LadIa

dt + Ub (8)

When the motor is operating at a steady state, the current Ia is constant, i.e. dIdta = 0 and the formula above can be reduced to

Ua= RaIa+ Ub (9)

When the magnetic flux φ is constant as in the case of a separately excited machine or a motor with permanent magnets (3) can be further simplified. The constant kT is combined with φ and is given as motor constant kM provided in data sheets. The following equation describes the linear relation between torque and current.

τ = kMIa (10)

The angular velocity of a motor can be derived from (5), (9) and (10).

ωm = 1 kM

(Ua− 1 kM

Raτ ) (11)

This equation is correct based on the assumption that the system is ideal and PM = PE. Figure 10 shows a velocity-torque curve of a DC motor with permanent magnets plotted for constant voltage Ua. The point where the curve subtends the velocity axis tags the no load velocity, the maximum velocity the motor can achieve. In this point the motor produces no torque. The stall torque, the intersection of the curve with the torque axis, marks the maximum torque of the motor. At this operating point the shaft is not rotating. The color-coded area tagged with “continuous operation” is the operating field in which the motor should be operated.

(24)

Figure 10: Velocity-torque characteristics

Instantaneous load with higher load is possible up to the stall torque. If this load is too long, the motor could be destroyed. The mechanical power Pm is the product of torque τ and velocity ω. The load of an application determines the applied motor and the operating point. To achieve higher torques but lower velocity, a gearbox can be used [2][4][41][5][42].

2.5 Selection of a brushed DC motor

2.5.1 Requirements

The new motors should replace the insufficient Herkulex DRS-0201 servo motors and should fulfill the following requirements which were derived from the modeled application.

ˆ Stall torque > 2.0 Nm

ˆ Maximum velocity > 7.12 rad/sec

ˆ As light as possible

ˆ Good thermal properties

ˆ Long-term usability

Due to the overheating problem of the Herkulex servo motors the focus concerning the new motor was on the thermal properties. The motor should have a full metal housing for a better radiation of the produced heat. This would enable the motor to provide a higher continuous torque. After the requirements were defined the search for appropriate motors started.

(25)

2.5.2 BlueBird BMS-2514

The first choice was the BMS-2514, a servo motor from the Taiwanese company Blue Bird Technology which is mainly produced for model making. It fulfilled the requirements and has a massive aluminum housing. The performance test yielded that it is suitable for the project.

Unfortunately our distributor took this motor out of its assortment. Despite an intensive search it was not possible to find an other appropriate distributor for this motor.

2.5.3 SAVOX SV-1270TG

After a new search, the SAVOX SV-1270TG from the US-company SAVOX seemed to be convenient. The performance parameter for the motor are quoted with the following values:

ˆ Stall torque: 3.5 Nm

ˆ Maximum velocity: 9.51 rad/sec

ˆ Weight: 0.056 kg

ˆ Aluminum housing

ˆ Gears made out of titanium and aluminum Figure 11: SAVOX SV-1270TG[43]

As concluded using the data sheet, the servo motor, shown in figure 11, fulfilled all requirements.

Therefore, this motor was tested to find out if it can fulfills the requested performance without overheating over a long time.For this test a small testbed with a force and a temperature sensor was used, displayed in figure 12(a). The servo motor was clamped into the testbed and a lever was mounted on the shaft. This lever pressed on the force sensor. A temperature sensor was directly applied to the motor which can not be seen in the figure. During the performance test the motor tries to drive to a position which leads to a collision with the force sensor. The force sensor measures the produced force, then the motor drives back to a zero position. To simulate the continuous operation this cycle was executed 6000 times while measuring the temperature.

The plot 12(b) displays that the maximum torque is almost 3 Nm, this is below the statements of the datasheet but still sufficient. In the cyclic test the motor lost some of its capability but was able to produce a torque higher than 1.5 Nm over the complete test 12(c). At the begin- ning of the test the temperature increased but reached a stable maximum at around 53°Celsius which is shown in figure 12(d). In contrast to industrial motors, where the customer receives a

(26)

(a) Testbed for the performance test (b) Maximum torque plot

(c) Produced torque during cyclic test (d) Temperature during cyclic test

Figure 12: Performance test of a SAVOX SV-1270TG motor and the results

lot of technical information about the motors, the data provided for servo motors are poor. To estimate the motor constant, described in section 2.4, for this servo motor, the input current and the torque were measured in another series of tests. The correlation between torque and current is linear and so several different currents where applied and the resulting force was measured.

The ratio MI

a corresponds the motor constant and was on average around 0.5 N mA .

The performed tests proved that a SAVOX SV-1270TG servo motor is able to fulfill all require- ments [44].

(27)

3 Controlling of a DC motor

3.1 Definition

To drive a motor, a control system is required which can be described as a “mechanical, optical, or electronic system that is used to maintain a desired output”[45]. In robotic motors are mainly used to produce a defined torque, to drive with a constant velocity or to reach a determined position. In all of these cases a controller is required which is realized as an electrical system. In the following chapters, appropriate control strategies are presented.

3.2 Control strategies

For an appropriate control of a DC motor the transfer function, which describes the relation of the input variables and the output variables is required. For the DC motor this function can be derived from and the following formula which describes Newton’s law:

Jdω

dt = τ − τL (12)

The inertia of the load is given by J . τL is the torque of the load. (5), (8), (10) and (12) are now transformed into the Laplace domain:

Ia(s) =

1 Ra

1 + sLRa

a

(Ua(s) − Ub(s)) (13)

τ (s) = kMIa(s) (14)

Ub(s) = kMω(s) (15)

ω(s) = 1

J s(τ (s) − τL(s)) (16)

Combining these equations, the transfer function of a DC motor is obtained (17). Figure 13 shows the corresponding block diagram.

ω(s) U (s) = kM

J s(Ra− Las) + (kM)2 (17)

(28)

Figure 13: Block diagram of the transfer function for a DC motor

For the control of a DC motor a cascaded control structure consisting of a current control loop and a superimposed velocity controller is applied. For the current control loop it is assumed that the change of the angular velocity is so slow that its influence on the armature voltage Ua

due to the induced back emf Ub can be neglected. This leads to a control loop with a current controller, a current converter, the current dynamics and a current transducer, described by the following formulas (same order like enumeration).

FcI(s) = KP i(1 + TN Is)

TN is (18)

Fcc(s) = e−sTt (19)

Fccs(s) = 1

Ra+ Las (20)

Fct(s) = 1

1 + Tgis (21)

The block diagram of the complete closed loop system is shown in figure 14. The blocks from left to right have the same order as mentioned above. For the practical implementation the model is further simplified. First, the dead-time element Fcc and the lag element Fct are summarized to one first order lag element in the forward part. Such a dynamics is usually controlled using a PI controller. Using the method of dynamic compensation, the time constant TN I is chosen as

(29)

Figure 14: Current control loop block diagram

TN I = Ta= LRa

a. The simplified equation is

F0i(s) = KP iKS

Tas(1 + T1s) (22)

The closed inner control loop is operating in a cascading control structure and is superimposed by the velocity control loop. Therefore, the controller can be described with a first order lag element.

FW i(s) = KSi

1 +KTa

P iKSs (23)

After this description of the current control loop a velocity controller is presented. This loop superimposes the current controller and consists of a velocity controller, the closed loop current control from above, an integrator for the rotation velocity and the feedback of a velocity sensor.

The formulas for this enumerated parts in the right order are given by:

FRΩ(s) = KP Ω(1 + TN Ωs)

TN Ωs (24)

FW i(s) = KSi 1 +KTa

P iKSs (25)

FS(s) = 1

J s (26)

Fss(s) = 1

1 + TgΩs (27)

(30)

Figure 15: Velocity control loop block diagram

The corresponding block diagram is shown in figure 15. The controller of this loop is usually realized as a PI controller and therefore the same simplification as for the current controller can be applied. The gained equation is:

FW Ω(s) = KP Ω(1 + TN Ωs)KSi

TN Ωs2(1 + TSi) (28)

After this modification, the controlled system consists of a first order lag element and an integra- tor, both in series. The complete cascading closed loop control system is composed of a current control loop and a velocity control loop. To protect the velocity controller from overshooting a limiter is implemented. The cascading loop is depicted in figure 16. After the presentation of the basic control strategies for a DC motor, the description of the system identification of the used SAVOX servo motor will be described [6][7].

Figure 16: Cascading control loop block diagram for a DC motor

3.3 System identification

As already mentioned, the amount of provided data for a model making motor are usually poor. For the chosen SAVOX SV-12170TG servo motor, the parameter values of the resistance

(31)

Ra and inductance La are not available. These values are required to determine the plant pa- rameters KS= R1

a and Ta. Without these values, the system has to be identified in experiments.

Therefore, the step response of the system is recorded and analyzed. With mathematical cal- culations based on stochastic or determined methods, the plant parameters KS and Ta can be estimated.

For these experiments the motor shaft is locked such that the motor cannot produce a back EMF voltage, i.e., the feedback influence is canceled out. The relation between armature volt- age and current is given by Ia=

1 Ra

1+sLaRaUa. Exciting the system with a predefined voltage signal, e.g., using a low-frequency PWM signal and recording the current flow provides all required data. The motor was connected to a H-Bridge type 34931, made by Freescale Semiconductor, to operate the motor with a PWM signal with the fitting voltage on the output. The inputs of the H-bridge was connected to an Arduino Micro which provides the PWM signal on tran- sistortransistor logic (TTL) level and configures the other inputs of the H-bridge according the data sheet. For the measurement and the recording of the values a Teledyne LeCroy HDO6104 oscilloscope was used due to its high sample rate of 2.5 GS/s and the available current probe.

One probe for the voltage measurement was placed directly on the motor terminal, a second one on the signal input of the H-bridge. For the current measurement, a CP030 current probe with a range of 0 – 30 A and a resolution of 50 MHz was connected to the oscilloscope. This probe is a kind of a clamp, which is closed around the current-carrying wire. For the test itself, the H-bridge was powered with 7.4 V by a laboratory power supply of type EA-PS3032-10B and the signals of the three channels were recorded by the oscilloscope.

Figure 17(a) shows a screen-shot of the measured values of the oscilloscope. The red graph rep- resents the PWM signal, the yellow graph the resulting voltage at the motor terminal and the blue line is the measured current flow. Figure 17(b) is a plot of the recorded data and when it is compared with the screen-shot it can be seen that the only difference is the scaling of the y axis.

This originates from the fact that the scaling for each channel on the oscilloscope is individually set. It is printed in the left lower corner of the screen-shot. The recorded data was processed in Matlab. The complete script can be found in the appendix 34. For the estimation of KS and Tathe System Identification Toolbox in Matlab was used. The function “pem” predicts an error estimation for linear and nonlinear models [46]. Using this function on the gathered data, the values in the following table 1 were estimated.

(32)

(a) Screenshot of the oscilloscope

(b) Plot of the recorded data (c) Measured vs calculated current

Figure 17: System identification of a SAVOX SV-1270TG motor

KS 0.7304 TA 1.1817 · 10−5 Ra 1.37 Ω La 8.62 · 10−6 H

Table 1: Estimated values of the system identification

Figure 17(c) shows the plot of the measured current and the calculated current based on the estimated model parameters. It can be seen that the difference between both curves is minimal which indicates the high quality of the model fit. For a further verification of the values, the

(33)

resistance of the motor was measured with a multimeter. The measured value was 1.4 Ω which matches very well the estimated value.

3.4 Implemented control loop

The goal is to implement the motor control using a micro-controller. Therefore, the current has to be measured and the control action of the current feedback has to be calculated in an appropriate rate. Empirical values imply that this control loop should be 20 times faster than the electrical time constant of the system. With Ta = 1.1817 · 10−5sec this means that the current control loop has to run with a rate of about 2 MHz. A control loop implemented on typical micro controller like the ATmega328 normally runs with 1 kHz up to 10 kHz. It is not possible to run a current controller for this motor on such a hardware.

The extremely short time constant of this motor is due to its special coreless design. “Coreless”

means that the rotor only consists of the windings without an iron core and therefore, the inductance is very low. To stabilize the windings, they are encapsulated with ace resin. The advantages of such motors are a smoother operation, a lower weight and a higher acceleration and deceleration due to the reduced inertia of the rotor.

For a working current control the time constant has to be increased. Looking at the equation Ta= LRa

a, this can either be done by lowering the resistance or by rising the inductance. Lowering the resistance means that an additional resistance has to be connected parallel to the motor.

Assuming a control loop with 10 kHz, this means that Tashould be around 2 · 10−3. To achieve this, the resistance of the parallel resistor has to be around 3.1 · 10−3 Ω. This would be a short circuit and would consequently cause a huge current flow. Therefore, this solution is not feasible.

The second option is to increase the inductance. Assuming the same setting (10 kHz control loop), means boosting the inductance up to around 2.7 · 10−3H. An acceptable coil with such a inductance weights around 400 gr [47]. For a mobile robot with at least eight motors this would be an additional weight of 3.2 kg, which is not an option.

It turned out that there is no feasible way to raise the time constant of this motor and therefore to implement a classic current controller. For an appropriate closed-loop behavior another method has to be found. The motor is operated together with a spring as a series elastic actuator.

The idea is now to determine the torque with the help of the displacement of the spring. The displacement can be easily acquired by measuring the position of the motor shaft θ and of the

(34)

link q. The spring constant is known such that the torque can be calculated by TSp = k(θ − q).

With this trick the torque acting on the motor shaft can be expressed by the following equation:

τm= J · ¨θ + k(θ − q) (29)

J is the inertia of the system and ¨θ is the acceleration of this mass. θ − q is replaced by τ in the further derivation. Combining (29) with (10) and differentiating the result, leads to:

dIa

dt = J kM

...θ + 1

kM ˙τ (30)

Together with the equation 8 the following formula which describes the behavior of the system is obtained.

LaB kM

...θ +RaB

kM θ + k¨ Mθ +˙ La

kM ˙τ + Ra

kMτ = Ua (31)

Looking at this equation it can be recognized that the controller would require to know the terms kLa

M ˙τ and kRa

Mτ to compensate its influence and to eliminate steady state control errors.

The rest of the equation 31 has an integrating behavior. To control this, a differentiating part is needed in the control loop. Together with a term for the control error the position controller

Ua= La

kM ˙τRa

kMτ − KDΘ − K˙ P(θ − θd) (32) was designed, where KP and KD are the control parameters and θd is the desired position.

(35)

4 Development of the electronics

4.1 Requirements concerning the electronics

A servo motor for model making normally has an electronic for the position control on board.

This electronic is usually controlled by applying a special PWM signal to steer the motor in a range from −180 to +180. For the usage in robots, this system is insufficient due to the first point on the list of all requirements:

ˆ Commanding the position with a desired rate

ˆ Continuous rotation

ˆ Possibility to connect additional sensors

ˆ Communication interface to a PC

ˆ Usage of additional position sensor on the link

After capturing the requirements, the next step was to find out whether there already is an appropriate commercial solution.

4.2 SuperModified V3.0 for servo motors

The Greek company Zero One Mechatronics sells assembly kits for the modification of model making motors. Their product SuperModified V3.0 was designed to improve stan- dard servo motors. It supports continuous rotation, has a high resolution position sensor

Figure 18: SuperModified V3.0 [48]

and provides several communication interfaces like I2C and RS485. At first view it seemed that we can use this product in total to modify our servo motors. After some tests though it turned out that we are not able to modify the firmware. So the plan using the complete unit was discarded and the idea to build a custom electronics was born. Due to the good basic approaches of the SuperModified V3.0 kit some re-engineering was done on this platform. Figure 18 shows the complete unit which consists of three parts, plugged together. On top

(36)

of the stack is the board with a position sensor. To reach a position resolution of 32768 ticks per revolution the TLE5012B sensorchip from Infineon was used. It is a 15 bit absolute position encoder working on the principle of giant magneto resistance (GMR). This chip supports several interfaces like PWM, Hall Switch Mode (HSM) and was connected via a synchronous serial communication interface (SSC) to a micro-controller, the board in the middle of the stack. It is a high performance 8-bit ATmega328-PU microcontroller produced by Atmel. With a flash memory of 32 kB, 1 kB EEPROM, 2 kB SRAM, 32 general purpose working registers and running with a frequency of up to 20 MHz, it is also powerful enough for the required tasks.

With its 23 general purpose I/O lines and six 10-bit A/D converter, it provides enough ports for additional parts like the H-bridge. For communication a SPI, an I2C and a serial UART port are available on the chip. The last part of the stack is an H-bridge which goes by the name 34931, manufactured by Freescale Semiconductor. The task of such an H-bridge is to power the motor with a suitable voltage. This chip needs only a few external components for operations and can drive the motor with currents of up to 5 A peak. It comes with an integrated overcurrent limiter and an output short-circuit protection. Due to the gained knowledge from the research on this commercial product the development of our custom electronics solution began [48][49][51][52].

4.3 Electronics development on the basis of an ATmega328

After the re-engineering, the first approach was to rebuild the system on a breadboard with the components of the commercial product. The main component is the micro-controller. Due to the experience concerning the limited resources on the HerkuleX DRS-0201 digital servo motor the ATmega328-PU being equipped with four times more flash memory and the double of SRAM seemed to be a good solution. This type of chip also is the core of the Arduino Uno and Arduino Nano boards, which are popular and widely used. Another point in favour of this chip is that it comes from the same family as the ATmega8 and so the developed firmware code should be reusable. Also the H-bridge seemed feasible for the selected servo motor because it supports a wide range of output voltage from 5 V up to 36 V. Also the peak current of 5 A should be enough for the operation of the motor. The TLE5012B would have been our first choice for the position determination, but other than the H-bridge and the micro-controller this chip was not available at the main electronics distributors. Therefore another sensor had to be found. The requirements concerning such a sensor has to meet are a high resolution and a high

(37)

frequency at reading the values. The AS5048A from AMS is a 14-bit rotary position encoder for absolute position measurements. It is available in two versions: one with a I2C and one with a SPI interface. Although its resolution is only half as high ascompared to the TLE5012B sensor could have offered it is still sufficient for a precise determination of the position. Another advantage is that this chip is also available on a breadboard for experimental purposes. To measure the position of the link, such a breadboard can be used without the need to design a new board. In a first approach, a circuit with these components was developed based on the circuits for an Arduino Uno and the SuperModified V3.0 boards. In a first step, all components were plugged together on a breadboard and the basic functions like reading sensor values or driving the motor were tested. In a second step the circuit was realized on a veroboard, therefore all components were soldered on it and connected via wire jumpers. The finished board for two motors is displayed in figure 19 and the main components are easy to identify.

1. Power supply connector

2. ATmega328-PU microcontroller 3. H-bridge FS34931

4. LEDs for optical feedback 5. AS5048A position sensors

6. Connection to the motor terminals

Figure 19: Prototype board The modified firmware for the HerkuleX DRS-0201 did

not compile properly for the new micro-controller due to

different register names. Fixing the names of the register according to the data sheet solved that problem. The board was connected to an Arduino Micro board which was again connected to the PC. The control loops were synced with the incoming messages which require a communication speed of 0.667 Mbit/s over the serial bus. This already turned out to be a problem with the HerkuleX servo. The idea of separating the control loop speed from the communication speed could not solve the problem. The communication needs to be at around 1 kHz to make sure that the overlying controller for walking and jumping achieves the desired control bandwidth. The usage of the Arduino Micro board as a communication relay which connects a Real Time PC to the servo motor is a grown solution. This was necessary for the connection of several HerkuleX

(38)

DRS-0201 motors but now one can come up with alternative solutions for the new system.

The disadvantage would be that the communication part in the firmware is outdated and has to be developed from scratch. But due to continuing communication problems it was decided to think about new ways of communication. The Arduino Micro board, which was used as a communication relay, is equipped with an ATmega32u4. This microcontroller has almost the same specifications as the ATmega328 but has a USB 2.0 full-speed device module integrated.

Now the idea was to use an ATmega32u4 instead of an ATmega328 [50][51][53][52].

4.4 Electronics development on the basis of an ATmega32u4

4.4.1 Short introduction to USB

Due to problems with the custom serial communication, the ATmega32u4 processor has been considered which consists of an USB module. USB is an acronym for “Universial Serial Bus”

and its design is standardized in the USB specifications [54]. It was and is developed by the USB Implementers Forum, a group of companies which includes Apple, IBM, Intel, Microsoft, NEC and Hewlett-Packard among others.

The idea of USB was to develop an industrial standard to standardize the connection between peripheral devices and a computer. The first version, USB 1.0, was released on 15th January 1996. There are five different data transfer modes defined right now, which are listed in table 2.

Low Speed 1.5 Mbit/s Full Speed 12 Mbit/s High Speed 480 Mbit/s Super Speed 5 Gbit/s Super Speed + 10 Gbit/s

Table 2: Different USB data transfer modes

USB is a host controlled bus.There can only be one host controller per bus. An exception is the on the go (OTG) which is a point to point connection between two devices without a controller. There are three different types of devices. Host controllers which are responsible for the management of the bus, hubs which provide additional ports, and terminals like mice, keyboards or cell phones. The physical connections between these devices and the host are based on a tired star technology. This means all devices are connected to the host. A maximum of 127 terminals can be connected to a host controller or a hub. USB supports uni- and bidirectional

(39)

communication between a host and a device. Each connection between the host and an endpoint on a device is called pipe which is a logical connection on software level. An endpoint is a hardware buffer on the USB device which can receive or send data. Every USB device has at least one control endpoint with the address 0. It can also have several data endpoints for the transmission of data. For the communication between host and devices, the following four transfer types are specified in the USB specifications.

ˆ Control transfer

ˆ Interrupt transfer

ˆ Isochronous transfer

ˆ Bulk transfer

The control transfer is a special kind of transfer and can only be performed on a control endpoint, which can perform both operations, reading and writing. Every device has at least one control endpoint. This endpoint provides access to configuration, control and status reports.

Therefore, a control transfer is used for the initialization and configuration of new devices and for status reports. Control transfer enables a bursty, non-periodical communication and provides a robust transfer with error detection, recovery and retransmission on hardware level. The packet size is depends on the type of the device. For low-speed devices it is 8 bytes. For full-speed devices are given a choice between 8, 16, 32 or 64 bytes and for high-speed devices only a packet size of 64 bytes is available.

The interrupt transfer is used for the transmission of small amount of non periodic data and is not limited to a specific speed device. The interrupt pipe which is used for this kind of communication is non-periodical and unidirectional from the device to the host. It supports a guaranteed latency with error detection and retransmission in the next period. During the initialization of such a connection, the device tells the host the desired latency. This can be between 1 ms and 255 ms for low- and full-speed and between 125 µs and 4096 ms for high- speed devices. After the initialization, the device queues its interrupt data until the host polls the device for data. The maximum packet size differs depending on the type of the devices.

The maximum size for low speed devices is 8, for full-speed devices 64 bytes and for high-speed devices 1 kilobyte. An example for a device using the interrupt transfer is a USB mouse.

(40)

The isochronous transfer is the third type and is only available on full- and high-speed devices. It is mainly for the streaming of audio and video data. The information is transferred continuously and periodically. The bandwidth is guaranteed and the latency is bounded. There also is an error detection based on cyclic redundancy check (CRC). Faulty data packets are not resent but discarded. So there is no guarantee of delivery. The stream pipes are unidirectional, necessitating two pipes for bi-directional communication. The maximum packet size is 1023 bytes for full-speed devices and 1024 bytes for high-speed devices. Minimizing the payload is recommended as it effects the bandwidth. It can happen that the host is not able to provide the required bandwidth due to other transmissions. Therefore, a fallback solution should be implemented.

The last transfer type is bulk transfer and is used for the transmission of large amounts of bursty non-time sensitive data. Typical use cases are printers and scanners. Free bandwidth on the bus is used for the transfer. This kind of transfer mode is only available on full- and high- speed devices. Error detection based on CRC with retransmission is provided but there is no bounded latency. As the isochronous and interrupt pipes, the bulk pipes are also unidirectional.

The maximum packet size differs for the two types of devices. The packet size for full-speed devices can be 8, 16, 32 and 64 bytes and 512 bytes for high-speed devices [55][56].

4.4.2 USB for real time communication

After this short overview, the question, whether a communication via USB is feasible for the servo motor has to be answered. On the HerkuleX DRS-0201 servo motor the communi- cation was done in real time via a serial connection. The problems of this solution have been already mentioned. An ATmega32u4 is compatible with the USB 2.0 standard and provides six programmable endpoints with bulk, interrupt or isochronous transfer. It supports data transfer rates up to 12 Mbit/s. Compared to the data rate of 0.667 Mbit/s this is an increase by the factor 18. This is appropriate for the present application and should also be more than enough for future developments. It has to be made sure that the data of the overlying controller for walking and jumping, running on a Linux system with real time patch, is arriving at the right time. Therefore the data communication should be in real time. The USB protocol is not de- signed for hard real time application. This means the response time is not fully deterministic.

The choice of the transfer mode is important for the timing behavior of the transmission. Only

(41)

the isochronous and the interrupt transfer are applicable for this task. The size of the transmit- ted packages would be higher than 64 bytes and so the isochronous transfer is the only feasible transfer mode. The retransmission of faulty packets would also lead to an undesired jitter at interrupt transfers. The isochronous transfer does no retransmission hence providing a constant latency at all time. This should be good enough for soft real time applications for which the data has to arrive within a defined time window. The University of Twente did a research on the ”Adequacy of the Universal Serial Bus for real time systems” [57] and concluded that USB is only feasible for soft real time application. The jitter varies but should be improved using a real time Linux instead of a Windows OS. In the case of the servo motor, the jitter of latency should be kept as small as possible. The usage of a Linux with RT patch should be a possible solution.

On the basis of this considerations, the decision was made to use the ATmega32u4 with USB as communication link.

4.4.3 Main components

The final concept consists of the following main parts:

ˆ Micro-controller ATmega32u4

ˆ Position-sensor AS5048A

ˆ H-bridge FS34931

The position sensor and the H-bridge were already used in the former prototype. These both components were approved as reliable and feasible. A short description of the new micro- controller and of the functioning of the other parts is given in the following sections.

4.4.4 ATmega32u4

The ATmega32u4 is a product of the Atmel Corporation, a US company. It is an 8-bit micro-controller with 32 kB flash memory, 2.5 kB internal SRAM and 1 kB EEPROM memory.

Additionally it has 32 general purpose working registers and can be programmed in system by an on-chip boot program. As already mentioned a full USB 2.0 compatible device module is on the chip. The micro-controller provides one 8-bit timer and two 16-bit timers. These will be used for the PWM signal and the timing of the control loop. Additionally one 10-bit high speed

(42)

timer is available. The chip can measure analog voltages with its 12-channels 10-bit ADCs and has SPI, I2C and UART interfaces on board. The micro-controller can be powered with 2.7 to up to 5.5 V. Due to its usage on the Arduino Micro board, a big community and a lot of support is available [50].

4.4.5 Functioning of the AS5048A

The position sensor AS5048A works on the principle of the hall effect. The main part of the sensor consists of an array of thin semiconductors which are driven by a current. Applying a vertical magnetic field leads to a voltage on the terminals. This voltage is proportional to the magnetic field strength and the applied current. Figure 20(a) illustrates this principle.

For the usage as a position sensor, additional components are necessary which can be seen in figure 20(b). The block diagram consists of an ADC for the measurement of the voltage, a digital signal processor (DSP) for the analysis of the measured data and some control logic and interface components to provide the data for a micro-controller. The hall array integrated in the AS5048A chip is made out of four hall elements. To get precise position data, a diametrical magnet is necessary [58].

(a) Sketch of an Hall element [59] (b) Block diagram of AS5048A [53]

Figure 20: Hall effect element and sketch of position sensor

4.4.6 Functioning of the H-bridge 34931

It normally is not possible to drive a motor directly on the output pins of a micro-controller.

An H-bridge like the 34931 from Freescale Semiconductor has to be used for that. The name is derived from the typical appearance of the electronic circuit for the amplification of signals. Such a circuit consists of four semiconducting switches, like transistors or metal-oxide-semiconductor field-effect transistors (MOSFET) which are arranged and connected in the shape of an “H”.

References

Related documents

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

För att uppskatta den totala effekten av reformerna måste dock hänsyn tas till såväl samt- liga priseffekter som sammansättningseffekter, till följd av ökad försäljningsandel

Från den teoretiska modellen vet vi att när det finns två budgivare på marknaden, och marknadsandelen för månadens vara ökar, så leder detta till lägre

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i