Texas Instruments | DRV832XXEVM Sensored Software | User Guides | Texas Instruments DRV832XXEVM Sensored Software User guides

Texas Instruments DRV832XXEVM Sensored Software User guides
User's Guide
SLVUB13 – February 2017
DRV832XX EVM Sensored Software User's Guide
This document is intended as a supplement to the BOOSTXL-DRV8320x User's Guide, BOOSTXLDRV8323RX User's Guide, and DRV832xx GUI User's Guide to describe the functionality of the sensored
BLDC motor commutation firmware used to on the BOOSTXL-DRV832x EVM. This user's guide outlines
the different considerations for motor commutation as well as how to adjust the different code parameters
provided in the sensored firmware.
1
2
3
4
Contents
Overview ......................................................................................................................
Sensored Control Background .............................................................................................
2.1
Motor Position Detection ...........................................................................................
2.2
Commutation ........................................................................................................
2.3
PWM Scheme .......................................................................................................
Customizing the Reference Code .........................................................................................
Running the Project in Code Composer Studio..........................................................................
2
2
2
2
3
4
7
List of Figures
1
2
3
4
5
........................................................................................................
Low-Side PWM Sequence..................................................................................................
High-Side PWM Sequence .................................................................................................
Symmetric PWM Sequence ................................................................................................
SPI REGISTER Page in GUI ...............................................................................................
Hall Sensor Outputs
2
3
4
4
7
List of Tables
1
Gray Coding of Hall sensors ............................................................................................... 2
2
Commutation Sequence .................................................................................................... 3
Trademarks
Code Composer Studio is a trademark of Texas Instruments.
All other trademarks are the property of their respective owners.
SLVUB13 – February 2017
Submit Documentation Feedback
DRV832XX EVM Sensored Software User's Guide
Copyright © 2017, Texas Instruments Incorporated
1
Overview
1
www.ti.com
Overview
Driving a BLDC motor involves electronically commutating the phases. The windings must be energized in
a sequence which makes knowing the rotor position important. In a sensored control solution, the rotor
position is detected by the outputs of Hall-effect sensors. Three sensors are placed on the motor giving a
3-bit code for the motor commutation sequence.
This user's guide is designed to show how sensored control works and to enable users to modify the
application software for a specific system. This document has two major sections. The first section is the
description of how sensored motor control works. The second section is an explanation of the reference
code.
2
Sensored Control Background
2.1
Motor Position Detection
In applications equipped with Hall Effect sensors, the shaft position detection is simple. Each sensor
output is directly wired to a GPIO pin of the microcontroller. The sensors give three 180° overlapping
signals offset by 60° and therefore providing the six mandatory commutation points. The rising and falling
edges of each sensor output represent a change in the drive state is needed. After the controller
determines which edge has been detected, it computes the time elapsed since the last detected edge and
commutates the respective phase.
Phase
1
2
3
4
5
6
U
V
W
Figure 1. Hall Sensor Outputs
The sensor output is gray coded (see Table 1), so the sensor signal has only one edge change for each
state change which reduces the noise sensitivity.
Table 1. Gray Coding of Hall sensors
2.2
Phase
Hall Inputs CW (WVU)
Active FETs
1
100
HS_W, LS_V
2
110
HS_W, LS_U
3
010
HS_V, LS_U
4
011
HS_V, LS_W
5
001
HS_U, LS_W
6
101
HS_U, LS_V
Commutation
With the position of the motor known, the next control state for the external FETs can be determined from
the commutation sequence. The commutation sequence defines which windings of the motor the current
flows through and which one is open. Commutating the phases occurs by the integrated predriver turning
on and off certain low-side and high-side FETs. The PWM duty cycle is used to control the amount of
current through the power FETs and motor windings. Adjusting the current to the motor, in turn, adjusts
the speed of the motor.
2
DRV832XX EVM Sensored Software User's Guide
Copyright © 2017, Texas Instruments Incorporated
SLVUB13 – February 2017
Submit Documentation Feedback
Sensored Control Background
www.ti.com
Table 2 provides an example low-side commutation table. Rotating motor steps through this table during
normal operation according to the Hall sensor signal that was received. If the motor is to spin in reverse,
the commutation sequence is simply reversed.
Table 2. Commutation Sequence
Gate Drive Outputs
Commutatio
n Phase
High-Side
U
2.3
Low-Side
V
W
1
ON
2
ON
3
ON
4
ON
5
ON
6
ON
U
V
Open Phase
Hall Sensor
State
U
100
V
110
W
PWM
PWM
PWM
PWM
W
010
PWM
U
011
PWM
V
001
W
101
PWM Scheme
The commutation of the driving circuit is set in three different ways: low-side PWM, high-side PWM (nonsymmetric PWM), and complementary PWM (using the built-in function called the dead time generator).
With the low-side PWM, only one high-side transistor is in the continuous ON state, and only one low-side
transistor is driven by the PWM signal. With the high-side PWM scheme, the high-side transistor is driven
by the PWM signal.
2.3.1
Low Side
Figure 2 shows the low-side PWM sequence.
Phase
1
2
3
4
5
6
HS_U
LS_U
HS_V
LS_V
HS_W
LS_W
Figure 2. Low-Side PWM Sequence
SLVUB13 – February 2017
Submit Documentation Feedback
DRV832XX EVM Sensored Software User's Guide
Copyright © 2017, Texas Instruments Incorporated
3
Customizing the Reference Code
2.3.2
www.ti.com
High Side
Figure 3 shows the high-side PWM sequence.
Phase
1
2
3
4
5
6
HS_U
LS_U
HS_V
LS_V
HS_W
LS_W
Figure 3. High-Side PWM Sequence
When the phase is driven with the PWM signal and when the PWM is in the off state of the duty cycle, the
current still must flow in the motor. Typically the current can flow through the body diode on the FET until
the PWM signal turns back on. To avoid any unnecessary power loss, the FET can be turned on instead
of just letting the body diode conduct. For example in phase 1 in Figure 3, when the U high-side FET sees
the PWM signal when the PWM is temporarily off the U low-side FET can be temporarily turned on. This
method of alternating the PWM on the low side and high side of the same phase is known as synchronous
PWM. A small amount of time must be inserted between when the high side turns on or off and when the
low side turns off or on, respectively. This inserted time is known as dead-time.
2.3.3
Symmetric (Complementary)
Figure 4 shows the symmetric PWM sequence.
Phase
1
2
3
4
5
6
HS_U
LS_U
HS_V
LS_V
HS_W
LS_W
Figure 4. Symmetric PWM Sequence
3
Customizing the Reference Code
To modify the sensored code, the end-user must download the Code Composer Studio™ (CCS) software
and the DRV832xx_EVM_BLDC_FW software. To modify the run time of the parameters, the user must
install BOOSTXL-DRV832X EVM GUI.
The following steps go through the process of modifying some parameters for sensored control.
4
DRV832XX EVM Sensored Software User's Guide
Copyright © 2017, Texas Instruments Incorporated
SLVUB13 – February 2017
Submit Documentation Feedback
Customizing the Reference Code
www.ti.com
1. Open the CCS software and import the project: DRV832XX_EVM_Trapezoidal_sensored_BLDC from
the folder where the demo software is located.
2. Select the file TrapSensored_Parameters_Setup.h. This folder contains most of the parameters used
to run this application code. Some parameters require modifications to properly tune for different
operating conditions. Step 3 describes the parameters and the detail in which they can be modified.
/* System parameter setup */
#define ALGO_ID
#define SPEED_INPUT_SAMPLE INTERVAL
#define PWM_FACTOR
#define PWM_PERIOD
#define READ_VCC_PERIOD
#define TIME_COUNT_1MS
#define MIN_DUTY_CYCLE
#define MAX_DUTY_CYCLE
#define RAMP_RATE
#define RAMP_RATE_DELAY
/* Fault handling setup */
#define UNDER_VOLTAGE_LIMIT
#define OVER_VOLTAGE_LIMIT
#define
#define
#define
#define
#define
#define
#define
MIN_STALLDETECT_DUTY
STALLDETECT_REV_THRESHOLD
STALLDETECT_TIMER_THRESHOLD
AUTO_FAULT_RECOVERY_TIME
STALL_DETECTION_FLAG
VCC_MONITOR_FLAG
MOTOR_PHASE_CURRENT_LIMIT
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
(0)
3. See the description for each parameter shown in Figure 5 in the following code comments:
ALGO_ID — This Parameter is used to identify the type of algorithm (sensored or sensorless) by the
GUI and this value should not be changed.
SPEED_INPUT_SAMPLE INTERVAL — In the state machine, when the motor is in the RUN state,
the speed Input must be read to get updated duty cycle inputs from the user. This parameter
determines how often the speed input is read. This number × PWM_PERIOD gives the time
Interval between each speed sample. This value cannot be configured and modified using GUI.
PWM_FACTOR — This parameter is the ratio of the ADC full-scale value to the PWM_PERIOD value.
This value cannot be configured and modified using GUI.
PWM_PERIOD — This value sets the frequency of the PWM pulse train used in switching the FETs.
The PWM frequency is calculated as the ratio of MCLK to PWM_PERIOD. As the master clock
is operated at 25 MHz, if PWM_PERIOD = 1024, then PWM frequency = ~ 25 Khz (40 µs). This
value also serves as the maximum comparator value that can be loaded that sets the duty
cycle. This parameter can be configured using GUI widget PWM switching frequency.
READ_VCC_PERIOD — This number sets the time in milliseconds after which the supply voltage is
periodically monitored for any voltage faults. This parameter cannot be configured through the
GUI widget.
TIME_COUNT_1MS — This parameter is the equivalent clock counts for 1 ms at 25-MHz clock. This
parameter cannot be configured through the GUI widget.
MIN_DUTY_CYCLE — This parameter sets the minimum threshold for the system to start spinning the
motor and at what duty cycle. After the system initializes, it waits for an input command greater
than this specified value before ramping up the motor. This value is about the PWM_PERIOD,
for example, PWM_PERIOD is 1024 and MIN_DUTY_CYCLE is 128 decimal, then the minimum
allowed duty cycle is 128 / 1024, or 12.5%.This value can be configured using the GUI widget
during motor run time.
SLVUB13 – February 2017
Submit Documentation Feedback
DRV832XX EVM Sensored Software User's Guide
Copyright © 2017, Texas Instruments Incorporated
5
Customizing the Reference Code
www.ti.com
MAX_DUTY_CYCLE — This parameter sets the maximum value that the system uses as the duty
cycle, therefore even if the input command is greater than this value, the duty cycle will not
exceed this threshold. This value is also related to the PWM_PERIOD, for example, if
PWM_PERIOD is 1024 and MAX_DUTY_CYCLE is 1000, then the maximum duty cycle is 1000
/ 1024, or 97.6%. This value can be configured using the GUI widget during motor run time.
RAMP_RATE — This parameter indicates the amount of increase or decrease in the duty cycle for
every PWM_PERIOD interrupt. If the system is either ramping up or down, and the acceleration
count is reached, the duty cycle is increased or decreased by RAMP_RATE. This value cannot
be configured by the GUI widget.
RAMP_RATE_DELAY — This parameter sets how many PWM_PERIOD interrupts must occur before
adjusting the duty cycle. Changing this value changes how fast the duty cycle is adjusted. For
example, if the PWM_PERIOD is 1024 or 40.96 µs and the RAMP_RATE_DELAY is 24, the
duty cycle is adjusted every 983 µs. This parameter controls the acceleration and deceleration
of motor. This parameter can be configured by the GUI widget.
UNDER_VOLTAGE_LIMIT — One feature of this code is voltage monitoring. Voltage monitoring
measures the VCC applied through the internal ADC and compares the ADC measurement with
the specified limits. If the voltage is less than the specified UNDER_VOLTAGE_LIMIT value, the
code shuts off the predrivers and the device goes into the FAULT state.
OVER_VOLTAGE_LIMIT — Coupled with the UNDER_VOLTAGE_LIMIT parameter, if the voltage is
found to exceed the specified OVER_VOTAGE_LIMIT value, the code shuts off the predrivers
and the device goes into the FAULT state.
MIN_STALLDETECT_DUTY — Some motors will spin very slowly at a low duty cycle. To prevent this
condition from triggering a stall fault, a minimum duty cycle is required for the stall detection to
be enabled. This parameter, MIN_STALLDETECT_DUTY, sets the threshold for the minimum
duty cycle where the stall detection feature will be enabled.
STALLDETECT_REV_THRESHOLD — In a certain amount of time, the motor should be spinning at
least a set amount of revolutions. This parameter sets the number of revolutions. In the set
amount of time specified by the STALLDETECT_TIMER_THRESHOLD parameter, if the motor
has not spun at least the count specified by this value, then the motor is assumed to have
stalled.
STALLDETECT_TIMER_THRESHOLD — TimerB0 generates an interrupt service routine (ISR) every
1 ms and each ISR has a count that is increased. When the count reaches the
STALLDETECT_TIMER_THRESHOLD value, If the current revolution count is less than the
STALLDETECT_REV_THRESHOLD, the motor is stalled and the state machine goes into the
FAULT state.
AUTO_FAULT_RECOVERY_TIME — TimerB0 is used to recover after a fault has been detected.
FAULT_RECOVERY_TIME is the value used for how many timer interrupts must occur before
reinitializing the system. For example, if the TimerB0 interrupt is set to occur every 1 ms and
FAULT_RECOVERY_TIME is set to 3000, the system will reinitialize 3 s after a fault was
detected.
STALL_DETECTION_FLAG — Setting the STALL_DETECTION_FLAG parameter to 1 enables the
stall detection fault logic. If this parameter is set to 0, the stall fault detection is disabled.
VCC_MONITOR_FLAG — Setting the VCC_MONITOR_FLAG parameter to 1 enables the VCC
undervoltage and overvoltage fault logic. If this parameter is set to 0, the VCC fault detection is
disabled.
6
DRV832XX EVM Sensored Software User's Guide
Copyright © 2017, Texas Instruments Incorporated
SLVUB13 – February 2017
Submit Documentation Feedback
Running the Project in Code Composer Studio
www.ti.com
MOTOR_PHASE_CURRENT_LIMIT — The parameter defines the maximum allowed motor-phase
peak current in Amperes. Motor A– phase current is monitored every electrical cycle during
commutation of phase A, and whenever the current limit is reached an overcurrent (OC) fault is
triggered. This value is scaled because it uses a 7-mΩ sense resistor on the DRV832XXEVM.
The current sense amplifier (CSA) gain 5 V/V is set using the firmware in the init section for
better sensitivity. This value can be modified accordingly when higher values of current sensing
are required. With an ADC of 3.3-V full-scale value and 12-bit resolution, use Equation 1 to
calculate the overcurrent limit in digital counts.
V
Ampheres u 0.007 : u 5
V u 4096
MOTOR _PHASE _ CURRENT _LIMIT
3.3 V
(1)
4. Customize the SPI REGISTER user parameters.
For all the DRV832xS devices set the SPI register settings accordingly from the DRV832xS device
data sheet (DRV832x 6 to 60-V Three-Phase Smart Gate Driver).
5. Modify the register settings using register page found in the GUI.
Figure 5. SPI REGISTER Page in GUI
4
Running the Project in Code Composer Studio
To
1.
2.
3.
4.
5.
run the project in CCS, use the steps that follow:
Install CCS software V6.1 or above.
Read through how to customize user parameters to tune the control for the specific motor.
Compile the modified project.
Connect the MSP430F5529 device to download and run the modified program.
The reference software was written for the Telco motor. If a different motor is used and the reference
code is unable to spin the motor, the motor was most likely improperly tuned. To properly tune the
motor parameters, see Section 3.
SLVUB13 – February 2017
Submit Documentation Feedback
DRV832XX EVM Sensored Software User's Guide
Copyright © 2017, Texas Instruments Incorporated
7
IMPORTANT NOTICE FOR TI DESIGN INFORMATION AND RESOURCES
Texas Instruments Incorporated (‘TI”) technical, application or other design advice, services or information, including, but not limited to,
reference designs and materials relating to evaluation modules, (collectively, “TI Resources”) are intended to assist designers who are
developing applications that incorporate TI products; by downloading, accessing or using any particular TI Resource in any way, you
(individually or, if you are acting on behalf of a company, your company) agree to use it solely for this purpose and subject to the terms of
this Notice.
TI’s provision of TI Resources does not expand or otherwise alter TI’s applicable published warranties or warranty disclaimers for TI
products, and no additional obligations or liabilities arise from TI providing such TI Resources. TI reserves the right to make corrections,
enhancements, improvements and other changes to its TI Resources.
You understand and agree that you remain responsible for using your independent analysis, evaluation and judgment in designing your
applications and that you have full and exclusive responsibility to assure the safety of your applications and compliance of your applications
(and of all TI products used in or for your applications) with all applicable regulations, laws and other applicable requirements. You
represent that, with respect to your applications, you have all the necessary expertise to create and implement safeguards that (1)
anticipate dangerous consequences of failures, (2) monitor failures and their consequences, and (3) lessen the likelihood of failures that
might cause harm and take appropriate actions. You agree that prior to using or distributing any applications that include TI products, you
will thoroughly test such applications and the functionality of such TI products as used in such applications. TI has not conducted any
testing other than that specifically described in the published documentation for a particular TI Resource.
You are authorized to use, copy and modify any individual TI Resource only in connection with the development of applications that include
the TI product(s) identified in such TI Resource. NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE TO
ANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY TECHNOLOGY OR INTELLECTUAL PROPERTY
RIGHT OF TI OR ANY THIRD PARTY IS GRANTED HEREIN, including but not limited to any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information
regarding or referencing third-party products or services does not constitute a license to use such products or services, or a warranty or
endorsement thereof. Use of TI Resources may require a license from a third party under the patents or other intellectual property of the
third party, or a license from TI under the patents or other intellectual property of TI.
TI RESOURCES ARE PROVIDED “AS IS” AND WITH ALL FAULTS. TI DISCLAIMS ALL OTHER WARRANTIES OR
REPRESENTATIONS, EXPRESS OR IMPLIED, REGARDING TI RESOURCES OR USE THEREOF, INCLUDING BUT NOT LIMITED TO
ACCURACY OR COMPLETENESS, TITLE, ANY EPIDEMIC FAILURE WARRANTY AND ANY IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL
PROPERTY RIGHTS.
TI SHALL NOT BE LIABLE FOR AND SHALL NOT DEFEND OR INDEMNIFY YOU AGAINST ANY CLAIM, INCLUDING BUT NOT
LIMITED TO ANY INFRINGEMENT CLAIM THAT RELATES TO OR IS BASED ON ANY COMBINATION OF PRODUCTS EVEN IF
DESCRIBED IN TI RESOURCES OR OTHERWISE. IN NO EVENT SHALL TI BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL,
COLLATERAL, INDIRECT, PUNITIVE, INCIDENTAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES IN CONNECTION WITH OR
ARISING OUT OF TI RESOURCES OR USE THEREOF, AND REGARDLESS OF WHETHER TI HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
You agree to fully indemnify TI and its representatives against any damages, costs, losses, and/or liabilities arising out of your noncompliance with the terms and provisions of this Notice.
This Notice applies to TI Resources. Additional terms apply to the use and purchase of certain types of materials, TI products and services.
These include; without limitation, TI’s standard terms for semiconductor products http://www.ti.com/sc/docs/stdterms.htm), evaluation
modules, and samples (http://www.ti.com/sc/docs/sampterms.htm).
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2017, Texas Instruments Incorporated
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising