• No results found

Design and construction of control system for a ball-shaped robot

N/A
N/A
Protected

Academic year: 2021

Share "Design and construction of control system for a ball-shaped robot"

Copied!
94
0
0

Loading.... (view fulltext now)

Full text

(1)

M A S T E R ' S T H E S I S

Design and construction of control system for a ball-shaped robot

Shi Yifei

Luleå University of Technology Master Thesis, Continuation Courses

Space Science and Technology Department of Space Science, Kiruna

2010:067 - ISSN: 1653-0187 - ISRN: LTU-PB-EX--10/067--SE

(2)

Acknowledgements

First of all, I would like to sincerely thank Professor Aarne Halme, Automation and Systems Technology Department, Aalto University, Finland, for giving me this opportunity to undertake this thesis, to survey and study the field of spher- ical robots as well as giving me valuable comments on my work. Also, I wish to acknowledge Professor Kalevi Hyypp¨ a Department of Computer Science and Electrical Engineering, Lule˚ a University of Technology, Sweden, for his guidance and constructive comments given at every important milestone of this research.

I am particularly grateful to my instructor Mr.Tomi Ylikorpi, Automation and Systems Technology Department, Aalto University, for guiding me to the com- pletion of my thesis and taking care of every single aspect throughout the project, including procurement, paper work, designing the mechanical part of the robot, as well as managing the SpaceMaster Programme as a whole.

Besides, I would also like to thank Mr. Tapio Lepp¨ anen, Sami Kielosto, Marek Matusiak, Hu Zhongliang, Automation and Systems Technology Department, Aalto University, for giving me suggestions and supporting my thesis and re- search.

Finally, I would like to extend my heartfelt gratitude to my student colleagues for their understanding, assistance, and encouragement: Mr.Asad Moin, Mr.Mikael Person, Mr.Richard Paisley, Mr.Tuomas Haarnoja, and Miss.He Yanning.

Espoo, August 14, 2010 Shi Yifei

ii

(3)

Author: Yifei Shi

Title of the thesis: Design and construction of control system for a ball-shaped robot

Date: August 14, 2010 Number of pages: 72

Faculty: Faculty of Electronics, Communications and Automation Department: Automation and System Technology

Programme: Master’s Degree Programme in Space Science and Technology Professorship: Automation Technology (Aut-84)

Supervisors: Professor Aarne Halme (Aalto) Professor Kalevi Hyypp¨ a (LTU) Instructor: Tomi Ylikorpi

The aim of this thesis work is to design and construct a control system for a ball- shaped robot, the Thistle, to meet the defined functional requirements. The control system, which includes two parts: hardware and software realizes the planned archi- tecture and performs required tasks.

In the hardware part, two DC motors are applied as actuators. Additionally, various sensors including encoders, accelerometers, gyros which are used to detect the attitude of the robot and inner status of the robot are investigated carefully. One on board computer (Gumstix Overo Fire) is used as a controller to integrate the functions of actuators and sensors. Then wireless communication between operator and robot is established in order to send some simple test commands to the on board computer by WLAN to prove that every part could work and well coordinate with each other.

In addition to this electronics work, mechanical work is also involved. Considering the frangibility of the on board computer, accuracy of the measurement from the sensors and the robustness of the whole system, the method to install components on the robot should be taken into account. In the software part, the development environment for cross complying is built based on OpenEmbedded. In robot, a simple embedded system based on the Gumstix COM is developed under Linux. As the controller of the robot, this on board computer is responsible for receiving data from sensors, send command to actuators and also communicate with the operator through WLAN.

Keywords: ball-shaped robot, control system

iii

(4)

Contents

1 Introduction 1

2 Literature Review 3

2.1 Rolling Minirobot . . . . 3

2.1.1 Hardware Structure Overview . . . . 4

2.1.2 Siemens C167 Micro-controller . . . . 4

2.1.3 Radio Module . . . . 5

2.1.4 Gyroscope . . . . 5

2.1.5 Inclinometer . . . . 6

2.1.6 Motor . . . . 6

2.1.7 Additional Circuit . . . . 7

2.1.8 Software overview . . . . 8

2.1.9 Communication Protocol . . . . 8

2.1.10 Software On the Robot Side . . . . 8

2.1.11 Software On the Computer Side . . . . 10

2.2 Tumbleweed rover . . . . 10

2.2.1 System Architecture . . . . 12

2.2.2 Rover System Overview . . . . 12

2.2.3 Power System Design . . . . 14

2.2.4 Batteries and Battery Packs . . . . 15

2.2.5 Ground Station Software Development . . . . 15

2.3 Other type of ball-shaped robots . . . . 16

2.3.1 Spherical micro robots for Mars exploration . . . . 17

2.3.2 Spherical Mobile Investigator for Planetary Surface (SMIPS) 17 2.3.3 Spherical Security Guard . . . . 18

3 System Overview 20 3.1 Development Background . . . . 20

3.2 System Architecture of the Thistle . . . . 21

iv

(5)

4 Prototype Robot Hardware Design 24

4.1 Hardware Structure of the Thistle . . . . 24

4.2 Gumstix Overo-Fire on board computer . . . . 24

4.3 Motor Driving . . . . 26

4.3.1 DC Motor . . . . 26

4.3.2 H-Bridge . . . . 27

4.4 Encoder and Quadrature Decoder . . . . 28

4.4.1 Encoder . . . . 28

4.4.2 Decoding Circuit . . . . 30

4.5 Communication . . . . 31

4.6 Tri-axial Accelerometer . . . . 32

4.6.1 Function description of SCA3000-D01 . . . . 32

4.6.2 Tilt angle measurement . . . . 33

4.7 Gyroscopes . . . . 34

4.8 Power Distribution . . . . 35

5 Prototype Robot Software Design 38 5.1 Software Structure of the Thistle . . . . 38

5.1.1 Software Structure . . . . 38

5.1.2 Development Process . . . . 39

5.2 WiFi Communication . . . . 40

5.3 Motor Driving . . . . 44

5.3.1 DC Motor Model . . . . 44

5.3.2 Current Controller Model . . . . 46

5.3.3 Speed Controller Model . . . . 50

5.3.4 PWM generating . . . . 53

5.4 Encoder Reading . . . . 56

5.4.1 I2C bus and I/O Expander . . . . 56

5.4.2 Rotation Velocity Calculation . . . . 57

6 Simulation and Testing 59 6.1 Motor Controller Simulation . . . . 59

6.1.1 Torque Control Simulation . . . . 59

6.1.2 Speed Control Simulation . . . . 62

6.2 PWM generating test . . . . 65

v

(6)

7 Summary and Conclusions 70 7.1 Future Work . . . . 70

References 72

A Gumstix COM Description I

B Circuit Design VI

vi

(7)

2.1 Interrupt priorities (Spitzmueller, 1998) . . . . 10

4.1 Main parameters of motors . . . . 27

4.2 Main parameters of gear boxes . . . . 27

4.3 Rotation state diagram . . . . 29 A.1 Gumstix Overo COMs - Feature Overview . . . . II A.2 Gumstix Overo COMs - Feature Overview . . . . III A.3 Gumstix Overo COMs - Feature Overview . . . . IV A.4 Pinouts for the 40-pin header . . . . V B.1 the circuit for encoder reading and PWM generating . . . VIII B.2 the PCB for encoder reading and PWM generating . . . . IX

vii

(8)

List of Figures

1.1 Photograph of a mobile robot (Winkvist, 2008) . . . . 1

1.2 Photograph of a ball shaped robot (Cavale, 2009) . . . . 2

2.1 The ball-shaped robot rollo . . . . 3

2.2 System diagram (Spitzmueller, 1998) . . . . 5

2.3 Interface circuitry between radio-module and mini-module (Spitz- mueller, 1998) . . . . 6

2.4 Power supply for micro controller, Gyroscope and Inclinosensor (Spitzmueller, 1998) . . . . 7

2.5 Interface computer-radiomodule (Spitzmueller, 1998) . . . . 7

2.6 Diagram flow of the robot program (Spitzmueller, 1998) . . . . 9

2.7 Program flow for off-line protocol (Spitzmueller, 1998) . . . . 11

2.8 Program flow for online protocol (Spitzmueller, 1998) . . . . 11

2.9 The Tumbleweed system architecture (Matthews, 2003) . . . . . 13

2.10 Exploded view of the Tumbleweed system (Matthews, 2003) . . 13

2.11 Tumbleweed power conditioning system schematic (Matthews, 2003) . . . . 14

2.12 (1) Small Ni-MH Pack (2) Large Ni-MH pack (3) Small Lithium Pack (4) Large Lithium Pack (Matthews, 2003) . . . . 15

2.13 Main screen of the ground station software (Matthews, 2003) . 16 2.14 the micro-robots packed into a capsule would land on the surface of a planet . . . . 17

2.15 SMIPS conceptual robot design. Image is courtesy of Per Sa- muellson (Bruhn et al., 2003) . . . . 18

2.16 The rolling robot carves a path through fresh snow (Knight, 2005) 19 3.1 The Thistle . . . . 21

3.2 System architecture . . . . 22

3.3 Mode choose . . . . 22

3.4 Work mode . . . . 23

viii

(9)

4.1 Hardware structure of prototype design (Ylikorpi, 2005) . . . . 25

4.2 Gumstix Overo Fire COM encapsulated in a plastic box . . . . 25

4.3 two DC motors with encoders installed . . . . 26

4.4 H-bridge . . . . 28

4.5 The structure of optical incremental encoder . . . . 29

4.6 Data from channel A and channel B . . . . 29

4.7 Working flow of encoder reading . . . . 30

4.8 The connection between encoder and line receiver . . . . 30

4.9 VTI SCA3000-D01 accelerometer . . . . 32

4.10 Block diagram of accelerometer . . . . 32

4.11 One axis tilt angle measurement . . . . 33

4.12 Tilt angle form a tri-axis accelerometer . . . . 34

4.13 Illustration on how to install accelerometer on robot . . . . 35

4.14 ADIS16100 . . . . 36

4.15 Function block diagram . . . . 36

5.1 Software structure . . . . 39

5.2 Equivalent circuit for the dc motor . . . . 44

5.3 Block diagram of DC motor dynamic . . . . 45

5.4 Simulink model for DC motor . . . . 46

5.5 Block diagram of the electrical dynamics . . . . 46

5.6 Closed loop block diagram . . . . 47

5.7 Two degrees of freedom current controller (CC) using “active resistance” and “back calculation” . . . . 47

5.8 Simulation model of current controller . . . . 50

5.9 Block diagram of the mechanical equation . . . . 51

5.10 Block diagram of the electrical dynamics with speed controller . 51 5.11 Two degrees of freedom speed controller (SC) using “active resis- tance” and “back calculation” . . . . 51

5.12 Simulink model of speed controller . . . . 52

5.13 Simulation model of motor driving . . . . 53

5.14 Current waveform in worst case . . . . 54

5.15 Functional relationship between and allowable ripple and switc- hing frequency . . . . 55

ix

(10)

5.16 Timing diagram . . . . 55

5.17 Timing diagram of PWM . . . . 56

5.18 I2C control byte format . . . . 57

5.19 calculation procedure of rotation velocity . . . . 58

6.1 Simulink model of current controller for testing torque control . 59 6.2 The desired output torque . . . . 60

6.3 The actual output torque . . . . 60

6.4 The motor velocity . . . . 61

6.5 Simulink model of DC motor . . . . 61

6.6 Simulink model of speed controller . . . . 62

6.7 Target velocity(the unit of horizontal axis is s and the unit of vertical axis is rpm) . . . . 62

6.8 Varying payload torque(the unit of horizontal axis is s and the unit of vertical axis is mN m) . . . . 63

6.9 Motor velocity . . . . 63

6.10 Electrical torque . . . . 63

6.11 The armature current(the unit of horizontal axis is s and the unit of vertical axis is mA) . . . . 64

6.12 The main part of the code for PWM generating . . . . 65

6.13 The code running result on terminal . . . . 66

6.14 The code running result on terminal . . . . 67

6.15 Pwm signal with duty cycle 30% . . . . 67

6.16 Pwm signal with duty cycle 50% . . . . 68

6.17 Pwm signal after buffer . . . . 69 B.1 the circuit of H-bridge . . . VII

x

(11)

5.1 Searching visible wireless network . . . . 40

5.2 Code for unencypted network . . . . 40

5.3 Code for WEP encryption . . . . 41

5.4 Code for WPA encryption . . . . 41

5.5 Code for WPA encryption . . . . 41

5.6 Edit wlan0 configuration . . . . 42

5.7 Enable wlan0 . . . . 42

5.8 Set up DHCP server . . . . 43

5.9 Set up DHCP server . . . . 43

5.10 Create the leases file and run the dhcp server . . . . 43

xi

(12)

Symbols and Abbreviations

IDU Inside Driving Unit

JPL Jet Propulsion Laboratory (NASA Research Center in California, USA) PID Proportional-Integral-Derivative

ADC Analog / Digital Covert NiMH Nickel-Metal Hydride PWM Pulse Width Modulation

GPIO Gerneral Purpoes Input Output AC Alternating current

DC Direct current

COM Computer on Module I/O In / Out

CV Capacitance to voltage

OE Open embedded

ARM Advanced RISC Machine CC Current controller

SC Speed controller A

x

Acceleration on x axis A

y

Acceleration on y axis A

z

Acceleration on z axis

~

g Earth gravity vector

α Pitch angle

β Roll angle

γ Jaw angle

J Rotor moment of inertia τ

e

Electrical torque

τ

l

Payload torque L Terminal inductance i Armature current

xii

(13)

E Back emf

ψ Flux linkage

ω

r

Rotation velocity

xiii

(14)

Chapter 1

Introduction

Mobile robot is a machine which has capability to move around in environment and is not fixed to one physical location. The first mobile robots, V1 and V2 rockets, emerged during Second World War as a result of technical advances on a number of relatively new research fields like computer science and mechani- cal engineering . At present, mobile robots have become the focus of current research and almost every major university has one or more labs that concen- trate on mobile robotic research. Mobile robots are also found in industry, military and security environment. They also appear as consumer products, for entertainment or to perform certain tasks like vacuum cleaning.

Figure 1.1: Photograph of a mobile robot (Winkvist, 2008)

(15)

Among diverse types of mobile robots, ball-shaped robot has dramatically at- tracted research interest of scientists and engineers. The ball-shaped robot is a mobile robot based on a ball structure and the locomotion and motion control systems are fully constructed inside a ball. Compared to other types of mobile robots, ball-shaped robots are believed to have several advantages, such as they can be made easily liquid and gas proof with durable mechanical cover, they could recover easily from collisions and hardly turn over or fall down.

Figure 1.2: Photograph of a ball shaped robot (Cavale, 2009)

Until now, considerable research has been conducted on the whole system ar-

chitectures. Therefore, several typical architectures and their applications are

introduced. The emphasis of this thesis is to build control system for a ball-

shaped robot,the Thistle, including both hardware and software parts. Besides,

the simulation and tests are also described.

(16)

Chapter 2

Literature Review

This chapter discusses some recent works of ball-shaped robot in control archi- tecture, including both hardware and software.

2.1 Rolling Minirobot

The ball-shaped robot “Rollo”, developed at Automation Technology Labora- tory, Aalto University, is a mobile robot based on a ball structure. It can move with two degrees of freedom which means it is able to steer the rolling direction and move backward and forward with the aid of inside driving unit (IDU). Fig- ure 2.1 shows the white ball shell and the IDU metal frame construction in it.

When the lower wheels turn ,the IDU tilts, shifting the gravitational center of the ball to make it move.

Figure 2.1: The ball-shaped robot rollo

(17)

Simon Spitzmueller finished his diploma thesis on building a control system for Rollo based on micro-controller. A Siemens 80C167 micro-controller, a gyro- scope and a inclinometer have been installed on a PCB board, which enables reception of various commands from a computer terminal via radio connection.

Additionally, the performance of the robot was tested and the results were mea- sured.

2.1.1 Hardware Structure Overview

The control system of Rollo is summarized in Figure 2.2. The computer trans- mits the commands to the robot and receives the data from the robot via a radio link. There are three feedback control system on the robot. The first one is a motor speed control loop with feedback from the encoders. The second one is the control loop which is used to determine the heading of IDU by gyroscope.

The last one is to eliminate the robots wobbling movements when it accelerates or stops, using inclinometer (Spitzmueller, 1998). The functionality of rollo control system is same as that of the Thistle, which is used to maintain the attitude of the ball-shaped robot under various terrain.

The Thistle is designed and constructed in a similar architecture. It is also a closed control loop based on a micro controller. The differences is that the Thistle uses more advanced micro controller and more accurate sensors. Also, the Thistle uses WiFi as wireless communication which has higher data transmit speed and larger communication range.

2.1.2 Siemens C167 Micro-controller

The Siemens C167 micro-controller is used to control the robot. It is imple-

mented through ready-made mother board, Phytec’s Minimodule 167, which is

a compact device that combines the C167 micro-controller, 128kB RAM, 128kB

Flash ROM, a UART and an integral real time clock on one board. The micro-

controller is equipped with 9 ports, timer units, an asynchronous/synchronous

serial interface, 4 pulse width modulation outputs and a 16-channel AD con-

verter. The power consumption is around 1.5W, which is about 300mA at 5V.

(18)

2.1 Rolling Minirobot 5

Figure 2.2: System diagram (Spitzmueller, 1998)

Compared to the Gumstix COM used by the Thistle, Siemens C167 is more simple and easier to use although the overall performance is lower.

2.1.3 Radio Module

Radiometrix BiM Low Power UHF Data Transciever Module is used for com- munication between the computer and the robot. It offers half duplex data transmission at speeds up to 40k/s over distance of 120m on open ground. The radio module is capable of transmitting ASCII characters directly and can be accessed through a RS232 interface. The baud rate is 9600 and the transmit frequency is 433Mhz.

2.1.4 Gyroscope

A gyroscope is a device for measuring or maintaining orientation, based on the principles of conservation of angular momentum.There are two basic classes:

1) rate gyroscope, which provides a voltage or frequency output signal propor-

(19)

Figure 2.3: Interface circuitry between radio-module and mini-module (Spitz- mueller, 1998)

tional to the turning rate (angular velocity) and 2) rate integrating gyros, which indicate the turn angle absolutely.

2.1.5 Inclinometer

An inclinometer or clinometer is an instrument for measuring angles of slope (or tilt), elevation or inclination of an object with respect to gravity. It measures both inclines (positive slopes, as seen by an observer looking upwards) and declines (negative slopes, as seen by an observer looking downward).

The sensor applied in this robot is Seika N4, using an electrically conducting fluid and two pairs of electrodes on the bottom of the fluid-chamber to mea- sure the angle. When the sensor is tilted, the fluid level rises above the one electrode pair while going down above the other. Less conducting fluid means more electrical resistance. This difference in resistance can then be measured (Spitzmueller, 1998).

2.1.6 Motor

The two motors are controlled through classical H-bridge by two signals: a

pulse-width-modulated signal (PWM) that controls the speed and a direction

signal.

(20)

2.1 Rolling Minirobot 7

2.1.7 Additional Circuit

Since a 12V Battery is installed on the robot, the DC-DC conversion circuit (shown in Figure 2.4) had to be employed to provide separate power for each component, including micro controller, gyroscope and inclinosensor.

Figure 2.4: Power supply for micro controller, Gyroscope and Inclinosensor (Spitzmueller, 1998)

Besides, another circuit for interfacing between radio module and micro con- troller is also designed. A TTL level conversion chip is needed since the logic level in an RS232 interface is +9v to -9v.

Figure 2.5: Interface computer-radiomodule (Spitzmueller, 1998)

(21)

2.1.8 Software overview

Software part is divided into three sections, protocol and command library, software on the robot side and software on the command station side.

2.1.9 Communication Protocol

Two protocols for communication between the computer and the ball robot is defined for both off-line and online transmit (Spitzmueller, 1998). The off-line protocol sends a precise command, that can be fully executed by the robot.The robot will do as told later and then wait for a new command.It is simple and useful when radio connection can not be guaranteed.In the online protocol, the robot is commanded as long as it is idle, which is suitable for controlling the robot through joystick. However, the online protocol is more complicated and relies on a stable radio connection. The design idea of two communication protocols is also applicable for the Thistle. Since the Thistle is also required to send data to the ground station, the design of online and off line protocols can utilize the network more efficient.

2.1.10 Software On the Robot Side

A general diagram flow of the program which is executed on the robot is shown in Figure 2.6

In the main loop there are two similar branches representing the two proto- cols. If the off-line protocol is in use, firstly the program will wait until a new command has been received. Then it checks the validity of this command and sends the corresponding feedback message. If the instruction is accepted, it is executed until the end and the program returns to the start. In case of the online-protocol, there is always a command under execution and whether it is still within time-out limits must be checked first. If no new command is received for a defined amount of time, the robot will be shut down.

Besides, the table 2.1 in following lists the priorities of all interrupts for further

programming. What should be noticed is that the command reception has

(22)

2.1 Rolling Minirobot 9

Figure 2.6: Diagram flow of the robot program (Spitzmueller, 1998)

(23)

higher priority than sending message. Other interrupt priorities are not very critical and can be changed if necessary.

Table 2.1: Interrupt priorities (Spitzmueller, 1998)

2.1.11 Software On the Computer Side

