• Nenhum resultado encontrado

Spherical rotor asynchronous motor control by 3D variable-frequency drive

N/A
N/A
Protected

Academic year: 2021

Share "Spherical rotor asynchronous motor control by 3D variable-frequency drive"

Copied!
66
0
0

Texto

(1)

Spherical rotor asynchronous motor control by 3D

variable-frequency drive

João António Silva Oliveira

Thesis to obtain the Master of Science Degree in

Engineering Physics

Supervisor(s):

Prof. Horácio João Matos Fernandes

Prof. Paulo Jose da Costa Branco

Examination Committee

Chairperson: Prof. João Pedro Saraiva Bizarro

Supervisor: Prof. Horácio João Matos Fernandes

Member of the Committee: Prof. João Filipe Pereira Fernandes

(2)
(3)

Eppur si muove Galileo Galilei

(4)
(5)

Acknowledgments

Concluding a thesis is far from a solitary endeavor, many people besides myself have been instrumental in its elaboration.

First of all I would like to thank my supervisors Prof. Hor ´acio Fernandes and Prof. Paulo Branco for all of their support and guidance.

I would like to thank all of the people in the IPFN shop for their assistance in the construction of the prototype in particular to the kind souls that helped me in the ill advised task to cut 120 laminations form the stator of an electric motor using nothing more than a hand saw and their patience.

I would like to thank all my friends at IST for their constant presence along this 5 year long journey. Their support and friendship made it a much more pleasant experience. In particular I would like to thank Bernardo Malaca, Diogo Carvalho and Gonc¸alo Castro for their assistance in proofreading this very document.

I would like to thank my parents for their unconditional support and encouragement throughout my life.

(6)
(7)

Resumo

Neste trabalho foi desenvolvido um prot ´otipo de um motor de induc¸ ˜ao de rotor esf ´erico de modo a avaliar a sua capacidade como actuador de transfer ˆencia de momento para um sistema de controlo de atitude de naves espaciais. Os actuadores esf ´ericos s ˜ao um grande passo em frente no dom´ınio destes sistemas porque t ˆem a capacidade de reduzir o seu n ´umero de partes m ´oveis. Um motor de induc¸ ˜ao esf ´erico ´e um bom candidato para este papel uma vez que o seu controlo ´e simples. O prot ´otipo desenvolvido foi baseado em m ´aquinas anteriores mas com a adic¸ ˜ao de um rolamento pneum ´atico para o suporte do rotor. O estator do motor foi composto por dois eixos el ´ectricos independentes para permitir a sua rotac¸ ˜ao com m ´ultiplos graus de liberdade. Tamb ´em foi desenvolvido um sensor ´optico de velocidade de modo a permitir o teste das caracter´ısticas do motor. O desempenho do motor foi avaliado com uma s ´erie de testes de acelerac¸ ˜ao que demonstraram a sua operac¸ ˜ao bem como algumas falhas, uma vez que desequil´ıbrios de massa no rotor provocavam a sua vibrac¸ ˜ao o que impossibilitou o alcance de velocidades superiores a 120rpm. Tamb ´em se verificou que o motor tinha um mau acoplamento magn ´etico entre o seu estator e o seu rotor provocado principalmente pela espessura excessiva do entre-ferro efectivo o que resultou em efici ˆencias da m ´aquina inferiores a 2%. Ainda assim o prot ´otipo provou o conceito do motor de rotor esf ´erico como actuador para sistemas de controlo de atitude e mostrou o caminho futuro a percorrer.

(8)
(9)

Abstract

In this work a prototype of a spherical induction machine is developed in order to evaluate its perfor-mance as the core of a momentum transfer satellite and spacecraft control system actuator. Spherical actuators would be a major breakthrough for these types of systems as they have potential advantages in reliability as they use less moving parts. A spherical induction motor is a good candidate for the role of a spherical actuator due to the simplicity of its control system and smooth operation. The prototype was based on earlier designs of spherical induction machines but with the use of an air-bearing to support its rotor. The stator of the motor featured two independent electrical axes that were successfully used to prove the concept of multi degree-of-freedom operation. An optical speed sensor was also developed in order to test the performance of the motor. The performance of the motor was evaluated with a se-ries of acceleration tests. These confirmed the operation of the motor but with some flaws as the rotor vibrated at speed due to its uneven mass distribution which limited its maximum speed to 120rpm. The motor was also found to have a very poor magnetic coupling between its armature and rotor caused by a large effective air-gap which resulted in a maximum efficiency of 2%. Nevertheless the prototype proved the initial concept of a spherical induction machine attitude control actuator since these issues resulted mostly from the crude nature of the prototype’s construction.

(10)
(11)

Contents

Acknowledgments . . . v

Resumo . . . vii

Abstract . . . ix

List of Tables . . . xiii

List of Figures . . . xv

Nomenclature . . . xvii

Glossary . . . xvii

1 Introduction 1 2 Satellite attitude control systems 3 2.1 Rigid Body Dynamics . . . 3

2.2 Inertial attitude control systems . . . 5

2.2.1 Reaction Wheels . . . 5

2.2.2 Control Moment Gyroscopes . . . 5

2.2.3 Inertia Spheres . . . 7

3 The spherical induction motor 10 3.1 Induction Motor . . . 10

3.2 Spherical Machines . . . 12

4 Spherical Induction Motor Prototype 13 4.1 Rotor . . . 13

4.1.1 Rotor support . . . 13

4.2 Stator . . . 14

4.3 Electronic controller . . . 17

4.3.1 Space Vector Modulation . . . 18

4.4 Speed Sensor . . . 21

5 Acceleration tests 25 6 Conclusions 29 6.1 Future work . . . 30

(12)

Bibliography 31

(13)

List of Tables

5.1 Summarized test results in terms of the steady-state rotor speed vu, the average

(14)
(15)

List of Figures

2.1 Diagram of a spherical shell . . . 4

2.2 Reaction wheel [18] . . . 5

2.3 Control Moment Gyroscope [5] . . . 6

2.4 Torque T , angular momentum h and gimbal speed ˙δ on a CMG [4] . . . 6

2.5 Spherical Rotor of the ELSA project, adapted from [19] . . . 7

3.1 Early induction motors . . . 10

3.2 Induction-machine torque-speed curve showing braking, motor, and generator regions. Adapted from [15] . . . 11

3.3 Examples of spherical electrical Machines . . . 12

4.1 Scheme of the machine’s rotor, note the two-piece construction of each layer. . . 14

4.2 Air pump used to power the air-bearing, it was an inexpensive off the shelf model clearly optimized for airflow rather than pressure. . . 14

4.3 Cut view of the 3D model of the main assembly and air bearing. The bearing has eight outlet orifices and the sum of their cross-sections equals the cross-section of the intake. . 15

4.4 Top view of the air-bearing assembly. Note the exposed outflow nozzles and the curved surface adjusted to the spherical shape of the rotor. . . 15

4.5 Top down view of the machine, note the spatial distribution of the supports on two orthog-onal planes, X and Y. . . 16

4.6 Stator support piece and silicon steel lamination. . . 16

4.7 Front view of the a coil support with the coils installed. Note the fitment of the laminations as well as the plastic tape bracing to prevent short circuits on the coils. . . 17

4.8 Finished stator support bracket with the two-phase winding fitted to the slots of the stator. 17 4.9 PCB holding the MCU and its support ICs. Note that the MCU is on the other side of the board, the exposed IC is a serial to USB converter. . . 18

4.10 Breakout board for the L298 power h-bridge driver. . . 18

4.11 Voltage source inverter for a single phase. The voltage source inverter was constructed as a full bridge inverter for each phase. . . 19

4.12 Scheme of the rotating voltage vectors for the construction of the SVM algorithm. Each numbered arrow corresponds to a state of the inverter. . . 19

(16)

4.13 Output waveforms for both phases(red and blue). Note the distortion minimizing center alignment. . . 20 4.14 Output waveforms for two inputs of a single phase of the inverter (Figure 4.11) (red and

blue), their sum (light blue) and current(purple). Note that the current was measured with a 100mV/A probe. . . 21 4.15 Stripped pattern painted on the rotor. The patterns consists of seven stripes so on a

complete revolution 14 stripes are detected. . . 22 4.16 Cut view from the sensor housing’s design. The outer holes housed phototransistors, the

center hole housed the LED. Note the pinholes that guide the light from the LED to the rotor’s surface an then to the phototransistors. . . 22 4.17 Bottom view of the speed sensor, the pinholes for the photo diodes and LED had to be

enlarged after printing as they were below the printer’s accuracy . . . 23 4.18 Side view of the machine. Note the sensor holding bracket that positions it over the rotor.

The bracket features three adjustment screws for precise adjustment of the clearance between the sensor and the rotor. . . 23 4.19 Schematic of the stripe sensing circuit. It was composed by a phototransistor coupled to

an amplifier and filter stage. The filters were designed taking the signal for the expected rotor velocity into consideration. . . 23 4.20 Top view of the implementation of the filtering circuit for all four measurement channels.

