hardware or software for motor control: is there finally a...

10
Hardware or software for motor control: Is there finally a truly flexible solution?

Upload: others

Post on 12-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Hardware or software for motor control: Is there finally a truly flexible solution?

Page 2: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

Hardware or software for motor control: Is there finally a truly flexible solution? Motors are one of the most valuable items in modern connected factories (and in many aspects of modern life) - they convert electrical energy into movement that can be used to make things, move things, cool things and much more. They are also one of the largest energy users and, therefore, industry continues to demand technology to be ever more efficient. While there are still efficiencies to be gained in both the motors themselves and the semiconductors that control them, the area with the greatest potential efficiency benefit is the way in which motors are driven. However, this is a particularly challenging area, which is why designers increasingly seek ‘off-the-shelf’ solutions that address as many requirements as possible.

Introduction In factories motors are used in a variety of applications such as rotary actuation, conveyor systems, servos, fluid pumps and cooling systems (including fans). As more basic functions become automated, we are seeing increasing use of motors in other aspects of our daily lives including in our offices, homes and cars. The International Energy Agency has estimated that electric motors account for nearly half (46%) of global electricity demand, thus making them a focus for energy efficiency initiatives. Saving energy in this area is seen as so important that, in 2009, the European Union issued their energy-related products directive (ErP) 2009/125/EC. While the directive focused on many energy-consuming devices, regulation 640/2009 relates specifically to electric motors, whether they are sold as stand-alone devices or as part of larger equipment. Clearly, motor manufacturers and users are faced with stringent legal and commercial challenges. If their products do not comply with the directive, they will not sell. While the motor itself is a fundamental element of a motion control system, the method of driving the motor has a large impact on overall system efficiency.

Types of motor and control Compared with traditional brushed AC and DC motors, Brushless DC (BLDC) motors offer a number of significant advantages including improved reliability and lower costs. Unlike traditional motors, BLDC motors have no commutator meaning that they require more complex electronics to achieve the torque control that is required by modern applications. Speed control for BLDC motors minimizes the current in the stator windings for keeping the selected speed. This ensures that all of the effort is directed into turning the motor, delivering optimal efficiency and reliability. One of the challenges of this approach is to sense the current to allow comparison with the desired torque. In trapezoidal motor control, the stator currents are controlled to be equal in the windings on either side of the rotor, while the third winding is unpowered. As the rotor spins the current of each phase is cycled through positive, zero, and negative. This creates a trapezoidal current that approximates to a sinusoidal waveform. However, trapezoidal control can lead to imprecise control and audible noise, especially at low speeds. Sinusoidal control uses phase-shifted sinusoidal current waveforms to produce smoother torque than the trapezoidal approach. This requires more accurate rotor position information and current values have to be calculated rapidly. At higher speeds, any lag in this calculation will lead to inefficiency.

Page 3: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

Field-Oriented Control Field Oriented Control (FOC), sometimes known as Vector Control, is a mathematical approach to controlling BLDC motors that overcomes the poor low-speed accuracy of trapezoidal control while addressing the high-speed inefficiency of sinusoidal control. FOC is a sensorless technique, so the space, weight and, most importantly, energy consumed by a rotary encoder is saved with this approach. FOC maintains a constant stator field in quadrature with the rotor field by manipulating the motor currents and voltages with reference to the rotor’s direct and quadrature axes. The sensed stator currents are converted into direct (D) and quadrature (Q) components. These components are then compared with the required torque and zero to create an error signal. These error signals are processed in a software-based Proportional-Integral (PI) function to create PWM drive signals for the motor.

Figure 1: Block diagram of a typical FOC control system FOC is efficient across all motor speeds and is not affected by the PI function bandwidth. However, real time FOC requires fast execution of the functions to transform the sensed stator current signals into the voltage-control signals for the output bridge. Software-based FOC demands a significant portion of available CPU performance to complete the calculations in a timely manner, especially at fast rotor speeds. In some cases, the processing ability of the system may be the main limitation on the rotational speeds achievable. In order to remove the dependence on the main processor performance, dedicated hardware platforms for FOC based motor control have been developed. Toshiba’s original Vector Engine (VE), for example, moved the complex vector control equations into a dedicated hardware engine with customisable firmware. Also included in the integrated solution was a Programmable Motor Drive (PMD) block to generate the PWM waveforms and perform other necessary functions such as dead-time control. By reducing the software content, the VE ensures stable and predictable execution of code that is not impacted by interrupts or the quality of the software. As standard software is provided as part of the development environment, designers can focus on their core competencies and bring products to market far quicker.