The GUI is programmed using Visual C++ by Simon Spitzmueller as front end for the control of the robot. Two protocols have been implemented as follows.

The program flow diagram for off-line protocol is shown in Figure 2.7. In a up to down way, the user is required to give a command. Then the computer takes the command and send it to robot after the conversion to a character string.

Afterwards, the computer records the status of robot as soon as the message is received and program execution returns to the beginning.

The program flow for online protocol is more complicated. After the initial

“switch protocol command”, the user can enter a list of instructions to be exe- cuted one after another and the execution starts with the first command in the list. The robot will send an answer immediately when instruction is received correctly; if not, the command will be sent again after a certain time. After received command is confirmed and executed, the robot will determine if this is the last command or go to the next command.

2.2 Tumbleweed rover

Tumbleweed is a large, wind-blown, inflated ball, which carries a set of scientific

instruments payload inside. It could be used to make long range, autonomous,

(24)

2.2 Tumbleweed rover 11

Figure 2.7: Program flow for off-line protocol (Spitzmueller, 1998)

Figure 2.8: Program flow for online protocol (Spitzmueller, 1998)

(25)

unmanned surface scientific survey and other activities under various environ- ment conditions(shown in Figure 2.10).

Mars might not be the only place where a rover like Tumbleweed is of use.

The current round of development for Tumbleweed is focused on an Antarctic deployment in the 2004 field season (Matthews, 2003).The data that can be collected by Tumbleweed in the Antarctic environment includes:

• Temperature

• Ice thickness via subsurface radar

• Topographic data via GPS

• Ground UV intensities (ozone depletion)

• Subsurface meteorite detection (via magnetometer)

The data is transmitted to ground station via the Iridium satellite.

2.2.1 System Architecture

The Tumbleweed system architecture is described in Figure 2.9. After acquiring temperature, pressure and position information, tumbleweed transmits its data to the Iridium satellite network. Then the ground station receives, parses, saves the incoming data. The main ground station also runs a web server, which will ensure the live incoming data is available in internet.

2.2.2 Rover System Overview

The configuration of the Tumbleweed rover is shown in Figure 2.10. The rover is

covered by Nylon bags with rubber studs outside. Inside the body, a lexan tube

acts as the main shaft, in which a set of electronics devices are housed, including

a motherboard, a liquid crystal display (LDC), a 900MHz serial transmitter,

an Iridium modem with integrated GPS receiver, an omni-directional Iridium

(26)

2.2 Tumbleweed rover 13

Figure 2.9: The Tumbleweed system architecture (Matthews, 2003)

antenna, an active GPS antenna, a lithium battery pack, a pulse modulated voltage regulator board, a darling transistor board, and an air pump.

The motherboard consists numerous electronic components, including two pres- sure transduces, a thermocouple, three 2-axis accelerometers and a real time clock, which are served to control the Tumbleweed

Figure 2.10: Exploded view of the Tumbleweed system (Matthews, 2003)

The heart of the Tumbleweed is the Basic Stamp micro controller. The micro

controller is equipped with 15 I/O pins which are used to communicate with

the various components and instruments. The micro controller takes sensor

data and system status information every second and stores it in 512K Flash

EEPROM memory. Every fifteen minutes, the microcontroller attempts to make

(27)

a connection with Iriduium network and send stored data.

What makes the Tumbleweed unique is the Iridium modem with an integrated GPS receiver. The Iridium modem allows communication from anywhere on the planet.

The system structure of the Tumbleweed is similar to the Thistle but more advanced. The Tumbleweed system is equipped with more than one ground station to perform 24h monitoring and synchronize the data between robot and internet. In addition, the GPS module on the Tumbleweed is applicable on the Thistle. With the aid of GPS module, the ground station is able to follow the track of the Thistle.

2.2.3 Power System Design

The main difficulty of power system design is that there are six different power consuming systems on Tumbleweed, each requiring a unique power condition.

The schematic of solution is presented in Figure 2.11. A pulse modulated voltage regulator is used to knock any voltage from 6v to 16v down to 5v to handle various power sources. This regulator pulses the input voltage to achieve an average of 5 volts output rather than wasting energy as heart, which improve power efficiency greatly.

Figure 2.11: Tumbleweed power conditioning system schematic (Matthews,

2003)

(28)

2.2 Tumbleweed rover 15

2.2.4 Batteries and Battery Packs

Since the Tumbleweed will be deployed on Mars, battery choice is closely linked with the expected ambient temperature range. Additionally, the deployment will last from 1 to 10 days with no hope of recovery, the use of long -life bat- teries is necessary. Therefore, the number of batteries must be given careful consideration to find a balance between weight and duration of power sup- ply. Rechargeable and non-rechargeable batteries are found,both of which can meet all of the above requirement. For rechargeable system, D-cell nickel metal hybride(NiMH) batteries were selected. For non-chargeable system, Lithium batteries were choosed, which can operate at more than twice the voltage than NiMH batteries with same physical size. Both types of batteries are built and tested.

Figure 2.12: (1) Small Ni-MH Pack (2) Large Ni-MH pack (3) Small Lithium Pack (4) Large Lithium Pack (Matthews, 2003)

2.2.5 Ground Station Software Development

A user-friendly ground station software was developed (Figure 2.13), which was

written in the LabVIEW (Virtual Instrument Engineering Workbench) devel-

opment environment. The ground station software allows for near real-time

data processing and distribution via the internet. It also accomplishes following

features:

(29)

• Awaits a call from Tumbleweed

• The ground station software receives each data transmission and appends it to a file.

• Once the data has been properly received, it is posted on the main screen of the program.

Figure 2.13: Main screen of the ground station software (Matthews, 2003)

2.3 Other type of ball-shaped robots

Several types of ball-shaped robots are brief introduced in this chapter to give

readers a wider understanding.

(30)

2.3 Other type of ball-shaped robots 17

2.3.1 Spherical micro robots for Mars exploration

The development of mobile robots is also influenced by push from NASA for autonomous planetary rovers. However, since the terrain of Mars was known to be very rocky, the approaches quickly fell into camps. One branch was led by MIT; favored deploying many small robots such as Genghis which could climb over small rocks and go around others. Another representative micro robot that could move by bouncing and rolling was designed by Young (Young, 2006).

Figure 2.14: the micro-robots packed into a capsule would land on the surface of a planet

As it is shown in Figure 2.14, these micro spherical robots could be sent to another planet all together in a capsule like eggs in a carton by a balloon floating above the surface. After they succeed to land on the Mars surface, they could move by rolling and bouncing, powered by artificial muscles that alter their overall shape. In addition, this is a multi-robots system, which means the loss of a few micro robots would not result in the whole system failure. Besides, they could cooperate to achieve certain goal which is complex to one single robot.

2.3.2 Spherical Mobile Investigator for Planetary Sur- face (SMIPS)

A spherical, inflatable micro rover system for Mars has been proposed by a

group of researchers from Uppsala University, Sweden (Bruhn et al., 2003). The

robot (shown in Figure 2.15) aims at using an internal motor and a jumping

(31)

mechanism to increase mobility, and applying micro-electromechanical systems (MEMS) higher lever Multifunctional MicroSystems (MMSs) design solution to increase science return with low cost and low weight. It is especially used for large area mappings and determinations of interesting targets. A pendulum is adopted as locomotion system by displacing the gravity center of the robot.

