6.6.1. Overview of board support in motorBench® Development Suite

MCAF supports custom boards as of MCAF R8. Users may now configure motorBench® Development Suite for use with a wide range of motor control boards with a variety of features. To configure a custom board, users can define a board configuration in the form of a board definition file. From there, motorBench can automatically configure MCC peripherals and then generate code based on the board configuration and other parameters set in the motorBench Configure, Tuning, and Customize pages.

See the motorBench User’s Guide for more information.

6.6.2. Scope of hardware support

Figure 6.7 illustrates the typical components of a motor drive hardware design that are within the scope of MCAF’s board support functionality.

../../_images/hw-blockdiag.svg

Figure 6.7 Hardware components supported by MCAF

Note

Motor terminals are shown above as A, B, and C. MCAF firmware reflects this naming choice. Some drive designs or motors may have terminals named U, V, and W; if this is the case, use A, B, and C, to substitute for U, V, and W, respectively.

6.6.2.1. Board configuration features

The following table details the features that can be configured for a custom board.

Note

Note that at least one of the three current measurement methods (single-, dual- or triple-channel) is required in order for a board to be compatible with motorBench.

Category

Supported board feature

Required

Comments

Device

dsPIC® Digital Signal Controller

yes

Devices from the following device families:

  • dsPIC33CK

  • dsPIC33CDV, dsPIC33CDVC and dsPIC33CDVL

  • dsPIC33E (custom board feature is not supported, peripherals must be configured manually in MCC)

MCP802x gate driver

MCP8021/MCP8022/MCP8027 supported by the MCC library

Analog

DC link voltage measurement

yes

Needed for DC link compensation in MCAF

Phase current — two phases

Phases A and B are required for dual-channel and triple-channel measurement (which also needs phase C).

DC link measurement is required for single-channel measurement.

Phase current — three phases

DC link current

Op amps for current measurement

Op amps that are internal to the dsPIC, or external/discrete devices

Inverter bridge temperature sensor

Absolute voltage reference

Custom analog channels

These channels will be queued for sequential sampling in every MCAF ADC interrupt cycle.

Digital

PWM fault

Overcurrent fault, for example. This can be set to none if not available.

UART

Required for real-time diagnostic kernel support. High baud rate UART support circuitry is suggested (at least 115.2Kbaud, but 921.6K or higher recommended).

Programmer/debugger

yes

Need to specify the programming pin pair (PGD/PGCx)

Oscillator

yes

Internal FRC / external clock / crystal

Internal comparator

Only one instance is supported in this release of motorBench

Pushbuttons

Up to two pushbuttons are supported for use with MCAF. Application may define additional pushbuttons using custom GPIOs.

LEDs

Up to two LEDs are supported for use with MCAF. Application may defined additional LEDs using custom GPIOs.

QEI

Only one instance is supported in this release of motorBench for use with MCAF.

Custom GPIOs

Application-specific digital inputs and outputs

6.6.2.2. Assumptions

6.6.2.2.1. Current measurement

MCAF requires the phase and DC link current measurement circuits to provide analog input to the ADC with a DC bias of \(AV_\text{dd}/2\) in order to be able to measure current across a range from negative full-scale (\(-I_\text{fs}\)) to positive full-scale (\(I_\text{fs}\)) as shown in Figure 6.8.

../../_images/custom-board-current-spec.svg

Figure 6.8 ADC input to measured phase / DC link current specification

Note

Depending on the circuit design, the sign of some of the current channels may need to be inverted. (See Current polarity conventions for more information.)

MCAF will automatically handle this sign inversion as long as it is configured in the appropriate current sense channels of the board definition file.

6.6.2.2.2. Voltage measurement

MCAF requires the DC link voltage measurement circuit to provide analog input to the ADC with zero DC bias to be able to measure voltage from 0V to positive full-scale (\(V_\text{fs}\)) as shown in Figure 6.9.

../../_images/custom-board-voltage-spec.svg

Figure 6.9 ADC input to measured phase / DC link voltage specification

The same specification applies for phase voltage measurement, which is optionally supported by MCAF.

6.6.3. Board definition file structure

The board definition file is a hierarchical data model that describes various configuration settings. The serialization format used in motorBench is YAML; we may expand this to include support for JSON and/or TOML in future revisions of motorBench® Development Suite.

For more information, see Custom board definition format.

6.6.4. System parameters

System parameters are application-specific properties that can be viewed and edited in the Configure page of motorBench® Development Suite. They include parameters such as PWM frequency and dead time, which are application choices, rather than inherent, fixed properties of a board. For this reason they are not part of a board definition — but they do need to meet the constraints of the board, for example maximum PWM frequency or minimum dead time.

The overall concept is analogous to getting some food in a buffet.

  • Meal = project at hand

  • Food = project properties / system parameters

  • Plate = board

The system parameters are “on top of” the board and need to fit within the constraints of the board.

../../_images/bento-tray-1400814356.jpg

System parameters configurable in motorBench are:

System parameter

Type

Unit

Editable

Comments

Use maximum supported system clock frequency (Fosc)

Boolean

yes

System clock frequency (Fosc)

Integer

MHz

yes

Editable only if the maximum supported system clock frequency is not being used.

PWM frequency

Float

kHz

yes

Initialized to default [1]

PWM dead time

Float

ns

yes

Initialized to default [1]

Current control loop sampling time factor

Integer

Tpwm

Sampling time of current control loop as a multiple of PWM periods.

Velocity control loop sampling time factor

Integer

Tpwm

yes

Sampling time of voltage control loop as a multiple of PWM periods.

ADC sampling time

Float

ns

yes

Initialized to default [1]

Nominal DC link voltage

Float

V

yes

Initialized to default [1]

System parameters should be configured to meet application requirements after a board configuration file is imported.