AN ABSTRACT OF THE THESIS OF Nathan R. Henshaw for the degree of Master of Science in Electrical and Computer Engineering presented on July 17, 2009. Title: A Force Control Algorithm for a Wave Energy Linear Test Bed Abstract approved: Ted K. Brekken Researchers at Oregon State University, focusing on the development of ocean wave energy converters, have designed and installed a unique linear test bed to aid in the characterization of these converters. Under the original control scheme, the linear test bed follows a position profile and is limited in its ability to replicate the forces a wave energy converter would experience in the ocean. To overcome these limitations, a force control algorithm has been developed to better simulate the hydrodynamic effects between an ocean wave and a wave energy converter device. This thesis presents the design and implementation of the force control algorithm on the linear test bed. c Copyright by Nathan R. Henshaw July 17, 2009 All Rights Reserved A Force Control Algorithm for a Wave Energy Linear Test Bed by Nathan R. Henshaw A THESIS submitted to Oregon State University in partial fulfillment of the requirements for the degree of Master of Science Presented July 17, 2009 Commencement June 2010 Master of Science thesis of Nathan R. Henshaw presented on July 17, 2009. APPROVED: Major Professor, representing Electrical and Computer Engineering Director of the School of Electrical Engineering and Computer Science Dean of the Graduate School I understand that my thesis will become part of the permanent collection of Oregon State University libraries. My signature below authorizes release of my thesis to any reader upon request. Nathan R. Henshaw, Author ACKNOWLEDGEMENTS I would first like to thank Dr. Ted Brekken and Dr. Annette von Jouanne for their insight and guidance throughout my graduate studies. I am grateful for all of the opportunities I have had as part of the Energy Systems research group. My thanks also go out to my fellow WESRF students, who have helped in many ways during the last two years. Most importantly, to my parents, who have never stopped supporting me over the years: thank you. TABLE OF CONTENTS Page 1 INTRODUCTION 1 1.1 Wave Energy Background . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 OSU Involvement in Wave Energy . . . . . . . . . . . . . . . . . . . 4 1.3 National Marine Renewable Energy Test Center . . . . . . . . . . . 6 1.4 WESRF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 THE LINEAR TEST BED 8 2.1 Purpose of the Linear Test Bed . . . . . . . . . . . . . . . . . . . . 8 2.2 Overview and Specifications . . . . . . . . . . . . . . . . . . . . . . 8 2.3 Linear Test Bed Controls . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Position Control Modes . . . . . . . . . . . . . . . . . . . . . 12 13 2.4 dSPACE DS1103 Rapid Prototyping System . . . . . . . . . . . . . 14 3 FORCE CONTROL 18 3.1 The Need for Force Control . . . . . . . . . . . . . . . . . . . . . . 18 3.2 Development of Force Control Model . . . 3.2.1 Hydrodynamic and Force Equations 3.2.2 Modeling in Simulink . . . . . . . . 3.2.3 Delta Tau Controller Response . . . 3.2.4 Load Cell Force Response . . . . . 3.2.5 Modifying Equations for Simulink . . . . . . . 20 20 24 26 27 29 3.3 Stability Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.4 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 IMPLEMENTATION OF FORCE CONTROL MODEL 39 4.1 Load Cell Signal Conversion . . . . . . . . . . . . . . . . . . . . . . 39 4.2 Safety Limit Checks . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.3 Integration with dSPACE . . . . . . . . . . . . . . . . . . . . . . . 48 4.4 Transition from Position Control to Force Control . . . . . . . . . . 50 TABLE OF CONTENTS (Continued) Page 5 TESTING RESULTS 52 5.1 DC Input Wave Height . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.2 Sinusoidal Wave Input . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.3 Barkhausen Stability Criterion . . . . . . . . . . . . . . . . . . . . . 57 5.4 Notch Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 5.5 Characterizing Position Response . . . . . . . . . . . . . . . . . . . 65 5.6 Padé Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . 70 5.7 Internal Model Controller . . . . . . . . . . . . . . . . . . . . . . . 73 5.8 Spring Constant Modeling and Compensation . . . . . . . . . . . . 75 6 FUTURE WORK AND CONCLUSION 83 Bibliography 84 Appendices 87 A DSPACE CONNECTIONS AND FORCE CONTROL OPERATION 88 A.1 I/O Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 A.2 Control and GUI Implementation . . . . . . . . . . . . . . . . . . . 91 A.3 Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 LIST OF FIGURES Figure Page 1.1 Oscillating Water Column [15] . . . . . . . . . . . . . . . . . . . . . 2 1.2 Overtopping System [5] . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Attenuator [4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4 L10 Wave Energy Converter [16] . . . . . . . . . . . . . . . . . . . . 5 2.1 Rendering of the Linear Test Bed [11] . . . . . . . . . . . . . . . . . 9 2.2 Frame and Drive System [11] . . . . . . . . . . . . . . . . . . . . . . 10 2.3 Carriage Assembly [11] . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.4 Interface 1010 Load Cell [2] . . . . . . . . . . . . . . . . . . . . . . 11 2.5 Block Diagram of dSPACE DS1103 [10] . . . . . . . . . . . . . . . . 15 2.6 Real-Time Interface Simulink Blocks [10] . . . . . . . . . . . . . . . 16 2.7 Example ControlDesk Interface . . . . . . . . . . . . . . . . . . . . 17 3.1 Simulink Control Model . . . . . . . . . . . . . . . . . . . . . . . . 24 3.2 Simulink Control Model for Stability Analysis . . . . . . . . . . . . 30 3.3 Example Feedback Loop . . . . . . . . . . . . . . . . . . . . . . . . 32 3.4 Bode Plot of Open-Loop Response . . . . . . . . . . . . . . . . . . 33 3.5 Bode Plot of Closed-Loop Response . . . . . . . . . . . . . . . . . . 34 3.6 Poles and Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.7 Step Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.8 Wave Height and Buoy Position for Step Input . . . . . . . . . . . . 36 3.9 Wave Height and Buoy Position for Sinusoidal Input . . . . . . . . 37 3.10 Commanded and Actual Position for Sinusoidal Input . . . . . . . . 37 3.11 Applied Force for Sinusoidal Input . . . . . . . . . . . . . . . . . . 38 Realtime Model Diagram . . . . . . . . . . . . . . . . . . . . . . . . 41 4.1 LIST OF FIGURES (Continued) Page Figure 4.2 Load Cell Conversion Subsystem . . . . . . . . . . . . . . . . . . . 42 4.3 Load Cell Geometry [11] . . . . . . . . . . . . . . . . . . . . . . . . 43 4.4 Realtime Model Diagram with Signal Limit Checking . . . . . . . . 44 4.5 Signal Limits Check Subsystem . . . . . . . . . . . . . . . . . . . . 45 4.6 Bode Plot of Derivative . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.7 Bode Plot of Derivative with 100 Hz Pole . . . . . . . . . . . . . . . 47 4.8 Details of Signal Limit Checking . . . . . . . . . . . . . . . . . . . . 47 4.9 Realtime Model with dSPACE I/O Blocks . . . . . . . . . . . . . . 49 4.10 Acceleration Signal Conversion . . . . . . . . . . . . . . . . . . . . 49 4.11 Realtime Model with Position Reference . . . . . . . . . . . . . . . 51 5.1 Position Oscillation . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.2 Fltb and Fe with Position Oscillation . . . . . . . . . . . . . . . . . 54 5.3 FFT of Position Oscillation . . . . . . . . . . . . . . . . . . . . . . 54 5.4 Position Oscillation, Generator Short-Circuited . . . . . . . . . . . 55 5.5 Fltb and Fe, Generator Short-Circuited . . . . . . . . . . . . . . . . 56 5.6 FFT of Position Oscillation, Generator Short-Circuited . . . . . . . 56 5.7 Position Response with Sinusoidal Input, Generator Unloaded . . . 58 5.8 Fltb and Fe with Sinusoidal Input, Generator Unloaded . . . . . . . 58 5.9 Position Response with Sinusoidal Input, Generator Short-Circuited 59 5.10 Fltb and Fe with Sinusoidal Input, Generator Short-Circuited . . . 59 5.11 Example Notch Filter . . . . . . . . . . . . . . . . . . . . . . . . . . 61 5.12 Designed Notch Filter . . . . . . . . . . . . . . . . . . . . . . . . . 62 5.13 Example Feedback Loop . . . . . . . . . . . . . . . . . . . . . . . . 62 LIST OF FIGURES (Continued) Figure Page 5.14 Force Controller with Notch Filter . . . . . . . . . . . . . . . . . . . 63 5.15 Position Oscillation with Notch Filter . . . . . . . . . . . . . . . . . 64 5.16 Fltb and Fe with Notch Filter . . . . . . . . . . . . . . . . . . . . . 64 5.17 FFT of Position Oscillation with Notch Filter . . . . . . . . . . . . 65 5.18 Position Response with Sinusoidal Input and Notch Filter . . . . . . 66 5.19 Fltb and Fe with Sinusoidal Input and Notch Filter . . . . . . . . . 66 5.20 Commanded and Actual Position . . . . . . . . . . . . . . . . . . . 67 5.21 Position Response Approximation Using Single Pole . . . . . . . . . 69 5.22 Bode Plot of Exponential Delay . . . . . . . . . . . . . . . . . . . . 70 5.23 Position Response Approximation Using Single Pole and Delay . . . 71 5.24 Comparison of Padé Approximation with Exponential Delay . . . . 72 5.25 Internal Model Control Example [18] . . . . . . . . . . . . . . . . . 74 5.26 Realtime Control Model with IMC . . . . . . . . . . . . . . . . . . 75 5.27 Position Response with IMC . . . . . . . . . . . . . . . . . . . . . . 76 5.28 Position Oscillation with IMC . . . . . . . . . . . . . . . . . . . . . 76 5.29 Fltb and Fe of Oscillation with IMC . . . . . . . . . . . . . . . . . 77 5.30 Force Control Subsystem with Spring Compensation . . . . . . . . . 79 5.31 Approximation of Force Response to Position Command . . . . . . 80 5.32 Position Oscillation with Spring Compensation . . . . . . . . . . . . 81 5.33 Fltb and Fe of Oscillation with Spring Compensation . . . . . . . . 82 LIST OF TABLES Table Page 3.1 L10 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.1 Measured Position Response Data . . . . . . . . . . . . . . . . . . . 68 5.2 Measured Force and Position Command Data . . . . . . . . . . . . 80 LIST OF APPENDIX FIGURES Figure Page A.1 dSPACE 1103 Connector Panel . . . . . . . . . . . . . . . . . . . . 93 A.2 dSPACE 1103 CP30 Connector . . . . . . . . . . . . . . . . . . . . 94 Chapter 1 – INTRODUCTION Along with the world’s growing demand for energy comes the need to develop new energy resources. Due in part to increased public awareness and government backing, interest has increased greatly in the field of renewable energy. The continued development of clean renewable energy sources is crucial to reducing our dependence on fossil fuels. Today, the most well-known renewable energy technology is wind energy, as it was the first alternative energy technology proven to be economically viable for large scale energy production [6]. Wind energy, however, has limitations due to factors such as the variability of wind preventing it from being used for base load generation on the electrical grid, and manufacturing and transportation constraints making it difficult to increase the size of wind turbines [9]. 1.1 Wave Energy Background Ocean wave energy is a renewable energy field with an enormous potential that is just beginning to be tapped. The energy density of ocean waves compared to wind means that there is a tremendous amount of power available; researchers estimate that up to two terawatts of electricity could be provided by ocean waves [12]. The energy in waves comes from wind, which ultimately comes from solar energy. As 2 long as this solar energy is available, ocean waves will be generated [8]. Wave energy is only one type of ocean energy, which also includes ocean thermal energy and tidal energy [13]. It is primarily the rising and falling motion of the water that is harnessed by wave energy converters to generate electricity. These converters can be either onshore or offshore systems. Onshore wave energy systems include technologies such as the oscillating water column, the tapered channel system, and the pendulor device [12]. Offshore devices can be floating or submerged, and include overtopping spill-over devices, point absorbers, and wave attenuators [6]. Figures 1.1, 1.2, and 1.3 illustrate some examples of various technologies for extracting power from waves. Figure 1.1: Oscillating Water Column [15] 3 Figure 1.2: Overtopping System [5] Figure 1.3: Attenuator [4] 4 1.2 OSU Involvement in Wave Energy The category of wave energy converter technology that has been the focus of research at Oregon State University (OSU) is the point absorber buoy. To date, eleven prototype wave energy converters have been built at OSU, and September 2008 marked the second prototype tested in the ocean [16]. The wave energy converter known as the L10 is a novel 10 kW direct-drive system using a permanentmagnet, transverse-flux, linear generator. The rendering of this buoy in Figure 1.4 depicts a central “spar” and surrounding float section. The spar is anchored so that it remains fairly stationary, and the float moves up and down following the waves, creating relative linear motion between the two sections. Permanent magnets in the active section of the float slide past the copper coils in the central spar, and the resulting changing magnetic field seen by the coils directly induces voltage by Faraday’s Law. Direct-drive wave energy converters can have several advantages over the use of a conventional rotary generator in a buoy system. Typical rotary machines are meant to operate at relatively high speed and low torque, requiring some conversion through hydraulic, pneumatic, or mechanical means. These power conversion steps introduce inefficiencies, and require maintenance to keep them operating as intended. The direct-drive linear generators developed at OSU directly convert the heaving motion of ocean waves into electrical energy, eliminating intermediate conversion stages with the goals of offering greater efficiency and requiring less maintenance. 5 Figure 1.4: L10 Wave Energy Converter [16] 6 1.3 National Marine Renewable Energy Test Center With funding from the U.S. Department of Energy, Oregon State University and the University of Washington have partnered to develop the Northwest National Marine Renewable Energy Center (NNMREC). This center will support wave and tidal energy development by serving as an integrated test center for both U.S. and international wave and tidal energy developers. Other objectives of NNMREC include evaluating the environmental and ecosystem impacts of marine energy technologies, optimizing devices and “wave park” arrays, maximizing the reliability and survivability of marine energy systems, and improving wave energy forecasting methods [7]. Seeking to address one of the challenges facing the wave energy industry, the lack of infrastructure for ocean testing and deployment of wave energy converters, NNMREC will include integrated and standardized test facilities for these devices. The test facility plan proposed by OSU includes test berths for full scale wave energy converter devices, along with power analysis and data acquisition systems. This approach allows for the testing and characterization of devices without the regulatory and technical complications of connecting to the electrical grid [7]. By helping to overcome some of the challenges currently holding back wave energy development, OSU can play a strong role in the transformation of wave energy from a fledgling technology into a commercially realizable clean source of energy. 7 1.4 WESRF As one of the facilities at Oregon State University involved in the Northwest National Marine Renewable Energy Center, the Wallace Energy Systems and Renewables Facility (WESRF) is the highest power energy systems laboratory at any university in the United States [16, 17]. Equipment resources in the WESRF include a 750 kVA independent power supply, test beds for testing motors, generators, and adjustable-speed drives up to 300 hp, with regenerative capability to put the power back onto the grid, and a 120 kVA fully-programmable source and waveform generator [17]. Recently, in the fall of 2007, installation was completed of a unique wave energy linear test bed in the WESRF lab. By recreating the vertical heaving motion of ocean waves, the linear test bed enables the testing and characterization of various wave energy conversion devices, and is a valuable tool for the advancement of wave energy technology. This thesis covers the development of a force control algorithm to further enhance the testing capabilities of the linear test bed. 8 Chapter 2 – THE LINEAR TEST BED 2.1 Purpose of the Linear Test Bed In order to test and characterize wave energy converters, the Energy Systems research group at Oregon State University has installed a unique wave energy linear test bed in the Wallace Energy Systems and Renewables Facility. The purpose of the linear test bed is to simulate the heaving of ocean waves and create relative linear motion between the spar and float section of a wave energy buoy. With the ability to recreate motion from real wave profiles captured by data collection buoys in the ocean, the linear test bed enables researchers to experimentally determine the response of various wave energy converter designs over a range of sea state conditions. 2.2 Overview and Specifications The linear test bed, shown in Figure 2.1, was constructed to OSU’s specifications by Mundt and Associates (Scottsdale, AZ), a company specializing in unique, custom, automated machines. It is capable of driving a 10 kW wave energy converter at full load, assuming a generator efficiency of 50%. With a 95% efficient device, the linear test bed can provide enough force to extract 19 kW of electrical power. The range of vertical motion is 2 meters, and the linear test bed is rated for 20,000 N 9 of thrust at speeds up to 1 m/s and accelerations up to 1.1 m/s2 . In fast mode operation, the linear test bed is rated for 10,000 N of thrust at speeds up to 2 m/s, with a maximum acceleration of 3.0 m/s2 . Various control modes are also possible, including preprogrammed wave position profiles, fixed velocity control, and force control, which is the topic explored in this thesis [16, 11]. Figure 2.1: Rendering of the Linear Test Bed [11] Powering the linear test bed is a 50 horsepower IndraDyn A servo motor (Bosch Rexroth, Hoffman Estates, IL), which is driven by an IndraDrive variable speed drive (Bosch Rexroth) [11]. The rotational motion of the motor is translated to vertical linear motion through a system of belts, as seen in Figure 2.2. These belts are steel timing belts, which are highly efficient and designed for high speeds. Attached to the vertical drive belts is the carriage assembly of Figure 2.3, to which the float section of the wave energy converter under test is mounted. The three 10 different yoke sizes seen in the center of the carriage assembly provide flexibility by allowing a wide range of device sizes to be tested. The spar section of the device under test is mounted to the platform at the base of the linear test bed, which includes a gimbal mount to eliminate side loading due to misalignment. Figure 2.2: Frame and Drive System [11] It is important for data acquisition and control feedback to know the force applied by the linear test bed to the device under test. To measure the force, a pair of load cells are mounted between the linear test bed carriage and yoke, illustrated by the diagonal elements in Figure 2.3. The load cells used are Interface model 1010 load cells (Interface Inc., Scottsdale, AZ), an example of which is shown in Figure 2.4. Since the linear test bed is intended to test devices of various sizes, three interchangeable pairs of load cells are used, with maximum forces per pair of 1.25 kN, 5 kN, and 25 kN in both tension and compression. The signal from the load 11 Figure 2.3: Carriage Assembly [11] cells is passed through a signal conditioning module, then to the analog-to-digital inputs of the dSPACE DS1103 system (dSPACE GmbH, Paderborn, Germany), discussed later in this chapter [11]. Figure 2.4: Interface 1010 Load Cell [2] In addition to the load cell force signals, position, velocity, and acceleration are also important parameters to record for the characterization of a wave energy converter under test. The linear velocity and acceleration of the device under test 12 are calculated from the rotational speed and acceleration of the linear test bed motor, as output by the Rexroth IndraDrive C Drive Controller. The digital-toanalog converter outputs of the drive controller have a voltage range of 0-5 V, with 8-bit resolution for the rotary speed and acceleration. The speed and acceleration signals from the Rexroth drive must be scaled by the known drive ratios of the linear test bed to obtain the actual linear velocity and acceleration of the device under test. The Delta Tau Turbo Programmable Multi Axis Controller (PMAC) PCI position controller (Delta Tau, Chatsworth, CA), described in Section 2.3, is capable of outputting the absolute linear position of the device under test by using encoder feedback from the motor, and scaling by the known gear ratio. The center position of the vertical range of linear motion is determined at each startup through a homing routine, and zero height is set to this center position. The digital-to-analog converter output of the Delta Tau controller is a ±10 V signal with 16-bit resolution for the linear position [11]. All of the position, velocity, and acceleration signals are fed to the dSPACE DS1103 system, where proper scaling is applied to convert the voltage signals into useful engineering units. 2.3 Linear Test Bed Controls The primary mode of control used in the linear test bed is position control, and was already implemented by Mundt and Associates when the equipment was installed in the WESRF lab. Position control is performed using the Delta Tau Turbo PMAC PCI controller to follow a preprogrammed linear position profile. There 13 are several modes of position control implemented on the linear test bed, including position versus time read from an input file, continuous programmable position control, fixed velocity control, and a manual jog mode [11]. 2.3.1 Position Control Modes In the first position control mode, position versus time data are read directly from a file by the Delta Tau controller. The input file contains data points with 1 millisecond time steps, meaning that a new position is commanded every 1 millisecond [11]. Since this file is generated in advance, any desired position profile can be used, within the rated limits of the linear test bed. By loading a file containing actual wave height data recorded by monitoring buoys in the ocean, the linear test bed can be made to follow the exact position profile of the recorded sea state. If preferred, one could also generate a file of random wave data using MATLAB or another tool, to achieve any desired distribution of amplitude, velocity, or acceleration. The second position control mode, continuous programmable position control, calculates a position profile using a trigonometric function. Typically, this would be used to input a simple sinusoidal profile for simulating a basic wave of a single frequency, however multiple harmonics could also be simulated through the addition of more sine function components at higher frequencies. This mode is useful for testing a wave energy converter with a basic approximation of an ocean wave, without the need to generate a position data file. 14 Fixed velocity position control attempts to maintain a constant velocity throughout as much of the range of a linear generator as possible. The acceleration and deceleration at each end of the stroke are specified, as well as the target velocity, and this velocity is held constant between the acceleration and deceleration points. For a linear generator with voltage output proportional to speed, this constant velocity mode can be useful in obtaining a constant amplitude voltage output [11]. The last mode of position control is a manual jog mode, that allows the carriage to be moved very slowly for placement and mounting of a wave energy converter device in the linear test bed. The motion can be controlled in this mode either by using a joystick mounted on the control panel, or through the linear test bed control software. 2.4 dSPACE DS1103 Rapid Prototyping System The system used for data acquisition in the linear test bed is a rapid prototyping system from dSPACE. The DS1103 is a controller board with its own onboard processor running at 1 GHz and plenty of input/output (I/O) interfaces to handle, in real-time, any necessary data gathering for the linear test bed, as well as the force control algorithm which runs on this system. The I/O includes 20 analog-todigital (A/D) converter channels as inputs and 8 digital-to-analog (D/A) output channels. All of the A/D and D/A converters have a range of ±10 V and 16-bit resolution. Of the 20 A/D converter channels, 16 are multiplexed with 4 channels 15 per A/D converter, and the other 4 are non-multiplexed inputs each equipped with one A/D converter. In addition, the DS1103 has 32 bits of digital I/O in 4 groups of 8 bits. Each 8-bit group can be configured as either input or output channels. If additional I/O is needed, a slave digital signal processor can provide 16 more A/D channels, 18 bits of digital I/O, and 5 pulse-width modulated (PWM) channels. The block diagram in Figure 2.5 illustrates the layout of the DS1103 interface [10]. Figure 2.5: Block Diagram of dSPACE DS1103 [10] A key feature of the dSPACE DS1103 system, which makes it powerful for use in the linear test bed, is its integration with MATLAB Simulink (Mathworks, Natick, MA). Control and data acquisition models are built in Simulink and interfaced with the DS1103 I/O through the Real-Time Interface graphical blocks shown in Figure 2.6 [10]. Any mathematical operations that can be performed using 16 standard Simulink blocks can thus be implemented and run in real-time on the DS1103 processor, allowing for great flexibility. The standard Simulink interface also means there is a faster learning curve than if learning a new proprietary interface was required. Simulink control models are compiled and loaded to the DS1103 processor from within MATLAB, typically taking less than one minute to complete this process. The speed of building models in Simulink and loading them to the DS1103 is beneficial in that changes can be implemented quickly with little downtime. Figure 2.6: Real-Time Interface Simulink Blocks [10] After a model for control and data acquisition is constructed in MATLAB Simulink and loaded to the dSPACE DS1103 processor, one can utilize the dSPACE 17 ControlDesk software to view and modify many parameters in real-time. In ControlDesk, an interface is created with data acquisition instruments, such as graphs and numerical displays, for viewing desired signals and input instruments, such as sliders and numerical inputs, for interactively changing parameter values without the need to recompile the model. Any variable or parameter from the Simulink model can be assigned to these instruments in ControlDesk by “dragging and dropping”. Multiple graph windows can be updated at once in real-time, for viewing only, or the data can be saved to MATLAB files, if desired, for later analysis. Figure 2.7 displays a sample ControlDesk layout created for capturing and viewing various measurements taken during operation of the linear test bed. Figure 2.7: Example ControlDesk Interface 18 Chapter 3 – FORCE CONTROL 3.1 The Need for Force Control The testing that has been performed on the linear test bed prior to this thesis work was done using position control mode only. As discussed in the previous chapter, some wave profile, such as a sine wave or actual wave data, is loaded into the linear test bed computer and tells the controller what position to go to at each time step. In this mode, the motion of the linear test bed, and thus the device under test, exactly replicates the input position profile. This position control mode is sufficient for the characterization of various linear generator prototypes when one is interested in knowing the voltage and current output from a generator driven at various velocities and with various loads. If loaded with recorded wave data, the linear test bed simulates the vertical motion of actual ocean waves and can be used to test devices with waves of varying amplitude and period. While position control mode is an important tool for characterizing wave energy converters, it does not provide an accurate representation of a complete wave energy buoy in an actual ocean environment. Such a combination of buoy and generator would not exactly follow the position profile of the ocean waves. Instead, the response will depend on the float design and generator loading; the overall amplitude and phase of the position response can differ from that of the wave. 19 Depending on the design of the float, there is a limit to how much force can be exerted on the buoy and generator by a wave. When following a position profile, the linear test bed uses as much force as necessary to move the device to the demanded position. To test a linear generator under the conditions it would experience when in a buoy driven by ocean waves, however, it would be ideal to apply only the force that the generator would actually see in the real world. Adding a force control algorithm to the linear test bed allows these effects to be taken into account to more accurately represent the response of the entire wave energy buoy in the ocean. By taking the hydrodynamic characteristics of the buoy into consideration as well, different buoy configurations can be tested to determine the optimal buoy design for a given generator. In addition to making the position of a buoy respond more accurately to an ocean wave, the addition of a force control algorithm permits the testing of various control strategies for the generator under test as well. With modern power electronics, much more control of the generator can be achieved by means other than by simply passively loading the generator with a resistive load, for example. The ideal control scheme for maximizing power output of a given wave energy converter may involve more complex control, such as constant current, constant power, or constant velocity, through dynamic loading of the generator. Under the linear test bed’s original position control mode, these various dynamic loading schemes cannot be properly tested, because the position follows a predetermined profile regardless of generator loading. Force control mode, on the other hand, lets the force applied by the wave energy converter affect the position response, as would be the case in 20 actual ocean testing. The rest of this chapter covers the development of the force control algorithm for the linear test bed. 3.2 Development of Force Control Model As discussed in Chapter 2, the Delta Tau motor controller of the linear test bed operates in position control mode. In the interest of safety, its external command input is also in terms of position; a desired force cannot be commanded directly. This means that, to implement a force control algorithm, the external dSPACE controller must wrap a force control loop around this inner position control loop. In essence, when given a desired force command, the controller must read the force applied to the linear test bed’s load cells, and output a position command. For the force control mode to be useful, however, it is necessary that the input be an ocean wave profile. Thus, the force control algorithm must also include a hydrodynamic model that, from the wave profile, calculates the force that the wave should exert on the float section of the buoy under test. For simplicity, the spar is assumed to remain stationary. 3.2.1 Hydrodynamic and Force Equations The first step in developing the force control model is to determine the governing equations for the hydrodynamic interactions between the float and the incident ocean wave. As stated previously, the input to the system is a wave position 21 profile, where the position is the vertical elevation of the wave. From this input position profile, the force to be applied to the device under test must be determined. Starting with the hydrodynamic equations by Minoo H. Patel for a floating buoy, the motion of the float section can be represented by Equation 3.1, where zw is the water surface elevation, zb is the vertical position of the float, and m is the mass of the float [14]. mz̈b = A (z̈w − z̈b ) + C (żw − żb ) + k (zw − zb ) (3.1) From Equation 3.1 it is apparent that the response of the float depends on the difference in vertical position between the water surface and the float, as well as the first and second derivatives of this differential position, which correspond to relative velocity and acceleration, respectively. The coefficient A represents the added mass and is attached to the acceleration term in the equation. Added mass comes from the water that moves with the float when the float is accelerated, requiring more force than accelerating the float alone. The added mass of the water effectively makes the float appear more massive when under acceleration. C is a velocity-dependent damping term and includes the effects of friction between the water and float section, as well as energy lost to radiated waves. The last coefficient, k, represents the hydrostatic stiffness, which is much like a spring force and is the proportionality constant relating displacement to buoyant force [14]. These hydrodynamic coefficients are dependent on the design of the specific buoy and need to be found through other simulation or testing. 22 The zw term and its derivatives in Equation 3.1 are already known, as this comes from the input wave profile. Rearranging to put known wave terms on one side of the equation and unknown buoy terms on the other gives the form shown in Equation 3.2. The excitation force exerted on the float by the wave motion is represented by Equation 3.3. Combining these two equations allows the excitation force to be written as Equation 3.4, where Fe is positive in the upward direction [14]. Az̈w + C żw + kzw = (m + A) z̈b + C żb + kzb (3.2) Fe = Az̈w + C żw + kzw (3.3) Fe = (m + A) z̈b + C żb + kzb (3.4) Equation 3.4 relates the excitation force from a wave to the motion response of the float section of the buoy. From this, the force to be applied by the linear test bed to the device under test can be determined. The linear test bed delivers the force necessary to accelerate the device under test, as well as the forces from electrical loading of the generator, and any friction between the float and spar. The force to be supplied to the float by the linear test bed (FLT B ) can be represented by Equation 3.5, where Fgen includes both the opposing forces from the electrical loading of the generator and friction. Fgen is positive when the generator is exerting a force in the downward direction. Increasing Fgen thus increases the force required 23 from the linear test bed to provide some desired float acceleration, because of the additional opposing forces. FLT B = mz̈b + Fgen (3.5) This generator force, Fgen , also needs to be taken into account in Equation 3.4 relating Fe to the motion response of the float. Equation 3.4 then becomes Equation 3.6. Fe = (m + A) z̈b + C żb + kzb + Fgen (3.6) It can be seen that, with higher loading from the generator and friction, the float responds less to a given excitation force. If Equation 3.5 is substituted into Equation 3.6, the resulting equation is Equation 3.7. Fe − FLT B = Az̈b + C żb + kzb (3.7) Fe is known from Equation 3.3, and FLT B is read from the load cells on the linear test bed. Using this relationship, the desired motion of the device under test can be determined. Converting Equation 3.7 into the Laplace domain gives Equation 3.8, which, when rearranged, gives the transfer function shown in Equation 3.9. Fe − FLT B = As2 zb + Cszb + kzb (3.8) 24 zb 1 = 2 Fe − FLT B As + Cs + k (3.9) 3.2.2 Modeling in Simulink Now that the necessary equations have been derived, the block diagram of the control model can be developed, as seen in Figure 3.1. Figure 3.1: Simulink Control Model Note in the model of Figure 3.1 the m2 term in the Zb∗ Fe −FLT B block. Here the original mass term has been split into m1 and m2 . This change is needed due to the modular nature of the Blue Ray L10 linear generator currently installed in the linear test bed. This 10 kW prototype was designed with the float section of the buoy detachable to allow for ocean testing and subsequent testing in the linear test bed without needing major modifications to fit in the linear test bed. The mass of the active components of the float that are actually in the linear test bed is referred to as m1 . The mass of the float that has been removed for installation of the device in the linear test bed, but will be present in the ocean configuration 25 of the buoy, is labeled m2 . Reworking the equations to include this separation of masses is straightforward. The excitation force due to the water surface motion remains the same as Equation 3.3, as this equation has no masses in it. Equation 3.6, relating the excitation force to the motion of the float, now contains both masses as shown in Equation 3.10. The equation for the force applied by the linear test bed becomes Equation 3.11, which contains only m1 . Substituting Equation 3.11 into Equation 3.12 gives Equation 3.12, which is put into transfer function form in the model of Figure 3.1. Fe = (m1 + m2 + A) z̈b + C żb + kzb (3.10) FLT B = m1 z̈b + Fgen (3.11) Fe − FLT B = (m2 + A) z̈b + C żb + kzb (3.12) Also, in Figure 3.1, the Fe Zw transfer function must be modified to put it into proper form for Simulink use, meaning that the numerator must not be of higher order than the denominator. This is done by adding appropriate poles to the denominator, and will be shown in the analysis that follows. The second transfer function, Zb∗ , Fe −FLT B is already in proper form for Simulink. The blocks shown in blue are already present in the linear test bed, and are part of the “plant function” for this controller, or elements that will not be included in the real time control model, but that are meant to model the response of the actual system. The response of 26 the Delta Tau position controller determines the relationship between commanded position (zb∗ ) and actual position (zb ) of the device under test. The force applied to the device as it is moved is read back by the linear test bed’s load cells, which are also shown in blue. The load cell block also must include the calculations necessary to convert the raw force signals into the actual force being applied to the device. The transfer functions for both of these blocks are needed in order to produce an accurate model of the overall system. 3.2.3 Delta Tau Controller Response An exact transfer function for the relationship between commanded position and actual position is unknown, so an estimate is initially used here for simulation. An assumption is made here that, at the relatively low frequencies of ocean waves that will be the input to the force control model, the position response is fast enough such that the actual position very closely matches the commanded position. The Delta Tau controller is known to have a sampling rate of 442 µs, which corresponds to a sampling frequency of approximately 2 kHz. Using the general guideline that, in order for the controller to accurately reproduce a sine wave input, there must be at least ten samples per period of the input, the Delta Tau controller should be able to track input signals up to about 200 Hz. With this in mind, an approximation of the position controller response was used with a pole at 200 Hz, as seen in 27 Equation 3.13 [11]. zb (s) = zb∗ 1 s 2π200 +1 (3.13) 3.2.4 Load Cell Force Response Now that a relationship has been determined between commanded position and actual position, the last relationship that must be derived is that between position and FLT B . This relationship has two components: the transfer function to find the force applied to the device under test based on the linear position, and the response of the load cells to this applied force. For the first part, if there is no electrical load on the generator, the force applied to the device under test is simply the force required to accelerate the mass plus any friction forces present, as shown in Equation 3.14. The force due to friction of the L10 generator is modeled as a viscous damping force, with the velocity z˙b multiplied by a friction coefficient Cf , which has units of Newtons per meter per second. This relationship has been converted to the Laplace domain and rearranged into transfer function form in Equation 3.15. Using this transfer function, the force applied to the device under test can be calculated from the linear position profile. This transfer function must have some poles added to the denominator to put it into proper Simulink form. This is done by multiplying by 1 s +1 ωp 2 , with the pole ωp at a higher frequency than the frequencies of interest. For the initial stability analysis, this pole is set to 100 Hz, giving Equation 3.16. The last equation to derive is the response of 28 the load cells to the applied force. For the initial stability analysis, the load cell response will be represented by a single-pole low pass filter with a transfer function of the form 1 s +1 ωp , where ωp is the pole frequency. The pole frequency is set at 100 Hz, as the load cells should respond well up to about this frequency, with the gain response rolling off at higher frequencies. This gives the transfer function shown in Equation 3.17. In the real-time control model, there are some calculations necessary to convert the raw voltage signal from the load cells into force. As these calculations will be performed within each sampling period, they should introduce little or no delay into the model, and have no effect on stability. Hence, the load cell conversion calculations are omitted from the stability analysis. FLT B = m1 z¨b + Ff riction = m1 z¨b + Cf z˙b (3.14) FLT B (s) = m1 s2 + Cf s zb (3.15) m1 s2 + Cf s FLT B (s) = 2 s zb +1 (3.16) 2π100 FLT B,measured (s) = FLT B,actual 1 s 2π100 +1 (3.17) 29 3.2.5 Modifying Equations for Simulink Lastly, the hydrodynamic transfer function Fe zw (s) is put into proper form for Simulink use by adding poles to the denominator to make it of the same order as the numerator. This puts it into the form of Equation 3.18, where ωp is the pole frequency. In order to choose a proper pole frequency, the frequencies of interest for the hydrodynamic forces must be known. A typical ocean wave of interest would have a period in the range of six to ten seconds. To allow some headroom for testing with smaller, higher frequency waves, it may be desirable to allow the controller to respond to waves as fast as 1 Hz. Based on this, the pole frequency was placed ten times higher, at 10 Hz, to allow sinusoidal waves up to 1 Hz to pass without loss in amplitude. With the pole frequency decided upon, the transfer function becomes Equation 3.19. Fe As2 + Cs + k (s) = 2 zw s + 1 ωp (3.18) Fe As2 + Cs + k (s) = 2 s zw +1 (3.19) 2π10 A block diagram including all of the equations that are used to estimate the stability of the system is shown in Figure 3.2. The blocks in blue again represent the plant - blocks that are not included in the real time control model, but simulate the response of the actual system. With all of the necessary transfer functions now determined, an analysis was performed to estimate the stability of the system 30 Parameter A C k m1 m2 Cf Value 12000 10000 30000 1273 kg 725 kg 2500 Table 3.1: L10 Parameters before implementing the control model on the linear test bed. Figure 3.2: Simulink Control Model for Stability Analysis 3.3 Stability Analysis As a first pass at determining whether this control model would be stable, testing was performed using MATLAB (Mathworks, Natick, MA) to generate a Bode plot of the system response. The necessary masses, hydrodynamic coefficients, and friction coefficient were provided by Columbia Power Technologies (Corvallis, OR) using results from previous tests and simulations of the L10 linear generator and buoy. These constants are included in Table 3.1. The plots of interest for the purpose of predicting the stability of this system 31 are the open-loop and closed-loop response. As the first hydrodynamic block for generating the required excitation force is outside the feedback loop, the open-loop transfer function was obtained by multiplying the gains around the loop, as shown in Equation 3.20. GOL = zb∗ zb FLT B FLT B,measured (s) (s) (s) (s) Fe − FLT B zb∗ zb FLT B,actual (3.20) To determine the closed loop transfer function, Equation 3.21 can be used, where X(s) is the input, Y (s) is the output, A(s) is the forward path gain, and B(s) is the feedback gain, as seen in Figure 3.3. Since the output will be the actual position response, zb , the forward gain A(s) is Equation 3.22, and the feedback gain B(s) is Equation 3.23. The Fe Fw transfer function is outside the feedback loop and will be multiplied by the closed loop transfer function of Equation 3.21 to yield the overall transfer function zb (s) zw in Equation 3.24. Y (s) A(s) = X(s) 1 + A(s)B(s) zb∗ zb (s) (s) Fe − FLT B zb∗ (3.22) FLT B FLT B,measured (s) (s) zb FLT B,actual (3.23) A(s) = B(s) = (3.21) 32 zb (s) = zw Fe (s) zw 1+ zb∗ Fe −FLT B zb∗ Fe −FLT B (s) zz∗b b zb (s) z∗ (s) b FLT B,measured FLT B (s) (s) (s) zb FLT B,actual (3.24) Figure 3.3: Example Feedback Loop The Bode plot of the open-loop response is shown in Figure 3.4. Looking at the gain margin and phase margin of the plot can give some clues to the stability of the system. The gain margin measures how far away the gain is from 0 dB when the phase crosses 180 degrees, and is shown to be 32.7 dB in Figure 3.4. A large gain margin will generally produce a more stable system than a smaller gain margin. Phase margin measures the distance of the phase from 180 degrees when the gain crosses 0 dB, or how much phase delay could be added before making the system unstable [11]. The loop gain here never crosses 0 dB, so it has an infinite phase margin and the Bode plot does not appear to indicate instability. A Bode plot of Equation 3.24 is shown in Figure 3.5, with a plot of the closed loop transfer function’s poles and zeros in Figure 3.6. As can be seen from Figure 3.6, all of the poles lie in the left half of the plane; that is, their real components are negative. Poles in the right half of the plane would cause instability, which is not indicated here. The step response of the closed loop system is also included in 33 Figure 3.4: Bode Plot of Open-Loop Response Figure 3.7. As would be expected, the buoy oscillates and settles at the new water level. 3.4 Simulation Results After the initial stability check indicated that the system, as modeled, would be stable, simulations were performed using Simulink to predict the system response to various inputs. The buoy position zb in response to a one meter step in the water height zw is shown in Figure 3.8. As expected, this is the same step response given by the MATLAB “step” command shown previously in Figure 3.7. The device under test oscillates and then settles at the new water height. Because of 34 Figure 3.5: Bode Plot of Closed-Loop Response Figure 3.6: Poles and Zeros 35 Figure 3.7: Step Response the step input, the device initially experiences a very high acceleration which is beyond the capability of the actual linear test bed, as limits have not been placed on the force and acceleration in this simulation model. The implementation of safe limits is discussed in Chapter 4 when the force control model is adapted to run on the linear test bed dSPACE hardware. Still, a simulated step input is useful to view the response due to the hydrodynamic model and to ensure that the initial oscillations settle and allow the buoy to reach a steady state position. Next, Figure 3.9 illustrates a simulated sinusoidal wave input with an amplitude of 0.5 meters, or 1 meter peak to peak, and a period of 8 seconds. From this, it is possible to see how the position of the buoy lags behind the wave height, and also resonates slightly with this sinusoidal input frequency. In Figure 3.10, the position 36 commanded by the hydrodynamic model and the simulated position of the device under test match almost exactly. This illustrates the Delta Tau position controller responding very quickly in relation to the low frequency of the position command. Figure 3.11 represents FLT B , the force applied to the device under test by the linear test bed, given the same sinusoidal input. Aside from the initial large spike in force, the FLT B sinusoid has an amplitude of about 1100 Newtons here. Slowly ramping up the amplitude of the input wave height sinusoid would eliminate the large transient seen in FLT B . Figure 3.8: Wave Height and Buoy Position for Step Input 37 Figure 3.9: Wave Height and Buoy Position for Sinusoidal Input Figure 3.10: Commanded and Actual Position for Sinusoidal Input 38 Figure 3.11: Applied Force for Sinusoidal Input 39 Chapter 4 – IMPLEMENTATION OF FORCE CONTROL MODEL Now that the force control model has been designed and built in software, simulated, and shown to be stable in simulations, the next step is the implementation of the force control algorithm using the dSPACE DS1103 hardware. Fortunately, programs to be run on the dSPACE DSP are built using Simulink models, which is part of the reason for creating the Simulink model for testing the controller and system response. Since the Simulink model has already been created, it only needs to have some modifications made to run on the DSP. First, the dSPACE DS1103 hardware communicates with the linear test bed through analog-to-digital inputs, digital-to-analog outputs, and a multiple bit digital I/O. It then interfaces Simulink with these hardware components through the Real Time Workshop toolbox included with the dSPACE software. These specialized blocks can be seen back in Figure 2.6. 4.1 Load Cell Signal Conversion In Figure 4.1, the model previously used for simulation has had the blocks representing the response of the real system removed and replaced with input and output ports where appropriate. The commanded position, zb∗ , which before was 40 sent to the model of the Delta Tau position controller, is output through a digitalto-analog converter and sent to the linear test bed’s external position input as an analog voltage signal. Where FLT B was simulated by calculating the force necessary to move the linear generator under test, in the real time model this force is calculated from the forces read by the load cells. The load cell conversion block seen in Figure 4.1 contains the calculations necessary to convert the load cell analog signals into FLT B . The internals of this block are laid out in Figure 4.2. In addition to simply applying the appropriate gain to convert the analog signals into units of force, this subsystem performs several other functions. Since the load cells are not mounted vertically on the carriage of the linear test bed, but at an angle relative to the vertical force, as seen in Figure 4.3, the signal is first scaled to take this geometry into account. It is then multiplied by the gain (in Newtons per volt) to obtain the magnitude of the vertical force on the load cells. Positive force on the load cells corresponds to tension, or a downward vertical force. In other words, a positive load cell force results from the linear test bed pulling up on a device. This raw force, however, still includes forces that should be cancelled out in order to know FLT B . These unwanted forces are due to the yoke and mounting arms, which lie between the load cells and the device under test and are moved along with the device. The masses of the mounting arms for the load cells and the yoke for mounting the linear generator are known from previous measurements taken when the linear test bed was installed. Multiplying this extra mass by the acceleration of gravity allows the constant force from the weight of these components to be cancelled out. There is also a force due to acceleration of this mass which is calculated 41 by multiplying by the acceleration given by the motor encoder. The forces from additional masses in the system have now been subtracted from the load cell force, but it is also necessary to subtract the weight of the device under test. The reason for this is that this constant force is neglected in the hydrodynamic model as well; from Equation 3.5, FLT B is considered to be the force to accelerate the device plus the forces from generator loading and friction. With the weight cancelled out, the force FLT B should read zero when the linear test bed is not moving and there is no force from the generator under test. Figure 4.1: Realtime Model Diagram 4.2 Safety Limit Checks The last main component added to the Simulink model before putting it in control of the linear test bed is a safety check to ensure that the linear test bed operates within its rated limits. As detailed in the description of the handshaking protocol in Appendix A, there is a digital bit set by the dSPACE controller that must 42 Figure 4.2: Load Cell Conversion Subsystem 43 Figure 4.3: Load Cell Geometry [11] be low in order for the linear test bed to operate in force control mode. If the force control algorithm for some reason attempts to command a position, velocity, or acceleration that is outside of the acceptable limits of the linear test bed, this disable bit is brought high, signaling for the Delta Tau controller to ignore further position commands and initiate an emergency stop. To avoid introducing further nonlinearities into the control model that could result in instability, the commanded position, and the velocity and acceleration resulting from the position command, are not simply limited with the use of saturation or rate limit blocks in the Simulink control model. If the linear test bed is caused to emergency stop due to one of these parameters being outside of the acceptable range, a bit is flagged to indicate whether it was an overlimit in position, velocity, or acceleration that caused the stop. To prevent an emergency stop from happening, it is thus 44 important to provide an appropriate ocean wave input profile. Figure 4.4 includes the subsystem to check that the position command profile being sent to the linear test bed does not exceed the rated limits of the machine. This block takes in zb∗ and outputs a digital signal that must remain in a low (zero) state for the linear test bed to operate in force control mode. If the limit check subsystem senses that the zb∗ position profile would exceed acceptable limits of the linear test bed, the digital signal is toggled high, causing the initiation of an emergency stop. The internal layout of this block is displayed in Figure 4.5. As shown, the zb∗ signal is checked for position, speed, and acceleration limits, and if one of these values goes outside the acceptable range, a digital flag is set and latched high, allowing the operator to view which parameter was over the limit. Figure 4.4: Realtime Model Diagram with Signal Limit Checking To check whether the commanded speed and acceleration are acceptable, the first and second derivatives of the position command signal are computed. Simply inserting derivative blocks would cause the calculated speed and acceleration to exceed their predetermined limits very easily with any high frequency noise, however. The Laplace domain representation of a derivative f (t) = dx dt is F (s) = sX(s), 45 Figure 4.5: Signal Limits Check Subsystem which, as illustrated by the Bode plot in Figure 4.6, results in a very high gain for high frequencies. To get around this problem, the transfer function of Equation 4.1 is implemented instead for calculating the derivative. At low frequencies, this function appears the same as the simple derivative F (s) = sX(s), but because of the pole at 100 Hz, the gain rolls off at higher frequencies to no longer act as a derivative, as observed in Figure 4.7. The relay blocks in Figure 4.8 allow the position, speed, and acceleration limits to be set individually. Since the range of vertical motion of the linear test bed is 2 meters, the position limit is set at ±1 meter. Likewise, the speed and acceleration limits are set to the rated normal mode values of 1 m/s and 1.1 m/s2 . F (s) = s s 2π100 +1 X(s) (4.1) 46 Figure 4.6: Bode Plot of Derivative Referring again to Figure 4.5, there are two additional elements also going in to the final “OR” block that can cause the “overlimit” flag to be sent high. The first is the “dSPACE disabled” command which is controlled by the operator in the control GUI. This signal is required by the handshaking protocol between the linear test bed and dSPACE hardware in order to enter force control mode. It also allows the operator to emergency stop and shut down force control mode from the GUI when necessary. Last is the “LTB disabled” bit, which is the digital signal from the linear test bed to the dSPACE hardware, and also required as part of the handshaking protocol. If this signal is sent high by the linear test bed during force control operation, it means that the limits of the Delta Tau controller have been tripped, or some other error has occurred. In this case, an emergency stop 47 Figure 4.7: Bode Plot of Derivative with 100 Hz Pole Figure 4.8: Details of Signal Limit Checking 48 will have already taken place, but the “dSPACE disabled” bit should still go high in response. Also, including this signal in the model allows it to be viewable in the GUI so that the operator will know if it has been toggled for some reason. 4.3 Integration with dSPACE Now that the model has been modified to include the load cell conversions and safety limit checking, the input and output signals are routed to the appropriate analog-to-digital and digital-to-analog converters, as well as the digital I/O, of the dSPACE hardware. This is accomplished through the dSPACE Simulink blocks, that are included in the model of Figure 4.9. The analog-to-digital inputs used for the load cell and acceleration signals are multiplexed ADCs, meaning that they can each contain up to four input signals. Only one channel of each of these ADCs is currently being used, however. On the acceleration signal from the Delta Tau controller, some conversion is necessary to obtain units of meters per second squared from the raw voltage signal. This conversion is displayed in Figure 4.10 and includes simply a gain to convert to the correct units, and an offset for calibration. Both of these values are already known from previous calibration when the linear test bed was installed. To send the output position command from the force control model to the linear test bed, the digital-to-analog converter on the right side of Figure 4.9 converts the command to a voltage signal with a range of ±10 V corresponding to ±1 meter. The last I/O block necessary is the digital output for the “dSPACE disabled” 49 command. The digital I/O for the dSPACE DS1103 is grouped into blocks of 8 bits, and each of these groups of 8 bits can be configured as either input or output. Only one digital bit is sent from the dSPACE hardware to the linear test bed, so the other bits are not used here. Other than the inputs and outputs to interface with the dSPACE DS1103, the other addition visible in Figure 4.9 is the sine wave generator connected to the zw input. Creating a sinusoid using these blocks instead of a simple sine wave source already included in Simulink allows the amplitude and period to be changed smoothly during operation. An offset is also included to allow the motion to be centered around a point other than the midpoint of the linear test bed’s range of motion, which is considered zero position. Figure 4.9: Realtime Model with dSPACE I/O Blocks Figure 4.10: Acceleration Signal Conversion 50 4.4 Transition from Position Control to Force Control As the command signal sent from the dSPACE DS1103 to the linear test bed is a position command, the external position input should first be tested with a simple position signal to verify functionality. This is done by bypassing the output of the hydrodynamic blocks, and controlling the commanded position directly. Also, part of the initialization procedure to enable the external mode of control for the linear test bed requires that the position command be set to zero before control is handed to the dSPACE hardware. Because the force commanded by the hydrodynamic model depends on the feedback force signal output by the load cells, there is no guarantee that the commanded position will be zero even for an input wave height of zero. To solve both of these requirements, enabling testing with a position command only and allowing the zb∗ position command to be set to zero, the Simulink model has some functionality added as in Figure 4.11. When the “ModeSwitch” variable has a value of one, only the position reference “zb,ref ” is passed to the signal limits check system, and to the linear test bed external position input. When “ModeSwitch” is set to zero, zb∗ is passed through from the force control model as before, and the position reference is ignored. The rate limiter on the switch value ensures that when there is a difference in position output from the force control block and the position reference block, the transition between the two will be gradual instead of giving a sudden step change in position. Such a step change would otherwise trip the safety limit checks and cause the linear test bed to emergency stop. With the rate limit set at ±0.1, the change occurs over 51 a period of 10 seconds to ensure a smooth transition. There is also a rate limiter placed on the position reference variable, so that when manually controlled by the operator through the GUI, the position is not accidentally changed too fast. The only other changes made to the model of Figure 4.11 were to clean up the layout by grouping the hydrodynamic force calculation blocks and load cell conversion into one “Force Controller” subsystem, and creating another subsystem from the sine wave generation blocks. Figure 4.11: Realtime Model with Position Reference After the signals between the linear test bed and dSPACE DS1103 were verified to be functional, and the linear test bed successfully responded to the position reference input, the switch described above was used to hand off control to the force control algorithm. The results of testing the force controller on the real system are presented in the next chapter. 52 Chapter 5 – TESTING RESULTS 5.1 DC Input Wave Height The first testing of the force control algorithm on the linear test bed was conducted with the L10 linear generator unloaded and with a constant wave height input of zero. Ideally, a wave height input of a constant value should result in the buoy settling at this wave height, as seen before with a simulated step input in Figure 3.8. When control was passed from the reference position command to the force control loop, the position began to oscillate. Figure 5.1 displays the position of the device under test versus time for a 10 second sample of this oscillation behavior. The oscillation in position is between 2 and 2.5 cm peak to peak, with a period of approximately 1 second. This behavior did not cause the system to become unstable; the magnitude and frequency of oscillation remained the same indefinitely. As Figure 5.2 shows, the excitation force Fe calculated from the wave input height has a constant value of zero as expected. On the other hand, the FLT B force derived from the load cell force displays the same frequency of oscillation as the position, but appearing much less sinusoidal due to the multiple peaks. By computing the fast Fourier transform of the position versus time data in MATLAB, the oscillation frequency was determined to be 1.05 Hz. The FFT plot is included 53 as Figure 5.3. The shape of the force waveform appears to be due to the cogging force of the L10 linear generator. Since the L10 is a permanent magnet machine, the magnets want to line up with the teeth of the iron laminations to create the lowest reluctance flux path. This generator has a significant cogging force at low speed when open-circuited. Figure 5.1: Position Oscillation Because the permanent magnet linear generator under test can have a large cogging force when unloaded, the same test with a constant input wave height of zero was conducted next with the generator short-circuited. In this case, the system still oscillated at approximately 1 Hz, as Figure 5.4 shows. Although the magnitude of oscillation is more consistent under the short circuit conditions, it increased slightly to between 2.5 and 3.0 cm peak to peak. The graph of FLT B in 54 Figure 5.2: Fltb and Fe with Position Oscillation Figure 5.3: FFT of Position Oscillation 55 Figure 5.5 is much smoother due to the reduced cogging force, but no smaller in magnitude than before. The frequency of oscillation was again calculated using a fast Fourier transform of the position versus time data to obtain the plot of Figure 5.6. The peak frequency of approximately 1.03 Hz is only slightly lower than the 1.05 Hz oscillation observed in the open circuit case, showing that there is no meaningful difference in the oscillation with the generator unloaded or shortcircuited for a wave input height of zero. Figure 5.4: Position Oscillation, Generator Short-Circuited 56 Figure 5.5: Fltb and Fe, Generator Short-Circuited Figure 5.6: FFT of Position Oscillation, Generator Short-Circuited 57 5.2 Sinusoidal Wave Input At this point, it is unclear whether the position oscillation will be large enough to be important when operating the linear test bed in force control mode with some wave input other than a constant position. If the oscillation is partly due to the cogging force of the permanent magnet linear generator, it should be reduced when the generator is operated at higher speed and the cogging is less noticeable. To test this for the unloaded generator, a sinusoidal wave height input with a period of 8 seconds and amplitude of 20 cm was applied. The position response in Figure 5.7 and corresponding force in Figure 5.8 demonstrate that the oscillation is clearly still present with the sinusoidal amplitude input wave. The same input was applied with the generator short-circuited, with similar results, as seen in Figures 5.9 and 5.10. 5.3 Barkhausen Stability Criterion While short-circuiting the terminals of the linear generator reduced its cogging force and smoothed out the force waveform as read by the load cells, the fact that it did not reduce the oscillation at all indicates that cogging is not the cause of this oscillation behavior. Also oscillation did not diminish with a sinusoidal wave input. The Barkhausen stability criterion, a necessary condition for oscillation, may provide some insight here. According to Barkhausen’s criterion for oscillation, in order for a system to sustain a steady state oscillation at a frequency, the magnitude of the loop gain must be equal to one and the phase shift around the 58 Figure 5.7: Position Response with Sinusoidal Input, Generator Unloaded Figure 5.8: Fltb and Fe with Sinusoidal Input, Generator Unloaded 59 Figure 5.9: Position Response with Sinusoidal Input, Generator Short-Circuited Figure 5.10: Fltb and Fe with Sinusoidal Input, Generator Short-Circuited 60 loop must be a multiple of 360 degrees [1]. For the oscillation observed in the linear test bed when operating in force control mode, the loop gain must be 0 dB with a phase of some multiple of 360 degrees at approximately 1.05 Hz. In the next section, a filter is added to the system to reduce the loop gain at this frequency. 5.4 Notch Filter If a filter is applied to dampen the response around 1 Hz, it may be possible to reduce the oscillation that has been observed in the system. To test whether this could improve the response, a notch filter was implemented of the form shown in Equation 5.1. H(s) = s2 ω02 + s2 ω02 + 2ϕ1 s ω0 2ϕ2 s ω0 +1 (5.1) +1 By changing the ratio of ϕ1 and ϕ2 , the depth of the notch may be adjusted. For example, with ω0 = 1.05 Hz, ϕ1 = 0.1, and ϕ2 = 1, the notch filter appears as Figure 5.11. This filter has a gain of -20 dB at the center frequency of 1.05 Hz, with -3 dB frequencies of approximately 0.43 Hz and 2.55 Hz. In order to make the shape of the filter drop off more sharply with more at√ tenuation at the center frequency, ϕ1 and ϕ2 were set at 0.01 and 2 , 2 respectively. With these coefficients, the notch filter that results is shown in Figure 5.12. It has a gain of -37 dB at 1.05 Hz, and -3 dB at 0.54 Hz and 2.05 Hz. The lower of these -3 dB frequencies, 0.54 Hz, corresponds to a period of 1.85 seconds. This would be faster than most ocean waves of interest, so the lower frequencies that should be 61 Figure 5.11: Example Notch Filter commanded by the hydrodynamics will remain relatively unchanged by this filter. When integrating this notch filter transfer function into the Simulink force control model, there are two possible places to put the filter. Referring to the simple feedback loop in Figure 5.13, the filter could be placed either in the forward gain path with A(s) or in the feedback path with B(s). Knowing that the closed loop transfer function of this example loop is that of Equation 5.2, it can be seen that decreasing the magnitude of the feedback gain with a filter at a certain frequency would actually increase the overall closed loop gain at that frequency. Decreasing the magnitude of A(s) instead gives the overall reduction that is desired, by affecting the numerator of Equation 5.2 more than the denominator. With the transfer function inserted into the Simulink model, the inside of the force control 62 Figure 5.12: Designed Notch Filter subsystem becomes as shown in Figure 5.14. Y (s) A(s) = X(s) 1 + A(s)B(s) (5.2) Figure 5.13: Example Feedback Loop After adding the notch filter into the Simulink model, the force control algorithm was again compiled and tested on the dSPACE hardware with the linear test bed. A constant input wave height of zero was used again to determine whether 63 Figure 5.14: Force Controller with Notch Filter the filtering would reduce the previously observed oscillation behavior. Plots of position and force are included in Figures 5.15 and 5.16. It can be seen, by comparing these plots with those of the initial results, that the steady state oscillation has not been reduced, but has been shifted to a lower frequency. Performing a fast Fourier transform on the position versus time data reveals in Figure 5.17 that the new oscillation frequency is approximately 0.63 Hz. This is not a surprising result, as according to the Barkhausen criterion explained above, the unfiltered system must have had a unity loop gain and phase shift of zero or a multiple of 360 degrees at the oscillation frequency, 1.05 Hz. With the effects on the magnitude and phase of the loop gain from adding the notch filter, the system must now satisfy the conditions of the Barkhausen criterion at 0.63 Hz. Applying a sinusoidal wave height input yielded similar results to the unfiltered case, as illustrated by Figure 5.18. With an input wave of 20 cm amplitude and a period of 8 seconds, the position response is a combination of the larger amplitude 8 second period wave and the higher frequency oscillation. The hydrodynamic excitation force and the resultant force applied by the linear test bed are plotted in 64 Figure 5.15: Position Oscillation with Notch Filter Figure 5.16: Fltb and Fe with Notch Filter 65 Figure 5.17: FFT of Position Oscillation with Notch Filter Figure 5.19 for the same sinusoidal input wave height. With the notch filter proving to be ineffective, some other method must be used to eliminate the steady-state oscillation. 5.5 Characterizing Position Response Since the experimental results on the real system do not match the initial simulations, the original transfer functions used to model the response of the real-world parts of the system are clearly not accurate. One noticeable discrepancy is the position response of the Delta Tau controller in following a commanded position. With the simple transfer function approximation of Equation 3.13 used in the 66 Figure 5.18: Position Response with Sinusoidal Input and Notch Filter Figure 5.19: Fltb and Fe with Sinusoidal Input and Notch Filter 67 stability analysis and simulation, the actual position matched the commanded position profile almost exactly for a sinusoidal 8 second period. On the real system, however, there is a noticeable delay between commanded and actual position. In Figure 5.20 for example, the delay is nearly 200 milliseconds. Figure 5.20: Commanded and Actual Position In order to better understand how the model of the position response should look, a sinusoidal position reference command was sent to the linear test bed, ignoring the hydrodynamic calculations of the force control model, and position data were collected. This was repeated over a range of frequencies and the gain and phase shift were calculated at each frequency. A summary of the results for a range of input periods from 1 second to 20 seconds is included in Table 5.1. Two different amplitudes were used at each frequency: the 3 cm input was intended 68 Amplitude (m) Period (sec) Gain Time Delay (sec) Phase Delay (deg) 0.3 20 1.00872 0.187 -3.366 0.3 10 1.00369 0.187 -6.738 0.3 5 0.98672 0.185 -13.320 0.1 2.5 0.92608 0.179 -25.728 0.03 20 1.01472 0.195 -3.510 0.03 10 1.01164 0.185 -6.654 0.03 5 0.99550 0.185 -13.332 0.03 2.5 0.92669 0.177 -25.512 0.03 1 0.68167 0.146 -52.560 Table 5.1: Measured Position Response Data to be small enough for cogging of the linear generator to play a large role in the motion of the device, and 30 cm was used as a larger range of motion for which the cogging force is a smaller portion of the total force. The exception is that, at a period of 2.5 seconds, the largest amplitude applied was 10 cm, to limit the forces on the linear test bed, and at a period of 1 second, the only input given was 3 cm amplitude. As the table indicates, there is little difference in gain and phase shift between the large and small input amplitude cases. While there is a noticeable time delay in seconds across all frequencies, the gain loss and phase angle become large only at the high end of the frequency range. With the gain and phase shift of the position response now known for a range of frequencies, it is possible to derive a more accurate model of the Delta Tau position controller. Using MATLAB, an approximation was first attempted using only a single pole transfer function with the form of Equation 5.3, where ωp is the pole frequency. Using this approximation, the closest match to the experimental data was found with ωp equal to 0.95 Hz. As seen in Figure 5.21, when tuning the pole 69 frequency so that the magnitude of the response closely matches the experimental data, there is not enough phase shift in the approximation. H(s) = s ωp 1 +1 (5.3) Figure 5.21: Position Response Approximation Using Single Pole A better model of the position response can be obtained by using a more complex representation of the delay, in the form of Equation 5.4. The numerator of this transfer function provides a phase delay with a unity gain, as shown in Figure 5.22, with τd as the time delay constant. Fitting this transfer function to the experimental data in Figure 5.23 matches both the magnitude and phase very 70 closely with ωp equal to 0.95 Hz and τd equal to 0.018 seconds. H(s) = e−sτd s +1 ωp (5.4) Figure 5.22: Bode Plot of Exponential Delay 5.6 Padé Approximation The problem with modeling the response of the Delta Tau position controller in the form of Equation 5.4 is that it cannot be put into proper transfer function form for use in Simulink. The technique used here to approximate the exponential delay term with a proper transfer function is called the Padé approximation. The nth order Padé approximation is represented by Equation 5.5 below. The ck coefficients 71 Figure 5.23: Position Response Approximation Using Single Pole and Delay are shown in Equation 5.6 [3]. Pn (−1)k ck τdk sk Pn ≈ k=0 k k k=0 ck τd s (5.5) (2n − k)!n! , k = 0, 1, ..., n 2n!k! (n − k)! (5.6) −sτd e ck = If a first-order Padé approximation is used, then n = 1 and the coefficient terms are c0 = 1 and c1 = 21 . The first-order approximation then becomes Equation 5.7 [3]. −sτd e 1− ≈ 1+ τd s 2 τd s 2 (5.7) 72 Replacing the delay term of Equation 5.4 with the approximation of Equation 5.7, the transfer function can be expressed in proper form for Simulink. Comparing the new approximation with the exponential transfer function in Figure 5.24, it can be seen that the magnitudes of the two functions match exactly, and the phase delays are nearly exact up until at least 2 Hz. This approximation fits very well with the experimental position response data, giving a better model of the position response than the single pole estimate used initially. Figure 5.24: Comparison of Padé Approximation with Exponential Delay 73 5.7 Internal Model Controller Now that the position response of the Delta Tau controller has been better characterized, it may be possible to add some compensation to reduce the phase delay. An internal model controller (IMC) is useful for improving control when the model describing a system is incomplete or there are unknown external disturbances affecting the system [18]. A general form of an internal model control system is seen in Figure 5.25. The input on the left side is the command, such as the desired buoy position commanded by the hydrodynamic equations of the force control model. The “process” Gp (s) is the actual system being modeled, or the Delta Tau controller in this case, while the “process model” G̃p (s) is the model of this system, which was developed for the Delta Tau position controller in the previous section. In this internal model control scheme, the real output of the system is compared with the output of the model. The output of the difference block is then the error ˆ between the actual and expected system response. This error, d(s), is fed back and subtracted from the input command, essentially providing correction to the input based on the error. Since a model of the Delta Tau position response has already been determined, the only part of the internal model controller that must be designed is the Gc (s) control block. To find Gc (s), the inverse of G̃p (s) is determined, taking only the “invertible” terms [18]. For the G̃p (s) of the Delta Tau position response using the Padé approximation in Equation 5.8, the “invertible” portion is the denominator. If the numerator were inverted, it would become a pole with a positive real component, which would cause instability. Inverting only 74 the denominator gives Equation 5.9. To make this a proper transfer function, a low pass filter should be added to add poles to the denominator. The pole frequency was set at double that of ωp from above, to reduce the derivative effect this transfer function would have on higher frequencies. With the necessary transfer functions for the internal model controller now decided upon, the controller was added to the overall Simulink control model in Figure 5.26. Here, the input to the internal model controller is a position reference input only, as the position response with the added controller will be tested before connecting it to the force control loop. Figure 5.25: Internal Model Control Example [18] G̃p (s) = 1+ Gc (s) = s ωp 1 − τd2s s τ s d 2 ωp +1 + 1 τd2s + 1 2 s +1 wf (5.8) (5.9) With a reference position input going to the internal model controller, the system remains stable, and as Figure 5.27 demonstrates, noticeably reduces the delay in position response. The delay between the position reference sine wave and 75 Figure 5.26: Realtime Control Model with IMC actual position response is now approximately 100 milliseconds for a period of 10 seconds and amplitude of 30 centimeters. The position command that is actually sent to the Delta Tau controller is noisier, however, due to the derivative effect the compensation has on the noise of the position feedback signal. Rerouting the signals in the Simulink model, the internal model controller was next connected to the output of the force control loop, to test whether it would improve the oscillation behavior by reducing the delay in the system. Figures 5.28 and 5.29 show that it did not have a meaningful effect with a wave input height of zero. 5.8 Spring Constant Modeling and Compensation While the position response delay is one issue that must be taken into consideration, another is the physical flexing of various elements in the linear test bed. With the large forces experienced in operation - over 20,000 Newtons of force on 76 Figure 5.27: Position Response with IMC Figure 5.28: Position Oscillation with IMC 77 Figure 5.29: Fltb and Fe of Oscillation with IMC the load cells - the carriage and yoke, which the linear generator under test is mounted to, undergo visible flexing. This results in the position as reported by the motor encoder not necessarily being the float position, or the position of the device under test. Along with the friction and cogging of the linear generator, the flex allows for a large force on the load cells even when the linear test bed and device under test are motionless. Modeling the flex of the system would allow the discrepancy between the position of the linear test bed’s drive motor and the actual position of the device under test to be taken into account. If the flex is expressed using a spring constant, as in Equation 5.10, the force on the load cells due to the flex is the difference in position between the carriage position and float position, multiplied by the spring 78 constant. FLT B = ks (zc − zb ) (5.10) According to this equation, if the carriage position zc is higher than the float position zb , the added force on the load cells is positive. In the linear test bed, a positive force on the load cells means that there is a downward force acting on the load cells, or that the load cells are exerting an upward force on the device under test. This is in agreement with the sign of the above equation. It must now be determined how to use this equation to compensate for the position difference. In the hydrodynamic equations of the force control model, the output position command to achieve a desired force is the float position. The position command sent to the Delta Tau position controller, however, is actually the carriage position, or linear position as calculated from the motor encoder. Therefore the float position command from the hydrodynamic model should be converted to a corresponding carriage position before being sent to the Delta Tau controller. Rearranging Equation 5.10 yields Equation 5.11 below. zc = zb + FLT B ks (5.11) This equation allows some position compensation to be inserted into the force control model, as depicted in Figure 5.30. Before being able to implement this model on the real system, however, an appropriate ks value must be determined. In order to model the physical flex in the system, a position reference command 79 Figure 5.30: Force Control Subsystem with Spring Compensation signal was sent to the linear test bed over a range of frequencies and at two different amplitudes, as seen in Table 5.2. This procedure is similar to the position response measurements taken previously, except that here the amplitude of the sinusoidal position input is very small, so as to flex the carriage and yoke of the linear test bed without causing the linear generator mounted on these components to move. Recording force and commanded position data at each amplitude and frequency allowed a gain and phase delay to be determined for the relationship between the force on the load cells and the commanded position. The gain and phase data from Table 5.2 was plotted versus frequency, and a transfer function fitted to the plot. As with the position response analysis before, a single pole plus a delay term provided a very close fit, as illustrated in Figure 5.31. This experimentally determined transfer function has the form of Equation 5.4, with τd equal to 14 milliseconds, ωp equal to 1 Hz, and an overall gain of 1.41 ∗ 106 . The gain term here is the spring constant, ks . 80 Amplitude (m) Frequency (Hz) Gain (N/m) Phase Delay (deg) 0.005 0.1 1361900 -4.76 0.005 0.2 1343400 -11.82 0.005 0.5 1216400 -29.24 0.005 1 949430 -50.99 0.005 2 596310 -73.16 0.005 5 262540 -103.40 0.001 0.1 1460100 -6.56 0.001 0.2 1452200 -13.83 0.001 0.5 1327900 -32.82 0.001 1 1017800 -50.84 0.001 2 655970 -75.60 0.001 5 314130 -103.04 Table 5.2: Measured Force and Position Command Data Figure 5.31: Approximation of Force Response to Position Command 81 With an approximation of ks now known, the position compensation was implemented in dSPACE. The position response for a constant wave input height of zero in Figure 5.32 and plot of the load cell force in Figure 5.33 show that this compensation had little effect on the position oscillation with zero wave height. Unfortunately the spring constant modeling will not be enough to correct the unwanted behavior of the force control loop. Solving the problem will most likely require a more in-depth investigation, or a restructuring of the control algorithm. Several suggestions are proposed in Chapter 6. Figure 5.32: Position Oscillation with Spring Compensation 82 Figure 5.33: Fltb and Fe of Oscillation with Spring Compensation 83 Chapter 6 – FUTURE WORK AND CONCLUSION At the conclusion of this thesis work, implementation of the force control algorithm on the linear test bed resulted in oscillations in the response to a wave input. The largest contributor to this behavior appears to be the physical flexing of components in the linear test bed. This flexing, along with the friction and cogging forces of the L10 linear generator, cause the position read by the Delta Tau controller to be different than the actual vertical position of the generator. The control algorithm attempts to drive the load cell force toward zero, but is unable to do so as the device under test pops back and forth, swinging between large positive and negative forces. A possible solution is to install a system to sense the actual vertical position of the linear generator, and modify the force control loop to include position feedback. Phase delays throughout the system may also be to blame for the unwanted behavior observed in testing. The position response of the Delta Tau controller, for example, had more delay than originally anticipated. Although improving the position response with an internal model controller did not have much effect on the oscillations, this does not rule out delays as a source of the problem. The response speed of the load cells is unknown, and could also be adding unwanted delays. If delay is determined to be the problem, it may be possible to tune the Delta Tau controller to achieve faster response. 84 Finally, noise in the various signals, particularly the load cell signals, may also be a contributor to the force control algorithm not behaving as expected. Careful filtering of these signals to reduce the noise without adding too much additional delay may be beneficial here. Once the force control algorithm becomes fully functional, it will greatly increase the usefulness of the linear test bed by more accurately simulating an ocean environment. This will also enable the testing of new generator control strategies for maximizing the output of wave energy converters. 85 Bibliography [1] Barkhausen stability criterion. Barkhausen stability criterion. http://en.wikipedia.org/wiki/ [2] Interface. http://www.interfaceforce.com/. [3] Padè approximation of delays. http://www.ee.bilkent.edu.tr/∼ee342/ Laboratory/pade.pdf. [4] Pelamis wave power. http://www.pelamiswave.com/. [5] Wave dragon. http://www.wavedragon.net/. [6] John Andrews and Nick Jelley. Energy Science. Oxford, 2007. [7] Northwest National Marine Renewable Energy Center. About nnmrec. http: //nnmrec.oregonstate.edu/, 2009. [8] Ocean Energy Council. Wave energy. http://www.oceanenergycouncil. com/index.php/Wave-Energy/Wave-Energy.html, 2009. [9] World Energy Council. 2004 survey of energy resources. worldenergy.org/documents/ser2004.pdf, 2004. http://www. [10] dSPACE. Ds1103 ppc controller board. http://www.dspaceinc.com/. [11] Peter M. Hogan. A linear test bed for characterizing the performance of ocean wave energy converters. Master’s thesis, Oregon State University, 2007. [12] U.S. Department of Energy. Ocean wave power. http://www.energysavers. gov/renewable energy/ocean/index.cfm/mytopic=50009, 2008. [13] U.S. Department of Energy. Exploring ways to use ocean energy. http://www.energysavers.gov/renewable energy/ocean/index. cfm/mytopic=50007, 2009. [14] Minoo H. Patel. Dynamics of Offshore Structures, pages 283–286. Butterworth & Co. Ltd., 1989. 86 [15] Nancy Stauffer. Catch the wave. Technical report, MIT Energy Initiative, 2008. [16] Wallace Energy Systems and Renewables Facility. Wave energy presentation. http://eecs.oregonstate.edu/wesrf/, 2009. [17] Wallace Energy Systems and Renewables Facility. Wesrf brochure. http: //eecs.oregonstate.edu/wesrf/, 2009. [18] Ming T. Tham. Internal model control. http://lorien.ncl.ac.uk/ming/ robust/imc.pdf, 2002. 87 APPENDICES 88 Appendix A – DSPACE CONNECTIONS AND FORCE CONTROL OPERATION From the document “Linear Test Bed: Connections to dSPACE and Force Control Operation”, by Ted Brekken. A.1 I/O Configuration 1. PMAC DAC1 OUTPUT • Actual position. • Analog. • PMAC to dSPACE. • This position is a home reference position signal with zero at the center of motion. • Scaling factor is fixed +10V = +1.000m, -10V = -1.000m. • CP16 2. AN1/M7133 INPUT • Commanded position. • Analog. 89 • dSPACE to PMAC. • This position is a home reference position signal with zero at the center of motion. • Scaling factor is fixed +10V = +1.000m, -10V = -1.000m. • CP28 3. REXROTH SPEED OUTPUT • Actual speed from Indradrive to dSPACE. • Analog. • Indradrive to dSPACE. • CP19 4. REXROTH CURRENT OUTPUT • Actual acceleration from Indradrive to dSPACE. • Analog. • Indradrive to dSPACE. • CP20 5. LOAD CELL LEFT OUTPUT and LOAD CELL RIGHT OUTPUT • Load Cell 1 and 2. • Analog. • Load cell to dSPACE. 90 • If current mode is used, a resistor must be used across the analog terminals. • CP14 and CP15 6. D-SPACE ENABLE • dSPACE stop command. • Digital. • PMAC to dSPACE. • 5V = PMAC tells dSPACE to stop and standby. • 0V = PMAC tells dSPACE everything is go. • pin 18 on CP30 7. D-SPACE ENABLED • dSPACE disabled command. • Digital. • dSPACE to PMAC. • 5V = dSPACE is off, disabled, or not ready. • 0V = dSPACE is ready. • pin 20 on CP30 8. PMAC→D-SPACE READY FOR DATA COLLECTION • Digital. 91 • PMAC to dSPACE. • Unknown if active high or low. • pin 22 on CP30 Analog in and analog out for dSPACE have maximum voltages of +10V and -10V. Anything to be output or input within that range is fine. All dSPACE analog inputs and outputs use a BNC type connector on the dSPACE connector panel. All dSPACE digital signals are 0 to 5V. Digital ground should be connected to pin 34 on CP30. dSPACE internally connects digital ground to earth. A.2 Control and GUI Implementation 1. Operator loads DUT into LTB, sets hard stops and homes the LTB including selecting the appropriate PID parameter set. 2. Operator turns on Dynamic Force key the RUN → Dynamic Force Control menu item is enabled 3. Operator sets appropriate PID parameter set for Dynamic Force if different from the one used to Home the machine. 4. Operator selects Run → Dynamic Force Control 5. GUI moves the DUT to 0.00 position (should already be there unless some activity took place intervening between the Home and selecting the menu 92 item). 6. When the DUT is at 0.00 the GUI sets the D-SPACE ENABLE output bit to 0. 7. The GUI waits until the D-SPACE ENABLED input is 0 8. Once the D-SPACE ENABLED input is 0 the GUI checks the input resulting from the encoder conversion tables to determine that it is within a specified tolerance of 0 9. When the input from the dSPACE has been within tolerance for a specified period of time the GUI enables the START button 10. The Operator presses the START button. 11. The GUI re-examines all the above flags to be sure that nothing has changed warning the operator and stopping the process if the key has been switched off, the D-SPACE ENABLED input is high, the input is no longer 0, etc. 12. The GUI downloads a specified file of PMAC instructions to the PMAC. After this point any stop in the process will require that the GUI automatically terminates, resets the PMAC and restarts 13. After a final check of the values in 11 above, the GUI enables PLC 2 (by setting Q2001 to 1) to monitor faults and sets I306 to 1 telling the motor to follow the input from the encoder conversion tables 93 14. If PLC 2 sees the D-SPACE ENABLED input go high it forces an EStop also causing the GUI to terminate, reset the PMAC and restart the GUI 15. If PLC 2 determines a fault from the motor on the PMAC side it sets DSPACE ENABLE to 1 and forces an EStop also causing the GUI to terminate, reset the PMAC and restart the GUI 16. Proper termination of this process is for the dSPACE to move the DUT to 0.00, stop and set D-SPACE ENABLED high. This will cause PLC 2 to generate an EStop and restart the GUI A.3 Figures Figure A.1: dSPACE 1103 Connector Panel 94 Figure A.2: dSPACE 1103 CP30 Connector