Vis Sim for Electric Motor Control Visual Solutions

  • Slides: 34
Download presentation
Vis. Sim for Electric Motor Control Visual Solutions, Inc. 487 Groton Road, Westford MA

Vis. Sim for Electric Motor Control Visual Solutions, Inc. 487 Groton Road, Westford MA 01886 USA (800) VISSIM-1 www. vissim. com

Vis. Sim Supported Motors • • • AC Induction BLDC Brush PMSM Stepper Switched

Vis. Sim Supported Motors • • • AC Induction BLDC Brush PMSM Stepper Switched Reluctance

TI-Based Motor Control Blocks • Sensored AC Induction Control Blocks • V/Hz Profile Generator

TI-Based Motor Control Blocks • Sensored AC Induction Control Blocks • V/Hz Profile Generator • Sensorless AC Induction Control Blocks • AC Motor: Simulated ACI Motor • ACI Speed Estimator: Speed estimation from phase currents • ACI Flux Estimator • Current Model • PMSM Sensorless Control Blocks • Phase Voltage Calc • SMO Position Estimator

General Transforms • Clarke & Inverse Clarke Transform • For balanced three-phase circuits, the

General Transforms • Clarke & Inverse Clarke Transform • For balanced three-phase circuits, the Clarke transform is the projection of three-phase AC signals (phase currents) to two stationary orthogonal signals • Park & Inverse Park Transform • For balanced three-phase circuits, the Park transform is the projection of stationary 3 phase AC signals two axes rotation with the same frequency as the original signal. This results in two DC quantities easier to use for control before performing the inverse transform back to AC values for the PWM. • PID Regulator • PWM Wave Form Generator • Space Vector Generator (Quadrature Control) • • Space Vector Generator (Magnitude/Frequency) • • 2 nd harmonic wave form generator w/D+ Q inputs 2 nd harmonic wave form generator w/ Mag+Freq inputs Space Vector PWM: Used for 2812 PWM modulation

Rotational Sensors • QEP Speed – Takes normalized unit sawtooth and produces fraction of

Rotational Sensors • QEP Speed – Takes normalized unit sawtooth and produces fraction of max speed • To normalize, apply gain of 1/<max counts> to EQEP output • Resolver Decoder – Resolver is like rotating transformer. Base carrier frequency is picked up by sensing coils at 90 deg. Carrier freq is filtered out, and atan 2 of 2 coil intensities gives rotor angle. • Speed Calculator – Takes event capture count as input, produces fraction of max count as result – Enter max count (interval between edge event) as block

Stepper Motors • Multiple "toothed" electromagnet stators around gear-shaped magnet or iron core rotor

Stepper Motors • Multiple "toothed" electromagnet stators around gear-shaped magnet or iron core rotor (switched reluctance) • Each stator coil is slightly offset from the next • By energizing each winding in turn, you move the rotor a bit • Order of energizing gives rotational direction • Used with open-loop positioning since it can be assumed that the rotor turns a discrete amount with each pole activation • A unipolar stepper motor has two windings per phase, one pole per winding • Bipolar motors have single winding per phase, 2 poles per winding. Must use H-bridge to reverse polarity

Stepper motor wave forms • To output waveform from DSP, write sequence of bit

Stepper motor wave forms • To output waveform from DSP, write sequence of bit patterns to GPIO port. • Wave Drive – one coil energized at a time • Full Step – two coils – Less smooth, more power, more torque • Half Step – alternates one and

Vis. Sim for Stepper Motor Control • Use case block to select hex constant

Vis. Sim for Stepper Motor Control • Use case block to select hex constant for GPIO pattern sequence • Use counter to drive case block • Output of case connects to GPIO write

Stepper Control Issues • Rate of pole switching controls rotational speed • Rate is

Stepper Control Issues • Rate of pole switching controls rotational speed • Rate is limited by rated torque and load – If you switch too fast, you will not rotate • maximum start frequency rating at no load • maximum start-stop torque is the pull-in torque • pull-out torque is max torque without losing steps • step rate is ramped up during start • Use variable frequency ramp block for

Vis. Sim/Motion • Extensive block set for simulation of electric motor systems • Supports

Vis. Sim/Motion • Extensive block set for simulation of electric motor systems • Supports AC induction, brush and brushless DC motors • Stepper motors • Low level PWM switching simulation level • Selection of Sensors, Loads, Controllers, Transforms

Brush DC Motors • Commutation done mechanically – Simple to control, but brushes wear

Brush DC Motors • Commutation done mechanically – Simple to control, but brushes wear over time • Low cost • Rotor has multiple coils, stator can be permanent magnet or coils. – Magnets lose strength over time

