Cypress SPANSION FM4 MB9BF568 Series User Manual

Pmsm servo motor speed control 32-bit arm cortex-m4f based microcontroller
Table of Contents

Advertisement

Quick Links

The following document contains information on Cypress products. Although the document is marked with
the name "Spansion" and "Fujitsu", the company that originally developed the specification, Cypress will
continue to offer these products to new and existing customers.
Continuity of Specifications
There is no change to this document as a result of offering the device as a Cypress product. Any changes
that have been made are the result of normal document improvements and are noted in the document
history page, where supported. Future revisions will occur when appropriate, and changes will be noted in
a document history page.
Continuity of Ordering Part Numbers
Cypress continues to support existing part numbers. To order these products, please use only the
Ordering Part Numbers listed in this document.
Worldwide Sales and Design Support
We look forward to partnering with you to provide solutions that will help make your systems successful.
Cypress maintains a worldwide network of offices, solution centers, manufacturer's representatives, and
distributors. To find the office closest to you, visit us at
Cypress
Locations.
About Cypress
Cypress (NASDAQ: CY) delivers high-performance, high-quality solutions at the heart of today's most
advanced embedded systems, from automotive, industrial and networking platforms to highly interactive
consumer and mobile devices. With a broad, differentiated product portfolio that includes NOR flash
®
memories, F-RAM™ and SRAM, Traveo™ microcontrollers, the industry's only PSoC
programmable
®
system-on-chip solutions, analog and PMIC Power Management ICs, CapSense
capacitive touch-
®
sensing controllers, and Wireless BLE Bluetooth
Low-Energy and USB connectivity solutions, Cypress is
committed to providing its customers worldwide with consistent innovation, best-in-class support and
exceptional system value.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SPANSION FM4 MB9BF568 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Cypress SPANSION FM4 MB9BF568 Series

  • Page 1 Continuity of Specifications There is no change to this document as a result of offering the device as a Cypress product. Any changes that have been made are the result of normal document improvements and are noted in the document history page, where supported.
  • Page 2 PMSM Servo Motor Speed Control User Manual 32-bit ARM Cortex-M4F based Microcontroller MB9BF568x Series and S6E2HG Series User Manual Jan 26, 2015, AN709-00011-1v0-E...
  • Page 3: Table Of Contents

    U S E R M A N U A L Table of Contents Introduction ............................. 4 Purpose …………………………………………………………………………………………….4 Definitions, Acronyms and Abbreviations ................4 Document Overview ......................4 System Hardware Environment ...................... 5 Development Environment ......................6 System Firmware Design ....................... 7 FW Feature .........................
  • Page 4 U S E R M A N U A L Tables Table 3-1: MCU Development Environment ....................6 Table 4-1: Feature List of servo motor speed control ................. 7 Table 4-2: Directory Description of Project ....................8 Table 4-3: File Description of Project ......................10 Table 5-1: System Used Interrupt Function ....................
  • Page 5: Introduction

    U S E R M A N U A L 1. Introduction Purpose This user manual describes the speed-control solution of the SPANSION servo motor and how to use the inverter servo motor FW library. This document will help you quickly learn how to build a servo motor project and how to debug the motor with SPANSION inverter servo motor FW library.
  • Page 6: System Hardware Environment

    U S E R M A N U A L 2. System Hardware Environment The below shows the brief information of MCU used in servo motor inverter board. CPU chip: Spansion MB9BF568R. CPU Frequency: 160MHz. MCU pin number: 120pin. RAM Space: 128Kbytes. Code Space: 1024Kbytes.
  • Page 7: Development Environment

    U S E R M A N U A L 3. Development Environment Table 3-1: MCU Development Environment Name Description Part Number Manufacturer Remark IAR bedded Workbench FW code edit , compile and debug J-Link Debug and Load FW by JTAG SPANSION FLASH Flash download program LOADER...
  • Page 8: System Firmware Design

    U S E R M A N U A L 4. System Firmware Design This chapter introduces the FW structure of the inverter servo motor project FW Feature The features of the servo motor speed control solution are shown in Table 4-1. Table 4-1: Feature List of servo motor speed control Feature Description...
  • Page 9: Figure 4-1: Structure Of Fw

    U S E R M A N U A L Figure 4-1: Structure of FW The C source and Header files which are included in each layer are shown in Table 4-2 Table 4-2: Directory Description of Project Layer Folder Description h01_global, global...
  • Page 10: Figure 4-2: Sub-Files In Each Layer

    U S E R M A N U A L Figure 4-2: Sub-files in Each Layer Jan 26, 2015, AN709-00011-1v0-E...
  • Page 11: Files Description

    U S E R M A N U A L The relationship between each layer is shown as the diagram in Figure 4-3. User Layer User interface Main program entrance Interrupt vectors Initialization Int. event App Layer Motor Start-up Brake Motor Speed Set Speed Calculation Current sample...
  • Page 12: Fw Control Flow

    U S E R M A N U A L pid_regulation.c The PID module for current and speed PI svpwm.c The SVPWM module adc_sample.c The ADC process module based on the ADC ISR brake.c The brake module including motor stop by brake limitation.c The FOC current and voltage limitation module Dead-time compensation.c...
  • Page 13: Interrupt Function

    U S E R M A N U A L 5. Interrupt Function Function List Table 5-1: System Used Interrupt Function Prototype Description Remark __root void HWD_Handler(void) The HW watch dog ISR s05_user/isr.c __root void Swd_IsrHandler (void) The software watch dog ISR s05_user/isr.c __root void Mft0_Frt0_ZeroIsrHandler (void) The MFT zero detect ISR for the motor control...
  • Page 14: Interrupt Generation

    U S E R M A N U A L Interrupt Generation The diagram of the interrupt used for the motor control is briefly introduced in this section. 5.3.1 The multifunction timer is used to generate the interrupt for the motor control algorithm execution, and trigger the AD sample at the zero point.
  • Page 15: Dtti

    U S E R M A N U A L 5.3.3 DTTI The DTTI0 is used to trigger the HW fault protection from the IPM. When the phase current is large enough to trigger the HW over-current fault, the interrupt is got and all of the drive signals for the motor control will shut off immediately.
  • Page 16: Demo System

    U S E R M A N U A L 6. Demo System This chapter introduces one example of inverter servo motor project and help you run a motor quickly. The primary steps are shown as following:  Hardware Connection ...
  • Page 17: Hardware Connection

    U S E R M A N U A L 6.1.1 Hardware Connection It is necessary to connect below 4 lines: 1. Connect motor’s encoder signal to inverter board, shown as below. Encoder port Figure 6-2: Encoder Signal Line Connection The connection of the encoder signal line follows the definition in the below table.
  • Page 18: Motor Debug

    U S E R M A N U A L J-Link Figure 6-4: JTAG Line Connection Note: If there is no isolator between the J-link and the HW, you must unplug the AC power and use the battery of your laptop computer 4.
  • Page 19: Fw Interface Configuration

    U S E R M A N U A L Figure 6-6: Open the Workspace 6.2.1 FW Interface Configuration All of the variables reserved for the user interfaces are located in the file ‘s05_user/ customer_interface.c’ and the macro definitions are located in the file ‘h05_user/ customer_interface.h’. Figure 6-7: Interface File Diagram 6.2.1.1 UI_01 Motor Parameters...
  • Page 20: Table 6-2: Sample Resistor, Amplification, Carrier Frequency And Dead-Time

    U S E R M A N U A L 6.2.1.2 UI_02 Encoder Information QPRC_LineNumber: indicating pulses per cycle for encoder signal A or B. QPRC_times: indicating QPRC unit working mode for detecting encoder signal. This is set to 4 by default. For more information about it, you can refer to MCU peripheral manual reading chapter QPRC for PC_Mode2 setting.
  • Page 21: Table 6-4: Motor Startup Parameters

    U S E R M A N U A L higher than Motor_u16ChgPiSpdHz Motor_f32Skp Speed loop proportion parameters when speed higher than Motor_u16ChgPiSpdHz Motor_u16ChgPiSpdHz Switch speed loop PI parameters 6.2.1.5 UI_05 Motor Startup Parameters Table 6-4: Motor Startup Parameters Name Explanation Value Motor_i16Q8_OrientIqRef...
  • Page 22: Encoder Check

    U S E R M A N U A L Table 6-6: Protection Parameters Name Explanation Value Motor_i16Q8CurrentMax Soft current protection happens when peak of current Q8(3.5): is higher than this value 3.5A Motor_u16OverCurrentTimeSec Define times of current continuously overpassing 1 time Motor_i16Q8CurrentMax.
  • Page 23: Run Motor

    U S E R M A N U A L 6.2.2.2 Encoder Check Run Click the debugger button to connect the J-link, and pass the global structure ‘Qprc_RunPars’ into the Live Watch in the IAR debug online. Connect PC and hardware with J-LINK, and give motor any target speed more than 0 to run motor. Wait until motor stops running, find structure “Qprc_RunPars”...
  • Page 24: Figure 6-9: Download And Debug By J-Link

    U S E R M A N U A L Figure 6-9: Download and debug by J-link Figure 6-10:Motor Run by J-link Figure 6-11: Motor in Running Status Jan 26, 2015, AN709-00011-1v0-E...
  • Page 25: Speed Acceleration And Deceleration

    U S E R M A N U A L Table 6-9: Running Status by the Command Speed MotorCtrl_stcRunPar.i16TargetSpeedRpm Running Status >0 <0 Stop Note: (4) Watch the important variable “MotorCtrl.i32Q8_EstimWmHzf” to check whether motor is achieved the command speed and running speed is stable. 6.2.4 Speed Acceleration and Deceleration After run motor normally, you can run motor in any speed (-5000rpm ~ 5000rpm).
  • Page 26: Additional Information

    U S E R M A N U A L 7. Additional Information For more Information on Spansion semiconductor products, visit the following websites: English version address: http://www.spansion.com/Products/microcontrollers/ Chinese version address: http://www.spansion.com/CN/Products/microcontrollers/ Please contact your local support team for any technical question America: Spansion.Solutions@Spansion.com China:...
  • Page 27: Reference Documents

    U S E R M A N U A L 8. Reference Documents Jan 26, 2015, AN709-00011-1v0-E...
  • Page 28 U S E R M A N U A L AN709-00011-1v0-E Spansion  Application Note FM4 Family 32-BIT MICROCONTROLLER PMSM Servo Motor Speed Control User Manual Jan 2015 Rev. 1.0 Published: Spansion Inc. Edited: Communications Jan 26, 2015, AN709-00011-1v0-E...
  • Page 29 U S E R M A N U A L Colophon The products described in this document are designed, developed and manufactured as contemplated for general use, including without limitation, ordinary industrial use, general office use, personal use, and household use, but are not designed, developed and manufactured as contemplated (1) for any use that includes fatal risks or dangers that, unless extremely high safety is secured, could have a serious effect to the public, and could lead directly to death, personal injury, severe physical damage or other loss (i.e., nuclear reaction control in nuclear facility, aircraft flight control, air traffic control,...

This manual is also suitable for:

Spansion fm4 s6e2hg series

Table of Contents