Besides, distributed internal on-board data system by I2C bus is applied for maneuvering, housekeeping, and communication.

Figure 2.15: SMIPS conceptual robot design. Image is courtesy of Per Samuell- son (Bruhn et al., 2003)

2.3.3 Spherical Security Guard

A spherical rolling robot designed to detect and report intruders, proving rolling security cover, which is developed by a Swedish company Rotundus AB (Knight, 2005). The prototype was first designed and implemented by Angstrom Space Technology Center of Uppsala University in Sweden for planetary exploration.

It is driven by a pendulum suspended on the main shaft of the robot. The

pendulum is controlled by a motor to tilt to certain angle, propelling the robot

moving forward or backward at different velocities.

(32)

2.3 Other type of ball-shaped robots 19

Figure 2.16: The rolling robot carves a path through fresh snow (Knight, 2005)

(33)

System Overview

This chapter discusses the development background of the Thistle and presents the system hardware architecture and software functional block diagram.

3.1 Development Background

The discovery of water on Mars and the attendant possibility of extra-terrestrial life has resurrected interest in the exploration of the Mars. Compared to former tasks, future mission must be able to explore large areas because the regions of scientific interest may be faraway from suitable landing site. The use of auton- omous rovers is obvious since tremendous risks exist within manned missions.

Much of the current research on the design of autonomous planetary rover fo- cuses on wheeled vehicles but does not adequately address the involved diffi- culties. Therefore, a novel design inspired from thistle was proposed, using a ball-shaped robot(shown in Figure 3.1).

Compared to the traditional wheeled Mars rovers, the Thistle has following

advantages. Firstly, it requires no complicated AI guidance for hazard avoidance

and it can operate over scientifically interesting but hazardous terrain due to

ball-shaped robot characteristics mentioned in Chapter 1. Secondly, Thistle

can move in greater range by utilizing wind power while the moving ability of

traditional rover is limited by the battery volume. Thirdly, the cost of Thistle

is relatively lower than wheeled rover.

(34)

3.2 System Architecture of the Thistle 21

Figure 3.1: The Thistle

In the thesis work, the Thistle is a testing module for the real robot to verify the design idea.

3.2 System Architecture of the Thistle

The following Figure 3.2 presents the system architecture of the Thistle.The heart of this system is the micro controller Gumstix COM, which receives robot status data from sensors and sends commands to actuators according to certain algorithm. Besides, it is capable to communicate with ground station through wifi. The lead-acid battery set is used to provide power, while regulators and special circuit are needed to meet different electrical requirement of components.

All the components are investigated carefully and will be introduced in Chapter 4.

3.3 Function Description

The aim of the Thistle is to autonomously perform long-term scientific measure-

ment within a large area with the aid of wind. The basic function is described

in this section. The Thistle will receive command from the ground station after

(35)

Figure 3.2: System architecture

system initialization is done. Then the Thistle will be in appointed mode as shown in Figure 3.3.

Figure 3.3: Mode choose

If it is commanded to be work mode (shown in Figure 3.4), then the Thistle

will set the destination location and moving speed. After that, the Thistle

will adjust the steering angle and move to it. During the driving period, the

sliding mode control is applied and the Gumstix COM will save the robot status

information collected from sensor every one minute. When the Thistle reaches

the destination, it will perform scientific research soon and save data. One timer

will be set in Gumstix COM, it will generate an interrupt every 15 minutes to

communicate with ground station and send stored data. If the data transmit

fails, it will try to communicate again. In case it is still unsuccessful, the Thistle

(36)

3.3 Function Description 23

will save the data and send it in next 15 minutes.

Figure 3.4: Work mode

If it is in drift mode (shown in Figure 3.5), the Thistle will go into power-saving status, waiting for the following command. The Thistle will move by wind and turn off all the sensors except the GPS, through which the ground station can follow the track of the robot.

Figure 3.5: Drift mode

If the command is go into sleep mode (shown in Figure 3.6), the Thistle will turn off the system and wait certain time to restart. Once it wakes up again, it will communicate with ground station and wait for new command.

Figure 3.6: Sleep mode

(37)

Prototype Robot Hardware Design

4.1 Hardware Structure of the Thistle

The aim idea of the Thistle is to develop a new locomotion method on Mars combining wind propulsion and ballast driven. It consists of a central main shaft, radial glass fiber arcs for turbine blades, and a pendulum driven by two motors. The shaft is made of a 32mm diameter glass fiber tube attached with two PVC-disks on both ends. The arcs are made of 18 pieces of 2m long 8mm diameter glass fiber rods and wind sails are sewn of nylon fabric intended for clothing (Ylikorpi, 2005).

4.2 Gumstix Overo-Fire on board computer

Gumstix series are small miniature computer with a Linux 2.6 operating sys-

tem. The word ”gumstix” refers to the mother board of COM(computer on

module) which is similar in size to a stick of gum. The specific model used

in the project is Gumstix Overo Fire COM(shown in Figure 4.2). The proces-

sor is OMAP3530 from Texas Instruments (TI) based on ARM Cortex-A8 core

and the main frequency is up to 600Mhz. Also, Gumstix Overo Fire COM has

256MB RAM and 256MB Flash separately. Another feature of Gumstix is that

(38)

4.2 Gumstix Overo-Fire on board computer 25

Figure 4.1: Hardware structure of prototype design (Ylikorpi, 2005)

it comes with many daughter boards which are helpful for adding more func- tions. The expansion board used in project is the Summit board. It supports numerous interfaces including audio, camera in, analog/digital convert (ADC), PWM output, general purpose input/output (GPIO), serial ports, Micro SD card, USB connectivity, Bluetooth and WiFi. Therefore, this powerful expan- sion capability will make design idea more flexible and allow Gumstix to be the ideal choice for our project.

Figure 4.2: Gumstix Overo Fire COM encapsulated in a plastic box

(39)

4.3 Motor Driving

4.3.1 DC Motor

Two Maxon A-Max DC motors (shown in Figure 4.3) are used to control the attitude of pendulum for rolling and steering. The main electrical and mechanical characters for two motors are as follows:

Figure 4.3: two DC motors with encoders installed

Additionally, suitable gear boxes are installed on each motor to increase the

torque output.

(40)

4.3 Motor Driving 27

Table 4.1: Main parameters of motors

Table 4.2: Main parameters of gear boxes

4.3.2 H-Bridge

The H-bridge (shown in Figure 4.4)works as the interface between Gumstix COM and DC motors. The H-bridge receives the PWM from Gumstix COM, the EN and DI signal from the I/O expanders to vary the voltage applied on the motor to control the speed or torque. The H-bridge used in this project is developed at the Department of Automation and System Technology, Aalto University. The inputs of the H-bridge are:

• Supply voltage: 12V

• PWM: Pulse width modulation signal, the maximum it can take is 30KHz

• EN: the enable signal of motor

• DI: the direction signal, to set motor rotation direction

The output is the voltage to drive the motor.

(41)

Figure 4.4: H-bridge

4.4 Encoder and Quadrature Decoder

4.4.1 Encoder