BDC motor types • Shunt-Wound – stator coils in parallel to rotor coils –

BDC motor types • Shunt-Wound – stator coils in parallel to rotor coils – Current in stator and rotor are independent. Good for speed control • Series-Wound – stator coils in series with rotor coils – Good for high torque since current in stator and rotor increases at same rate • Wound stators does not suffer torque degradation like permanent magnet stator

BDC directional control • Requires H-bridge to reverse polarity of supply • Ifwd =

BDC directional control • Requires H-bridge to reverse polarity of supply • Ifwd = forward motion, Irvs = reverse, Ibrk = braking • Need grounding R’s to avoid shorts on startup

BDC Speed Control • BDC motor speed is proportional to voltage • Motor coils

BDC Speed Control • BDC motor speed is proportional to voltage • Motor coils act as low-pass filter for PWM so voltage is proportional to PWM duty cycle • Frequency of PWM an issue – Too low a frequency results in audible noise at low speed and sluggish response – Too high a frequency loses efficiency due to switching losses – 4 to 20 k. Hz is typically used

Feedback control • For speed control, use speed sensor with PID feedback control •

Feedback control • For speed control, use speed sensor with PID feedback control • QEP speed block needs “normalized” QEP input. (QEP / encoder tick count) for fraction of complete revolution • Use enabled blocks forward and reverse PWM configuration

Motion Trajectory • Trapezoidal - spec max vel, max accel • Diagrams>Examples>Applications>Motion>Trapezoidal. Pr ofile.

Motion Trajectory • Trapezoidal - spec max vel, max accel • Diagrams>Examples>Applications>Motion>Trapezoidal. Pr ofile. vsm • Linear acceleration from stop to max vel, hold max vel to stop zone, constant deceleration to stop • S-Curve - spec max vel, max accel, max jerk • Diagrams>Examples>Applications>Motion>Scurve. Profile. vsm • Linearly increase acceleration from stop to max accel,

PID Tuning • • Parameter. Unknown blocks for PID terms Use overshoot penalty to

PID Tuning • • Parameter. Unknown blocks for PID terms Use overshoot penalty to find stable solution Use sliders with simple plant in auto-restart mode to examine the PID response space Good paper “PID Control System Analysis & Design” Feb 2006, IEEE Control Systems Magazine Effects of independent P, I, and D tuning on closed-loop response. Rise Time Overshoot Settling Time Steady. State Error Stability ↑ KP -- ++ + -- Degrade ↑ KI - ++ ++ --- Degrade ↑ KD - -- -- ~ Improve - derivative term can degrade stability if plant has transport delay - 80% of PID controllers in use have the derivative part switched off

PID structures • Simple 3 term: y = e(x)(Kp + Ki/s + Kds) –

PID structures • Simple 3 term: y = e(x)(Kp + Ki/s + Kds) – Implement s (d/dx) via zero/pole, zero gives derivative, pole is tuned for low pass filter. • If Ti ≥ 4 TD can do series PD-PI: y =e(x)(α + TDs) KP(1 +1/αTis) Where α =(1 ± √(1 − 4 TD/ Ti ) )/2 > 0 • Examine response w/autorestart, sample plant, and sliders for gains. • Can be helpful to fix d/dt coef by hand opt P and I

State Transition Block • Allows creation of any number of states • Each state

State Transition Block • Allows creation of any number of states • Each state has any number of transition conditions to change to another state • Conditions are written in C code and may reference Vis. Sim variables (must be syntactic C – no space or punctuation in name) • Block output is current state, and rule that last fired to enter this state • Vis. Sim lets you use state names anywhere you can use expressions, like const and expression blocks

Scaled Fixed-Point Operations • Arithmetics (add, mul, div, gain etc) • Limit, unit delay,

Scaled Fixed-Point Operations • Arithmetics (add, mul, div, gain etc) • Limit, unit delay, merge, map, PI regulator • Hands-on • Make sample diagram of sin->Fix. Pt gain>plot • run - observe high/low values in block. • Change scaling to 13. 16. Run. Observe plot • Change sin amplitude to 4, scaling to 1. 16 • Run. Enable Tools/Fixed. Point Configure…

Vis. Sim/Embedded Controls Developer • Bundle of Vis. Sim, C-Code, C 2000 target, TI

Vis. Sim/Embedded Controls Developer • Bundle of Vis. Sim, C-Code, C 2000 target, TI DMC block-set , fixed-point block set, TI Code Composer Studio plug-in • Supports F 280 x, F 28 MSP 430, F 2812 on-chip peripherals: Analog in, PWM, CAN, encoder, event capture, serial, SPI, I/O ports, watch dog

Debug, Test, and Validate • Minimize time spent in debug and test • Use