Page 4: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

Figure 2: Block diagram of TMPM37x vector engine microcontroller Also, as dedicated hardware can execute up to 70% faster than a software-based solution, higher rotor speeds can be achieved. Moreover, the hardware VE approach releases main CPU resources for high-level product features. In many cases, when a hardware VE is implemented, a lower performance main CPU can easily provide the required application-level functionality thus saving space, cost and energy. However, many dedicated hardware-based motor control solutions are inflexible and are not suitable for deploying a single core solution across a range of different applications, limiting the effective re-use of proprietary IP. This can mean that some designers continue to use the more complex and time-consuming software based solutions. What is needed, therefore, is a platform that allows engineers to migrate their existing FOC algorithms from a pure software environment. Now, however, a new breed of microcontrollers with dedicated motor control functions provides a ‘third way’ through a firmware-based approach that allows designers to choose the percentage of control managed by hardware and software. The question, therefore, moves from whether a software or hardware route is preferred to which microcontroller will do the best job. Key considerations will be performance, code efficiency and capacity to handle functions beyond the motor control, built in functionality and peripherals and compatibility with existing IP. It should be noted that with today’s dedicated motor control microcontrollers clock speed and/or MIPS ratings are not an indicator of optimum motor control performance. For FOC schemes, for instance, engineers must understand total runtime for the motor control loop, including execution time for PI control, ‘Clarke and Park’ transformations, position estimations and, possibly, sensor measurement.

New and emerging technologies One of the latest microcontroller developments helping to address this challenge is Toshiba’s TMPM37A. Capable of running at speeds of up to 80MHz/100MIPS, this micro represents the latest addition to the company’s TX03 series of ARM® Cortex®-M3-based devices and combines some of the highest levels of integration on the market with one of the smallest footprints. The TMPM37A realizes improved code efficiency through the use of the Thumb®-2 instruction set. 16-bit instructions improve the program flow, while 32-bit instructions improve performance, allowing 32-bit multiplication (32 x 32 = 32-bit) to be executed with a single clock cycle. Together, the combination of 16- and 32-bit instructions allow for significantly faster code execution.

Page 5: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

As well as powerful 32-bit processing, the TMPM37A allows designs to be optimized for low power operation through the use of a low power consumption code library. A standby function controls the operation of the microcontroller core to further enhance power management. Indeed, housed in a VQFN32 package measuring just 5mm x 5mm, the new solution is the world's smallest microcontroller to incorporate Toshiba's Vector Engine Plus (VE+) as well as a pre-driver. Dedicated FOC capabilities are provided through the provision of a Programmable Motor Drive (PMD) alongside the Vector Engine. The PMD block incorporates the 3-phase PWM generator, dead-time controller, protection circuit and ADC timing network. Developers can combine functions from this block with proprietary motor control IP or use the Vector Engine to handle some or all of the FOC control. Within the VE a scheduler for event and priority control, a calculation core and decoder, an operation unit, a MAC unit and vector control modules handle processing of the 3-phase current input from the microcontroller’s ADC and perform the FOC algorithm. Using the PMD and VE together, only a few simple register settings are needed to manage all motor control functions including speed control, position estimation and 3-phase PWM generation at 16-bit resolution. Figure 3 below illustrates the flexibility of this vector control configuration.

Figure 3: Flexible Vector Control Configuration Using the VE, total runtime for the control loop is just 14µs (5µs for the position estimation and speed control calculations handled by the CPU and 9µs for FOC calculations). This is significantly faster than typical software FOC and is just 54% of the execution time of a competitive micro operating at 100MHz/165MIPS. This shorter execution time allows the motor to run at higher RPM while the slower processor clock speed demands less energy. The superior performance and efficiency are due to the implementation of the PMD and VE blocks, not least the fact that Toshiba’s approach delivers the same level of accuracy as the higher speed device without needing an FPU. In addition, at just under 4000 bytes, the code required is little more than half that of the FPU-based alternative.

Page 6: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