In order to get feedback from motors, two incremental encoders are needed to measure the velocity. The encoder we are using is the AEDA-3300 (shown in Figure 4.3)from Avago Technology. It converts shaft rotation into a sequence of digital pulses, from which position measurement will be conducted by counting a single bit or decoding a set of bits. The rotary encoder is composed of a code disk with two tracks of photographically radial pattern, two infrared emitters and two phototransistors, showing in Figure 4.5. As photographically radial pattern on each track interrupt the beam between a photo emitter-detector pair, digital pulses are generated, shown in Figure 4.6.

The outputs of two tracks are called channel A and B, which are quadrature

outputs as they are 90 degrees out of phases. They are used to determine the

direction of rotation by tracking the phase of each channel(shown in Table 4.3).

(42)

4.4 Encoder and Quadrature Decoder 29

Figure 4.5: The structure of optical incremental encoder

Figure 4.6: Data from channel A and channel B

Table 4.3: Rotation state diagram

(43)

4.4.2 Decoding Circuit

From working principle of encoder presented above, two counters/timers are needed for each encoder if we want to determine both the velocity and direction at the same time. However, on the Summit board of gumstix, there are only two available counters/timers while two encoders will be read which means four counters/timers are needed. In order to solve the lack of counters/timers, the decoder chip is applied and a decoding circuit was designed.

In Figure 4.7, the working flow is shown.

Figure 4.7: Working flow of encoder reading

The output of encoders integrate RS422 line driver. Therefore, a line receiver (AM26C32) is applied to receive data from encoder, which can minimize the error introduced by noise.

Figure 4.8: The connection between encoder and line receiver

After the line receiver, the data from the two encoders is sent to a decoder

(HCTL-2032). HCTL-2032 performs the quadrature decoder, counter and bus

(44)

4.5 Communication 31

interface function by shifting time intensive quadrature decoder functions to a cost effective hardware solution. It consists of a quadrature decoder logic unit, a 32-bit binary up/down state counter, and an 8-bit bus interface. It also has dual-axis capability to support two encoders and can be programmed as 4X/2X/1X mode.

• 1X: 1X resolution only provides a single pulse for each cycle in one of the signals A or B

• 2X: 2X resolution provides a pulse at every edge transition in one of signals A or B, providing two times than 1X resolution.

• 4X: 4X resolution provides a pulse at every edge transition in the two signals A and B, providing four times than 1X resolution.

Since Gumstix COM does not have enough GPIOs, two 16-bit I/O expanders (MCP23017) are adopted to compensate for this shortage. The usage of GPIO is to control the decoder, read decoder status from corresponding pins and convert the 8-bit parallel signal from a bus interface to a serial signal.

The communication between I/O expander and Gumstix COM is realized by I2C. Because of the voltage level difference (5v from i/o expander and 1.8v from Gumstix COM), a level shifter (PCA9306) is applied.

The circuit is appended in Appendix B.

4.5 Communication

The Gumstix COM is integrated with a WiFi module which is to support wire-

less communication with a ground station. The transfer rate is 100kb/s and

can be upgraded to 12Mb/s. The WiFi module is based on Wi2Wi chip from

Marvell, supporting 802.11 b/g wifi. Wi2Wi chip is a complete system-in-pack

solution, including all radio components, clocking and regulations for a whole

WLAN radio system.

(45)

4.6 Tri-axial Accelerometer

The VTI SCA3000-D01 accelerometer is installed to measure the tilt angle of the main shaft to provide the feedback for steering control.

4.6.1 Function description of SCA3000-D01

SCA3000-D01 is a three axis accelerometer with high performance but low power consumption, which consists of a 3D-MEMS sensing element and a signal pro- cessing ASIC embedded into a plastic Model Interconnection Device package (MID), shown in Figure 4.9. It also contains a temperature sensor, an internal oscillator and non-volatile memory that enables the sensor autonomous opera- tion within a system.

Figure 4.9: VTI SCA3000-D01 accelerometer

A block diagram of accelerometer is presented in Figure 4.10.

Figure 4.10: Block diagram of accelerometer

(46)

4.6 Tri-axial Accelerometer 33

Three acceleration sensitive masses on the X, Y and Z axes consists of the sensing elements, which are interfaced via a capacitance to a voltage (CV) converter. The analog signal from the CV will be calibrated first and then sent to an analog to digital converter (ADC) to digital signal. Afterwards, the digital signal is de-multiplexed into three signal processing channels where it is low- pass filtered and decimated. After that, the signals are mapped into orthogonal coordinates (X-Y-Z) and transferred to the output register. At last, the output can be read through the SPI interface.

4.6.2 Tilt angle measurement

The theory of operation is shown in Figure 4.11.

Figure 4.11: One axis tilt angle measurement

The accelerometer measures the projection of the gravity vector on the sensing axis. The amplitude of the sensed acceleration changes as the sine of the angle α between the sensitive axis and the horizontal plane.

A = g × sin(α) α = arcsin( A

g ) (4.1)

A: measured acceleration

(47)

α: angle between the sensitive axis and the horizontal plane

With a tri-axis accelerometer, the Z axis can be utilized to combine with the X and Y axis for tilt sensing to improve the accuracy.

Figure 4.12: Tilt angle form a tri-axis accelerometer

α = arcsin( A

x

g ) β = arcsin( A

y

g ) γ = arcsin( A

z

g ) (4.2)

In order to produces constant sensitivity over 360 degrees of rotation, trigono- metric is used to calculate pitch and roll tilt angle.

P itch = α = arctan A

x

pA

2y

+ A

2z

Roll = β = arctan A

y

pA

2x

+ A

2z

(4.3)

4.7 Gyroscopes

Gyroscopes are used to measure angular rate. In this project, the ADIS16100

(shown in Figure 4.14 and Figure 4.15) from Analog Devices with a SPI interface

(48)

4.8 Power Distribution 35

Figure 4.13: Illustration on how to install accelerometer on robot

is applied to detect the steering rate (yaw axis) of the robot. The ADIS16100 has built-in ADC to convert the analog signal to digital signal, which is proportional to the angular rate about the axis that is normal to the top surface of the sensor.

A single external resistor can be used to increase the measurement range and an external capacitor can be used to lower the bandwidth. Additionally, it is equipped with an internal temperature sensor, two extra pins for analog input of ADC, one pin providing precise reference voltage and two digital self-test inputs.

4.8 Power Distribution

Lead-acid batteries are utilized to provide power for the robot. Lead-acid bat-

tery generates electricity by electrochemistry reaction; it is the oldest type of

rechargeable battery invented by French physicist Gaston Plant´ e. Compared to

various new types rechargeable battery, the disadvantages of lead-acid battery

are obviously. It has very low energy-to-weight ration and a low energy-to-

weight ratio. However, in this thesis work, the batteries are also used as a

pendulum. Therefore, the weight of lead-acid batteries can be utilized. Be-

sides, they are capable to provide high currents which can meet the electrical

requirements of DC motors.

(49)

Figure 4.14: ADIS16100

Figure 4.15: Function block diagram

(50)

4.8 Power Distribution 37

One set of lead-acid batteries produces a total of 12V, which is connected to DC

motor directly.The sensors and Gumstix COM need 5v power supply. Therefore,

a 5v regulator is used to provide stable and accurate power supply.

(51)

Prototype Robot Software Design

5.1 Software Structure of the Thistle

5.1.1 Software Structure