Due to time constraints the circuit had to be implemented on a breadboard. Better noise characteristics could be expected had a PCB been produced allowing shorter cables to be employed . . . 24 4.21 Waveforms captured at the collector of the phototransistor (black) and the circuit output

(blue). . . 24

5.1 Acceleration test results, with excitation frequency f=20Hz (synchronous speed ωs=2.2Hz)

and excitation voltage U = 10V . Note the two distinct regions and also the different types of noise . . . 25 5.2 Acceleration test results, the teal line is the synchronous speed ns . . . 27

5.3 Acceleration test results, with excitation frequency f = 50Hz (synchronous speed ωs=2.2Hz)

and excitation voltage U = 14V . Note how the apparent friction barrier is surpassed but the velocity signal behaves very erratically (compare with Figure 5.1) . . . 27

(17)

Glossary

ACS Attitude Control System

CMG Control Moment Gyroscope

EMF ElectroMotive Force

IC Integrated Circuit

MCU MicroController (Unit)

PMSM Permanent Magnet Synchronous Machine

PWM Pulse Width Modulation

RCS Reaction Control System

SVM Space Vector Modulation

TPIM Two Phase Induction Machine

(18)
(19)

Chapter 1

Introduction

In recent years interest has surged in spherical electromechanical converters due to their potential ap-plications in new engineering challenges such as ball joint actuators, omnidirectional wheels and even aerospace applications as part of an ACS for spacecraft.

This thesis is focused on the latter, that is, in the use of spherical electromechanical converters in an ACS for spacecraft. In particular in the use of a spherical induction machine to control the attitude of small spacecraft.

The efficiency and reliability of attitude control systems directly influences the performance, cost and quality of commercial and scientific space missions. The ACS system is responsible for pointing the spacecraft in the correct direction. Its performance is crucial for efficient use of a finite resource of the spacecraft: its propellant; as such it plays an important role on the lifetime of the spacecraft. Furthermore, one of the main factors that influences the cost of a space mission is its payload mass, greater mass results in greater costs. Thus reducing mass, while improving reliability and keeping the required precision is a major goal in current design of spacecraft ACS.

ACS solutions based on the Earth’s magnetic and gravitational field are commonly used when point-ing accuracy and torque requirements are not too high [1–3]. For missions with higher torque and ac-curacy requirements either reaction wheels [4, 5] or control moment gyroscopes (CMGs) are employed [5].

Both of the latter devices are momentum transfer devices - that is, they exploit the conservation of angular momentum in order to change the orientation of the spacecraft. Reaction wheels accomplish this by changing their rotation speed, as accelerating the wheel causes the spacecraft to rotate in the opposite direction [6, p. 147]. CMGs have an inertia wheel rotating with constant velocity supported on a gimbal. When the orientation of the wheel’s rotation axis is changed, a reaction torque is felt on the spacecraft. [6, p. 166]

A step forward in the technology of momentum transfer actuators would be the use of a spherical actuator as it combines the principles of operation of both reaction wheels and CMGs with only a single moving part [7]. This would potentially have a greater reliability than other momentum transfer actuators [8]. To date there are a number of different manners to transfer momentum to a reaction sphere, a

(20)

system based on several holonomic wheels [7], piezoelectric ultrasonic actuation [9] or electromagnetic actuation [10–12]. Among them, the latter seem more promising as they are entirely contactless and potentially yielding better reliability and efficiency since frictional losses are eliminated.

When using an electromagnetic driving mechanism, the actuator behaves as an electric motor, one with three degrees of freedom in its rotations. In a similar manner to electric machines, there are multiple ways to drive the sphere’s rotation. For instance, the drive could be based on an induction motor [8], a PMSM [13], or a variable reluctance design [14].

Recently there was a project that pursued the development of a spherical actuator ACS using a PMSM [10]. Although this drive system has advantages in specific power and torque density, several challenges were found in the design of its control system as it featured a large number of control sys-tem degrees of freedom. The variable reluctance motor features similar challenges on its realization. However the induction motor can be driven with a much simpler control scheme.

All of the aforementioned drive schemes transmit mechanical power to the reaction sphere (which also acts as the motor’s rotor) by the means of a rotating magnetic field. This field is generated by controlling the voltage across coils wound on the motor’s stator. On the induction machine, the rotating field of the stator induces time-varying currents on the rotor which then create another magnetic field rotating at the same speed of the first. The tendency of fields to align (in a manner similar to two magnets) causes a mechanical torque, accelerating the rotor [15, p. 308].

The foregoing conclusions seem to indicate the spherical induction machine as a promising can-didate for an actuator in a satellite’s ACS due to its lower cost and simpler control even considering its lower precision and specific torque. In this work the suitability of this solution is tested through the development of a simple prototype based on an existing rotor [16].

This concept of can also be applied to other engineering challenges, such as the construction of multiple degree-of-freedom joint actuators or omnidirectional wheels with less moving parts, both of which potentially provide more reliability than existing solutions.

The objective of this work is then to investigate the suitability of a spherical induction motor as an actuator for a satellite ACS. This was accomplished through the development , construction and testing of a prototype. The suitability of the motor was evaluated on two parameters, its maximum momentum storage capacity, and its maximum output torque.

(21)

Chapter 2

Satellite attitude control systems

In this chapter a brief review of the most common attitude control systems for spacecraft is presented. There are also some considerations on the dynamics of a spherical shell.

2.1

Rigid Body Dynamics

A rigid body is considered to be as a collection of particles where the distances between each pair of particles is fixed. The angular momentum with respect to the origin O of an inertial referential is defined as

LO=X

i

riOpiO, (2.1)

where riO is the position of particle i, piO its momentum. The moment of inertia of a rigid body about

an axis P is defined as

IP =

X

i

mir2P i, (2.2)

where rP iis the distance from the ithparticle to axis P . Using this in an orthonormal frame of reference

it is possible to define the inertia tensor

IP =      Ixx Ixy Ixz Iyx Iyy Iyz Izx Izy Izz      , (2.3) where Ixx= X i mi(y2i + z 2 i), (2.4) Ixy= Iyx = − X i mixiyi (2.5)

the remaining components are obtained similarly. The frame of reference where the cross terms (Ixy, Ixz,...)

(22)

of the rigid body which are designated the principal axes.

The dynamics of a rigid body are then described by Euler’s Equation,

I ˙ω + ω × (Iω) = τa, (2.6)

where ω is the the angular velocity vector about the principal axes and τ is the applied torque. In the body frame they are written as

Ixxω˙x+ (Izz− Iyy)ωyωz= τx, (2.7)

Iyyω˙y+ (Ixx− Izz)ωxωz= τy, (2.8)

Izzω˙z+ (Iyy− Ixx)ωxωy = τz (2.9)

For the particular case of a spherical shell

Ixx= Iyy= Izz= 2 5m r25− r51 r3 2− r31 , (2.10)

where r1and r2are defined in Figure 2.1.

(23)

for the construction of an ACS.

2.2

Inertial attitude control systems

2.2.1

Reaction Wheels

Reaction wheels are used as the primary ACS on most spacecraft. In order to obtain three axis control at least three wheels are needed. In practice, four or five wheels are used to achieve better reliability. Although many reaction wheels have operated reliably for decades, reaction wheel failures have been a problem for some space missions. Even when a redundant configuration is used, failure of one wheel is often followed by the others. Four reaction wheels failed on the Far Ultraviolet Spectroscopy Explorer in 2001, 2002, 2004 and 2007; two have failed on Kepler in 2012 and 2013 [17].

Figure 2.2: Reaction wheel [18]

Reaction wheels assemblies consist of a rotating flywheel, usually supported by a ball bearing, and a motor, usually a permanent magnet synchronous motor. The motor has an associated controller controlling its speed. By applying torque to the flywheel an equal and opposite torque is applied to the spacecraft thereby changing its orientation as required. As the actuator is a PMSM the back-emf produced by the motor will grow as its speed increases. This limits the torque that can be applied to the flywheel. Typical torque figures for this ACS range from 0.01 to 1Nm [4].

These actuator are saturated when the flywheel’s speed is such that no usable torque can be further produced. In this situation the momentum stored in the flywheel has to be disposed of. This can be done using a separate ACS usually using dedicated attitude control thrusters (RCS) at the expense of some propellant.

2.2.2

Control Moment Gyroscopes

A CMG is used as an ACS for higher torque applications. Typical torque values from these actuators range from 0.1Nm to 100Nm. These actuators consist of a flywheel spinning with constant speed about an axis of rotation that is able to rotate about two gimbal axes (see Figure 2.3)

(24)

(a) Control Moment Gyroscope (b) ISS Control Moment Gyroscope

Figure 2.3: Control Moment Gyroscope [5]

This actuator can apply torque to change the orientation of the axis of rotation of the flywheel. This functions in the same manner as the reaction wheels, by applying torque to the flywheel an equal and opposite reaction torque is felt by the spacecraft thereby turning it in the requested direction. However while in the reaction wheel this torque is always along a fixed axis, in the CMG the torque will lie in an axis perpendicular to both the flywheel rotation axis and the gimbal rotation axis (see Figure 2.4), this requires the use of more sophisticated attitude control algorithms which makes them less attractive for simple missions [4].

