eletrônica de potência ii - aula 2

Upload: marcos-vinicius-rocha

Post on 14-Apr-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    1/46

    I n s t i t u t o P o l i t c n i c o I P U C

    U n i d a d e C o r a o E u c a r s t i c o

    B e l o H o r i z o n t e

    A g o s t o d e 2 0 1 3

    Disciplina EP2_MT

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    2/46

    PONTIFCIA UNIVERSIDADE CATLICA DE MINAS GERAIS

    Instituto Politcnico/IPUCCurso de Engenharia Mecatrnica

    Projeto 1:

    Acionamento CC

    Professor Lauro de Vilhena Brando Machado Neto

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    3/46

    Belo Horizonte

    2013

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    4/46

    PROJETO I:

    ACIONAMENTO A VELOCIDADE VARIVEL DE UMA MQUINA CC

    ETAPAS DE DESENVOLVIMENTO:

    1. Carga mecnica: sistemas rotacionais, acoplamento rgidos e no rgidos e

    modelagem e simulao;

    2. Mquina de corrente contnua: converso eletromecnica, mquina CC,

    caracterstica torque versus velocidade e modelagem e simulao;

    3. Fonte de alimentao / Conversores estticos: retificador controlado (tiristores),

    conversor indireto de tenso (diodos mais transistores) e modelagem e simulao;

    4. Circuitos de comando e controle: comando dos transistores, controle em malha

    aberta e malha fechada modelagem e simulao e sistemas eletrnicos.

    CRONOGRAMA DE DESENVOLVIMENTO E ACOMPANHAMENTO E AVALIAO:

    1. Semana 1: Simulao utilizando o SystemVision;

    2. Semana 2: Apresentao do sistema eletrnico Arduino e estudo e montagem dos

    mdulos;

    3. Semana 3: Apresentao do programa de linguagem grfica LabView e do toolkit do

    Arduino;

    4. Semana 4: Implementao do programa e primeiros testes;

    5. Semana 5: testes e resultados obtidos

    6. Semana 6: entrega relatrio final

    4

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    5/46

    PROJETO I:

    ACIONAMENTO A VELOCIDADE VARIVEL DE UMA MQUINA CC

    COMPONENTES GRUPOS:

    Grupo 1:

    Marcos Vincius dos Santos Rocha

    Cristiano Athayde Braga DinizDaniel de Oliveira Nogueira

    5

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    6/46

    ORIENTAO 1: SIMULAO PONTE H, MQUINA CC E CARGA MECNICA

    1. Faa o tutorial Parametric and Statistical Analyses, disponvel neste documento e

    capture, explique, analise e comente as janelas dos circuitos e resultados obtidos;

    2. Carga mecnica: descreva o modelo VHDL-AMS da carga mecnica utilizada;

    3. Mquina de corrente contnua: descreva o modelo VHDL-MAS da mquina CC

    utilizada;

    4. Fonte de alimentao / Conversores estticos: descreva o funcionamento da ponte

    H utilizada;

    5. Salve o projeto com o seguinte nome: BeyondSPICE_Posio;

    6. Troque a mquina CC, cuja sada posio, por uma mquina CC com sada em

    velocidade. Refaa o tutorial.

    6

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    7/46

    ORIENTAO 2: SISTEMA DE DESENVOLVIMENTO ARDUINO, SHIELDS EMQUINA CC

    1. Descreva as principais caractersticas do sistema de desenvolvimento ARDUINO,

    tais como especificaes, pinos digitais de entrada/ sada, PWMs, entradas

    analgicas e memrias;

    2. Descreva as principais caractersticas do Shield L298 de acionamento de mquinas

    CC Ponte H. Descreva o diagrama de blocos do integrado L298;

    3. Descreva o princpio de funcionamento do motor CC e descreva as principais

    caractersticas do motor CC a ser utilizado no projeto;

    4. Com base nos diagramas esquemticos do ARDUINO, do Shield L298 e do motor

    CC, desenhe um diagrama da sua aplicao;

    5. Considerando como exemplos os programas a seguir para acionamento de um

    motor CC, descreva a lgica dos programas;

    6. Monte o sistema do ARDUINO, Shield L298 e motor CC. Descarregue o programa

    no ARDUINO e anlise o seu funcionamento.

    7. Com o osciloscpio, capture e anlise as principais formas de ondas do sistema;

    8. Faa a redao do relatrio sobre este experimento.

    PROGRAMA 1 Sadas digitais:

    7

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    8/46

    int pin2 = 2;

    int pin3 = 3;

    void setup (){

    pinMode(pin3,OUTPUT);pinMode(pin2,OUTPUT);

    }

    void loop(){

    {

    digitalWrite(pin2,HIGH);

    digitalWrite(pin3,LOW);

    delay(2000);digitalWrite(pin3,HIGH);

    digitalWrite(pin2,LOW);

    delay(2000);

    }

    }

    PROGRAMA 2 PWM constant:

    int pin2 = 2; // IN4

    int pin3 = 3;

    int pin4 = 4; // enable da ponte B em high

    // Definindo variveis de controle de velocidade e sentido dos motores

    const int Motor1 = 6; //PWM motor 1//const int DirMotor1 = 2;// Direo motor 1

    //Definindo PWM como zero

    int pwm =0;

    void setup (){

    pinMode(pin3,OUTPUT);

    8

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    9/46

    pinMode(pin2,OUTPUT);

    pinMode(pin4,OUTPUT);

    }

    void loop(){{

    digitalWrite(pin4,HIGH);

    digitalWrite(pin2,LOW);

    //digitalWrite(pin3,LOW);

    analogWrite(Motor1, 90);

    delay(10000);

    //digitalWrite(pin3,HIGH);//digitalWrite(pin2,LOW);

    delay(2000);

    }

    }

    PROGRAMA 3 Partida Suave:

    int pin2 = 2; // IN4

    int pin3 = 3;

    int pin4 = 4; // enable da ponte B em high

    // Definindo variveis de controle de velocidade e sentido dos motores

    const int Motor1 = 6; //PWM motor 1

    //const int DirMotor1 = 2;// Direo motor 1

    //Definindo PWM como zero

    9

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    10/46

    int pwm =0;

    int i = 0;

    void setup (){

    pinMode(pin3,OUTPUT);

    pinMode(pin2,OUTPUT);

    pinMode(pin4,OUTPUT);

    }

    void loop(){

    {

    i = i + 10;

    digitalWrite(pin4,HIGH);

    digitalWrite(pin2,LOW);

    //digitalWrite(pin3,LOW);

    analogWrite(Motor1, i);

    //delay(10000);

    //digitalWrite(pin3,HIGH);

    //digitalWrite(pin2,LOW);

    delay(1000);

    }

    }

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    11/46

    PROGRAMA 4 Rotao nos dois sentidos com acelerao e frenagem suave:

    int pin4 = 4; // enable da ponte B em high

    // Definindo variveis de controle de velocidade e sentido dos motores

    const int Motor1 = 6; //PWM motor 1 IN4

    const int Motor2 = 3; //PWM motor 2 IN3

    //Definindo PWM como zero

    int pwm =0;

    int i = 0;

    void setup (){

    pinMode(pin4,OUTPUT);

    pinMode(Motor1, OUTPUT);

    pinMode(Motor2, OUTPUT);

    }

    void loop(){

    {

    do{

    i = i + 10;

    digitalWrite(pin4,HIGH);

    digitalWrite(Motor1,LOW);

    analogWrite(Motor2, i);

    delay(1000);

    }while(i

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    12/46

    delay(3000);

    do{

    i = i - 10;digitalWrite(pin4,HIGH);

    digitalWrite(Motor1,LOW);

    analogWrite(Motor2, i);

    delay(1000);

    }while(i>=0);

    do{i = i + 10;

    digitalWrite(pin4,HIGH);

    digitalWrite(Motor2,LOW);

    analogWrite(Motor1, i);

    delay(1000);

    }while(i=0);

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    13/46

    }

    }

    SystemVision How To Tutorials

    The following tutorials include a diverse collection of designs that highlight

    SystemVisions design and analysis capabilities. If you are new to SystemVision, it is

    recommended that you begin with the Getting Startedtutorial.

    To begin a tutorial, click on the desired icon below. The corresponding tutorial

    instructions will be automatically loaded into a new browser window. In some cases, anadditional menu will be presented that offers multiple design choices related to the icon

    you have chosen.

    You can go to the previous page at any time by clicking on the Back button, in the

    SystemVision Toolbar, or the link at the top of a given page.

    SystemVision Design & Analysis Tutorials

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    14/46

    Getting Started Sensitivity, Monte Carlo, WCA

    Create Symbols for Models Create Models from Datasheets

    Import SPICE/PSpice Models Graphical Component Modeling

    Create Behavioral Models Use C Code in a Design

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    15/46

    Switch Characteriztion &

    ModelingPlace Symbols with DxDataBook

    PCB/Library Setup Automation Scripts, Tips

    Read S-ParametersGlobal Params, Sim Options,

    etc.

    Experiment Manager (SV Excel)

    Parametric and Statistical Analyses Tutorial

    In this tutorial you will use Parameter Sweeps, Sensitivity, Monte Carlo and Worst-Caseanalyses in SystemVision to analyze the performance of a simple H-Bridge Motor

    Controller. This example combines SPICE models for the electronics with VHDL-AMS

    models for the motor and loads. The ability to simulate these together is made possible

    by SystemVisions support for multiple industry standard languages. Combining this with

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    16/46

    Parametric Analyses makes SystemVision a powerful tool for robust mixed-technology

    system design.

    Related Documents:

    For further information on the subjects discussed in this exercise, please refer to the

    SystemVision Help (Help > SystemVision Help).

    Open Beyond SPICE Project

    The first step for designing and simulating a design is to open a SystemVision project.

    If you have already gone through the initial steps of this tutorial and created

    this project, you should just open the project as follows: select File > Open

    > Project, browse to the location you specified when creating theproject, and open the Beyond_Spice.dproj file. You can then continue this

    tutorial wherever you left off.

    When you open any of the pre-installed SystemVision tutorials (like the Beyond SPICE

    project) for the first time, you will follow these steps.

    1. Select File > New

    2. Click on the Project tab in the New dialog.

    3. Click on the TutorialProjects folder under Categories.

    4. Select the Parametric icon under Types.

    The name of the project, Beyond_Spice, will appear in the Name field.

    5. Browse into a location where you would like to copy the Beyond_Spice project

    files.

    6. Click OK.

    The Beyond_Spice project files are copied to the location you specified, and the

    project is then loaded into SystemVision and is ready to run.

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    17/46

    To open this project in the future, select File > Open > Project, browse to the location

    you specified when creating the project, and open the Beyond_Spice.dproj file.

    H-bridge Motor Controller

    The design tb_hbridge_spice_ams, shown in Figure 1, is an H-bridge circuit combining

    SPICE level transistors with digital (VHDL) stimulus and VHDL-AMS drivers, DC motor

    and loads. Using SystemVision, the power of VHDL-AMS can be seamlessly integrated

    with existing SPICE models or subcircuits, to provide a multi-language, mixed-

    technology system simulation.

    Figure 1 - tb_hbridge_spice_ams schematic.

    Design Selection/Exploration

    1. From the Simulation tab, click on TestBenches > tb_hbridge_spice_ams to open

    the schematic.

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    18/46

    2. Explore some of the component models.

    For example, select the DC Motor Symbol and right-click > Push VHDL to view the

    VHDL-AMS model (repeat for other VHDL-AMS models as desired).

    3. View some of the model properties that have been assigned to various symbols:

    Double-click on a VHDL-AMS or SPICE model to access model attributes .

    Simulating the Circuit (Nominal Simulation)

    First you will perform a nominal simulation to verify that the circuit is operating as

    intended.

    1. Return to the schematic and from the menu, select Simulation > Simulate to

    invoke the Simulation Control window (there is also a simulation icon available on

    the icon bar).

    2. In the Simulations tab enable the Time-Domain Analysis and set End Time to 1

    sec e em Run colocar nominal.

    3. Leave the settings in the Results tab as they are.

    The Results tab allows you to select the signals for viewing. The default selection

    for this design is Selected Waveforms, with which individual waveforms have

    been selected for analysis.

    4. Click on the Multi-Run tab, and select Nominal for the Multi-Run Type, if

    necessary.

    The Multi-Run tab is for performing variations on component parameters.

    5. No settings will be needed for the Advanced tab.

    The Advanced tab is used for advanced simulation settings (normally not

    required).

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    19/46

    6. Click the OKbutton to run the simulation.

    Viewing Results

    The simulation results will automatically be loaded into the Waveform Analyzer uponcompletion of a successful simulation (if not, look in the Output Window for any error

    messages).

    Individual signals can be viewed by double-clicking with the left-mouse button or by

    using the drag-and-drop feature. You can also plot a signal from the schematic by

    selecting the desired signal and using right-click > Plot Waveform.

    1. Use one of these methods to plot the digital command signals d_fcmd and d_rcmd

    indicated by the symbol next to the waveform name.

    2. Next plot the motor current ydcmotor1/i.

    Notice the effect of the back-emf voltage as modeled in the motor equations,

    which levels out the current as the motor spins.

    3. Plot the waveform position.

    This is the position of the motor shaft over time. Notice that the motor does notreturn to its original position due to the short length of the reverse command

    signal.

    4. Verify that the waveforms match those shown in Figure 2.

    5. Bring up a new graph window by selecting File > New. This window will be used

    shortly.

    1

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    20/46

    Figure 2 - Nominal Simulation Results.

    dada a partida no motor em aproximadamente 0,2s para o sentido positivo (dc_fcmd).

    Inicialmente tem-se um pico devido inercia do indutor. O motor permanece neste

    sentido durante 0,2 segundos. O sentido inverso est defasado de 0,2 segundo do

    sentido direto, entretanto o sentido reverso tem durao de 0,1 segundo. Isso implica

    que ele no consegue retornar posio inicial permanecento na metade do caminho.

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    21/46

    Figura 01: Circuito de comando.

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    22/46

    Figura 02: Forma de ondas

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    23/46

    Parameter Sweeps

    Parameter sweeps are useful for automatically varying specific circuit parameters and

    running simulations.

    Setup Sweeps

    You will next examine the effects of the component parameters on the motor position.

    You will do this by sweeping a parameter (motor winding resistance) over a specified

    range.

    1. Return to the tb_hbridge_spice_ams schematic and from the menu, select

    Simulation > Simulate to invoke the Simulation Control window

    2. Select the Multi-Run tab.

    3. Change the Multi-Run Type to Sweep Values.

    4. Click on the Parameter Editbutton to invoke the Sweep Parameter dialog.

    5. Click on the browse button () to invoke the Select Parameterdialog.

    6. Select ydcmotor1.r_wind and click OK.

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    24/46

    7. Set the Sweep Type to List and the Sweep List to 50.0 100.0 200.0.

    8. Click the Replace current sweep parameters checkbox.

    This will remove any previous sweep commands. The dialog should appear similar to

    that shown in Figure 3.

    Figure 3 - Sweep parameter dialog box.

    9. Click OK in the Sweep Parameter dialog.

    10. Click OK in the Simulation Control dialog.

    11. When the simulation runs are complete, plot the digital command signals

    (d_fcmd and d_rcmd) along with the motor position as shown in Figure 4.

    Note the sweep values shown are annotations that were added manually.

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    25/46

    Figure 4 - Parameter Sweep Results.

    Figura 03:

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    26/46

    Performing Measurements

    As expected, these results show that the winding resistance has a significant effect on

    the final angular position. SystemVision allows you to quantify relationships between

    system performance and component parameters by performing measurements on thesimulation results. In this section you will re-run the previous analysis with additional

    sweep values. The extra data that is generated will allow you to create correlation plots.

    1. Re-invoke the Simulation Controldialog and click on the Multi-Run tab.

    2. Click the Parameter Edit button and modify the existing fields as follows:

    Parameter:E(ydcmotor1,r_wind) (unchanged from previous analysis)

    Sweep Type:Increment

    Sweep Start:10.0

    Sweep Stop:100.0

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    27/46

    Sweep Increment:10.0

    3. Click the Replace current sweep parameters checkbox.

    4. Click OK in the Sweep Parameter dialog.

    5. Click OK in the Simulation Control dialog.

    6. When the simulation runs complete, plot the position waveform into a new graph

    (select File > New to create a new graph window).

    7. Click the Add Cursor button twice to place two cursors (C1 and C2) at locations

    similar to those shown in Figure 5.

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    28/46

    Figure 5 - Parameter Sweep Results with Measurements.

    8. Click the Measurement Tool icon and fill in the dialog as shown in Figure 6 to

    annotate the Risetime measurement results to the graph.

    Be sure to Apply Measurements Between Two Cursors.

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    29/46

    Figure 6 - Measurement Tool for Risetime Measurement.

    9. Click Apply. The measurements are annotated to the graph.

    The measurement can be moved from one waveform to another by clicking on

    the handle at either the top or bottom of the result markers, and holding and

    dragging to another waveform. All measurement results can be viewed by right-

    clicking with the cursor over the measurement and selecting Measurement

    Results.

    10. In the Measurement Tool, select the Plot New Waveform option under

    Measurement Results and re-apply to create a plot of Risetime vs. motor winding

    resistance.

    11. In necessary, click Continue in the Open New Window dialog.

    2

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    30/46

    You now have a waveform that displays Risetime as a function of motor winding

    resistance.

    12. Bring back up the graph window with the waveforms shown in Figure 5.

    13. Reposition the cursors so that they enclose the falling edges of the swept

    waveforms.

    14. In the MeasurementTool, select Falltime as the Measurement.

    15. Be sure to specify that the measurement is to be performed between the cursors.

    16. Re-apply to create a plot of Falltime vs. motor winding resistance.

    17. The results are shown in Figure 7.

    The waveforms were super-imposed by copying and pasting (or dragging) a

    waveform from one graph window to another graph window.

    The individual measurement points can be displayed by selecting the waveform

    name (in the signal pane) and selecting right-click > Data Point > Symbols.

    3

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    31/46

    Figure 7 Risetime/Falltime Plots.

    Figura 04: Tempo de subida e tempo de descida.

    3

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    32/46

    Figure 7 clearly shows the effect the value the motor winding resistance has on the shaft

    position rise- and fall-times when used with the H-bridge driver circuit. This is a simple

    example of how SystemVision can be used to turn simulation data into engineering

    information that can be used to help improve a system design.

    Note that rise- and fall-times are measured relative to the minimum and maximum value

    of each individual waveform, which explains why fluctuations such as those shown

    above are possible (as opposed to a continuous increasing or decreasing pattern).

    18. Exit out of the Waveform Analyzer. Do not save the waveforms.

    19. Descrio dos cdigos em VHDL:

    19.1. Descrio do bloco clock pulse:

    No SystemVision, o Bloco Clock Pulse tem a seguinte representao grfica:

    3

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    33/46

    Figura 05: Bloco do Clock_Pulse

    Abaixo segue o cdigo em VHDL que descreve as funcionalidades do bloco

    Clock Pulse. O smbolo \* *\ representa delimitao de comentrios dos integrantes

    deste relatrio.

    library IEEE;

    use IEEE.std_logic_1164.all;

    \* Determina qual biblioteca dever ser utilizada. Contm a maioria dos comandos

    utilizados na linguagem VHDL*\

    entity clock_pulse is

    \* a parte principal do projeto, a interface do Sistema que descreve as

    entradas e sadas. Neste caso a entrada o bloco clock_pulse.

    generic (initial_delay : time; -- Delay Time [Sec]

    width : time; -- pulse width [Sec]

    period : time); -- Period [Sec]

    \* generic : Declarado naentitypara definir constantes. Neste caso, as

    constantes so width e period, que so dados de entrada a serem determinados pelo

    usurio. *\

    port (out_state : out std_logic);

    end entity clock_pulse;

    architecture ideal of clock_pulse is

    3

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    34/46

    signal out_signal : std_logic;

    constant off_time : time := period - width;

    \* generic : Operao para determinar a constante de tempo *\

    \* -----------------------------------------------------------------------------------------------*\

    Begin

    \* Inicia o processo de criao do sinal de sada do clock.*\

    -- purpose: Creates events on signal "out_signal"

    -- type : combinational

    -- inputs :

    -- outputs: out_signal

    CreateEvent : process

    Begin \* Incio do processo de repetio que dar origem ao clock pulse .*\

    out_signal

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    35/46

    end process CreateEvent;

    out_state

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    36/46

    Figura 06: Bloco do Transistor.

    * Model 2N3904

    \* Determina qual transistor dever ser utilizado na simulao.*\

    .MODEL 2N3904 NPN ( IS=11.3161F

    + BF=174.8327 NF=1.017 VAF=102.2265 IKF=64.3415M

    + ISE=59.1356F NE=1.5412 BR=23.1889 NR=1.024

    + VAR=12.7191 IKR=0.1342 ISC=13.4919P NC=1.5092

    + RB=5 IRB=8.8078M RBM=2.2344 RE=0.4831

    + RC=1.3075 CJE=6.622P VJE=0.5954 MJE=0.2753

    + TF=75.9047P XTF=3.5 ITF=11.5542M CJC=3.42P

    + VJC=0.5 MJC=0.2024 TR=10.7163N EG=1.11 )

    \* Este cdigo determina as caractersticas intrnsecas do transistor escolhido para a

    simulao e em cada ponto descreve um parmetro caracterstico dele*\

    19.3. Descrio do cdigo VHDL que descreve o motor dc:

    3

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    37/46

    Figura 07: Bloco do Motor DC

    - Use proposed IEEE natures and packages

    library IEEE;

    \*Bibliotecapadro que contm comandos de execuo para linguagem VHDL */

    use IEEE.mechanical_systems.all;

    \*Permite utilizar definies e comandos que no esto na biblioteca padro. Neste

    caso usa uma biblioteca especifica para comandos ou definies mecnicas do

    motor DC */

    use IEEE.electrical_systems.all;

    \*Permite utilizar definies e comandos que no esto na biblioteca padro. Neste

    caso usa uma biblioteca especifica para comandos ou definies elticas do

    motor DC */

    entity DCMotor_r is

    \*Determina o comportamento do motor dc */

    3

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    38/46

    generic (

    pos_ic : angle := real'low; -- Initial value for shaft angle

    \*Determina o o ngulo inicial do eixo do motor */

    r_wind : resistance; -- Motor winding resistance [Ohm]

    \*Determina o a resistncia da bobina do motor dc */

    kt : real; -- Torque Constant [N*m/Amp]

    \*Recebe o valor do torque do motor dc */

    l : inductance; -- Winding inductance [Henrys]

    \*Recebe o valor da indutncia da bobina do motor dc */

    d : real; -- Damping coefficient [N*m/(rad/sec)]

    \*Determina o valor do coeficiente de amortecimento do motor dc */

    j : moment_inertia); -- Moment of inertia [kg*meter**2]

    \*Determina o momento de inrcia da carga do motor dc */

    port (terminal p1, p2 : electrical;

    terminal shaft_rot : rotational);

    end entity DCMotor_r;

    -------------------------------------------------------------------------------

    -- Basic Architecture

    -- Motor equations: V = Kt*W + I*Rwind + L*dI/dt

    -- T = -Kt*I + D*W + J*dW/dt

    3

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    39/46

    -------------------------------------------------------------------------------

    architecture basic of DCMotor_r is

    quantity v across i through p1 to p2;

    quantity theta across torq through shaft_rot to rotational_ref;

    begin

    if domain = quiescent_domain and pos_ic /= real'low use

    theta == pos_ic;

    v == kt*theta'dot + i*r_wind + l*i'dot;

    \* Observa o valor da posio angular do eixo e partir dele calcula a velocidade

    angular *\

    else

    torq == -1.0*kt*i + d*theta'dot + j*theta'dot'dot;

    \* Calcula o valor do torque a partir da variao do ngulo do eixo *\

    v == kt*theta'dot + i*r_wind + l*i'dot;

    \* Calcula o valor da velocidade a partir da variao do ngulo do eixo *\

    end use;

    end architecture basic;

    3

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    40/46

    19.4.Descrio do cdigo VHDL que descreve o bloco do momento de inrcia

    Figura 08: Bloco da Carga (momento de inrcia)

    -- Use proposed IEEE natures and packages

    library IEEE;

    use IEEE.mechanical_systems.all;

    entity inertia_r is

    generic (j : moment_inertia); -- Value of moment of inertia [Kg*m^2]

    \* Determina o valor do momento de inrcia de massa (j) da carga acoplada aoeixo*\

    port (terminal rot1 : rotational);

    end entity inertia_r;

    -------------------------------------------------------------------------------

    -- Ideal architecture

    -- Tload = J*dW/dt

    -------------------------------------------------------------------------------

    architecture ideal of inertia_r is

    4

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    41/46

    quantity theta across torq through rot1 to rotational_ref;

    begin

    torq == j * theta'dot'dot;

    \* Calcula o valor do torque a partir da variao do ngulo do eixo e do momento de

    inrcia da carga *\

    end architecture ideal;

    ------------------------------------------------------------------------------

    -- Copyright (c) 2003 Mentor Graphics Corporation

    19.5. Descrio do cdigo que modela o fim de curso rotacional:

    library IEEE;

    use IEEE.MATH_REAL.all;

    use IEEE.MECHANICAL_SYSTEMS.all;

    entity stop_r is

    generic (

    k_stop : stiffness; \*Constante de rigidez de parada do motor*\

    damp_stop : damping := 1.0e-9; \*Constante de amortecimento de parada domotor*\

    ang_max : angle; \*Valor mximo do ngulo *\

    ang_min : angle := 0.0 \*Valor mnimo do ngulo *\ );

    4

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    42/46

    port ( terminal ang1, ang2 : rotational);

    end entity stop_r;

    architecture ideal of stop_r is

    quantity velocity : velocity;

    quantity ang across trq through ang1 to ang2;

    begin

    velocity == ang'dot; \*Define a velocidade angular em funo da derivada da

    posio angular no tempo *\

    if ang'above(ang_max) use

    trq == k_stop * (ang - ang_max) + (damp_stop * velocity);

    ; \*Calcula trq em funo da velocidade, do amortecimento de parada, da diferena

    entre a posio angular mxima e a atual e da rigidez de parada *\

    elsif ang'above(ang_min) use

    trq == 0.0;

    else

    trq == k_stop * (ang - ang_min) + (damp_stop * velocity);

    \*Calcula trq em funo da velocidade, do amortecimento de parada, da diferena

    entre a posio angular mnima e a atual e da rigidez de parada *\

    end use;

    break on ang'above(ang_min), ang'above(ang_max);

    4

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    43/46

    end architecture ideal;

    -------------------------------------------------------------------------------

    -- Copyright (c) 2003 Mentor Graphics Corporation

    Simulao para velocidade angular.

    Substituiu-se o motor cujo controle era feito para posicionamento pelo de controle

    de velocidade, e por conseguinte substituiu-se a carga correspondente.

    Component--> atuadores e motores motor dc revoluo

    Copiar e posicionar sobre a rea de trabalho sem retirar o motor cujo controle foi de

    posio.

    Figura 09: Circuito modificado para incluir carga dinmica.

    4

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    44/46

    Simulao:

    4

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    45/46

    Figura 10:Velocidade, corrente e sentido de rotao em funo do tempo.

    A curva em branco representa a velocidade. As curvas em azul representam o qual

    sentido da rotao (direto ou inverso de acordo com conveno ) e a ltima

    curva representa a corrente.

    Simulao paramtrica

    4

  • 7/27/2019 Eletrnica de Potncia II - Aula 2

    46/46

    Figura 11: Representao posio em funo do tempo atravs de simulao

    paramtrica.