The whole software structure is an embedded Linux system. Embedded system is a special purpose computer system designed to perform one or a few dedicated functions with time computing constraints. It is usually embedded as part of a complete device including hardware and mechanical parts. As in Figure 5.1, the software structure consists of four parts: boot loader, Linux kernel, Standard C library, the third party application and library.

The boot loader is started by the hardware, responsible for basic initialization,

loading and executing the kernel which contains process and memory manage-

ment, the network stack and device drivers. The kernel is used to provide

services to user space applications through C library, which is the interface be-

tween kernel and user space. The boot loader, Linux kernel and standard the C

library consists of the foundation of an embedded system. Based on it, the third

party applications and libraries are developed and build up a root file system

with the standard C library. In this project, the Gumstix COM stored boot

loader; Linux Kernel and root file system in on board micro SD card.

(52)

5.1 Software Structure of the Thistle 39

Figure 5.1: Software structure

5.1.2 Development Process

The development process is divided into three steps. First, it is system building.

It involves downloading, configuring, compiling and installing all the compo- nents of the system. The goal is to fix and adapt configuration files, and also integrate all the software components into root file system. Normally, there are three solutions to achieve this goal: Firstly,manually; Secondly,System building tools; Thirdly, Distribution and ready-made files systems. In the project, sec- ond and third solutions are adopted. Based on ready-made configuration files downloaded from Gumstix COM official website, several changes were made to configure the file system though system building tools CMake.

The second step is to create a cross compiling tool chain, which consists of

five parts, including Binutils, Kernel headers, C/C++ library, GCC compiler

and GDB debugger. Since the source code is developed in a machine under

the x86 structure, while the target machine where the code will be executed is

ARM structure, cross compiling is needed to cross compile source code to ARM

binary.

(53)

The final step is application development. In this project, all the applications are written in C language. The detailed development process of each application will be explained in the following.

5.2 WiFi Communication

There are two methods to utilize the WiFi module.

The first one is to connect the Gumstix COM to any existed wifi network.

Excute the following code to search and list visible network.

r o o t @ o v e r o :˜# i w c o n f i g wlan0 e s s i d any r o o t @ o v e r o :˜# i f c o n f i g wlan0 up

r o o t @ o v e r o :˜# i w l i s t wlan0 s c a n

Algorithm 5.1: Searching visible wireless network

Then edit /etc/network/interfaces in Linux Kernel and add corresponding code according to type of network.

If it is unencypted network, the code is as follows:

a l l o w −h o t p l u g wlan0 a u t o wlan0

i f a c e wlan0 i n e t dhcp

pre−up / s b i n / i w c o n f i g wlan0 e s s i d any w i r e l e s s m o d e managed

Algorithm 5.2: Code for unencypted network

If it is WEP encryption, the command is as follows:

For WPA encryption, the command is as follows and create /etc/wpa suppli- cant.conf in Algorithm 4.5

After that, input SSH command to connect it. The advantage is that it can

extend the communication area through the network. The disadvantage is also

(54)

5.2 WiFi Communication 41

i w c o n f i g wlan0 e s s i d ‘ ‘ D e s i r e d W i r e l e s s Network ’ ’ i w c o n f i g wlan0 key my−hex−key

i f d o w n wlan0 i f u p wlan0

Algorithm 5.3: Code for WEP encryption

a l l o w −h o t p l u g wlan0 i f a c e wlan0 i n e t dhcp

pre−up w p a s u p p l i c a n t −D −i w l a n 0 −c / e t c / w p a s u p p l i c a n t . c o n f −B down k i l l a l l w p a s u p p l i c a n t

Algorithm 5.4: Code for WPA encryption

c t r l i n t e r f a c e =/v a r / run / w p a s u p p l i c a n t c t r l i n t e r f a c e g r o u p =0

e a p o l v e r s i o n =1 a p s c a n=1

f a s t r e a u t h =1

network={

s s i d = ‘ ‘ add−my−a s c i i −s s i d ’ ’ p r o t o=WPA2

key mgmt=WPA−PSK p a i r w i s e=CCMP TKIP group=CCMP TKIP s c a n s s i d =1

psk = ‘ ‘ add−my−a s c i i −p a s s p h r a s e ’ ’ p r i o r i t y =10

}

Algorithm 5.5: Code for WPA encryption

(55)

obviously. Since Gumstix COM does not install any anti-virus software, it is easily be accessed by any user in same network which may result in seriously security problem.

The second case for using WiFi module is to create an Ad-hoc wireless network and other WiFi units can be connected to the network. The advantage is that it can control the access to Gumstix COM by setting allowed IP address range.

The shortcoming is that the communication area is reduced due to the limited power of Gumstix COM. In the thesis work, this method is adopted. The specific steps are as follows:

Firstly, edit /etc/network/interfaces in Linux Kernel and change the configura- tion of wlan0

a u t o wlan0

i f a c e wlan0 i n e t s t a t i c a d d r e s s 1 9 2 . 1 6 8 . 2 . 2 netmask 2 5 5 . 2 5 5 . 2 5 5 . 0 w i r e l e s s −mode ad−hoc

w i r e l e s s −e s s i d gumstix−network

Algorithm 5.6: Edit wlan0 configuration

Enable it after reboot.

i f c o n f i g wlan0 down

i f c o n f i g wlan0 a d d r e s s 1 9 2 . 1 6 8 . 2 . 2 netmask 2 5 5 . 2 5 5 . 2 5 5 . 0 i w c o n f i g wlan0 mode ad−hoc e s s i d gumstix−network

i f c o n f i g wlan0 up

Algorithm 5.7: Enable wlan0

Secondly, set up a DHCP server on the ad-hoc network.

Create a configuration file with following contents:

Create the leases file and run the dhcp server:

(56)

5.2 WiFi Communication 43

v i / e t c / udhcpd . c o n f

Algorithm 5.8: Set up DHCP server

#s t a r t a d d r e s s

s t a r t 1 9 2 . 1 6 8 . 2 . 3

#end a d d r e s s

end 1 9 2 . 1 6 8 . 2 . 3

#i n t e r f a c e t o l i s t e n on i n t e r f a c e wlan0

#maximum number o f l e a s e s m a x l e a s e s 64

Algorithm 5.9: Set up DHCP server

t o u c h / v a r / l i b / misc / udhcpd . l e a s e s udhcpd / e t c / udhcpd . c o n f

Algorithm 5.10: Create the leases file and run the dhcp server

(57)

From above wlan0 configuration file, it is noticed that the only allowable IP address is 192.168.2.3. Therefore, change the IP address of command station and use SSH command to connect to Gumstix COM.

5.3 Motor Driving

In order to drive the DC motor, a closed loop control model is needed to achieve precise torque control or speed control, which means this control model needs two controllers: current control and speed control. Besides, other benefits of this control model include further improvement of armature current response time t

r

and prevention of current i from exceeding the maximum value although a large value is allowed sometimes at transients.

5.3.1 DC Motor Model

In order to create the current controller and speed controller, the DC motor must be defined first.

Figure 5.2: Equivalent circuit for the dc motor

From the equivalent circuit of the DC motor, basic electrical and mechanical equations can be easily obtained.

Mechanical Equation:

J × dω

r

dt = τ

e

− τ

l

τ

e

= ψ × i (5.1)

(58)