(25)

2.2.3

Inertia Spheres

A novel approach to inertial attitude control systems consists in the use of a reaction sphere instead of a flywheel as in sections 2.2.1 and 2.2.2. The use of a sphere has the potential to reduce the mass of the ACS as a sphere has a greater specific moment of inertia (I = 2

3M R

2 for a hollow sphere, I = 2 5M R

2

for a solid one) when compared to a flywheel (I = MR2for a ring, I = MR2for a disk) because at least 3 flywheels are required to attain 3 axis attitude control while one inertia sphere is needed to archive the same.

This approach was introduced in 1959 by Walter Haeussermann [8]. The concept was further devel-oped and theorized with differing driving mechanisms for the the inertia sphere. A friction based driving mechanism is presented in [7], another approach consists in driving the sphere with an electromagnetic system this approach was investigated in the ELSA project [13]. In this last approach the driving system forms a spherical PMSM which is also responsible for levitating the sphere. The main problems found by the ELSA team were vibrations on the sphere caused by mass imbalances that limited is maximum speed and dynamical instabilities on the control system due to its large number of degrees of freedom (voltage control across 20 coils).

Figure 2.5: Spherical Rotor of the ELSA project, adapted from [19]

The inertia sphere approach can work like both a CMG, applying torque to an already rotating body in order to generate a reaction torque which has advantages in torque density, and a regular reaction wheel, generating reaction torque by accelerating or decelerating the sphere, which has advantages in momentum storage density.

(26)
(27)
(28)

Chapter 3

The spherical induction motor

In this chapter a basic review on the operating principles of the induction motor is given. There is also a review on the state of the art of spherical machines and their proposed applications.

3.1

Induction Motor

The foundations for the invention of the induction motor were laid in 1831 when Michael Faraday discov-ered electromagnetic induction. Thirty years later J. C. Maxwell formulated his laws of electromagnetism which presented an unified framework describing both electricity and magnetism as two aspects of the same phenomenon allowing the development of an induction motor.

The first induction motors were designed in parallel by Galilleo Ferraris and Nikola Tesla. (see Figure 3.3) Ferraris’s machine had the static armature (stator) wound with four coils paired in to two phases its rotor was a copper cylinder Tesla’s machine had a stator built in a similar way to Ferrari’s but its rotor differed, it consisted of a ferromagnetic cylinder where a short-circuited coil was wound.

(29)

Both of the machines on Figure 3.3 were TPIMs fed by two sinusoidal currents 90 degrees out of phase, this creates a rotating magnetic field that ”travels” across the air-gap of the machine with a frequency equal to the frequency of the supplied current divided by the number of magnetic pole pairs, the synchronous speed ns, this field is referred to as the stator field.

Assuming a steady state condition where the rotor rotates with a frequency smaller than the stator field frequency. The difference between the speed of the rotor and the synchronous speed is refereed to as the slip of the rotor, is is usually expressed as a fraction of the synchronous speed (ns),

s = ns− n ns

(3.1)

where n is the speed of the rotor.

Because the rotor rotates at a speed inferior to the synchronous speed it experiences, in its own referential, a time varying magnetic field of with frequency equal to the slip frequency. This implies, by Faraday’s law of magnetic induction that voltages of frequency fr = sns will be induced in the rotor.

Since the rotor is made out of a conductive material, these voltages will produce rotor currents of the same frfrequency. Note that since the rotor spins with speed n the magnetic field produced by the rotor

currents rotates at the synchronous speed (ns = sns+ n), the same speed as the stator field. Since

the stator and the rotor field rotate at the same speed their interaction will produce a steady torque in a manner similar to two magnets aligning their poles.

Figure 3.2: Induction-machine torque-speed curve showing braking, motor, and generator regions. Adapted from [15]

A typical torque-speed characteristic curve is shown in figure 3.2. There are three distinct regions: a motor region, where positive torque is produced and energy is transferred from the stator to the rotor, a generator region where negative torque is produced and mechanical energy from the rotor is transferred

(30)

to electric energy in the stator and a braking region where positive torque is also produced but acts in a direction opposite to the rotor’s velocity.

3.2

Spherical Machines

In recent years interest has increased in spherical electromechanical converters due to their potential applications in new engineering challenges such as ball joint actuators [20], omnidirectional wheels [21],[22],[23] and even aerospace applications as part of an attitude control system for spacecraft [24]. Among the designs proposed the most common are induction machines [12] and permanent magnet machines [25]. The permanent magnet machines usually consist of a concentrated coil stator, with poles distributed throughout the surface of the rotor, each coil is controlled independently to create a rotating magnetic field on the surface of the rotor, thus generating torque. The induction spherical machine can be designed in a simpler way, with distributed windings, thus reducing control complexity. As it is the case with cylindrical motors PMSM typically have better torque density and precision at the expense of requiring a more complicated control system and less smoothness in their torque delivery.

(a) Permanent magnet spherical machine [26] (b) Induction spherical machine [12]

(31)

Chapter 4

Spherical Induction Motor Prototype

In this chapter the design and construction process of the prototype is described.

4.1

Rotor

A prototype of a spherical induction motor was built in order to evaluate its suitability as an actuator for a satellite attitude control system (ACS). The development of the prototype began with the rotor. The rotor was not developed in this work instead one with construction identical to the one in the prototype in [22] was provided by the supervisors. The rotor was a sphere with a diameter of 89mm, a mass of 940g and a moment of inertia of 1.01gm2. The moment of inertia was calculated from (2.10) using the size and

mass of each shell. It was constructed from four hemispheres forming two separate layers (see Figure 4.1). The four pieces were assembled by gluing them together using a cyanoacrylate based glue as it bond strength proved adequate and did not disturb the geometry of the rotor. An earlier attempt with a two-part epoxy based glue failed as this glue was too thick and disturbed the geometry of the rotor, making the hemispheres no longer fit together.

The inner layer acts a part of the magnetic circuit of the machine. It was machined from an anisotropic ferromagnetic material [27] to form a 5mm thick spherical layer. This material was used due to its relatively high and anisotropic resistivity, which helps the minimization of losses through eddy currents. The use of grain oriented silicon steel as it is typical for electric motors was an inferior option since this material is optimized for magnetic flux flow in a particular direction (it is anisotropic) and the rotor has no preferential direction for the flow of magnetic flux.

The outer layer carried the induced rotor currents, was 4mm thick and made of aluminum. This material was used due to its low resistance which reduces Joule effect losses on the rotor thus improving the efficiency of the machine.

4.1.1

Rotor support

The rotor was supported by an air bearing which enabled its near frictionless rotation. The bearing was built into the main assembly of the machine which supported all of its other components. The bearing

(32)

Figure 4.1: Scheme of the machine’s rotor, note the two-piece construction of each layer.

itself was an adaptation of the design from [28] that was scaled down to the dimensions of the rotor. It was also adapted to work with an inexpensive, off-the-shelf air mattress pump (Figure 4.2).

Figure 4.2: Air pump used to power the air-bearing, it was an inexpensive off the shelf model clearly optimized for airflow rather than pressure.

The air pump was found to provide a maximum differential pressure of 0.4 bar. Since its outlet had a circular cross-section with a diameter of 17mm, the maximum force (9.1N) supplied by the pump should be adequate to suspend the rotor on a thin air film.

The inner ducts were designed to provide minimal resistance to the airflow, the radii of the bends in the air flow path were maximized and care was taken to achieve a constant flow cross section (see Figure 4.3).

(33)

Figure 4.3: Cut view of the 3D model of the main assembly and air bearing. The bearing has eight outlet orifices and the sum of their cross-sections equals the cross-section of the intake.

Figure 4.4: Top view of the air-bearing assembly. Note the exposed outflow nozzles and the curved surface adjusted to the spherical shape of the rotor.

construction enables the generation of a rotating magnetic field on two independent planes of rotation such that the rotor’s rotation can be controlled with two degrees of freedom.

The stator supports the windings responsible for creating the rotating magnetic field. It is constructed from laminated silicon (electrical) steel cut from an old electric motor. The use of such a high magnetic permeability material maximizes the coupling between the currents flowing in the stator windings and the rotor. The laminations help to prevent loss due to induced eddy currents caused by the time varying magnetic flux.

To further improve the stator-rotor coupling it is desirable that the air gap between them is small. A support was designed to locate these laminations in a spherical shape along the shape of the rotor (See Figure 4.6). The position of the supports could be further adjusted as the supports had adjustment slots where they were bolted to the main assembly; in practice an air gap between 0.5 to 1 mm was achievable. These supports were modeled and 3d-printed in a manner similar to the main assembly.

(34)

Figure 4.5: Top down view of the machine, note the spatial distribution of the supports on two orthogonal planes, X and Y.

(35)

forming then a two phase winding for each axis of motion.

Figure 4.7: Front view of the a coil support with the coils installed. Note the fitment of the laminations as well as the plastic tape bracing to prevent short circuits on the coils.