Debug, Test, and Validate • Minimize time spent in debug and test • Use high-level, predebugged blocks • Support simulation of controller at block level on PC • Allow mouse probe of every input and output to display values at any instant • Debug block-level simulation on PC

Debug and Validation • Pure simulation plus DSP-in-loop simulation and block level monitoring gives

Debug and Validation • Pure simulation plus DSP-in-loop simulation and block level monitoring gives rapid feedback of controller response Vis. Sim on PC External Hardware C 2000 TM DSP (I/O Only) Peripheral Output Blocks Peripheral Input Blocks Vis. Sim block diagram DMC Fixed-Point User Blocks Standard Blocks Test DSP based controller against virtual plant on PC using JTAG Hot. Link • Inject plant failure modes to test controller response • High/Low watermark on fixed-point blocks gives numerical “headroom” safety factor • Interactive DSP utilization gives continuous CPU load factor • Interactively Change DSP controller gains from Vis. Sim and plot DSP response.

Debug and Validate • Rapid diagram edit-compile-download-debug cycle (under 10 secs) * Code automatically

Debug and Validate • Rapid diagram edit-compile-download-debug cycle (under 10 secs) * Code automatically generated, compiled, linked, and downloaded Vis. Sim on PC Plant Under Control C 2000 Peripherals Control Application Code* C 2000 DSP JTAG Vis. Sim Interface block downloads and monitors code running on DSP Vis. Sim blocks for: • Virtual plant • Interactive gains • Plots of DSP response • DSP-in-loop simulation of controller at code level on DSP through automatic code generation, compile, link, and download, and using JTAG in Real-Time Monitor mode • Test, debug, and validate the complete control system executing on DSP using an interface block • Provide test input vectors and observe DSP results in Vis. Sim on PC

Build AC - induction DSP in loop • Open AC induction motor speed control

Build AC - induction DSP in loop • Open AC induction motor speed control system – C: vis. Sim 50Embed_Controls_Developerc 2407(2812)e. ZdspQuick. Startacim_spd_co ntrol_qs. vsm • Run and observe pure simulation results • Select controller, click Tools/Codgen…, click “Include Vis. Sim Comm Interface” 7

Insert DSP component • Delete simulated controller • Insert Vis. Sim/DSP|C 2407(F 28 xx)|DSPinterf

Insert DSP component • Delete simulated controller • Insert Vis. Sim/DSP|C 2407(F 28 xx)|DSPinterf ace block • Wire up in diagram same as simulated controller • Save diagram as <filename>-d. vsm

Add blinking LED to controller • Add blink logic to sim model – Hint

Add blinking LED to controller • Add blink logic to sim model – Hint LED connected to C 0 (2407) or F 14 (F 2812) • Re-codegen • Re-rerun DSP based version • Compare F 2812 waveforms to LF 2407 – Difference is due to increased JTAG delays in 2407 part

Burn FLASH • Create FLASHable blink program and burn to flash. Note that 2812

Burn FLASH • Create FLASHable blink program and burn to flash. Note that 2812 must use Spectrum Digital FLASH utility.

Break • 15 min

Break • 15 min

Basic pressure-flow system • Pressure differential causes flow • Integral of flow into a

Basic pressure-flow system • Pressure differential causes flow • Integral of flow into a volume gives current mass occupying the volume • Pvolume = n. RT/V

Review of User Diagram Look at specific customer diagram

Review of User Diagram Look at specific customer diagram

On-chip peripherals • All on-board DSP peripherals supported including: analog inputs (outputs on EVM)

On-chip peripherals • All on-board DSP peripherals supported including: analog inputs (outputs on EVM) digital inputs and outputs simple PWMs and full compare PWMs quadrature encoder event capture, watch dog, interrupt, CAN bus serial port SPI I/O ports

TI Digital Motor Control (DMC) Library – written by TI in C-callable assembler –

TI Digital Motor Control (DMC) Library – written by TI in C-callable assembler – hand-written, tested and optimized by TI – available in Vis. Sim/ECD in easy-to-use block set – supports simulation mode (pure PC based simulation with 16 -bit truncation effects) – supports code generation mode

Custom Block Creation • Vis. Sim DLL Wizard for MSVC • Automatically creates project

Custom Block Creation • Vis. Sim DLL Wizard for MSVC • Automatically creates project with code for creating block, naming block, pin count and pin names, data types, dialog for parameters • Vis. Sim exported function vissim. Request() allows query of Vis. Sim properties: current time, time step, current block handle, block properties. – DLL exported function: <my block>Event(event. Code, p 1, p 2) is called by Vis. Sim on interesting events like sim start, end, step, code gen, mouse click