5.3 Motor Driving 45

Electrical Equation:

L × di

dt = v − R × i − E

E = ψ × ω

r

(5.2)

J : Rotor moment of inertia τ

e

: Electrical torque

τ

l

: Payload torque L: Terminal inductance i: Armature current v: Applied voltage R: Terminal resistance E: Back emf

ψ: Flux linkage ω

r

: Rotation velocity

Normally, the load torque increases with the speed. As a simplification, it is assumed that it is proportional to the speed, where b is called the viscous damping constant.

τ

l

= b × ω

r

(5.3)

Therefore, based on the Laplace transform of electrical and mechanical equa- tions, a block diagram of the dc motor is shown in Figure 5.3

Figure 5.3: Block diagram of DC motor dynamic

Finally, the model of the DC motor is built in Matlab based all above.

The input of the DC motor subsystem is applied voltage and payload torque.

After the simulation through this subsystem, the armature current , electrical

torque and rotation velocity can be obtained. The testing results are contained

in Chapter 6.

(59)

Figure 5.4: Simulink model for DC motor

5.3.2 Current Controller Model

Based on the DC motor model obtained above, the electrical subsystem (Equa- tion 5.2)can be expressed in Figure 5.5.

Figure 5.5: Block diagram of the electrical dynamics

G

e

(s) is the transfer function obtained from Equation 5.2 through Laplace trans- form.

G

e

(s) = 1

sL + R (5.4)

In order to control the current, a closed loop must be built, as shown in Figure 5.6(CC is the current controller).

In this control loop, the reference current i

ref

is set by a speed controller which will be presented in the next section. The output current i is measured and compared to the reference current (set point) i

ref

to obtain the error signal e.

The error signal e = i

ref

− i forms the input to the current controller (CC),

which manipulates the voltage v so that i follows i

ref

quickly and accurately.

(60)

5.3 Motor Driving 47

Figure 5.6: Closed loop block diagram

In the project, this voltage v is generated by Gumstix COM in form of PWM through DC-DC conversion which will be depicted in the following section in detail.

Figure 5.7: Two degrees of freedom current controller (CC) using “active resis- tance” and “back calculation”

The design of a current controller can be seen from the above figure (Figure 5.7).

As the controller operates current error e and voltage error u, as shown in Figure 5.7, this is called a two degrees of freedom current controller.

Since the electrical dynamics are of order one, a simple proportional-integral (PI) controller should be sufficient. Therefore, it is assumed that:

F

c

(s) = k

p

+ k

i

s (5.5)

In order to improve load disturbance rejection, an inner feedback loop using

“active resistance” R

a

is introduced. The active resistance R

a

has increased

resistance from R to R + R

a

, but since this is done just using signals–involving

no energy transfer, there will be no additional power loss. The transfer function

of this loop is

(61)

G

0e

(s) = G

e

(s)

1 + R

a

∗ G

e

(s) = 1

sL + R + R

a

(5.6)

In addition, there are two issues which must be noticed. Firstly, the control loop is treated as an ideal, linear system so far, while it is not in practice. The terminal voltage v can not be arbitrarily large. It is limited by the capability of the robot power system which supplies voltage. Therefore, the upper value should be set to 12v while the lower one is −12v(Equation 5.7).

v = s(u) =

 

 

−V

s

, u < −V

s

u, −V

s

≤ u ≤ V

s

V

s

, u > V

s

(5.7)

V

s

= 12V is the maximum voltage that can be applied on the motor.

Secondly, the overshot caused by integrator windup should be taken into ac- count. The integral term of the PI controller keeps accumulating the control error during the time of voltage output. When i is getting close to i

ref

, the integrator has wound up so that u reaches a large value. Then this overshot will be worked off by accumulation of negative control error.

To eliminate this overshot, negative control error should be accumulated in integrator. Thus, a voltage saturation s(u) and back calculation must be ap- plied.Consequently, “back calculation” (shown in Figure 5.7) should be intro- duced to eliminate this overshot rapidly. Once |u|>V

s

, back calculate i

ref

, obtaining a modified reference i

0ref

which yield |u| ≤ V

s

.

Back calculation error ¯ e

¯

e = e + 1

k

p

(v − u) (5.8)

From the above, the control algorithm is obtained:

dI

dt = e + 1

k

p

(v − u) u = k

p

e + k

i

I − R

a

i

v = s(u) (5.9)

(62)

5.3 Motor Driving 49

After the control model is created, it is necessary to determine the value of k

p

and k

i

. There are numerous means and it is also common that to find approximate value by trial and error. However, this is time consuming and inaccurate. Since motor parameters are known, it is reasonable to use this knowledge for selecting suitable values. Here, a method called loop shaping is adopted.

It is started with a specification for the 10%-90% rise time of the closed loop system t

rc

. With G

0e

(s) being of order one, it is apparent that a closed loop transfer function of order one can also be obtained. It is assumed that G

cc

(s) to be the transfer function.

G

cc

(s) = α

c

s + α

c

= 1

sT

c

+ 1 = F

e

(s)G

0e

(s) 1 + F

e

(s)G

0e

(s)

α = 1

T

c

(5.10)

α

c

: the closed loop system bandwidth T

c

: the closed loop electrical time constant.

For a first order system, the following analytic relation between rise time t

rc

and time constant T

c

is known:

t

rc

= T

c

× ln 9 (5.11)

Hence, the connection between bandwidth and rise time:

α

c

× t

rc

= ln 9 (5.12)

From Equation 5.10, it is clear that

F

e

(s)G

0e

(s) = α

c

s F

e

(s) = α

c

c × G

0e

(s)

= α

c

s (sL + R + R

a

) = α

c

L + α

c

s (R + R

a

) (5.13)

(63)

Combined with Equation 5.5, it is obvious that:

k

p

= α

c

L

k

i

= α

c

(R + R

a

)

R

a

= α

c

L − R (5.14)

The controller parameters are now expressed directly in the desired closed loop bandwidth and the motor parameters L and R. The above design approach is a special case of internal model control (IMC).

Ultimately, based on above control algorithm and motor parameters from data sheet, a simulation model can be built in M atlab.

Figure 5.8: Simulation model of current controller

Figure 5.8 presents the simulation model of current controller in Matlab. The input is current error e and measured current i. The output is voltage u.

5.3.3 Speed Controller Model

Since the current controller is created, the next step is to establish a speed control model which is used to provide i

ref

for the current controller. Based on the DC motor model obtained above, the mechanical subsystem can be expressed in Figure 5.9.

In order to control the current, a closed loop must be built, as shown in Fig-

ure 5.10 (SC is the current controller).

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

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

A control system has been set up, using ATLAS DCS standard components, such as ELMBs, CANbus, CANopen OPC server and a PVSS II application.. The system has been calibrated in order

As illustrated in Figure 7, the switching power-pole and its control circuitry can be considered a two-input system where the inputs are the control signal,

It is always a risk to go at a higher speed than the normal speed which we can control it easily, that is why the motor is placed there has limited rpm (rotation per minute) speed by

For the measured test data, linear and quadratic regression methods will be applied for approximating the relationships between motor input power and output torque at

By using a permanent magnet synchronous motor drive as a test bench, the paper gives an exhaustive description of the design procedure of a Model Predictive Control (MPC) applied to