The electrical steel laminations featured slots that were used to install the coils composing the two phase winding of the motor. The angle between the axes of consecutive phase coils is 10 degrees. Comparing this to a two-phase motor with a single pole pair where this angle is 90 degrees it can be concluded that this motor behaves like one with 9 pole pairs. As such it follows that θae = 9θe where

θeis a spatial angle and θaeis an electrical angle. An identical relation is valid for the frequency of the

supply voltage neand the synchronous speed of the motor ns: ns= n9e.

Figure 4.8: Finished stator support bracket with the two-phase winding fitted to the slots of the stator.

Each coil was wound into the slots of the stator and consisted of 110 turns of magnet wire with a diameter of 0.3mm which resulted in a resistance of 3.5Ω per coil. These parameters were chosen considering the characteristics (maximum voltage and current) of the available power driver and also the space available for windings in the slots of the stator.

4.3

Electronic controller

An inverter was developed in order to control the voltages across the armature windings. It consisted of a microcontroller (MCU) coupled to a laboratory power supply and a power h-bridge driver. The MCU was a dsPIC33FJ128MC804 (see Figure 4.9). Chosen mainly due to its four independent PWM generators. The power supply was also used as a convenient manner to vary the maximum voltage applied to the motor as it could supply a maximum power of 240W at 24V. The power h-bridge driver consisted of two L298 breakout boards (Figure 4.10). They were chosen for its inexpensiveness and ease of connection to both the microcontroller and the power supply.

The software programmed on the MCU generated the driving waveforms to control both the rotation plane and the speed of the motor. Its core consists of a variable frequency two phase sinusoidal drive

(36)

Figure 4.9: PCB holding the MCU and its support ICs. Note that the MCU is on the other side of the board, the exposed IC is a serial to USB converter.

(37)

Vcc

INxA

INxB

Figure 4.11: Voltage source inverter for a single phase. The voltage source inverter was constructed as a full bridge inverter for each phase.

to vector control schemes.

The SVM algorithm was adapted from the three phase scheme shown in [29]. Its end goal is the establishment of a rotating magnetic field, adjustable in both frequency and amplitude, in the machine’s air gap through the armature phase voltages. Since the machine has a two phase design, the voltages applied to each phase will be ninety degrees out of phase in respect to each other. A diagram of this is shown in Figure 4.12. Va Vb 1 3 5 7 2 4 6 8 Vo V = Vcc φ

Figure 4.12: Scheme of the rotating voltage vectors for the construction of the SVM algorithm. Each numbered arrow corresponds to a state of the inverter.

The algorithm is heavily based in the configuration of the inverter. The first step to convert the scheme in [29] to a two phase system is the enumeration of all possible inverter states. Since the inverter has four inputs, this implies the existence of sixteen different states. However only nine are useful since there are multiple off and redundant states as a phase can be off in two different manners (Figure 4.12). To create a rotating output vector Vo the states are sequenced in either a clockwise or counter

(38)

closest to it and the null state (Figure 4.12). In the first octant, for each modulation period Tm the

following holds,

Tm= T1+ T2+ T0. (4.1)

In each period the average value of each component of Vois,

Va = T1 Tm V +√2T2 Tm V (4.2) Vb= √ 2T2 Tm V, (4.3)

where V in the input voltage for the VSI. Representing Voin polar coordinates and solving for the

modu-lation ratios T1 Tm and

T2

Tm, the following is obtained(see Figure 4.12):

T1 Tm =√2 sinπ 4 − φ  (4.4) T2 Tm = sin φ (4.5)

This analysis is valid when Vo is in the first octant, but the modulation ratios for the other quadrants

are easily obtained taking into account the symmetry of the problem and shifting the angle back to the first octant. From these results it can be seen that there are only 2 state transitions per modulation period, one from the null state to the state with only one phase turned on and one from the latter state to the state with both phases turned on (Figure 4.13). Note that the waveforms are center-aligned in order to minimize harmonic distortion.

(39)

the frequency and amplitude of the generated signal as well as the direction of rotation which is encoded using negative amplitudes.

Figure 4.14: Output waveforms for two inputs of a single phase of the inverter (Figure 4.11) (red and blue), their sum (light blue) and current(purple). Note that the current was measured with a 100mV/A probe.

The implementation of the algorithm receives these inputs through commands on the MCU’s serial port. The input frequency is immediately converted into its inverse, a time period, and is assigned to the interrupt period on a Timer. On every Timer interrupt an internal ”angle” variable is incremented and the modulation ratios are computed as per (4.4) and (4.5). Afterwards the octant is computed from the angle value and is used to configure the inverter states correctly (mostly used to define the direction of each phase). Finally the PWM duty cycles for each phase are computed from the modulation ratios which is needed since there are composite states ( i.e. states with both phases turned on) and the duty cycles have to be set for each phase individually. For example, if the modulation ratios for states one and two are 10% and 20% respectively and state one is phase A on, phase B off while state two is both on, the duty cycles will be 30% and 20% for phase A and B respectively.

The computation of the sine function is done using a lookup table, as computing the sine in real-time is too computationally expensive. The computation of the modulation ratios only requires angles in the range [0,π

4] which enables significant memory savings in comparison to a traditional sine PWM

algorithm that requires at least twice as much memory. This table was implemented with 256 entries in the relevant interval which results in an accuracy of 11bits (maximum error of 0.05%) for an entire electrical period. The waveforms generated by the algorithm can be seen in Figure 4.14. The full code that was developed can be consulted on Appendix A.

4.4

Speed Sensor

As an actuator in an ACS an accurate measurement of the motor’s rotational speed is important. The use of a speed sensor allows for better accuracy which in turn enables a stabler and more precise

(40)

attitude keeping. Due to its frictionless air-bearing rotor support system a contactless solution is most desirable.

Other implementations of a spherical motor have used an optical position sensor taken from an optical mouse. This approach was tried with unsatisfactory results as the available sensor had severe limitations on its maximum detection speed [30]. A better, more modern sensor could have been used [31], but difficulties in sourcing a suitable sensor in a timely manner led to the development of a custom solution.

Figure 4.15: Stripped pattern painted on the rotor. The patterns consists of seven stripes so on a complete revolution 14 stripes are detected.

Such a sensor was developed with the goal of detecting higher speeds. First an evenly spaced pat-tern of seven stripes was painted on the rotor (Figure 4.15). Then an optical system, capable of detecting the stripes, was developed. The system was composed by an LED surrounded by four photo-transistors mounted on a 3d-printed support (Figure 4.16, 4.17), designed specifically to follow the curvature of the rotor and to attach to the motor’s frame (Figure 4.18).

(41)

Figure 4.17: Bottom view of the speed sensor, the pinholes for the photo diodes and LED had to be enlarged after printing as they were below the printer’s accuracy

Figure 4.18: Side view of the machine. Note the sensor holding bracket that positions it over the rotor. The bracket features three adjustment screws for precise adjustment of the clearance between the sensor and the rotor.

+5V 350kΩ MEL709 − + LM358 A 10kΩ 1µF − + LM358 B +2.5V 250kΩ 68kΩ 22nF ICx

Figure 4.19: Schematic of the stripe sensing circuit. It was composed by a phototransistor coupled to an amplifier and filter stage. The filters were designed taking the signal for the expected rotor velocity into consideration.

the rotor was measured as it was sufficient for the acceleration tests that were performed. As such the velocity is simply measured by counting the time between events on a single detector, since there are 7 stripes on the sphere the average velocity between two events is:

¯

v = 60

14∆t[s] (4.6)

(42)

Figure 4.20: Top view of the implementation of the filtering circuit for all four measurement channels. Due to time constraints the circuit had to be implemented on a breadboard. Better noise characteristics could be expected had a PCB been produced allowing shorter cables to be employed

Figure 4.21: Waveforms captured at the collector of the phototransistor (black) and the circuit output (blue).

not explored as for testing the capabilities of the motor, measuring speed in a single axis is sufficient. Furthermore it is important to note that this sensor is inadequate for a working ACS with three degrees of freedom as it requires a sensor capable of measuring the speed of the rotor in its three axes. Due to the symmetry of the striped pattern the sensor is incapable of measuring movement in the axis perpendicular to the stripes.

(43)

Chapter 5

Acceleration tests

Acceleration tests were done in order to evaluate the performance of the prototype. For each of the tests the rotor started from a standstill. Then, power was applied and the rotational velocity of the rotor was recorded as it accelerated until it reaches a steady-state velocity vu. This procedure was repeated

for various excitation frequencies and voltages. During each of the tests the rotor was oriented with its stripes orthogonal to the direction of motion in order to reduce errors and increase the precision of the speed measurement. This was also necessary for the correct measurement of the rotor’s rotation as the present sensor configuration is incapable of measuring speed parallel to the stripes of the rotor. The velocity of the rotor is calculated by dividing the angle between two stripes by the difference between consecutive timestamps. The results of a test are show on Figure 5.1.

Figure 5.1: Acceleration test results, with excitation frequency f=20Hz (synchronous speed ωs=2.2Hz)

and excitation voltage U = 10V . Note the two distinct regions and also the different types of noise

