60 likes | 216 Views
This document outlines a systematic approach to generating production code for wind turbine pitch controllers. It includes key steps such as generating test data, discretizing integrator blocks, assigning data types, and generating code for software-in-the-loop (SIL) and production systems. It emphasizes continuous verification with test data, ensuring acceptable results after each modification, and utilizing MATLAB for parameter adjustments. The importance of thorough testing within closed-loop systems, using production code, to validate performance against specifications is also highlighted.
E N D
StepsforProduction Code Generation 1. Generatetestdataandextractcontroller Input Data(Wind Data) 1 Wind Turbine Output Data(Reference) PitchController 2 1 2. Discretize Change integratorblocks Change solver Output Data(Discretized) Input Data(Reference) PitchController PitchController PitchController 3 5 3. Assign Data Types Default double tosingle, boolean, etc. Output Data(Data Types) 4 4. Generate Code SIL Testing, PIL Testing,Productioncode, reports Output Data(Prod. Code) 5. Test controller in closed-loopsystem
StepsforProduction Code Generation 1. Generatetestdataandextractcontroller 1 Wind Turbine • Used for continuous verification • With each change, verify results are still acceptable • Test data generated using full model and signal logging • Script used to compare results Output Data(Reference) PitchController ?? = 1 Output Data(Reference) Output Data(Modified) Input Data(Reference)
StepsforProduction Code Generation 2. Discretize Change integratorblocks Change todiscretesolver Identify proper step size PitchController • Discrete integrators needed for embedded controllers • Replaced using Model Discretizer • Step-size adjusted formaximum speed and acceptable accuracy • Parameterized with MATLAB variables Output Data(Reference) 2 Output Data(Discretized) Input Data(Reference) PitchController
StepsforProduction Code Generation 3. Assign Data Types Default double tosingle, boolean, etc. PitchController • Data types assigned to variablesto specify memory allocationon controller • Storage classes are assignedto variables to define how theyare implemented on the target • Global, pointers, etc. • Decouples model from embedded target Output Data(Reference) 3 PitchController Output Data(Discretized) Input Data(Reference)
StepsforProduction Code Generation 4. Generate Code PitchController • Code generated for SIL(Software-in-the-Loop) and for embedded target • Reports generated include information on interfacing to custom code and traceability • Done using Real-Time Workshop Embedded Coder Output Data(Reference) 4 PitchController Output Data(Prod. Code) Input Data(Reference) ProductionCode
StepsforProduction Code Generation 5. Test controller inclosed-loopsystem Output Data(Prod. Code) Wind Turbine • Replace controller in simulationmodel with production code • Re-run simulation to verify performance against system specification PitchController 5 PitchController