Figure 4: Comparison of software and hardware based FOC implementations By integrating a pre-driver, the TMPM37x can directly drive MOSFETs with a complementary three-phase output with a minimum unit of 25ns. Direct microcontroller drive and control of small motors such as those found in domestic appliances, server fans, small cooling fans, vents, pumps, compressors and toys is now possible. The device is particularly popular in home appliance applications as it includes hardware-based oscillator frequency detection (OFD) allowing compliance with the IEC 60730 safety standard for Class B products. Furthermore, the TMPM37x series only requires a single 5V supply, with on-board conversion to 3.3V and 1.5V. Also included are up to two on-board 12-bit ADCs with more than a dozen analog input channels. The ADCs offer a constant conversion mode and complete conversions within 2µS, when using a 40MHz conversion clock. Some products incorporate a 4-channel operational amplifier for single or three shunt resistor current detection as well as a comparator for over-current detection. External interfacing is extensive with up to 74 I/O pins. The full-function TMP37x includes up to two-channels of encoder input circuit (ENC) that corresponds to incremental encoders (AB/ABZ). Allowing for 3-phase input, the ENC is able to detect rotation direction and includes a comparator for position detection as well as a counter for absolute position detection. Other features integrated into the advanced TMP37x include a watchdog timer, power-on reset, voltage detect and a general purpose serial interface (SIO/UART). Even though the vector control is hardware-based, the VE allows for widely differing solutions to be implemented via software. This brings both flexibility and hardware-based performance into a single solution. This flexibility is further enhanced through an architecture that allows developers the flexibility to choose whether to use their own IP or take advantage of hardware acceleration using IP from Toshiba or combine both. The TMP37x is just one part of an ever-increasing microcontroller offering from Toshiba. The closely-related TMP47x series is based on an ARM® Cortex®-M4F processor and offers operation at speeds up to 120MHz. The recently announced M4K group is a single-chip solution with a low pin-count for controlling multiple motors - especially in home appliance and HVAC applications. As well as a high-precision ADC with a 0.5uS conversion time, the devices feature high-speed Flash memory with 80MHz operation, a co-processor for Toshiba’s original vector engine, and 3-channel op-amps wit selectable gain. Together, they ensure the new products realize efficient motor control while improving the power factor and system control.

Page 7: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

The new M4K products support the RAMScope interface that can confirm parameters in real time without stopping motors by loading parameters relevant to motor control to RAM. A self-diagnostic function that confirms the reference voltage of the ADC, and a CRC arithmetic circuit that identifies incorrect detection for every read operation of the memory are also incorporated. These support load mitigation of the software process required for functional safety, compliant with IEC 60730. Offering pin counts from 32 pins to 64 pins, the new M4K devices are available with flash memory capacities from 64KB to 128KB. Communication options include UART, TSPI and I2C interfaces, while I/O ports range from 24 to 52. Operating voltage range is from 4.5V to 5.4V. Toshiba’s integrated Advanced Vector Engine Plus (A-VE+) incorporates supports vector control and dead-time compensation, while an advanced programmable motor control (A-PMD) circuit delivers 3-phase output and supports 3-phase interleaved PFC. Products with a wide pitch for flow mounting and a fine pitch for reflow mounting are included in the line-up. Operating temperature is from -40 to +105℃

Series Name / Product Group M37x M47x “TXZ4” Series “M4K” Group

CPU core ARM® Cortex®-M3 ARM® Cortex®-M4F ARM® Cortex®-M4F

Maximum Operating Frequency 40 MHz / 80 MHz 120 MHz 80 MHz

Internal Oscillator 10 MHz 10 MHz 10 MHz

Internal Memory FlashROM 64 KB to 512 kB 256 KB to 512 KB 64 KB to 128 KB

RAM 4 KB to 32 KB 18 KB to 34 KB 18 KB to 26 KB

I/O Port (PORT) 13 to 76 pins 79 pins 24 to 52

CRC Arithmetic Circuit (CRC) - - 1 channel

uDMA Controller (uDMAC) - 32 channels 32 Channels

Clock Generator (CG) 8x 8x, 10x, 12x PLL 8x

Interrupt source Int: 62 - Ext: 16 Int: 77 - Ext: 16

Communication

UART up to 4 channels 4 channels 2 to 4 channels

TSPI - 4 channels 1 to 4 channels

I2C 1 channel *1 1 channel 0 to 1 channels

CAN - 1 channel -