Figure 5.1 shows some noise on the speed measurement, nevertheless it does not completely com-promise the results of the test. There are two clearly separated regions, the first where the rotor ac-celerates with near constant torque and the second, where the velocity is almost constant. In order to compare each individual test with the others there are two key values worth noting: the average torque

(44)

on the first region (τm) and the steady-state velocity attained by the rotor (vu). The noise found on the

measurements has also some characteristics worth of note. First there is some dispersion on each measurement, an effect likely caused by both rotor vibration due to its spherical asymmetry and slight variation on the contrast of each individual stripe. There are also some alias of the velocity graph that happen due to missed stripes on the detection system. This is evident as these aliases are copies of the main signal scaled down by an integer factor. Finally there is also some noise high velocity measure-ments caused by multiple triggering on a single transition on the the Input Capture system likely due to the length of the signal carrying wires.

The results of the all of the tests in terms of vuand τmare summarized in Table 5.1. It is important to

note that while these tests are done in what may seem to be a ”no-load” environment in practice this is not verified and at least in the acceleration phase, the motor is running at full power with its load being the inertia of the rotor. A new parameter Pmax, the maximum mechanical power output, is calculated

from the data in the acceleration phase. In this regime, assuming constant torque (an assumption that is verified in all of the tests), the maximum mechanical power transmitted to the rotor is in the moment immediately before reaching the steady state velocity. In this moment the maximum power is calculated by:

Pmax= τmvu (5.1)

The test results indicate that the available torque increases both with the excitation frequency and the excitation voltage which indicates that chosen operating points were far from reaching the saturation flux of the magnetic materials.

Table 5.1: Summarized test results in terms of the steady-state rotor speed vu, the average mechanical

torque and the maximum power Pmax

f[Hz] U[V] Uf [Vs] τm[mNm] vu[Hz] Pmax[mW] 20 10 0.5 4.7 ± 0.5 2.0 ± 0.1 9 ± 1 20 8 0.4 3.2 ± 0.5 2.1 ± 0.1 7 ± 1 50 14 0.28 23.1 ± 0.5 4.0 ± 0.5 57 ± 1 30 8 0.27 4.2 ± 0.5 2.1 ± 0.1 8 ± 1 40 8 0.2 5.7 ± 0.5 2.2 ± 0.1 12 ± 1 50 8 0.16 6.3 ± 0.5 2.2 ± 0.1 14 ± 1

(45)

further.

(a) f=40Hz, U=8V (b) f=50Hz, U=8V

Figure 5.2: Acceleration test results, the teal line is the synchronous speed ns

The test with excitation frequency f = 50Hz and voltage U = 14V is the exception to the aforemen-tioned phenomenon, by increasing the power delivered to the motor the friction barrier appears to be surpassed. However as it can be seen the from the test results on Figure 5.3 the velocity behaves very erratically in these conditions, a consequence from the stronger vibrations caused by the higher velocity and the chaotic friction that results from them.

Figure 5.3: Acceleration test results, with excitation frequency f = 50Hz (synchronous speed ωs=2.2Hz)

and excitation voltage U = 14V . Note how the apparent friction barrier is surpassed but the velocity signal behaves very erratically (compare with Figure 5.1)

Finally it was also observed that the current drawn by the machine was constant during the entirety of the tests, only changing from test to test due to the effect of the impedance of the armature winding which as expected varies with the excitation frequency. This is expected as on all of the tests (except for the ones at the lowest frequency), although there was no explicit load on the motor, the high inertia of

(46)

the rotor and the friction at higher velocities cause the motor to be always under a significant load. Even in the tests that were done at lower frequency, where apparently the motor reached velocities close to its synchronous speed, it was verified that the current drawn by the stator remained constant throughout its acceleration which indicates very poor magnetic coupling between the stator and the rotor. The calculated maximum mechanical power values (see Table 5.1) seem to confirm this as they are under 2% of the applied electrical power which is approximately equal to U2

Z where Z is the impedance of the

(47)

Chapter 6

Conclusions

In spite of all the technical issues it harbors the developed prototype was a success, increasing the technology readiness level of a spherical induction motor based attitude control system actuator from 2 (Potential application validated) to 3 (Proof of concept demonstrated). The air-bearing solution for suspension of the rotor worked remarkably well for its improvised and low-pressure construction. It enabled near frictionless operation of the machine up to a speed where vibration of the rotor caused its contact with the bearing’s surface (about 120rpm).

One of main limiting factors on the prototype was the rotor, that by virtue of its shape and construction ended up with an unbalanced mass distribution thus causing undesirable vibrations. The air pump used to suspend the rotor on the air bearing was barely sufficient which increased the severity of the vibration issues as it decreased the resilience of the bearing upon vibration of the rotor.

The layout of the machine’s armature proved to be acceptable although it covered a small solid angle of the rotor. Although it limited the magnetic coupling between the stator and the rotor as well as the maximum attainable torque, this type of structure had advantages in ease of construction and assembly which is one of the major hurdles in the construction of an effective spherical motor. Due to its construction it only allowed motion in two directions, however it is possible to archive three axis motion with only small modifications to the machine. Due to its adjustable construction it was possible to obtain a relatively small air-gap ( 1mm), but the effective air-gap was much larger as the magnetic permeability of aluminum is low when compared to iron, in practice the effective air-gap combined the actual air-gap and the aluminum thickness on the rotor ( 5mm) this increased the leakage flux on both the stator and the rotor and was the main reason for the poor magnetic coupling that was observed.

The controller hardware proved to be entirely adequate for the task. Although the MCU was chosen primarily for its availability it had plenty of processing power available to execute the control software. The control software, was open-loop only but the SVM algorithm that was implemented was a good stepping stone for the implementation of more sophisticated control algorithms as it is adaptable into a field oriented controller, for example.

The machine’s velocity sensor was far from ideal but it was sufficient to obtain usable test data. The striped pattern on the rotor was simple to execute but restricted the detection of the velocity to only two

(48)

axes. The use of a better mouse sensor could prove to be a better solution although these sensors are not well suited to this task as their focus on a small portion of the measured surface conceptually limits their maximum speed.

The acceleration test results showed the limitations of the prototype, its problem with rotor vibration, the unreliable speed detection and the poor magnetic coupling between the armature and the rotor. However in spite of all of these difficulties the core idea of using a spherical induction motor as the heart of an attitude control system seems viable as even this low budget and rudimentary prototype showed some functionality. As such future research on this concept seems promising.

6.1

Future work

The development and testing of this prototype provided many valuable lessons and further illuminated the path for future research on this topic.

There were two main points learned, first that the rotor must be precisely balanced otherwise the maximum speed of operation will be severely limited. The second point lies in the thickness of the aluminum layer, a layer that is too thick will cause a poor magnetic coupling and subsequent loss of efficiency of the machine. The solution to both of these problems lies in the construction of a better rotor with better manufacturing tolerances, potentially using a metal 3D printer for the iron core and electroplating a layer of copper for the conductive layer. The design of the rotor itself can also be improved by using a salient pole type design consisting of castellations on the iron core to further improve the magnetic coupling of the machine. The design of the stator should also be improved, it should span a higher solid angle of the rotor for improved coupling. A third axis should also be added to fully test 3D operation.

The air-bearing itself can also be improved manly by using a stronger pump and by integrating the bearing further in the design of the stator so that it provides better support to the rotor. However for the specific application of an ACS actuator this is not crucial as the bearing is only required for operation on the ground.

An important part of the control system is the speed sensor, any future work improving the motor’s control system must start here. A full 3D sensor may be achieved by exploiting the castelation pattern on the improved rotor design, detecting the passage of the borders between materials with a set of four optical sensors on a tetrahedral layout for redundancy. With a reliable speed measurement and an improved magnetic coupling it should be possible to implement a closed-loop vector control solution, for

(49)

Bibliography

[1] E. Silani and M. Lovera. Magnetic spacecraft attitude control: a survey and some new results. Control Engineering Practice, 13(3):357–371, 2005.

[2] Y.-H. Chen, Z.-C. Hong, C.-H. Lin, and J.-S. Chern. Aerodynamic and gravity gradient stabilization for microsatellites. Acta Astronautica, 46(7):491–499, 2000.

[3] J. Ashenberg and E. C. Lorenzini. Active gravity-gradient stabilization of a satellite in elliptic orbits. Acta Astronautica, 45(10):619–627, 1999.

[4] R. Votel and D. Sinclair. Comparison of control moment gyros and reaction wheels for small earth-observing satellites. In Proceedings of the AIAA/USU Confer-ence on Small Satellites, number SSC12-X-1 in Advanced Technologies III, 2012. https://digitalcommons.usu.edu/smallsat/2012/all2012/74/.

[5] C. Gurrisi, R. Seidel, S. Dickerson, S. Didziulis, P. Frantz, and K. Ferguson. Space station control moment gyroscope lessons learned. In ”Proceedings of the 40th Aerospace Mechanisms Sympo-sium”, number NASA/CP-2010-216272, pages 161–176, 2010.

