Cypress Semiconductor CY8CKIT-037 User Manual

CY8CKIT-037
PSoC® 4 Motor Control Evaluation Kit Guide
Doc. No. 001-92562 Rev. *C
198 Champion Court
San Jose, CA 95134 USA
www.cypress.com
Copyrights
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 2
© Cypress Semiconductor Corporation, 2015-2018. This document is the property of Cypress Semiconductor
Corporation and its subsidiaries, including Spansion LLC (“Cypress”). This document, including any software or
firmware included or referenced in this document (“Software”), is owned by Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress
hardware product units, and (2) under those claims of Cypress’s patents that are infringed by the Software (as provided
by Cypress, unmodified) to make, use, distribute, and import the Software solely for use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited.
TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. No computing device can be absolutely secure. Therefore, despite security measures implemented in Cypress hardware or software products, Cypress does not assume any liability arising out of any security breach, such as unauthorized access to or use of a Cypress product. In addition, the products described in these materials may contain design defects or errors known as errata which may cause the product to deviate from published specifications. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in this document. Any information provided in this document, including any sample design information or programming code, is provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. Cypress products are not designed, intended, or authorized for use as critical components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, life-support devices or systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses
where the failure of the device or system could cause personal injury, death, or property damage (“Unintended Uses”).
A critical component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products. You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products.
Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, WICED, PSoC, CapSense, EZ-USB, F-RAM, and Traveo are trademarks or registered trademarks of Cypress in the United States and other countries. For a more complete list of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective owners.
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 3
Contents
Safety Information .......................................................................................................................................................... 5
1. Introduction .......................................................................................................................................................... 6
1.1 Kit Contents ........................................................................................................................................................... 6
1.2 Getting Started ...................................................................................................................................................... 7
1.3 Additional Learning Resources .............................................................................................................................. 8
1.4 Technical Support .................................................................................................................................................. 9
1.5 Documentation Conventions ................................................................................................................................. 9
1.6 Acronyms .............................................................................................................................................................. 9
2. Software Installation ......................................................................................................................................... 10
2.1 Before You Begin ................................................................................................................................................ 10
2.2 Install Kit Software ............................................................................................................................................... 10
2.3 Uninstall Software ................................................................................................................................................ 13
3. Kit Operation ...................................................................................................................................................... 14
3.1 CY8CKIT-037 Evaluation Kit Overview ............................................................................................................... 14
3.2 Kit Operation and Configuration Guide ................................................................................................................ 15
3.2.1 DC Power Supply Connector .................................................................................................................. 15
3.2.2 Motor Winding Connectors ..................................................................................................................... 15
3.2.3 Hall Sensors Interface Connector ........................................................................................................... 16
3.2.4 Connectors to CY8CKIT-042 Board ........................................................................................................ 16
3.2.5 USB Connector ....................................................................................................................................... 17
4. Hardware ............................................................................................................................................................ 18
4.1 Block Diagram Overview ..................................................................................................................................... 18
4.2 Input Protection Circuit ........................................................................................................................................ 19
4.3 DC/DC Switching Regulator ................................................................................................................................ 19
4.4 MOSFET Dual H-Bridge and Dual H-Bridge PWM Drivers .................................................................................. 20
4.5 Phase Current Detecting and Processing Circuit ................................................................................................. 21
4.6 Hall Sensors and BEMF Sensing Circuit ............................................................................................................. 22
4.7 USB-to-UART Bridge Controller Circuit ............................................................................................................... 23
4.8 Connectors .......................................................................................................................................................... 23
4.9 Test Points........................................................................................................................................................... 24
5. Code Examples .................................................................................................................................................. 25
5.1 Using the Kit Code Examples .............................................................................................................................. 25
5.2 Configuration Jumpers for Different Motor Types ................................................................................................ 28
5.3 Sensored BLDC Motor Control Code Example.................................................................................................... 28
5.3.1 Sensored BLDC Background .................................................................................................................. 28
5.3.2 Sensored BLDC Motor Control Code Example Overview ....................................................................... 29
Contents
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 4
5.3.3 Control Schematic Overview .................................................................................................................. 30
5.3.4 Flow Chart .............................................................................................................................................. 31
5.3.5 Running the Sensored BLDC Motor Control Code Example .................................................................. 32
5.3.6 Adapting the Code Example to another Motor ........................................................................................ 35
5.4 Sensorless BLDC Motor Control Code Example ................................................................................................. 36
5.4.1 Sensorless BLDC Background ............................................................................................................... 36
5.4.2 Sensorless BLDC Motor Control Code Example Overview .................................................................... 36
5.4.3 Control Schematic Overview .................................................................................................................. 37
5.4.4 Firmware Introduction ............................................................................................................................. 38
5.4.5 Running the Sensorless BLDC Motor Control Code Example ................................................................ 39
5.4.6 Adapting the Code Example to another Motor ........................................................................................ 42
5.5 Sensorless FOC Motor Control Code Example ................................................................................................... 49
5.5.1 Sensorless FOC Background ................................................................................................................. 49
5.5.2 Sensorless FOC Motor Control Code Example Overview ...................................................................... 55
5.5.3 Control Schematic Overview .................................................................................................................. 56
5.5.4 Firmware Introduction ............................................................................................................................. 58
5.5.5 Running the Sensorless FOC Motor Control Code Example .................................................................. 60
5.5.6 Adapting the Code Example to another Motor ........................................................................................ 62
5.6 Single Shunt FOC Motor Control Code Example ................................................................................................. 63
5.6.1 Single Shunt FOC Background ............................................................................................................... 63
5.6.2 Single Shunt FOC Motor Control Code Example Overview .................................................................... 65
5.6.3 Control Schematic Overview .................................................................................................................. 66
5.6.4 Firmware Introduction ............................................................................................................................. 67
5.6.5 Running the Single Shunt FOC Motor Control Code Example ............................................................... 68
5.6.6 Adapting the Code Example to another Motor ........................................................................................ 69
5.7 Stepper Motor Control Code Example ................................................................................................................. 70
5.7.1 Stepper Motor Background ..................................................................................................................... 70
5.7.2 Stepper Motor Control Code Example Overview .................................................................................... 71
5.7.3 Control Schematic Overview .................................................................................................................. 72
5.7.4 Firmware Introduction ............................................................................................................................. 73
5.7.5 Running the Stepper Motor Control Code Example ................................................................................ 74
5.7.6 Adapting the Code Example to another Motor ........................................................................................ 77
5.8 Bridge Control Panel Monitor Tool Guide ............................................................................................................ 78
5.8.1 BCP Monitoring Overview ....................................................................................................................... 78
5.8.2 Installing the Driver for CY7C65213 USB-to-UART Bridge Controller .................................................... 78
5.8.3 Upper Terminal Configuration Guide ...................................................................................................... 80
5.8.4 Lower Terminal Configuration Guide ...................................................................................................... 84
5.8.5 Reading the Motor Speed Using BCP Commands ................................................................................. 85
A.1. Board Schematics, Board Layout, and BOM ....................................................................................................... 87
A.2. Bill of Materials .................................................................................................................................................... 96
A.3. No Load Components .......................................................................................................................................... 99
A.4. Special Installation Instructions ......................................................................................................................... 100
A.5. Label .................................................................................................................................................................. 100
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 5
Safety Information
Regulatory Compliance
The CY8CKIT-037 PSoC
®
4 Motor Control Evaluation Kit is intended for use as a motor control development platform for
hardware or software in a laboratory environment. The board is an open-system design, which does not include a shielded enclosure. Therefore, the board may cause interference with other electrical or electronic devices in close proximity. In a domestic environment, this product may cause radio interference. In such cases, the user may be required to take adequate preventive measures. Also, this board should not be used near any medical equipment or RF devices.
Attaching additional wiring to this product or modifying the product operation from the factory default may affect its performance and cause interference with other apparatus in the immediate vicinity. If such interference is detected, suitable mitigating measures should be taken.
The CY8CKIT-037, as shipped from the factory, has been verified to meet with the requirements of CE as a Class A product.
The CY8CKIT-037 contains ESD-sensitive devices. Electrostatic charges readily accumulate on the human body and any equipment, and can discharge without detection. Permanent damage may occur to devices subjected to high-energy discharges. Proper ESD precautions are recommended to avoid performance degradation or loss of functionality. Store unused CY8CKIT­037 boards in the protective shipping package.
End-of-Life/Product Recycling The end of life for this kit is five years from the date of manufacture mentioned on the back of the
box. Contact your nearest recycler to discard the kit.
General Safety Instructions
ESD Protection
ESD can damage boards and associated components. Cypress recommends that the user perform procedures only at an ESD workstation. If an ESD workstation is not available, use appropriate ESD protection by wearing an antistatic wrist strap attached to the chassis ground (any unpainted metal surface) on the board when handling parts.
Handling Boards
CY8CKIT-037 boards are sensitive to ESD. Hold the board only by its edges. After removing the board from its box, place it on a grounded, static-free surface. Use a conductive foam pad if available. Do not slide the board over any surface.
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 6
1. Introduction
Thanks for your interest in the CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit (EVK). This kit enables engineers to evaluate Cypress PSoC 4 family of devices for motor control applications. Based on this kit, customers can create control solutions for three major motor types: Permanent Magnet Synchronous Motor (PMSM), stepper, and Brushless DC (BLDC).
The Cypress PSoC family of devices integrates abundant internal resources for motor control applications, such as Timer Counter Pulse Width Modulator (TCPWM), SAR ADC, comparators, opamps, and universal digital blocks (UDBs). In addition, an Arm® Cortex® core enables high-performance motor control solutions on PSoC devices. Headers provided on the EVK board allow you to connect it to the CY8CKIT-042 PSoC 4 Pioneer Kit board to create a complete motor control system.
This kit guide provides the circuit structure of the Motor Control EVK board and explains how to configure it to create a solution for different motor types. It provides five code examples that cover sensored and sensorless BLDC control, PMSM sensorless field-oriented control (FOC), and stepper motor microstepping control. It also introduces the Bridge Control Panel (BCP) as a debugging tool in the motor control development process.
1.1 Kit Contents
The CY8CKIT-037 PSoC 4 Motor Control EVK includes the following:
CY8CKIT-037 Motor Control Evaluation Board
24-V/2.1-A AC-DC Adapter
BLDC motor (BLY172S-24V-4000) with sinusoidal back electromotive force
USB Standard-A to Mini-B cable
Configuration Jumpers
Fuse
Screwdriver
Quick Start Guide
Introduction
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 7
Figure 1-1. CY8CKIT-037 PSoC 4 Motor Control EVK Contents
Inspect the contents of the kit. If you find any part missing, contact your nearest Cypress sales office for assistance:
www.cypress.com/support.
1.2 Getting Started
To learn the solution quickly and apply it to your design, refer to the CY8CKIT-037 PSoC 4 Motor Control Evaluation Kit Quick Start Guide inside the kit box or in the installation directory. The default location for the kit documents is:
<Install_Directory>\CY8CKIT-037 Motor Control EVK\<version>\Documentation
This guide will help you get acquainted with the CY8CKIT-037 PSoC 4 Motor Control EVK:
The Introduction chapter describes the basic information of the CY8CKIT-037 PSoC 4 Motor Control Evaluation Kit. The Software Installation chapter describes the installation of the kit software. The Kit Operation chapter describes the major features of the CY8CKIT-037 PSoC 4 Motor Control Evaluation Kit. The Hardware chapter describes the hardware content of the CY8CKIT-037 PSoC 4 Motor Control Evaluation Kit and
the hardware operation.
The Code Examples chapter describes the multiple projects that will help you understand how to evaluate different
supported output standards on this kit.
The Appendix captures DC/AC Measurements of Clock Outputs, Schematics, Fab Drawing, and the bill of materials
(BOM).
Introduction
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 8
1.3 Additional Learning Resources
Cypress provides a wealth of data at www.cypress.com to help you select the right PSoC device for your design, and to help you to quickly and effectively integrate the device into your design. For a comprehensive list of resources, see
KBA86521, How to Design with PSoC 3, PSoC 4, and PSoC 5LP. The following is an abbreviated list for PSoC 4:
Overview: PSoC Portfolio and PSoC Roadmap. Product Selectors: PSoC 4 Product Selector. In addition, PSoC Creator includes a device selection tool. Datasheets: Describe and provide electrical specifications for the PSoC 4000, PSoC 4100, PSoC 4200, PSoC 4100M,
PSoC 4200M, and PSoC 4200L device families.
CapSense Design Guide: Learn how to design capacitive touch-sensing applications with the PSoC 4 family of devices.  Application Notes and Code Examples: Cover a broad range of topics, from basic to advanced. Many of the application
notes include code examples. Visit the PSoC 3/4/5 Code Examples webpage for a list of all available PSoC Creator code examples.
Technical Reference Manuals (TRM): Provide detailed descriptions of the architecture and registers in each PSoC 4
device family.
Development Kits:
CY8CKIT-046, CY8CKIT-044, CY8CKIT-042, and CY8CKIT-040 are easy-to-use and inexpensive development
platforms. These kits include connectors for Arduino-compatible shields and Digilent Pmod peripheral modules.
CY8CKIT-049 and CY8CKIT-043 are low-cost prototyping platforms for sampling PSoC 4 devices.
MiniProg3 device provides an interface for flash programming and debug.  Knowledge Base Articles (KBA): Provide design and application tips from experts on using the device.  PSoC Creator Training: Visit www.cypress.com/go/creatorstart/creatortraining for a comprehensive list of video
trainings on PSoC Creator. Learning from Peers: Visit www.cypress.com/forums to meet enthusiastic PSoC developers discussing the next generation
embedded systems on Cypress Developer Community Forums
Introduction
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 9
1.4 Technical Support
For assistance, go to www.cypress.com/support, or contact our customer support at +1(800) 541-4736 Ext. 3 (in the USA), or +1 (408) 943-2600 Ext. 3 (International).
1.5 Documentation Conventions
Table 1-1. Document Conventions for Guides
Convention
Usage
Courier New
Displays file locations, user-entered text, and source code: C:\...cd\icc\
Italics
Displays file names and reference documentation: Read about the sourcefile.hex file in the PSoC Designer User Guide.
[Bracketed, Bold]
Displays keyboard commands in procedures: [Enter] or [Ctrl] [C]
File > Open
Represents menu paths: File > Open > New Project
Bold
Displays commands, menu paths, and icon names in procedures: Click the File icon and then click Open.
Times New Roman
Displays an equation: 2 + 2 = 4
Text in gray boxes
Describes cautions or unique functionality of the product.
1.6 Acronyms
Table 1-2. List of Acronyms used in this Document
Acronym
Definition
BCP
Bridge Control Panel
BEMF
Back Electromotive Force
BLDC
Brushless DC
BOM
Bill of Materials
EVK
Evaluation Kit
FOC
Field-Oriented Control
IDE
Integrated Design Environment
IPMSM
Interior Permanent Magnet Synchronous Motor
ISR
Interrupt Service Routine
PMSM
Permanent Magnet Synchronous Motor
SPMSM
Surface Permanent Magnet Synchronous Motor
SVPWM
Space Vector Pulse Width Modulation
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 10
2. Software Installation
This chapter describes the steps to install the software tools and packages on a PC for using the CY8CKIT-037 PSoC 4 Motor Control EVK.
2.1 Before You Begin
All Cypress software installations require administrator privileges, but these are not required to run the software after it is installed. Close any other Cypress software that is currently running before installing the kit software.
2.2 Install Kit Software
Follow these steps to install the CY8CKIT-037 PSoC 4 Motor Control EVK software:
1. Download the CY8CKIT-037 EVK software from www.cypress.com/CY8CKIT-037. The CY8CKIT-037 software is available in the following formats for download (see Figure 2-1):
a. CY8CKIT-037 DVD ISO: This file is a complete package, stored in a CD/DVD-ROM image format that you can
use to create a CD/DVD or extract using an ISO extraction program such as WinZip or WinRAR. The file can also be mounted similar to a virtual CD/DVD using virtual drive programs such as Virtual CloneDrive and MagicISO. This file includes all the required software, utilities, drivers, hardware files, and user documents.
b. CY8CKIT-037 Evaluation Kit Complete Setup: This installation package contains the files related to the
CY8CKIT-037 Evaluation Kit. However, it does not include the Windows Installer or Microsoft .NET Framework packages. If these packages are not available on your computer, the installer directs you to download and install them from the Internet.
c. CY8CKIT-037 Evaluation Kit Only: This executable file installs only the CY8CKIT-037 EVK contents, which
include code examples, hardware files, and user documents. This package can be used if all the software prerequisites (listed in step 4) are installed on your PC.
Figure 2-1. Available Formats for Downloading EVK Software
2. If you have downloaded the ISO file, mount it on a virtual drive. If you do not have a virtual drive to mount, extract the ISO contents using the appropriate ISO extractor (such as MagicISO or PowerISO). Double-click cyautorun.exe in the root directory of the extracted content or the mounted ISO if the “Autorun from CD/DVD option is not enabled on the PC. The installation window will appear automatically (see Figure 2-2).
Note: If you are using the CY8CKIT-037 Kit Setup or CY8CKIT-037 Kit Only file, then go to step 3 for installation.
(a)
(b)
(c)
Software Installation
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 11
3. Click Install CY8CKIT-037 EVK to start the kit installation, as shown in Figure 2-2.
Figure 2-2. Kit Installer Startup Screen
4. Select the folder where you want to install the files related to the CY8CKIT-037 PSoC 4 Motor Control EVK. Choose the directory and click Next.
Note: When you click the Next button, the CY8CKIT-037 installer automatically installs the required software, if it is not present on your computer.
Following are the required software:
a. PSoC Creator 4.2 or later: This software is also available at www.cypress.com/psoccreator. b. PSoC Programmer 3.27.1 or later: This is installed as part of PSoC Creator installation
(www.cypress.com/programmer).
Software Installation
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 12
5. Choose the Typical, Custom, or Complete installation type (select 'Typical' if you do not know which one to select) in the Product Installation Overview window, as shown in Figure 2-3. Click Next after you select the installation type.
Figure 2-3. Product Installation Overview Window
6. Read the License agreement and select I accept the terms in the license agreement to continue with the installation. Click Next.
7. When the installation begins, a list of packages appears on the installation page. A green check mark appears next to each package after successful installation.
8. Enter your contact information or select the option Continue without Contact Information. Click Finish to complete the CY8CKIT-037 kit installation.
9. After the installation is complete, the kit contents are available at the following location: <Install_Directory>\CY8CKIT-037 Motor Control EVK.
Default location: a. Windows OS (64-bit):
C:\Program Files(x86)\Cypress\CY8CKIT-037 Motor Control EVK
b. Windows OS (32-bit):
C:\Program Files\Cypress\CY8CKIT-037 Motor Control EVK Note: For Windows 7/8/8.1/10 users, the installed files and the folder are read-only. To use the installed code examples, follow the steps outlined in Using the Kit Code Examples section. These steps
will create an editable copy of the example in a path that you choose so the original installed example is not modified.
Software Installation
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 13
2.3 Uninstall Software
The software can be uninstalled using one of the following methods:
Go to Start > Control Panel > Programs and Features for Windows 7 or Add/Remove Programs for Windows XP and select the Uninstall button.
Go to Start > All Programs > Cypress > Cypress Update Manager and select the Uninstall button next to the product that needs to be uninstalled.
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 14
3. Kit Operation
This chapter introduces you to the features of the CY8CKIT-037 EVK. It describes the connectors of the board and the usage of these connectors.
3.1 CY8CKIT-037 Evaluation Kit Overview
The motor control system can be separated into two parts: the driver board and the controller board. The CY8CKIT-037 Motor Control EVK is the driver board, which contains the DC/DC power circuit, dual H-bridge circuit, motor current and bus voltage sampling and processing circuit, protection circuit, user configuration circuit, and connectors to the controller board. The controller board receives the signals, implements the proper algorithm to process them, and then generates control signals to the driver board to run the motor. Figure 3-1 shows the EVK board and its general description. CY8CKIT-037 EVK is the driver board; the CY8CKIT-042 kit works as the controller board. They are interfaced with Arduino-compatible connectors.
Figure 3-1. General Description of EVK Board
Kit Operation
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 15
3.2 Kit Operation and Configuration Guide
3.2.1 DC Power Supply Connector
There are two connectors for DC power input, J7 and J8, as shown in Figure 3-2. J7 is a standard power jack for DC adapters with 12 V or 24 V DC output. J8 enables the kit to get input power from a general variable DC power supply with 24 V to 48 V DC output voltage. The input current of both connectors can be up to 2 A. For schematic details, see Input
Protection Circuit. CY8CKIT-042 gets 12 V from the DC/DC converter on CY8CKIT-037. The LDO on CY8CKIT-042
generates the 3.3 V supply for the PSoC device if the VDD on CY8CKIT-042 is configured as 3.3 V. If the VDD on CY8CKIT-042 is configured as 5 V, CY8CKIT-042 needs 5 V from the USB cable.
CAUTION
Do not connect power to both J7 and J8 simultaneously. Also, when using J7, connect the power cable to it before loading the AC supply at the AC/DC adapter to avoid a potential spark.
Figure 3-2. Connectors for DC Power Input
3.2.2 Motor Winding Connectors
J9 and J10 provide four pins for motor windings, as shown in Figure 3-3. The BLDC and PMSM motors use three pins, while the stepper motor application needs all four pins.
Connection details are as follows: For BLDC and PMSM:
Pin 1–1A (A) Motor winding A – Red
Pin 2–2A (B) Motor winding B – Yellow
Pin 3–1B (C) Motor winding C – Black
For stepper motor:
Pin 1–1A (A) Motor winding 1 terminal A – Blue
Pin 2–2A (B) Motor winding 1 terminal B – Yellow
Pin 3–1B (C) Motor winding 2 terminal A – Red
Pin 4–2B Motor winding 2 terminal B – Green
For schematic details, see Connectors.
Figure 3-3. Connectors to Motor Windings
J7
J8
J10
J9
Kit Operation
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 16
3.2.3 Hall Sensors Interface Connector
J12 is the Hall Sensors Interface Connector for the Sensored BLDC Motor Control code example, as Figure 3-4 shows. It is a five-pin connector.
The details of each pin are as follows:
VDD: Hall sensor board VDD – Red
HALLA: Hall sensor A output – Blue
HALLB: Hall sensor B output – Green
HALLC: Hall sensor C output – White
GND: Hall sensor board ground – Black
For schematic details, refer to Hall Sensors and BEMF Sensing Circuit.
Figure 3-4. Hall Sensors Connector
3.2.4 Connectors to CY8CKIT-042 Board
Figure 3-5 shows the Arduino-compatible connectors to the CY8CKIT-042 board: J1, J2, J3, and J4. You can plug the EVK
board into the CY8CKIT-042 board through these connectors. For schematic details, refer to Connectors. Note: Pin connectors J1, J2, J3, and J4 may bend when plugging the EVK board into CY8CKIT-042.
Figure 3-5. Connectors to CY8CKIT-042 Board
J12
J3
J4
J1
J2
Kit Operation
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 17
3.2.5 USB Connector
To monitor the real-time parameters while the motor is running, you can use the Bridge Control Panel (BCP) (refer to Bridge
Control Panel Monitor Tool Guide) to get data through the USB-to-UART bridge circuit on the EVK board during the
debugging process. The USB-to-UART bridge circuit on the EVK board can be connected to the PC using a USB Cable connected at the J11 connector, as shown in Figure 3-6. For schematic details of the USB-to-UART bridge circuit part, refer to USB-to-UART Bridge Controller Circuit.
Figure 3-6. USB-to-UART Bridge Controller Circuit
J11
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 18
4. Hardware
4.1 Block Diagram Overview
Figure 4-1 illustrates the CY8CKIT-037 hardware block diagram. The major features are as follows:
Input protection circuit
DC/DC switching regulator
MOSFET dual H-bridge and dual H-bridge PWM drivers
Phase current detecting and processing circuit
Hall and back electromagnetic force (BEMF) sensing circuit
USB-to-UART bridge controller circuit
Connectors
Test points and LEDs
Figure 4-1. CY8CKIT-037 Hardware Block Diagram
Hardware
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 19
4.2 Input Protection Circuit
Figure 4-2 shows the input protection circuit that consists of three parts: overcurrent protection by fuse F1 or F2, power
supply reverse protection by Schottky diode D2, and input voltage inrush protection by varistor VR1. Notice that there are two parallel fuses: F1 is a PTC resettable fuse, and F2 is a common thermal fuse. F2 is populated onboard by default. You can also use PTC fuse F1 to replace F2 according to your requirements.
Figure 4-2. Input Protection Circuit
CAUTION
Do not populate both F1 and F2 on the EVK board. Otherwise, when an overcurrent condition occurs, F1 and F2 cannot cut off the circuit, which will lead to component damage on the board.
4.3 DC/DC Switching Regulator
Figure 4-3 shows the DC/DC switching regulator circuit on the EVK board. It converts the voltage V
in
(output of the input protection circuit, 0.5 V to 1 V lower than the input voltage) to +12 V.This switching converter is a buck regulator using LM5005. LM5005 has an internal 75 V N-channel buck switch with an output current capability of 2.5 A. It is designed to take an input in the range of 7 V–75 V and provides 12 V output with 1.5 A current capability when the input voltage is higher than 13 V.
Figure 4-3. Switching DC/DC Converter
When the voltage at the SD pin of LM5005 is less than 1.225 V, the IC will go into an inactive state. The external R1 and R2 divider with 10 kΩ and 2 kΩ will give exactly 1.225 V at 7.35 V input. If the input goes below 7.35 V, LM5005 will be in an inactive state.
The +12 V output of the regulator provides power to the dual H-bridge driver chips and the PSoC 4 Pioneer Kit. The power supply in the range of 2.7 V to 5.5 V, needed by the other circuits and chips on the EVK board is provided from the controller board through the Arduino headers.
Hardware
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 20
4.4 MOSFET Dual H-Bridge and Dual H-Bridge PWM Drivers
This part (see Figure 4-4) contains four half-bridge circuits and four driver circuits. For BLDC and PMSM control, you can use three half-bridge circuits to form a standard three-phase inverter. For the stepper motor, you can control two windings of the stepper motor separately via the dual H-bridge.
Figure 4-4 shows the driver circuit, containing four ASIC driver chips (IR2101) and relative peripheral components. IR2101
can source 100 mA or sink 210 mA current to the MOSFETs. Each chip can drive two MOSFETs of a half-bridge, and its high-side PWM operates with a floating supply by a peripheral bootstrap circuit.
Figure 4-4. Dual H-Bridge Driver Circuit
Figure 4-5 shows the MOSFET dual H-bridge. There are four half bridges in total, each one serving a motor phase or
winding. Considering the compatibility for different motor control types, the population of components J19, J20, and J21 needs to be adjusted to fit different motor type applications.
Figure 4-5. MOSFET Dual H-Bridge
Hardware
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 21
4.5 Phase Current Detecting and Processing Circuit
As Figure 4-5 shows, three sensing resistors (R34, R35 and R36) are inserted into three half-bridges. When the motor is running, the winding current floats through these resistors. So, detecting the voltage on the sensing resistors can get the phase current of the motor windings. Because of the sensing resistors’ low value and the noise of the running motor, the voltage signal needs to be amplified. Figure 4-6 shows the current detecting and processing circuit for winding A and winding C.
The core of this circuit is the amplifier. The internal opamps of the PSoC 4 on the controller board are used. J18 and J23 are used only for PMSM FOC control because in the FOC application, the winding current can be both positive and negative. J18 and J23 add 1/2 VDD bias voltage to the sensing signal to make it always positive.
J22 is used only for the sensorless BLDC application, because the sensorless BLDC firmware uses an inside low-power comparator (LPComp). P1[1] is dedicated to the negative terminal of the comparator, which needs to be connected to the Vin divider circuit (P2[6]/Vin). R49 will change the divider proportion. Pins 2 and pin 3 of J22 need to be shorted to remove R49 from the circuit in the Sensorless BLDC Motor Control code example.
Figure 4-6. Current Detecting and Processing Circuit
Figure 4-7 shows the external two-phase winding current comparing circuit, which is used only in the stepper motor
application. The positive terminal input is the current sensing signal after amplifying and filtering, and the negative terminal input is the current reference set by the internal IDAC. The comparator output is routed to the PWM kill terminal to shut down the PWM output, forcing the winding current to follow the IDAC current reference.
Figure 4-7. Two-Phase Winding Current Comparing Circuit
(Winding A)
(Winding C)
Hardware
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 22
Figure 4-8 shows the overcurrent protection circuit. R60, R61, and R62 add the three-phase winding current, and the
external opamp U7 amplifies and filters the sum of the currents. Its output is routed to the positive terminal of the internal comparator to be compared with the overcurrent threshold set by the IDAC.
Figure 4-8. Overcurrent Protection Circuit
4.6 Hall Sensors and BEMF Sensing Circuit
Both sensored and sensorless BLDC motors can be rotated with the EVK board. The sensored BLDC gets its rotor position from the Hall sensors, and the sensorless BLDC gets its rotor position by detecting the BEMF signal from the stator winding. Figure 4-9 shows the Hall sensor interface. The Hall sensor output is in an open-collector structure, so the interface adds pull-up resistors to make the PSoC device receive the correct Hall sensor signal.
Figure 4-9. Hall Sensor Interface
Figure 4-10 shows the voltage divider and filter circuit for BEMF detection. Three phases of the Hall sensor and BEMF
signals are routed to jumpers J13, J14, and J15, as shown in Figure 4-11. Users can select sensored or sensorless configuration via the three jumpers.
Figure 4-10. Sensorless BLDC BEMF Detecting Circuit
Hardware
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 23
Figure 4-11 shows that the two Hall sensor and BEMF signals, as well as the two external comparator output kill signals of
the stepper motor, are routed to J16 and J17. Since the GPIO pin numbers of PSoC 4 are limited, these signals need to share two GPIO pins. Be sure to configure J16 and J17 correctly for the BLDC and stepper motor applications.
Figure 4-11. Signal Configuration Jumpers
4.7 USB-to-UART Bridge Controller Circuit
Figure 4-12 shows the USB-to-UART bridge controller used for transferring data, such as speed and winding current, that
you want to monitor on the BCP. The bridge controller receives the data from PSoC 4 on CY8CKIT-042 over UART and transmits it over USB to be monitored using the BCP software.
Figure 4-12. USB-to-UART Bridge Controller
4.8 Connectors
There are several connectors on the EVK board. Figure 4-13 shows the input power connectors. J7 is the standard power jack for DC adapters, with an output from 12 V to 24 V. J8 can accept an input voltage from 24 V to 48 V through raw wire from a general variable DC power supply. The input current of both connectors can be as high as 2 A.
Figure 4-13. Input Power Supply Connectors
Hardware
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 24
Figure 4-14 shows the motor winding connectors. The two connectors provide four pins in total. The BLDC motor contains
three windings with a common neutral point inside the motor. It uses only three pins. The stepper motor contains two independent windings, so it needs all four pins.
Figure 4-14. Motor Winding Connectors
Figure 4-15 shows the connectors to the CY8CKIT-042 board. The layout of connectors J1, J2, J3, and J4 on the EVK
board is designed to be pin-to-pin compatible with J1, J2, J3, and J4 on the Pioneer Kit, so users can plug the EVK board directly into the Pioneer Kit.
Figure 4-15. Connectors to CY8CKIT-042
4.9 Test Points
The EVK board provides many test points of critical signals, making it convenient for users to debug during the development process. Test points cover driver PWMs, power output and ground, winding current, and IDAC reference output. You can observe and monitor these signals using probes. Figure 4-16 shows some instances of test points.
Figure 4-16. Test Points
CAUTION
Do not power the kit through these test points to avoid damage to the board.
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 25
5. Code Examples
The CY8CKIT-037 EVK can be evaluated using code examples, which can help you accelerate the motor control development processes that configure the device with PSoC 4.
5.1 Using the Kit Code Examples
Follow the steps below to use the installed code examples.
1. Launch PSoC Creator from Start > All Programs > Cypress > PSoC Creator<version> > PSoC Creator <version>.
2. On the Start page, click CY8CKIT-037 Motor Control EVK under Start > Kits. The code examples shipped with the kit appear (see Figure 5-1).
Figure 5-1. Product Installation Overview Window
3. Click on the desired code example, select a location to save the example and click OK.
4. Build the code example by choosing Build > Build <Project_Name>. After the build process is successful, a .hex file is generated.
Code Examples
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 26
5. To program, connect the PSoC 4 Pioneer Kit to the computer using the USB cable connected to port J10.
Figure 5-2. Connect USB Cable to J10
6. Choose Debug > Program in PSoC Creator.
7. If the device is yet to be acquired, the Select Debug Target window will appear. Select KitProg/<serial_number> and click Port Acquire, as shown in Figure 5-3.
Figure 5-3. Acquire Device from PSoC Creator
Code Examples
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 27
8. After the device is acquired, it is shown in a tree structure below the KitProg/<serial_number>. Now, click the Connect button.
Figure 5-4. Connect Device from PSoC Creator
9. Click OK to exit the window and start programming.
Figure 5-5. Program Device from PSoC Creator
Code Examples
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 28
5.2 Configuration Jumpers for Different Motor Types
CY8CKIT-037 supports three motor types: BLDC, PMSM, and stepper. When switching between different motor types or algorithms, the EVK board needs to be reconfigured via jumpers J13–J24. The jumper configuration table is printed on the top layer of the EVK board, as shown in Figure 5-6.
Figure 5-6. J13–J24 Configuration Table for Different Motors
These jumpers are located in several different circuit parts. To learn about the principle of configuration, refer to Hardware. Note: When you prepare to change the configuration jumper settings for different motor types, ensure that all power
sources are turned off; otherwise, the kits may be damaged.
5.3 Sensored BLDC Motor Control Code Example
5.3.1 Sensored BLDC Background
BLDC motors are widely used in industrial applications, home appliances, and vehicle systems. Such motors consist of a multi-pole permanent magnet placed on the rotor and several windings. In the BLDC motor, the commutation is controlled electronically. The motor requires the stator windings to be energized in a particular sequence. To implement this sequence, it is important to know the rotor position. The simplest way is to use rotor position sensors. The sensors can be optical, magnetic (Hall or magneto-resistance effect based), or inductive. The Hall sensor is selected in most applications for its high accuracy and low cost.
Hall sensors are embedded in the stator. When the rotor magnetic poles pass near the Hall sensors, they supply a high or low signal, indicating that the north or south poles are passing nearby. The rotor position is derived from the exact combination of the three Hall sensor signals. Three position sensors can provide six effective states (except 000 and 111) and separate a whole electrical space into six parts, each having a 60-degree electrical angle. Figure 5-7 gives a timing diagram of the sensor output and the required motor driving voltage. The optional use of a PWM provides speed or torque control as shown in phases U, V, and W. The duty cycle of the modulated output control signal (PWM) is varied to change the speed and torque of the motor.
Figure 5-7. BLDC Sensor Output Versus Commutation Timing
Code Examples
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 29
5.3.2 Sensored BLDC Motor Control Code Example Overview
Figure 5-8 illustrates the block diagram of the Sensored BLDC Motor Control code example based on PSoC 4.
Figure 5-8. Block Diagram of Sensored BLDC Motor Control Code Example based on PSoC 4
GPIO
SAR
ADC
State Machine
( Speed Control
& Commute )
PWM
Generator
OP
IDAC
CMP
GPIO
GPIO
GPIO
PSoC 4
BLDC
Motor
Inverter
12V & 5V
Power Supply
24V Power
Supply
/ 6
/3
/3
Speed
Command
Bus Voltage
Bus Current
Hall Sensors
The input control signals to the PSoC 4 device are as follows:
Speed command: Analog input pin that measures the voltage across a potentiometer to set the desired speed of rotation (one analog input pin).
Motor current detection: Analog input pin that detects and cuts off the power device driver to protect the motor when an overcurrent condition is detected (see Error! Reference source not found.) (one analog input pin).
Hall sensors: Three digital input pins connected to the outputs of the Hall sensors from the motor. These sensor inputs provide the position of the motor and are used to control the commutation by varying the PWM output signals to the power driver (three digital input pins).
Start/stop control: Digital input connected to a switch to start and stop motor rotation (one digital input pin).
Outputs from the PSoC 4 device are power device driver signals.
PWM signals to the high side of the MOSFET driver (three digital output pins)
PWM signals to the low side of the MOSFET driver (three digital output pins)
Code Examples
CY8CKIT-037 PSoC® 4 Motor Control Evaluation Kit Guide, Doc. No. 001-92562 Rev. *C 30
5.3.3 Control Schematic Overview
The Sensored BLDC Motor Control code example firmware is developed in PSoC Creator 4.2. Its schematic is separated into two pages according to their function. Figure 5-9 shows the “PWM Drive and Commutate schematic. The three Hall sensor signals are imported by pins Hall1, Hall2, and Hall3. The LUT_Cmut outputs the PWM signal to the motor windings according to the Hall signals and its internal commutation table. PWM_Drive generates the real-time duty cycle to follow the users RPM request.
Figure 5-9. PWM Drive and Commutate Schematic
Figure 5-10 shows the “ADC sampling schematic. ADC_SAR_Seq_1 is the SAR ADC to detect and measure the bus
voltage and potentiometer voltage.
Figure 5-10. ADC Sampling Schematic
Figure 5-11 shows the Speed Measurement schematic. Counter_Spd uses one Hall signal to measure the RPM of the
motor. It can work as real-time feedback of the closed-loop speed control.
Figure 5-11. Speed Measurement Schematic
Loading...
+ 74 hidden pages