12-bit AD Convertor (ADC)

Input Channel up to 22 channels 20 channels 8 to 13 channels

Conversion Time 2.0μs 1.0μs 0.5μs

Operational Amplifier/Comparator up to 4 channels - 3 channels

Advanced Programmable Motor Control Circuit (A-PMD)

up to 2 channels

- 3-phase complementary output - Synchronous AD convert start trigger generator - Emergency protective function

2 channels

- 3-phase complementary output - Synchronous AD convert start trigger generator - Emergency protective function

2 channels - 3-phase complementation output: - PFC Control: 3-phase interleave PFC supported - Scram function by an external input

Page 8: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

Vector Engine Co-processor for a vector control operation, coordinated operation with ADC/A-PMD

1 unit VE1 / VE+

Calculation circuit for motor control

Corresponding to 2 motors

1 unit A-VE

Calculation circuit for motor control

Corresponding to 2 motors

1 unit A-VE

Expansion control of 1 shunt current detection area

Dead time compensation control, no-interactive control

Advanced Encoder Input Circuit (A-ENC) up to 2 channels 2 channels 1 channel

Timer (TMRB) 16 bit: 8 channels 16 bit: 10 channels 32 bit: 6 channels

Watchdog Timer (WDT) 1 channel 1 channel 1 channel

Operating Temperature Range -40 to +85°C

-40 to +105°C *1 -40 to +85°C -40 to +105°C

Operating Voltage Range 4.5 to 5.5V 4.5 to 5.5V 4.5 to 5.5V

Number of pins up to 100 pins 100 pins 32 to 64 pins

*1: TMPM375 specifications

*2: An extended temperature range (-40˚C to +105˚C) with reduced clock speed is also available for TMPM372/3/4

Figure 5: Comparison of Toshiba motor drive microcontrollers

Development support To assist with design-in, a software library provides access to the essential software needed for 1-shunt and 3-shunt vector control on the ARM-based microcontrollers. Application notes and user guides are also provided, and MDK-ARM provides affordable access to a high-quality ARM-based software development environment dedicated to the TMPM families. In addition, Toshiba’s Parameter Tuning System (PTS) simplifies optimisation of the PI gain. This is the major user-configurable aspect of vector control, dependent on the motor used. Figure 6 illustrates the effect of setting the correct PI gain. PTS measures the motor inductance and resistance automatically, and also measures PI gain to determine the correct parameters for when the motor is under load.

Figure 6: The parameter Tuning System simplifies optimisation of the PI gain. Alongside these tools, Toshiba's MotorMind software provides a starting point to easily setup and initialize a motor. The software enables designers to enter basic motor parameters without the need to write any code.

Page 9: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

Figure 7: Toshiba MotorMind PC software allows rapid code-free development MotorMind offers an advanced graphical interface to show actual motor parameters including speed and torque. The package also features an integrated µDSO (Digital Storage Oscilloscope) to visualize registers from inside the Vector Engine based upon optional, configurable, trigger points. Toshiba plans to extend MotorMind to Android systems using bidirectional communications over a Bluetooth link between the starter kit and a phone or tablet. This will not only enhance flexibility and ease of use but will also provide a simple and elegant route to galvanic separation in field tests of high voltage motor designs and simplify the field testing of ‘mobility’ applications such as eBikes.

Page 10: Hardware or software for motor control: Is there finally a ...toshiba.semicon-storage.com/content/dam/toshiba-ss/emea/en_gb/... · Hardware or software for motor control: Is there

Whitepaper

Copyright 2019 © TOSHIBA ELECTRONICS EUROPE GMBH, All Rights Reserved.

Restrictions On Product Use

Toshiba Corporation and its subsidiaries and affiliates are collectively referred to as “TOSHIBA”. Hardware, software and systems described in this document are collectively referred to as “Product”. • TOSHIBA reserves the right to make changes to the information in this document and related Product without notice. • This document and any information herein may not be reproduced without prior written permission from TOSHIBA. Even with

TOSHIBA’s written permission, reproduction is permissible only if reproduction is without alteration/omission. • Though TOSHIBA works continually to improve Product's quality and reliability, Product can malfunction or fail. Customers are