[6] F. L. Markley and J. L. Crassidis. Fundamentals of spacecraft attitude determination and control, volume 33. Springer, 2014.

[7] A. A. Craveiro and J. S. Sequeira. Reaction sphere actuator. IFAC-PapersOnLine, 49(17):212–217, 2016.

[8] W. Haeussermann. The spherical control motor for three axis attitude control of space vehicles. NASA TM X-50071, 1959.

[9] S. Toyama and S. Hatae. Multi-degree of freedom spherical ultrasonic motor. In RoManSy 9, pages 243–252. Springer, 1993.

[10] R. Wawrzaszek, M. Sidz, M. Strumik, M. Banaszkiewicz, K. Seweryn, L. Rossini, E. Onillon, et al. Novel type of inertial actuator for satellite attitude control system basis on concept of reaction sphere—elsa project. In Aerospace Robotics II, pages 85–92. Springer, 2015.

[11] J. F. Fernandes and P. C. Branco. A shell-like induction electrical machine. In Doctoral Conference on Computing, Electrical and Industrial Systems, pages 209–216. Springer, 2014.

(50)

[12] M. Kumagai and R. L. Hollis. Development and control of a three dof spherical induction motor. In Robotics and Automation (ICRA), 2013 IEEE International Conference on, pages 1528–1533. IEEE, 2013.

[13] L. Rossini, E. Onillon, A. Boletis, S. Mingard, R. Wawrzaszek, J. Serin, and C. Ortega. Development and closed-loop experimental results of a reaction sphere elegant breadboard. In 16th European Space Mechanisms and Tribology Symposium (ESMATS), 2015, 2015.

[14] R. Roth and K.-M. Lee. Design optimization of a three degrees-of-freedom variable-reluctance spherical wrist motor. Journal of engineering for industry, 117(3):378–388, 1995.

[15] A. E. Fitzgerald, C. Kingsley, S. D. Umans, and B. James. Electric machinery, volume 5. McGraw-Hill New York, 2003.

[16] J. F. Fernandes and P. C. Branco. The shell-like spherical induction motor for low-speed traction: electromagnetic design, analysis, and experimental tests. IEEE Transactions on Industrial Elec-tronics, 63(7):4325–4335, 2016.

[17] R. Cowen. The wheels come off kepler. Nature, 497(7450), 2013.

[18] Reaction Wheel. Cta space reaction wheel. available at https://spinoff.nasa.gov/ spinoff1997/t3.html. Accessed: 2018-03-03.

[19] L. Rossini, O. Ch ´etelat, E. Onillon, and Y. Perriard. Force and torque analytical models of a reaction sphere actuator based on spherical harmonic rotation and decomposition. IEEE/ASME Transac-tions on Mechatronics, 18(3):1006–1018, 2012.

[20] K. Bai and K.-M. Lee. Direct field-feedback control of a ball-joint-like permanent-magnet spherical motor. IEEE/ASME Transactions on Mechatronics, 19(3):975–986, 2014.

[21] M. Kim and Y. S. Yang. Spherical wheel motor, July 12 2016. US Patent 9,391,481.

[22] J. F. Fernandes, S. M. Vieira, and P. C. Branco. Multiobjective optimization of a shell-like induction spherical motor for a power-assisted wheelchair. IEEE Transactions on Energy Conversion, 33(2): 660–669, 2018.

(51)

[26] L. Rossini, O. Ch ´etelat, E. Onillon, and Y. Perriard. Force and torque analytical models of a reac-tion sphere actuator based on spherical harmonic rotareac-tion and decomposireac-tion. IEEE/ASME Trans. Mechatronics, 18(3):1006–1018, 2013.

[27] Somaloy 1P Material Data. H ¨oganas AB, 6 2018.

[28] Detroit sat airbearing. Detroitsat air bearing. available at https://github.com/Detroit-Sat/ Air-Bearing. Accessed: 2018-03-03.

[29] H. W. Van Der Broeck, H.-C. Skudelny, and G. V. Stanke. Analysis and realization of a pulsewidth modulator based on voltage space vectors. IEEE transactions on industry applications, 24(1):142– 150, 1988.

[30] Optical Mouse Sensor. Avago Technologies, 10 2008.

(52)
(53)

Appendix A

Controller Software implementation

The code developed to implement the SVM algorithm is presented on listing A.1 the non crucial parts of the code such as reading commands from the serial port, device specific configurations (timer, oscilator, motor control registers) have been removed for the sake of clarity, the full code can be seen in listings A.2, A.3 and A.4

Listing A.1: SVM algorithm implementation in C

1 # d e f i n e TURN 0x0800 2 # d e f i n e SEC 0x0100 3 4 / ∗ 1 6 b i t s i n e LUT from 0 t o p i / 4 ∗ / 5 c o n s t u i n t 1 6 t t b l [ ] = 6 { 0 , 202 , 404 , 606 , 807 , 1009 , 1211 , 1413 , 1615 , 1816 , 2018 , 2220 , 2422 , 7 2623 , 2825 , 3027 , 3228 , 3430 , 3631 , 3833 , 4034 , 4236 , 4437 , 4639 , 4840 , 5041 , 8 5242 , 5444 , 5645 , 5846 , 6047 , 6248 , 6449 , 6649 , 6850 , 7051 , 7252 , 7452 , 7653 , 9 7853 , 8053 , 8254 , 8454 , 8654 , 8854 , 9054 , 9254 , 9454 , 9653 , 9853 , 10053 , 10 10252 , 10451 , 10650 , 10850 , 11049 , 11247 , 11446 , 11645 , 11844 , 12042 , 12240 , 11 12439 , 12637 , 12835 , 13033 , 13230 , 13428 , 13625 , 13823 , 14020 , 14217 , 14414 , 12 14611 , 14808 , 15004 , 15201 , 15397 , 15593 , 15789 , 15985 , 16181 , 16376 , 16571 , 13 16767 , 16962 , 17157 , 17351 , 17546 , 17740 , 17935 , 18129 , 18322 , 18516 , 18710 , 14 18903 , 19096 , 19289 , 19482 , 19675 , 19867 , 20059 , 20251 , 20443 , 20635 , 20826 , 15 21018 , 21209 , 21400 , 21590 , 21781 , 21971 , 22161 , 22351 , 22541 , 22730 , 22919 , 16 23108 , 23297 , 23486 , 23674 , 23862 , 24050 , 24238 , 24425 , 24612 , 24799 , 24986 , 17 25172 , 25359 , 25545 , 25730 , 25916 , 26101 , 26286 , 26471 , 26655 , 26840 , 27024 , 18 27208 , 27391 , 27574 , 27757 , 27940 , 28122 , 28305 , 28487 , 28668 , 28850 , 29031 , 19 29211 , 29392 , 29572 , 29752 , 29932 , 30111 , 30291 , 30469 , 30648 , 30826 , 31004 , 20 31182 , 31359 , 31536 , 31713 , 31890 , 32066 , 32242 , 32417 , 32593 , 32768 , 32942 , 21 33116 , 33291 , 33464 , 33638 , 33811 , 33983 , 34156 , 34328 , 34500 , 34671 , 34842 , 22 35013 , 35184 , 35354 , 35523 , 35693 , 35862 , 36031 , 36199 , 36367 , 36535 , 36702 , 23 36870 , 37036 , 37203 , 37369 , 37534 , 37699 , 37864 , 38029 , 38193 , 38357 , 38521 , 24 38684 , 38846 , 39009 , 39171 , 39332 , 39494 , 39655 , 39815 , 39975 , 40135 , 40294 , 25 40453 , 40612 , 40770 , 40928 , 41085 , 41243 , 41399 , 41555 , 41711 , 41867 , 42022 , 26 42177 , 42331 , 42485 , 42638 , 42791 , 42944 , 43096 , 43248 , 43400 , 43551 , 43701 , 27 43851 , 44001 , 44151 , 44300 , 44448 , 44596 , 44744 , 44891 , 45038 , 45184 , 45330 , 28 45476 , 45621 , 45766 , 45910 , 46054 , 46197 , 46340};

(54)

29

30 / ∗ t h e s t a t e v e c t o r s c o n t r o l t h e d i r e c t i o n o f t h e c u r r e n t on t h e b r i d g e w h i l e

31 ∗ t h e sv r o u t i n e c a l c u l a t e s i t s magnitude , s i n c e t h e mcpwm module i s setup i n an u n c o n v i n i e n t 32 ∗ way 3+1 channels we need 5 v e c t o r s t o a l l o w f o r d i r e c t and i n v e r s e motion on both axes 33 ∗ t h e motor i s w i r e d as (XA XB YA) (YB) , r o t a t i o n r e v e r s a l i m p l i e s a p o l a r i t y i n v e r s i o n 34 ∗ on one o f t h e phases 35 c o n s t u i n t 1 6 t s t a t e 1 a n [ ] = {0x0900 , 0 x0900 , 0 x0a00 , 0 x0a00 , 0 x0600 , 0 x0600 , 0 x0500 , 0 x0500 } ; 36 c o n s t u i n t 1 6 t s t a t e 1 a r [ ] = {0x0500 , 0 x0500 , 0 x0600 , 0 x0600 , 0 x0a00 , 0 x0a00 , 0 x0900 , 0 x0900 } ; 37 c o n s t u i n t 1 6 t s t a t e 1 b [ ] = {0x1000 , 0 x1000 , 0 x2000 , 0 x2000 , 0 x2000 , 0 x2000 , 0 x1000 , 0 x1000 } ; 38 c o n s t u i n t 1 6 t s t a t e 2 n [ ] = {0x0200 , 0 x0200 , 0 x0200 , 0 x0200 , 0 x0100 , 0 x0100 , 0 x0100 , 0 x0100 } ; 39 c o n s t u i n t 1 6 t s t a t e 2 r [ ] = {0x0100 , 0 x0100 , 0 x0100 , 0 x0100 , 0 x0200 , 0 x0200 , 0 x0200 , 0 x0200 } ; 40 c o n s t u i n t 1 6 t ∗ s t a t e 1 a , ∗ s t a t e 2 ; / ∗ th ese w i l l p o i n t t o t h e above s t a t e v e c t o r s and 41 depend on t h e d i r e c t i o n o f r o t a t i o n ∗ / 42 43 u i n t 1 6 t per =2048; / ∗ pwm p e r i o d , t h i s i s a t i m e / magnitude r e s o l u t i o n t r a d e o f f ∗ / 44 u i n t 1 6 t a n g l e x =0 , a n g l e y = 0 ; 45 u i n t 1 6 t i n c x =1 , i n c y = 1 ; 46 u i n t 1 6 t s t o p = 1 ; 47 u i n t 1 6 t an , bn , t r a p = 0 ; 48 i n t 1 6 t scx =256; 49 i n t 1 6 t scy =256; 50 51 52 v o i d svmx ( )

53 / ∗ c a l c u l a t e d u t y c y c l e v a l u e s depending on a ngl e and a m p l i t u d e scx needless t o say 54 ∗ t h i s r o u t i n e c o u l d be w r i t t e n i n asm and g e t a 10x speed boost by u s i n g t h e dsp f e a t u r e s 55 ∗ on t h e hardware ∗ /

56 {

57 u i n t 1 6 t a , b ;

58 u i n t 3 2 t tmp ; / ∗ c a l c u l a t i o n s are done i n h i g h p r e c i s i o n 59 and then c o n v e r t e d back t o 16− b i t ∗ /

60 / ∗ n o r m a l i z e an gle v a l u e 1 t u r n = 4096 ∗ / 61 w h i l e ( a n g l e x >= TURN) anglex −=TURN; 62

63 / ∗ f i n d o c t a n t where an gle l i e s and n o r m a l i z e ag ain t o t h e o c t a n t 64 ∗ t h i s can be o p t i m i z e d as both TURN and ANGLE are powers o f two ,

65 ∗ f o r r e a d a b i l t y i t was l e f t t h i s way , a smart c o m p i l e r w i l l l i k e l y o p t i m i z e ∗ / 66 u i n t 1 6 t quad= a n g l e x / SEC ;

67 u i n t 1 6 t nangle =anglex−quad∗SEC ; 68 s w i t c h ( quad )

(55)

78 case 1 : case 5 : 79 a= t b l [ SEC−1−nangle ] ; 80 tmp=92682∗ t b l [ nangle ] / 6 5 5 3 6 ; 81 b = ( u i n t 1 6 t ) tmp+a ; 82 break ; 83 case 2 : case 6 : 84 a= t b l [ nangle ] ; 85 tmp=92682∗ t b l [ SEC−1−nangle ] / 6 5 5 3 6 ; 86 b = ( u i n t 1 6 t ) tmp+a ; 87 break ; 88 case 3 : case 7 : 89 b= t b l [ SEC−1−nangle ] ; c 90 tmp=92682∗ t b l [ nangle ] / 6 5 5 3 6 ; 91 a = ( u i n t 1 6 t ) tmp+b ; 92 break ; 93 d e f a u l t : 94 break ; 95 } 96 tmp = ( scx ∗ ( ( per ∗ ( u i n t 3 2 t ) a ) / 6 5 5 3 6 ) ) / 2 5 6 ; 97 / ∗ s c a l e d u t y c y c l e v a l u e s depending on a m p l i t i d e 98 ∗ and pwm f r e q u e n c y ∗ / 99 P1DC1= ( u i n t 1 6 t ) tmp ; 100 tmp = ( scx ∗ ( ( per ∗ ( u i n t 3 2 t ) b ) / 6 5 5 3 6 ) ) / 2 5 6 ; 101 P1DC2= ( u i n t 1 6 t ) tmp ;

102 P1OVDCON&=0 x f 0 f f ; / ∗ c l e a r t h e o u t p u t b r i d g e s t a t e and s e t i t t o t h e c o r r e c t one ∗ / 103 P1OVDCON| = s t a t e 1 a [ quad ] ;

104 } 105

106 / ∗ t i m e r i n t e r r u p t v e c t o r , t h e f r e q u e n c y o f t h i s i n t e r r u p t i s t h e d e s i r e d 107 ∗ o u t p u t f r e q u e n c y ∗4096/ i n c x , i t i s s e t e x t e r n a l l y on a s e r i a l p o r t command

108 ∗ t o o h i g h i n t e r r u p t f r e q u e n c i e s w i l l crash t h e code keep i n mind t h e svm r o u t i n e t a k e s 109 ∗ ˜20 us t o execute use i n c x t o o b t a i n h i g h e r f r e q u e n c i e s a t t h e expense o f r e s o l u t i o n 110 ∗ i f needed ∗ / 111 v o i d a t t r i b u t e ( ( i n t e r r u p t , a u t o p s v ) ) T 4 I n t e r r u p t ( v o i d ) 112 { 113 T 4 I F = 0 ; 114 a n g l e x += i n c x ; 115 svmx ( ) ; 116 }

Listing A.2: Microprocessor code main file

1 / ∗ t h i s f i l e wont f e a t u r e many comments , most o f t h e i m p o r t a n t s t u f f i s commented on t h e 2 ∗ l i s t i n g f i l e ∗ / 3 4 # i n c l u d e <xc . h> 5 # i n c l u d e < s t d i n t . h> 6 # i n c l u d e <s t d i o . h> 7 # i n c l u d e < s t d l i b . h> 8 # i n c l u d e ” main . h ”

(56)

9 # i n c l u d e ” c f g . h ” 10 # i n c l u d e <l i b p i c 3 0 . h> 11

12 FOSCSEL ( FNOSC PRIPLL & IESO OFF ) ;

13 FOSC (POSCMD XT & IOL1WAY OFF & FCKSM CSECMD) ; 14 FWDT(FWDTEN OFF) ;

15 FPOR (FPWRT PWR128 & PWMPIN ON & LPOL ON & HPOL ON) ; 16

17 # d e f i n e RXBSZ 20 18

19 unsigned i n t s t r p o s = 0 ; 20 char r x b u f [ RXBSZ ] ;

21 unsigned i n t command avail = 0 ; 22 23 # d e f i n e TURN 0x0800 24 # d e f i n e SEC 0x0100 25 26 c o n s t u i n t 1 6 t t b l [ ] = 27 { 0 , 202 , 404 , 606 , 807 , 1009 , 1211 , 1413 , 1615 , 1816 , 2018 , 2220 , 2422 , 28 2623 , 2825 , 3027 , 3228 , 3430 , 3631 , 3833 , 4034 , 4236 , 4437 , 4639 , 4840 , 5041 , 29 5242 , 5444 , 5645 , 5846 , 6047 , 6248 , 6449 , 6649 , 6850 , 7051 , 7252 , 7452 , 7653 , 30 7853 , 8053 , 8254 , 8454 , 8654 , 8854 , 9054 , 9254 , 9454 , 9653 , 9853 , 10053 , 31 10252 , 10451 , 10650 , 10850 , 11049 , 11247 , 11446 , 11645 , 11844 , 12042 , 12240 , 32 12439 , 12637 , 12835 , 13033 , 13230 , 13428 , 13625 , 13823 , 14020 , 14217 , 14414 , 33 14611 , 14808 , 15004 , 15201 , 15397 , 15593 , 15789 , 15985 , 16181 , 16376 , 16571 , 34 16767 , 16962 , 17157 , 17351 , 17546 , 17740 , 17935 , 18129 , 18322 , 18516 , 18710 , 35 18903 , 19096 , 19289 , 19482 , 19675 , 19867 , 20059 , 20251 , 20443 , 20635 , 20826 , 36 21018 , 21209 , 21400 , 21590 , 21781 , 21971 , 22161 , 22351 , 22541 , 22730 , 22919 , 37 23108 , 23297 , 23486 , 23674 , 23862 , 24050 , 24238 , 24425 , 24612 , 24799 , 24986 , 38 25172 , 25359 , 25545 , 25730 , 25916 , 26101 , 26286 , 26471 , 26655 , 26840 , 27024 , 39 27208 , 27391 , 27574 , 27757 , 27940 , 28122 , 28305 , 28487 , 28668 , 28850 , 29031 , 40 29211 , 29392 , 29572 , 29752 , 29932 , 30111 , 30291 , 30469 , 30648 , 30826 , 31004 , 41 31182 , 31359 , 31536 , 31713 , 31890 , 32066 , 32242 , 32417 , 32593 , 32768 , 32942 , 42 33116 , 33291 , 33464 , 33638 , 33811 , 33983 , 34156 , 34328 , 34500 , 34671 , 34842 , 43 35013 , 35184 , 35354 , 35523 , 35693 , 35862 , 36031 , 36199 , 36367 , 36535 , 36702 , 44 36870 , 37036 , 37203 , 37369 , 37534 , 37699 , 37864 , 38029 , 38193 , 38357 , 38521 , 45 38684 , 38846 , 39009 , 39171 , 39332 , 39494 , 39655 , 39815 , 39975 , 40135 , 40294 , 46 40453 , 40612 , 40770 , 40928 , 41085 , 41243 , 41399 , 41555 , 41711 , 41867 , 42022 , 47 42177 , 42331 , 42485 , 42638 , 42791 , 42944 , 43096 , 43248 , 43400 , 43551 , 43701 , 48 43851 , 44001 , 44151 , 44300 , 44448 , 44596 , 44744 , 44891 , 45038 , 45184 , 45330 ,

(57)

58 u i n t 1 6 t per =2048; 59 u i n t 1 6 t a n g l e x =0 , a n g l e y = 0 ; 60 u i n t 1 6 t i n c x =1 , i n c y = 1 ; 61 u i n t 1 6 t s t o p = 1 ; 62 u i n t 1 6 t an , bn , t r a p = 0 ; 63 i n t 1 6 t scx =256; 64 i n t 1 6 t scy =256; 65 66 v o i d 67 intrep command ( v o i d ) 68 / ∗ execute commands ∗ / 69 { 70 i n t i ; 71 r x b u f [ s t r p o s − 1 ] = 0 ; 72 s w i t c h ( r x b u f [ 0 ] ) { 73 case ’ t ’ : 74 P1TPER= a t o i ( r x b u f +1) ; 75 P2TPER= a t o i ( r x b u f +1) ; 76 per =2∗ a t o i ( r x b u f +1) ; 77 break ; 78 case ’ s ’ : 79 p r i n t f ( ” \ n ” ) ; 80 break ; 81 case ’ y ’ : 82 PR4=19531/ a t o i ( r x b u f +1) ; 83 break ; 84 case ’ u ’ : 85 PR5=19531/ a t o i ( r x b u f +1) ; 86 break ; 87 case ’ 1 ’ : 88 p r i n t f (”%d\n\ r ” , PDC1) ; 89 PDC1= a t o i ( r x b u f +1) ; 90 break ; 91 case ’ 2 ’ : 92 p r i n t f (”%d\n\ r ” , PDC2) ; 93 PDC2= a t o i ( r x b u f +1) ; 94 break ; 95 case ’ b ’ : 96 s t o p = a t o i ( r x b u f +1) ; 97 break ; 98 case ’ r ’ : 99 T4IE = 0 ; 100 T 4 I F = 0 ; 101 T5IE = 0 ; 102 T 5 I F = 0 ; 103 P1DC1= 0 ; 104 P1DC2= 0 ; 105 P1DC3= 0 ; 106 P2DC1= 0 ;

(58)

107 break ; 108 case ’ e ’ : 109 a n g l e x = 0 ; 110 a n g l e y = 0 ; 111 T4IE = 1 ; 112 T5IE = 1 ; 113 break ; 114 case ’ z ’ : 115 scy= a t o i ( r x b u f +1) ; 116 i f ( scy <0) { 117 scy=−scy ; 118 s t a t e 2 = s t a t e 2 r ; 119 } e l s e { 120 s t a t e 2 = s t a t e 2 n ; 121 } 122 break ; 123 case ’ x ’ : 124 scx= a t o i ( r x b u f +1) ; 125 i f ( scx <0){ 126 scx=−scx ; 127 s t a t e 1 a = s t a t e 1 a r ; 128 } e l s e { 129 s t a t e 1 a = s t a t e 1 a n ; 130 } 131 break ; 132 d e f a u l t : 133 p u t s ( ” ? \ r ” ) ; 134 } 135 s t r p o s = 0 ; 136 command avail = 0 ; 137 138 } 139 140 v o i d svmx ( ) 141 { 142 u i n t 1 6 t a , b ; 143 u i n t 3 2 t tmp ;

144 w h i l e ( a n g l e x >= TURN) anglex −=TURN; 145

(59)

156 a= t b l [ SEC−1−nangle ] ; 157 tmp=92682∗ t b l [ nangle ] / 6 5 5 3 6 ; 158 b = ( u i n t 1 6 t ) tmp+a ; 159 break ; 160 case 2 : case 6 : 161 a= t b l [ nangle ] ; 162 tmp=92682∗ t b l [ SEC−1−nangle ] / 6 5 5 3 6 ; 163 b = ( u i n t 1 6 t ) tmp+a ; 164 break ; 165 case 3 : case 7 : 166 b= t b l [ SEC−1−nangle ] ; 167 tmp=92682∗ t b l [ nangle ] / 6 5 5 3 6 ; 168 a = ( u i n t 1 6 t ) tmp+b ; 169 break ; 170 d e f a u l t : 171 break ; 172 } 173 tmp = ( scx ∗ ( ( per ∗ ( u i n t 3 2 t ) a ) / 6 5 5 3 6 ) ) / 2 5 6 ; 174 P1DC1= ( u i n t 1 6 t ) tmp ; 175 tmp = ( scx ∗ ( ( per ∗ ( u i n t 3 2 t ) b ) / 6 5 5 3 6 ) ) / 2 5 6 ; 176 P1DC2= ( u i n t 1 6 t ) tmp ; 177 P1OVDCON&=0 x f 0 f f ; 178 P1OVDCON| = s t a t e 1 a [ quad ] ; 179 } 180 181 v o i d svmy ( ) 182 { 183 u i n t 1 6 t a , b ; 184 u i n t 3 2 t tmp ;

185 w h i l e ( a n g l e y >= TURN) angley −=TURN; 186 187 u i n t 1 6 t quad= a n g l e y / SEC ; 188 u i n t 1 6 t nangle =angley−quad∗SEC ; 189 s w i t c h ( quad ) 190 { 191 case 0 : case 4 : 192 b= t b l [ nangle ] ; 193 tmp=92682∗ t b l [ SEC−1−nangle ] / 6 5 5 3 6 ; 194 a = ( u i n t 1 6 t ) tmp+b ; 195 break ; 196 case 1 : case 5 : 197 a= t b l [ SEC−1−nangle ] ; 198 tmp=92682∗ t b l [ nangle ] / 6 5 5 3 6 ; 199 b = ( u i n t 1 6 t ) tmp+a ; 200 break ; 201 case 2 : case 6 : 202 a= t b l [ nangle ] ; 203 tmp=92682∗ t b l [ SEC−1−nangle ] / 6 5 5 3 6 ; 204 b = ( u i n t 1 6 t ) tmp+a ;

(60)

205 break ; 206 case 3 : case 7 : 207 b= t b l [ SEC−1−nangle ] ; 208 tmp=92682∗ t b l [ nangle ] / 6 5 5 3 6 ; 209 a = ( u i n t 1 6 t ) tmp+b ; 210 break ; 211 d e f a u l t : 212 break ; 213 } 214 215 tmp = ( scy ∗ ( ( per ∗ ( u i n t 3 2 t ) a ) / 6 5 5 3 6 ) ) / 2 5 6 ; 216 P1DC3= ( u i n t 1 6 t ) tmp ; 217 tmp = ( scy ∗ ( ( per ∗ ( u i n t 3 2 t ) b ) / 6 5 5 3 6 ) ) / 2 5 6 ; 218 P2DC1= ( u i n t 1 6 t ) tmp ; 219 220 P1OVDCON&=0 x 0 f f f ; 221 P1OVDCON| = s t a t e 1 b [ quad ] ; 222 P2OVDCON= s t a t e 2 [ quad ] ; 223 } 224 225 v o i d a t t r i b u t e ( ( i n t e r r u p t , a u t o p s v ) ) U 2 R X I n t e r r u p t ( v o i d ) 226 / ∗ s e r i a l p o r t read r o u t i n e ∗ / 227 { 228 U2RXIF = 0 ; 229 LATC8 = 1 ; 230 char c ; 231 w h i l e ( U2STAbits .URXDA) { 232 c = U2RXREG; 233 p u t c h a r ( c ) ; 234 r x b u f [ s t r p o s ++] = c ; 235 i f ( s t r p o s >= RXBSZ) { 236 s t r p o s = 0 ; 237 } 238 } 239 i f ( c == ’ \ r ’ ) { 240 command avail = 1 ; 241 p u t c h a r ( ’ \ n ’ ) ; 242 p u t c h a r ( ’ \ r ’ ) ; 243 } 244 LATC8 = 0 ;

Referências

Documentos relacionados