responsible for complying with safety standards and for providing adequate designs and safeguards for their hardware, software and systems which minimize risk and avoid situations in which a malfunction or failure of Product could cause loss of human life, bodily injury or damage to property, including data loss or corruption. Before customers use the Product, create designs including the Product, or incorporate the Product into their own applications, customers must also refer to and comply with (a) the latest versions of all relevant TOSHIBA information, including without limitation, this document, the specifications, the data sheets and application notes for Product and the precautions and conditions set forth in the "TOSHIBA Semiconductor Reliability Handbook" and (b) the instructions for the application with which the Product will be used with or for. Customers are solely responsible for all aspects of their own product design or applications, including but not limited to (a) determining the appropriateness of the use of this Product in such design or applications; (b) evaluating and determining the applicability of any information contained in this document, or in charts, diagrams, programs, algorithms, sample application circuits, or any other referenced documents; and (c) validating all operating parameters for such designs and applications. TOSHIBA ASSUMES NO LIABILITY FOR CUSTOMERS' PRODUCT DESIGN OR APPLICATIONS.

• PRODUCT IS NEITHER INTENDED NOR WARRANTED FOR USE IN EQUIPMENTS OR SYSTEMS THAT REQUIRE EXTRAORDINARILY HIGH LEVELS OF QUALITY AND/OR RELIABILITY, AND/OR A MALFUNCTION OR FAILURE OF WHICH MAY CAUSE LOSS OF HUMAN LIFE, BODILY INJURY, SERIOUS PROPERTY DAMAGE AND/OR SERIOUS PUBLIC IMPACT ("UNINTENDED USE"). Except for specific applications as expressly stated in this document, Unintended Use includes, without limitation, equipment used in nuclear facilities, equipment used in the aerospace industry, lifesaving and/or life supporting medical equipment, equipment used for automobiles, trains, ships and other transportation, traffic signalling equipment, equipment used to control combustions or explosions, safety devices, elevators and escalators, and devices related to power plant. IF YOU USE PRODUCT FOR UNINTENDED USE, TOSHIBA ASSUMES NO LIABILITY FOR PRODUCT. For details, please contact your TOSHIBA sales representative or contact as via our website.

• Do not disassemble, analyze, reverse-engineer, alter, modify, translate or copy Product, whether in whole or in part. • Product shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under

any applicable laws or regulations. • The information contained herein is presented only as guidance for Product use. No responsibility is assumed by TOSHIBA for

any infringement of patents or any other intellectual property rights of third parties that may result from the use of Product. No license to any intellectual property right is granted by this document, whether express or implied, by estoppel or otherwise.

• ABSENT A WRITTEN SIGNED AGREEMENT, EXCEPT AS PROVIDED IN THE RELEVANT TERMS AND CONDITIONS OF SALE FOR PRODUCT, AND TO THE MAXIMUM EXTENT ALLOWABLE BY LAW, TOSHIBA (1) ASSUMES NO LIABILITY WHATSOEVER, INCLUDING WITHOUT LIMITATION, INDIRECT, CONSEQUENTIAL, SPECIAL, OR INCIDENTAL DAMAGES OR LOSS, INCLUDING WITHOUT LIMITATION, LOSS OF PROFITS, LOSS OF OPPORTUNITIES, BUSINESS INTERRUPTION AND LOSS OF DATA, AND (2) DISCLAIMS ANY AND ALL EXPRESS OR IMPLIED WARRANTIES AND CONDITIONS RELATED TO SALE, USE OF PRODUCT, OR INFORMATION, INCLUDING WARRANTIES OR CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OF INFORMATION, OR NONINFRINGEMENT.

• Do not use or otherwise make available Product or related software or technology for any military purposes, including without limitation, for the design, development, use, stockpiling or manufacturing of nuclear, chemical, or biological weapons or missile technology products (mass destruction weapons). Product and related software and technology may be controlled under the applicable export laws and regulations including, without limitation, the Japanese Foreign Exchange and Foreign Trade Law and the U.S. Export Administration Regulations. Export and re-export of Product or related software or technology are strictly prohibited except in compliance with all applicable export laws and regulations.

• Please contact your TOSHIBA sales representative for details as to environmental matters such as the RoHS compatibility of Product. Please use Product in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive. TOSHIBA ASSUMES NO LIABILITY FOR DAMAGES OR LOSSES OCCURRING AS A RESULT OF NONCOMPLIANCE WITH APPLICABLE LAWS AND REGULATIONS.