Kinetis Motor Suite Lab Guide

Kinetis Motor Suite Lab Guide
Freescale Semiconductor, Inc.
User’s Guide
Document Number: KMS100LG
Rev. 0, 02/2016
Kinetis Motor Suite Lab Guide
1
Introduction
Based on Kinetis V series microcontrollers, Kinetis Motor
Suite (KMS) is an integrated solution of hardware,
embedded firmware, and PC software that enables rapid
development of applications driven by three phase
permanent magnet or brushless DC motors.
This document introduces you to key elements of KMS in a
series of labs that simulate the start of a motor application
design cycle. No motor application or coding experience is
required, nor is previous usage of KMS, NXP hardware, or
NXP software assumed.
Now let’s get spinning!
© 2016 Freescale Semiconductor, Inc. All rights reserved.
Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 1
2. Set up your environment . . . . . . . . . . . . . . 4
2.1.Software . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.Hardware . . . . . . . . . . . . . . . . . . . . . . 17
3. Labs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.1.Velocity labs . . . . . . . . . . . . . . . . . . . 46
3.2.Position labs . . . . . . . . . . . . . . . . . . 191
4. Revision history . . . . . . . . . . . . . . . . . . . 318
Introduction
1.1
How to use this document
KMS supports a variety of different configurations according to:
• how you want to control your motor
• which NXP development platform you are starting with
• what your preferred development environment is
These decisions determine how you should proceed through this lab guide.
1.1.1
Velocity vs. position
This document has two main tracks: velocity control and position control. After setting up your
environment in Section 2, "Set up your environment", determine whether your target application requires
velocity control or position control, then proceed to either Section 3.1, "Velocity labs" or Section 3.2,
"Position labs".
A velocity control application requires regulation of the speed of the motor. The motor is typically in
spinning at one or various speeds and the commanded speed must be maintained. An example velocity
control application is a ceiling fan.
Conversely, a position control application typically requires point-to-point movement, with the ability to
hold steady upon reaching the defined point. A position control application is therefore spinning only in
service of getting to the desired position. An example position control application is a security camera.
If you do not have a specific application in mind, start with velocity control labs, as you can run these labs
in sensorless velocity control mode using out-of-the-box hardware. Position control requires an additional
sensor that may not be included.
1.1.2
Additional configuration considerations
For both velocity and position control, KMS supports multiple development platforms and integrated
development environments (IDE). Table 1 enumerates the supported configurations.
Table 1. Supported implementations
Development
platform
IDE
Freedom
Kinetis Design Studio
Sensored velocity
Tower
IAR Embedded
Workbench for ARM
Sensored position
High voltage
Control type
Sensorless velocity
The features and behavior of KMS differ slightly depending on your chosen configuration. Although the
instructions are generic across configurations where possible, and any key differences are highlighted, it
is important to make sure the instructions you are following apply to your specific configuration.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
2
Freescale Semiconductor, Inc.
Introduction
A description of how the different configurations are addressed in each major section of this document is
provided in Table 2.
Table 2. Applicable configurations by document section
Section
Applicability of content
Section 2.1, "Software"
• All configurations covered
• Minimal differences across configurations
Section 2.2, "Hardware"
• Separate sections for each development platform
• Subsections for each development platform for basic (sensorless)
setup vs. sensored setup
Section 3.1, "Velocity labs"
• Applicable only for sensorless or sensored velocity control
• All development platforms and IDEs supported
Section 3.2, "Position labs"
• Applicable only for sensored position control implementations
• All development platforms and IDEs supported
Use Table 2 to determine how to proceed through the guide. For example, suppose your chosen
configuration were:
Table 3. Example configuration
Development
platform
Control type
Freedom
IDE
Kinetis Design Studio
Sensored position
You would proceed through the document as follows:
Table 4. Applicable content given example configuration
Section
Follow instructions?
Section 2.1, "Software"
Yes
Section 2.2, "Hardware"
Partially; find and use the section for the Freedom platform and its
subsection for sensored setup
Section 3.1, "Velocity labs"
No (not applicable; skip these labs)
Section 3.2, "Position labs"
Yes
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
2
Set up your environment
2.1
Software
KMS relies on or utilizes a variety of software components. These requirements are enumerated in Table 5.
Table 5 may be sufficient for you to confirm whether you have all required software components for KMS.
In this case, proceed to Section 2.2, "Hardware" to set up your development platform.
Otherwise, review the subsections that follow Table 5 for further detail and methods regarding how to
validate that each component exists on your system.
Table 5. Software requirements
Software requirement
2.1.1
Version
Kinetis Motor Suite PC software
1.0.0
Kinetis Motor Suite proprietary code
1.0.0
Operating system
Windows 7 (32 or 64 bit)
Software framework
Microsoft .NET Framework 4.6
Kinetis Software Development Kit
1.3.0
Integrated development environment
• Kinetis Design Studio 3.0.0, OR
• IAR Embedded Workbench for ARM7.40
Communication
• openSDA USB Driver Version 11.1 or greater
Debug
• P&E Micro OpenSDA application version 1.17 or
greater
• If using KDS: P&E Micro Debugger plugin
com.pemicro.debug.gdbjtag.pne_2.2.9.201512221411
or greater
Kinetis Motor Suite PC software
Kinetis Motor Suite PC software refers to the PC executable that runs the KMS user interface,
communicates with the selected microcontroller (MCU), and adapts embedded firmware reference
projects for your system.
2.1.1.1
Check to see if you already have it
Using Windows Explorer, navigate to the list of installed programs located at:
• Control Panel\All Control Panel Items\Programs and Features
Scroll down to find Kinetis Motor Suite and look for version number in the Version column.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
4
Freescale Semiconductor, Inc.
Set up your environment
Figure 1. KMS version information
2.1.1.2
Install if you don’t have it
Follow the instructions at nxp.com/kms to locate, download, and install the proper version of the KMS
installer.
2.1.2
Kinetis Motor Suite proprietary code
Kinetis Motor Suite proprietary code refers to the special firmware preprogrammed on KMS-enabled
MCUs at the factory. This code is protected as execute-only and must reside on the chip for KMS to be
utilized.
WARNING
Code that is marked as execute-only is still subject to the consequences of
mass erase. Thus, KMS ONLY SUPPORTS SECTOR ERASE OF THE
MCU. If you mass erase the device, you will not be able to restore the KMS
proprietary code and will not be able to continue using KMS with the
affected MCU. The device must be replaced.
2.1.2.1
Check to see if you already have it
Check your MCU part number to ensure that it is KMS-enabled. This is indicated by the existence of the
letter “P” at the end of a typical part number, where “P” denotes KMS support for permanent
magnet/BLDC motors.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
•
•
If if it is a supported MCU but your device is unable to communicate with the KMS PC software
or a ROM fault is declared after connecting, your proprietary code version is incorrect.
If it is a supported MCU and you are able to communicate with the KMS PC user interface without
indication of ROM fault, your version is correct. You may look for more detailed information by
right clicking on the communication button at bottom right of the KMS PC software and selecting
Show MCU Firmware Identity Information.
Figure 2. Access KMS MCU firmware version information
2.1.2.2
Install if you don’t have it
If your device does not have KMS proprietary code or the proprietary code has been mass erased, you must
replace the device.
2.1.3
Operating system
The operating system refers to the foundational software on your PC.
2.1.3.1
Check to see if you already have it
Using Windows Explorer, navigate to system information located at:
• Control Panel\All Control Panel Items\System
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
6
Freescale Semiconductor, Inc.
Set up your environment
Look for information regarding your Windows edition and your system type.
Figure 3. Basic operating system information
2.1.3.2
Install if you don’t have it
Changing your operating system is not as trivial as installing a new software package. In fact, Microsoft’s
recommendation for moving to Windows OS 7 is to purchase a new PC. Consequently, provided that you
are using a Windows operating system, it may be preferable to proceed regardless of your version
information. KMS has been smoke-tested on Windows OS 8 and Windows OS 10 with limited issues
reported. Supported for these operating systems is anticipated in future releases.
2.1.4
Software framework
The software framework refers to basic software components installed on your computer that KMS
leverages for its own purposes.
2.1.4.1
Check to see if you already have it
Using Windows Explorer, navigate to the list of installed programs located at:
• Control Panel\All Control Panel Items\Programs and Features
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
Scroll down to verify that you have Microsoft .NET Framework 4.6.
Figure 4. Microsoft .NET Framework 4.6 in list of programs
2.1.4.2
Install if you don’t have it
Follow the instructions at microsoft.com/net to locate, download, and install .NET Framework 4.6 for your
PC. If you run the KMS installer prior to installing, KMS may trigger this installation and require system
reboot.
2.1.5
Kinetis Software Development Kit
KMS builds on the Kinetis software development kit (KSDK) to configure hardware and peripherals for
the supported microcontrollers.
2.1.5.1
Check to see if you already have it
Using Windows Explorer, navigate to the default installation location for KSDK:
• C:\Freescale
Or, if you have previously installed KSDK outside of the default location, navigate to your custom
installation path.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
8
Freescale Semiconductor, Inc.
Set up your environment
In either case, verify that your KSDK version is KSDK_1.3.0.
Figure 5. Kinetis software development kit 1.3.0 directory
2.1.5.2
Install if you don’t have it
Follow the instructions at nxp.com/ksdk to locate, download, and install the proper version of the KSDK
installer.
2.1.6
Development tools
In order to access the open source embedded firmware provided as part of KMS and to compile KMS
firmware, your PC must have one of the following integrated development environments (IDE). You may
skip the instructions for IDEs that you do not intend to use.
2.1.6.1
Kinetis Design Studio
Kinetis Design Studio (KDS) is a free IDE based on the Eclipse software framework and distributed by
NXP Semiconductors N.V. You do not need to proceed through this section if intending to use a different
IDE.
2.1.6.1.1
Check to see if you already have it
Using Windows Explorer, navigate to the list of installed programs located at:
• Control Panel\All Control Panel Items\Programs and Features
Scroll down to verify that you have KDS version 3.0.0.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
Figure 6. Kinetis Design Studio 3.0.0 in list of programs
2.1.6.1.2
Install if you don’t have it
Follow the instructions at nxp.com/kds to locate, download, and install the proper version of the KDS
installer.
2.1.6.2
IAR Embedded Workbench for ARM
IAR Embedded Workbench for ARM (IAR) is a proprietary IDE sold and distributed by IAR Systems. You
do not need to proceed through this section if intending to use a different IDE.
2.1.6.2.1
Check to see if you already have it
Using Windows Explorer, navigate to the list of installed programs located at:
• Control Panel\All Control Panel Items\Programs and Features
Scroll down to verify that you have IAR version 7.40.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
10
Freescale Semiconductor, Inc.
Set up your environment
Figure 7. IAR Embedded Workbench for ARM in list of programs
2.1.6.2.2
Install if you don’t have it
Follow the instructions at https://www.iar.com/iar-embedded-workbench/#!?architecture=ARM to locate
and purchase an appropriate version of IAR.
2.1.7
Communication
For communication between your system and Kinetis development platforms, serial communication
drivers may need to be installed. Kinetis development platforms are preloaded with P&E Microcomputer
Systems (P&E Micro) openSDA software which communicate serially via USB with your PC using P&E
Micro Windows Hardware Interface Drivers.
2.1.7.1
Check to see if you already have it
Using Windows Explorer, navigate to the default installation location for P&E Micro drivers:
• C:\PEMicro\PEDrivers
Or, if you have previously installed P&E Micro drivers outside of the default location, navigate to your
custom installation path.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
In either case, verify that the Drivers_11_1_1 folder or later is installed.
Figure 8. P&E Micro drivers
2.1.7.2
Install if you don’t have it
Follow the instructions at pemicro.com/opensda to locate, download, and install the proper version of P&E
Micro Windows USB Drivers.
2.1.8
Debug
WARNING
Utilizing supported debug tools is critical for KMS. Certain elements of
KMS firmware are preprogrammed on the microcontroller and marked as
execute-only. In order to preserve this code, which is required to run KMS,
MASS ERASE OF THE DEVICE MUST BE AVOIDED. Sector erase
must therefore be supported by the relevant debug tools. The following
requirements ensure usage of debug tools that perform sector erase and not
mass erase.
2.1.8.1
KDS
To utilize KDS with the default P&E Micro software, the P&E Micro Debugger plug-in must be at a
version that supports sector erase.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
12
Freescale Semiconductor, Inc.
Set up your environment
2.1.8.1.1
Check to see if you already have it
Launch KDS. Use an existing workspace or define an arbitrary workspace if prompted.
Upon reaching the main KDS interface, open the Help menu and select Installation Details.
Figure 9. Installation details menu option
Navigate to the Plug-ins tab and find the plug-in named GNU ARM Interface Debugging Support (plug-in
ID com.pemicro.debug.gdbjtag.pne). Verify that the version is 2.2.9.201512221411 or greater.
2.1.8.1.2
Install if you don’t have it
While still in the Installation Details window, click on the Installed Software tab. Click on Update... at
bottom right and follow instructions.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
Figure 10. Mechanism for updating software plug-ins
2.1.8.2
P&E Micro openSDA application image
Kinetis development platforms are preloaded with P&E Micro openSDA software that must be at a version
that supports sector erase.
2.1.8.2.1
Check to see if you already have it
After connecting your development board to your PC, use Windows Explorer to navigate to the
development board to view files and folders. Click to open SDA_INFO.HTM
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
14
Freescale Semiconductor, Inc.
Set up your environment
Figure 11. Example of Tower development board information
Verify that the Application Version of the Mass Storage/Debug App is 1.17 or greater.
Figure 12. Example of application version information
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
2.1.8.2.2
Install if you don’t have it
Follow the instructions at pemicro.com/opensda to locate, download, and install the proper version of the
Mass Storage/Debug App for your development board.
Figure 13. Firmware application download
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
16
Freescale Semiconductor, Inc.
Set up your environment
2.2
Hardware
Once your software environment has been configured, start putting together your development platform.
The following sections describe the Freedom, Tower, and High Voltage platforms separately. Each
development platform is described in terms of the minimum setup required for all control types, followed
by a separate description of how to add additional hardware to support sensored control.
2.2.1
Freedom
2.2.1.1
Required setup for all control types
1. Locate the required hardware. Table 6 identifies the hardware required for performing these labs
using the Freedom development platform.
Table 6. Freedom hardware requirements
Hardware
requirement
Basic information
Power Supply
• Sceptre AC Adapter (24V, 3.75A) (included in purchase of TWR-MC-LV3PH:
Low-Voltage, 3 Phase Motor Control Tower System Module; not provided with
FRDM-MC-LVPMSM)
• Equivalent power supply with 24V, 5A output and 5.5 x 2.1mm barrel connector is
acceptable
Power Stage
FRDM-MC-LVPMSM: Low-Voltage, 3 Phase Motor Control Module (Figure 14)
Control Board
FRDM-KV31F: Kinetis V3x FRDM Development Module (Figure 15)
USB Cable
USB to micro USB cable (provided)
Reference
FRDM-MC-LVMOTR Linix 45ZWN24-40
Motor Option #1
Reference
Anaheim BLY174D-24V-4000-2000SI
Motor Option #2
Screwdriver
Small flat-head screwdriver for connect motor cabling to Power Stage (not provided)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
Figure 14. Power Stage (FRDM-MC-LVPMSM)
Figure 15. Control Board (FRDM-KV31F)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
18
Freescale Semiconductor, Inc.
Set up your environment
2. Connect the Power Stage and the Control Board by inserting the pins from the bottom of the
Power Stage into the top of connectors on the Control Board (Figure 16). The default jumper
configuration is appropriate.
Figure 16. Plug Power Stage into Control Board
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
3. The FRDM-MC-LVMOTR (Linix 45ZWN24-40) comes with a “flying leads” connection for use
with the FRDM-MC-LVPMSM (Figure 17).
Figure 17. Linix with flying leads
4. Insert the flying leads into the Power Stage connector block and use Screwdriver to tighten
(Figure 18). The order in which the cables are inserted does not matter for sensorless velocity
control.
NOTE
The order of cables determines the physical direction of rotation of the
motor (clockwise vs. counterclockwise) in sensorless velocity control.
Inverting the order of your cables causes the same speed command to spin
the motor in the opposite direction. Hence, the order of cables only matters
if your motor or application must spin in a specific direction. This is not the
case for sensored control, as described later in this section.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
20
Freescale Semiconductor, Inc.
Set up your environment
Figure 18. Connect flying leads to Power Stage
5. Plug in Power Supply and connect it to the Power Stage (Figure 19).
Figure 19. Connect power supply to power stage
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
6. Connect the Control Board to the computer using the USB cable(Figure 20).
Figure 20. Connect MCU to computer
Figure 21. Installation window for P&E Micro driver
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
22
Freescale Semiconductor, Inc.
Set up your environment
Figure 22. AutoPlay window upon successful connection to device
7. Confirm successful connection by verifying that a COM port has been assigned to a P&E Micro
openSDA Serial Port (Figure 23).
Figure 23. mbed communication port
2.2.1.2
2.2.1.2.1
Add incremental encoder for sensored implementations
Building encoder cable
The FRDM-MC-LVPMSM has a connector for single-ended quadrature encoders. It does not operate with
hall effect sensors. It uses a physical interface of a Molex 22-05-3051 connector. Ensure that your encoder
cable features a compatible end. It is advised to use a shielded cable to prevent electrical noise from the
motor phase signals having an impact on the encoder signals.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
The encoder cable needs to adhere to the pinout on the FRDM-MC-LVPMSM board shown in Figure 24.
Figure 24. FRDM-MC-LVPMSM encoder pinout
NOTE
The pinout for the FRDM-MC-LVPMSM is different from the
TWR-MC-LV3PH. If you have a cable that works on the
TWR-MC-LV3PH, it may need to be modified.
In addition to the encoder requiring a specific pinout, the motor phases must be connected in a specific
order. While running sensorlessly, the motor phase order only influences which direction is considered
positive rotation. When using an encoder, the direction that the encoder reports as positive motor rotation
must be aligned with the direction that the motor thinks is positive motor rotation. Simply put, the encoder
must be directionally aligned with the motor. The simplest way to accomplish this is to make sure that your
motor and encoder connections correspond to the correct connection. For example, Phase A of the motor
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
24
Freescale Semiconductor, Inc.
Set up your environment
must be connected to Phase A on the FRDM-MC-LVPMSM, Phase A of the encoder must be connected
to pin 3 (labeled ENC A) of the J8 connector on the FRDM-MC-LVPMSM, and so on.
The J8 connector on the FRDM-MC-LVPMSM board supplies 5V as available power for the encoder.
Additionally, it is expecting a 5V signal as the output from the encoder. If this is not the case for your
encoder, additional circuitry to translate the voltage level might be required.
2.2.1.2.2
Connecting motor and encoder
1. Disconnect Power Supply from Power Stage and USB Cable from Control Board (assuming these
were connected at end of previous section)
2. Insert the encoder connector into the Power Stage encoder connection labeled J8 before supplying
power to the FRDM-KV31F board.
Figure 25. Motor and encoder connected to FRDM-MC-LVPMSM
3. Plug in Power Supply and connect it to the Power Stage.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
4. Reconnect the Control Board to the computer using the USB cable
Figure 26. Powered and connected FRDM
2.2.2
Tower
2.2.2.1
Required setup for all control types
1. Locate the required hardware. Table 7 identifies the hardware required for performing these labs
using the Tower development platform.
Table 7. Tower hardware requirements
Hardware
requirement
Basic information
Power Supply
Sceptre AC Adapter (24V, 3.75A) (included in purchase of TWR-MC-LV3PH: Low-Voltage,
3 Phase Motor Control Tower System Module)
Tower
TWR-ELEV: Tower System Elevator Module
Power Stage
TWR-MC-LV3PH: Low-Voltage, 3 Phase Motor Control Tower System Module
Control Board
TWR-KV31F120M: Kinetis KV3x Family Tower System Module
USB Cable
Micro USB to USB included in purchase of TWR-KV31F120M
Reference
Linix 45ZWN24-40 (included in standard purchase of TWR-MC-LV3PH: Low-Voltage, 3
Motor Option #1 Phase Motor Control Tower System Module)
Reference
Anaheim BLY174D-24V-4000-2000SI
Motor Option #2
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
26
Freescale Semiconductor, Inc.
Set up your environment
2. Check that the Power Stage has its potentiometer dialed as far as possible in the
counter-clockwise direction.
Figure 27. Location of potentiometer on Power Stage
Figure 28. Correct position for potentiometer
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
3. Install the Power Stage and the Control Board in the Tower. Note that the white stripes of the
Power Stage and Control Board should be plugged into the white connectors of the Tower
(Figure 29).
Figure 29. White connection indicators
NOTE
Older Tower boards may not have white stripes or white connectors. If yours
does not, look for the text “primary” and “secondary,” and match the
primary side of the Control Board to the primary Tower elevator card, and
similarly for the secondary side.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
28
Freescale Semiconductor, Inc.
Set up your environment
Figure 30. Fully connected Tower system
4. Connect the motor to the Power Stage (Figure 32) using the three-pronged connector (the five
pronged connector is not relevant).
Figure 31. Three pronged connector for motor
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
Figure 32. Connect motor to power stage
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
30
Freescale Semiconductor, Inc.
Set up your environment
5. Plug in Power Supply and connect it to the Power Stage (Figure 19). It is important to do this
before connecting the Control Board to the computer.
Figure 33. Connect power supply to power stage
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
6. Connect the Control Board to the computer (Figure 20).
Figure 34. Connect MCU to computer
7. If the Control Board has not been connected to your computer before, wait for Windows to update
device driver software. This may take several minutes. You may elect to “Skip obtaining driver
software from Windows Update” to accelerate the process.
Figure 35. Device driver update icon
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
32
Freescale Semiconductor, Inc.
Set up your environment
Figure 36. Device driver installation
8. Green checkmarks indicate success (Figure 37) and depending on system settings, you may see an
AutoPlay window showing TWR-KV31F12 (Figure 38).
Figure 37. Successful device driver installation
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
Figure 38. AutoPlay window
2.2.2.2
2.2.2.2.1
Add incremental encoder for sensored implementations
Building encoder cable
The TWR-MC-LV3PH has a connector for single-ended quadrature encoders. While the
TWR-MC-LV3PH can work with either quadrature encoders or hall effect sensors, the KMS firmware
only works with quadrature encoders. It does not operate with hall effect sensors. It uses a physical
interface of a Molex 22-05-3051 connector. Ensure that your encoder cable features a compatible end. It
is advised to use a shielded cable to prevent electrical noise from the motor phase signals having an impact
on the encoder signals.
The encoder cable needs to adhere to the pinout on the TWR-MC-LV3PH board shown in Table 8. This
information was taken from the TWR-MC-LV3PH User's Guide (TWRMCLV3PHUG).
Table 8. TWR-MC-LV3PH pinout
Pin #
Signal Name
Description
1
+5.0V
Supplies power from the board to
either ENCODER or Hall sensors
2
GND
ENCODER or Hall sensors ground
3
Phase A
ENCODER or Hall Phase A input
3
Phase B
ENCODER or Hall Phase B input
5
Phase C
ENCODER or Hall Phase C input
In addition to the encoder requiring a specific pinout, the motor must be connected in a specific order.
While running sensorlessly, the motor phase order only influences which direction is considered positive
rotation. When using an encoder, the direction that the encoder reports as positive motor rotation must be
aligned with the direction that the motor thinks is positive motor rotation. Simply put, the encoder must be
directionally aligned with the motor. The simplest way to accomplish this is to make sure that your motor
and encoder connections correspond to the correct connection. For example, Phase A of the motor must
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
34
Freescale Semiconductor, Inc.
Set up your environment
be connected to Phase A on the TWR-MC-LV3PH, Phase A of the encoder must be connected to pin 3 of
the J8 connector on the TWR-MC-LV3PH, and so on.
The J8 connector on the TWR-MC-LV3PH board supplies +5V as available power for the encoder.
Additionally, it is expecting a +3.3V to +5V signal as the output from the encoder. If this is not the case
for your encoder, additional circuitry to translate the voltage level might be required.
2.2.2.2.2
Connecting motor and encoder
1. Disconnect Power Supply from Power Stage and USB Cable from Control Board (assuming these
were connected at end of previous section)
2. Connect the motor to the Power Stage using the three-pronged connector.
3. Insert the encoder connector into the power stage encoder connection labeled J8.
Figure 39. Motor and encoder connected
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
4. Plug in Power Supply and connect it to the Power Stage.
5. Connect the Control Board to the computer using the USB cable.
Figure 40. Powered and connected kit with encoder
2.2.3
High Voltage
2.2.3.1
Required setup for all control types
1. Locate the required hardware. Table 7 identifies the hardware required for performing these labs
using the High Voltage development platform.
Table 9. High voltage hardware requirements
Hardware
requirement
Basic information
Power Supply
IEC320C13 Power Cable provided with HVP-MC3PH plugged into either 120Vac or
220Vac socket
Power Stage
HVP-MC3PH: High-Voltage Development Platform
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
36
Freescale Semiconductor, Inc.
Set up your environment
Table 9. High voltage hardware requirements
Hardware
requirement
Basic information
Control Board
HVP-KV31F120M: Kinetis KV3x High-Voltage Development Platform Controller Card
USB Cable
USB Mini Cable (Provided)
Reference
Motor
Anaheim EMJ-04APB22
2. Connect the motor’s flying leads to the Power Stage by inserting the flying leads then tightening
with a screwdriver.
Figure 41. Connect motor flying leads to Power Stage
3. Plug the Control Board in the Power Stage.
Figure 42. Insert Control Board into Power Stage
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
4. Plug Power Supply into wall, connect Power Supply to the Power Stage, and click switch next to
power input to power up.
Figure 43. Plug in and power up
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
38
Freescale Semiconductor, Inc.
Set up your environment
5. Connect the Control Board to the PC by plugging in the USB cable.
Figure 44. Plug USB cable into Control Card
6. If the Control Board has not been connected to your computer before, wait for Windows to update
device driver software. This may take several minutes. You may elect to “Skip obtaining driver
software from Windows Update” to accelerate the process.
Figure 45. Device driver update icon
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
Figure 46. Device driver installation
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
40
Freescale Semiconductor, Inc.
Set up your environment
7. Green checkmarks indicate success (Figure 37) and depending on system settings, you may see an
AutoPlay window showing HVP-KV31F12 (Figure 38).
Figure 47. Successful device driver installation
Figure 48. AutoPlay window
2.2.3.2
2.2.3.2.1
Add incremental encoder for sensored implementations
Building encoder cable
The HVP-MC3PH has a similar pinout to the encoder for the FRDM and TWR development platforms
(described in previous sections). It is designed to be used with single-ended quadrature encoders. It is
advised to use a shielded cable to prevent electrical noise from the motor phase signals having an impact
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Set up your environment
on the encoder signals. It does not operate with hall-effect sensors or analog resolvers. It uses a physical
interface of a Molex 22-05-3051 connector.
Figure 49. Location of encoder connector on HVP-MC3PH
Connection to the encoder must use the pinout shown in Figure 9.
Figure 50. HVP-MC3PH encoder pinout
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
42
Freescale Semiconductor, Inc.
Set up your environment
When using an encoder, the direction that the encoder reports as positive motor rotation must be aligned
with the direction that the motor thinks is positive motor rotation. For tips refer to Section 2.2.1.2, "Add
incremental encoder for sensored implementations" about FRDM encoder connections.
2.2.3.2.2
Connecting motor and encoder
1. Disconnect Power Supply from Power Stage and USB Cable from Control Board (assuming these
were connected at end of previous section)
2. Insert the encoder connector into the power stage encoder connection labeled J9 before supplying
power to the HVP-MC3PH board.
3. Connect Power Supply to Power Stage and power up device.
4. Connect Control Board to PC using USB cable.
5. Add HVP-MC3PH protective shield for safety.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3
Labs
Once you have set up your software and hardware, you are ready to begin spinning a motor and exploring
KMS.
There are two tracks for these labs, defined by the type of motion that is desired: velocity control or
position control.
•
•
Select Section 3.1, "Velocity labs" if you plan to run your motor using sensorless velocity control
OR sensored velocity control. Velocity labs include:
— Velocity lab 1: spin your motor using Motor Tuner
— Velocity lab 2: explore other methods for spinning your motor in KMS
— Velocity lab 3: tune your motor with Motor Manager
— Velocity lab 4: test trajectories
— Velocity lab 5: evaluate processor utilization
— Velocity lab 6: build a simple motion sequence
— Velocity lab 7: connect your motor to the real world
— Velocity lab 8: make your application stand alone
Select Section 3.2, "Position labs" if you plan to run your motor using sensored position control.
Position labs include:
— Position lab 1: spin your motor using Motor Tuner
— Position lab 2: explore other methods for spinning your motor in KMS
— Position lab 3: customize for your application with Motor Manager
— Position lab 4: evaluate processor utilization
— Position lab 5: build a simple motion sequence
— Position lab 6: connect your motor to the real world
— Position lab 7: make your application stand alone
The manner in which these labs have been designed should inform how you proceed through them. Key
considerations include:
• The two tracks are largely parallel: the content in the Velocity lab 6: build a simple motion
sequence is very similar to Position lab 5: build a simple motion sequence; the key difference is in
how KMS must configure and display behavior for velocity vs. position. This means that there is
strong overlap in general KMS learning across tracks, so it may not be useful to perform both the
velocity and the position labs if you do not require both control types in your application(s).
• Content within tracks is cumulative. That is, Velocity lab 2 builds on Velocity lab 1, just as Position
lab 2 builds on Position lab 1. Settings and procedures may be assumed in later labs based on
assumed completion of preceding labs.
• Within each lab track (velocity or position), all labs can be completed using any configuration of
development platform and development environment. Examples and screenshots are weighted
toward the Tower platform because it is low voltage and many Kinetis device users are already
familiar with it, but the instructions are intended to be generic with configuration-specific details
highlighted.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
44
Freescale Semiconductor, Inc.
Labs
It is therefore recommended that you pick either velocity or position labs, then proceed through the lab
track sequentially (i.e., velocity lab 1, then velocity lab 2, and so on) using your preferred KMS
configuration.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.1
Velocity labs
These may be performed either sensored or sensorlessly.
3.1.1
3.1.1.1
Velocity lab 1: spin your motor using Motor Tuner
Objective
Just getting a motor to spin is typically challenging. Kinetis Motor Suite makes it easy.
In this lab, use KMS Motor Tuner to characterize a motor and then operate it across the speed range - with
minimal user configuration and without coding.
3.1.1.2
Procedure
3.1.1.2.1
Start KMS
1. Launch KMS by double-clicking the Desktop icon. If prompted, click OK to allow the .exe to make
changes to your computer.
Figure 51. KMS desktop icon
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
46
Freescale Semiconductor, Inc.
Labs
2. Select New… and specify your desired system configuration (Figure 53).
Figure 52. Example system configuration (yours may be different given hardware & IDE preference)
3. Click OK to accept the default path for saving the embedded firmware reference project that
underlies KMS. The default path is:
– C:\Users\<username>\Documents\<KMS version number>\SavedProjects\<development
platform>_<control_type>_<KMS reference project version number>
4. The result of clicking OK is shown in (Figure 53) for informational purposes (this window does
not appear on-screen automatically).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 53. Folder structure and path for KMS reference project
5. KMS relies on the Kinetis Software Development Kit (KSDK) version 1.3.0. If KMS cannot find
KSDK 1.3.0 on your computer, KMS prompts you to specify the path. Find and select the folder
named KSDK_1.3.0 (Figure 54). The default installation location is: C:\Freescale\KSDK_1.3.0.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
48
Freescale Semiconductor, Inc.
Labs
Figure 54. Specify the location of KSDK 1.3.0
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
6. Wait a minute or two for the unzipping and placement of the KMS reference project. Then select
the proper communication port for your board from the dropdown menu (Figure 55). The proper
communication port can be determined by looking in your Windows Device Manager (accessible
from Control Panel) and finding the openSDA communication port (Figure 56).
Figure 55. Select COM port
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
50
Freescale Semiconductor, Inc.
Labs
Figure 56. Example validation of communication port in Windows Device Manager
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
7. KMS should open to its Main Window and indicate successful communication by virtue of green
arrows at the bottom of the screen.
Figure 57. Successful opening of KMS main window
8. However, KMS may not be able to communicate with the MCU if the on-device image is not
what is expected by the GUI. Two scenarios for this are described below:
— Your MCU only has the execute-only KMS proprietary code programmed on it (vs. an entire
KMS application image).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
52
Freescale Semiconductor, Inc.
Labs
– In this case, click OK and proceed to the KMS Main Window, select Project->Load .out file,
and download the KMS application image to the MCU. Retry communication.
Figure 58. Load .out file to MCU
Figure 59. Click to attempt to communicate
— The application image loaded on the MCU does not exactly match the image expected by the
KMS GUI. (This typically happens after code is downloaded to the MCU in one KMS session
but then a new KMS session is started (instead of re-opening the previous KMS session). )
– When this occurs, a mismatch notification appears. KMS can automatically update the
software on the MCU if desired. For the purposes of this lab, if this message appears, click
YES to allow KMS to update the code (Figure 60).
In a real design, you may prefer to click NO if you have code loaded to the MCU that you
want to preserve. This is more likely to occur when you have started to work from the IDE.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 60. Checksum mismatch notification
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
54
Freescale Semiconductor, Inc.
Labs
– If downloading of code is required and you have not previously used KMS, KMS prompts
you to select the location of your IDE.
Figure 61. Specify location of Kinetis Design Studio
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 62. Specify location of IAR Embedded Workbench for ARM
– A command line-style window will appear to load code to the MCU (Figure 63). Upon
successful loading, follow the instructions at the bottom of the command window.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
56
Freescale Semiconductor, Inc.
Labs
NOTE
When using the Freedom platform, you may be required to press the reset
button on the Control Board (near green communication LED) before
clicking OK in the command window to proceed.
Figure 63. Download code to MCU using KDS
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 64. Download code to MCU using IAR
– Wait while KMS boots up and begins communicating with the MCU. When the input fields
and buttons cease to be grayed out, you can proceed.
3.1.1.2.2
Enter the basics
KMS opens to the first page of Motor Tuner, the wizard-style interface for identifying and running your
motor that is the subject of this lab.
9. The first step in commissioning your system is to enter your motor’s basic information, as shown
in Figure 65. Linix 45ZWN24-40 information is prepopulated in KMS for the Tower and
Freedom development platform (sensorless velocity). Information for the MiGe 60CST-M01330
is prepopulated in KMS for the High Voltage development platform.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
58
Freescale Semiconductor, Inc.
Labs
Figure 65. Enter basic motor information (Tower and Freedom sensorless velocity)
Figure 66. Enter basic motor information (High Voltage sensorless velocity)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 67. Enter basic motor information (Tower sensored)
10. Click to update the basic motor values, as shown in Figure 68.
Figure 68. Click to update the values
11. Motor Tuner advances to the next step: measuring your motor.
3.1.1.2.3
Measure motor
1. Motor Tuner applies voltage to measure the motor’s resistance and inductance. Motor Tuner then
rotates the motor’s shaft at a low speed to measure the rotor flux. Click to measure your motor’s
characteristics, as shown in Figure 69.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
60
Freescale Semiconductor, Inc.
Labs
.
Figure 69. Click to measure your motor’s characteristics
2. The values for Stator Resistance, Stator Inductance, and Rotor Flux sequentially update.
If you are running with a sensor, this step also incidentally validates your encoder setup: if the
encoder has been incorrectly configured or specified (e.g., mismatch of motor phases, wrong
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
number for lines of encoder, not plugged in, etc.), Motor Tuner cannot complete the Rotor Flux
measurement and returns a notification.
Figure 70. Notification for encoder issue
3. Upon completion, Motor Tuner advances to the next step: measuring your system’s inertia.
3.1.1.2.4
Measure inertia
Inertia is important for controlling the motion of the application, but is often neglected by traditional
approaches. Motor Tuner uses inertia as a direct input to create an appropriate model of the system for
advanced control.
If you are running your motor without anything connected to the motor shaft, Motor Tuner measures the
inertia represented by the motor shaft.
When developing your application, couple the motor to anything that spins directly with the motor during
operation. Do this after completing the motor measurement but before measuring the application inertia.
1. Click to start inertia measurement, as shown in Figure 71. The motor spins briefly. If successful in
the default configuration, KMS also updates the reference project that you created upon launching
KMS with your motor and inertia characteristics.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
62
Freescale Semiconductor, Inc.
Labs
Figure 71. Click to measure your system’s inertia
2. In some instances, Motor Tuner may not be able to automatically measure the system’s inertia
with the default settings. This is because the inertia measurement routine requires an acceleration
and deceleration of the system, and without prior knowledge of the mechanical setup, KMS may
not specify a slow enough (large inertia) or fast enough (high friction) ramp.
Where Motor Tuner cannot identify the inertia with the existing configuration, settings are
intelligently and automatically adjusted based on the error encountered. You are prompted to rerun
the inertia test as shown in Figure 72.
After clicking OK, you must click the Start Inertia Measurement button again. This process may
need to be repeated multiple times depending on your system.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 72. Click to accept updated configuration
3.1.1.2.5
Spin!
1. Motor Tuner automatically advances to the next step when the system inertia measurement is
successful. In this step, Motor Tuner runs your motor to its rated speed, which you entered or
confirmed on step 1) Enter the Basics. Click to run your motor to the rated speed, as shown in
Figure 73.
If it is not desirable to run your motor to rated speed (e.g., if your application is attached and the
rated speed of the motor is too high for your application), overwrite the Target Speed value to a
more suitable value before clicking to Run.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
64
Freescale Semiconductor, Inc.
Labs
Figure 73. Click to run your motor to the target speed (rated speed by default)
2. Motor Tuner automatically activates the Software Oscilloscope, as shown in Figure 74, so that
you can watch the performance of your motor as it transitions to the rated speed. Commanded
speed is plotted in red and estimated actual speed is plotted in green.
When operating under sensorless velocity control, KMS transitions from open to closed loop speed
control upon reaching10% of the motor’s rated speed. This results in a noticeable bump in the plot
(Figure 74) as the system attempts to lock onto a signal that is a function of speed and thus small
when running at low speed. This transition from open to closed loop control is a key challenge of
sensorless velocity control.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 74. Open to closed loop in TWR sensorless velocity control
By contrast, when running sensored velocity control, the motor is always in closed loop control due
to the external sensor. This results in smoother operation at low speed, which is a chief benefit of
sensored control. Nevertheless, the encoder has to catch up when starting from zero, so shows a
small divergence from commanded speed near zero (Figure 75).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
66
Freescale Semiconductor, Inc.
Labs
Figure 75. TWR sensored velocity control spin step
3. The motor spins to the Target Speed and remains at that speed for 5 seconds. After that, Motor
Tuner closes the Software Oscilloscope and proceeds to the next step.
3.1.1.2.6
Simulate application
Motion Sequence Builder is one of the tools available in KMS. It allows you to easily build complex
motion sequences and automatically generate application code.
One of the provided motion sequences simulates simple washing machine behavior. The motor:
• remains at 0 rpm speed during the "water fill" stage
• “agitates” by ramping to a certain speed, then reversing direction to reach the same speed in the
opposite direction (repeating this behavior several times)
• ramps to twice the agitation speed during the "spin cycle"
• comes to a halt and concludes the motion sequence.
1. Click to start the washing machine trajectory, as shown in Figure 76.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 76. Click to start the washing machine trajectory
2. Motor Tuner automatically launches the Software Oscilloscope so that you can observe your
motor’s performance as it executes the simulation (Figure 77).
Figure 77. TWR sensorless velocity control plot of washing machine motion
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
68
Freescale Semiconductor, Inc.
Labs
Figure 78. TWR sensored velocity control plot of washing machine motion
3.1.1.3
Summary
Congratulations! Wasn’t it easy to spin a motor? In this lab, you performed the following steps to spin your
motor:
— Entered basic information about the motor
— Characterized the electrical and mechanical system
— Ran the motor and validated its ability to achieve and hold rated speed
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.1.2
3.1.2.1
Velocity lab 2: explore other methods for spinning your motor in
KMS
Objective
KMS is intended to allow flexibility for both beginner and expert users. In this lab, spin your motor using
Motor Manager, which is a superset of the functionality available in Motor Tuner, and the Watch Window,
which allows runtime access to MCU variables. Trying these components should allow you to determine
how KMS fits your needs and motor control expertise level.
3.1.2.2
3.1.2.2.1
Procedure
Start Motor Manager
1. Click to open Motor Manager, as shown in Figure 79.
Figure 79. Click to open Motor Manager
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
70
Freescale Semiconductor, Inc.
Labs
2. Navigate to the Identify page by clicking on the appropriate diamond in the navigation bar at top
right, as shown in Figure 80.
Figure 80. Navigate to identify page
3.1.2.2.2
Basic motor information
1. When using Motor Tuner to get your motor spinning, the first step was to enter the motor’s basic
information. The same is true for Motor Manager. Enter the basic information for your motor in
Basic Motor Parameters (Figure 82, Figure 82).
Figure 81. Enter the motor’s basic motor parameters (Tower sensorless velocity example)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 82. Enter the motor’s basic motor parameters (Tower sensored velocity example)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
72
Freescale Semiconductor, Inc.
Labs
3.1.2.2.3
Automatic parameter measurement
1. Motor Tuner applied a voltage to measure the motor’s resistance and inductance, and then rotated
the motor’s shaft at a low speed to measure the rotor flux. Motor Manager does the same thing.
Click to start the motor measurement, as shown in Figure 83.
Figure 83. Click to start motor measurement
2. Notice that Motor Manager allows you to adjust the amount of current that is used to measure
resistance and inductance (Figure 84). These values may automatically update during motor
measurement if the existing configuration does not produce a valid result. You may also adjust
these values manually if Automatic Parameter Measurement does not succeed.
Motor Manager also allows you to enable and disable shaft rotation, and to specify the speed used
for flux identification. You may want to disable shaft rotation if your motor is directly connected
to your application and therefore should not be rotated for measurement purposes. Disabling
rotation requires you to manually enter a value for rotor flux on the Advanced Tuning page.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 84. Specify the system parameters to be used to identify motor parameters
3. After Motor Manager measures the motor parameters, they are updated on the screen, as shown in
Figure 85.
Figure 85. Measured motor parameters
3.1.2.2.4
System inertia measurement
In Section 3.1.1, "Velocity lab 1: spin your motor using Motor Tuner", we learned that Motor Tuner uses
inertia as a direct input to create an appropriate model of the system for advanced control. Motor Manager
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
74
Freescale Semiconductor, Inc.
Labs
does the same. When developing your application, connect the motor to the application inertia (anything
that spins directly with the motor during operation) before running System Inertia Measurement.
1. Click to start the inertia measurement, as shown in Figure 86.
Figure 86. Click to start inertia measurement
2. During system inertia measurement, the motor ramps to the rated speed of the motor. By default,
this process is configured to complete in 3.5 seconds.
In some cases, the inertia identification speed and/or ramp time may need to be adjusted to
successfully identify the system inertia. As noted in Section 3.2.1, "Position lab 1: spin your motor
using Motor Tuner", KMS automatically adjusts these settings if the previous attempt does not
succeed.
You are prompted to retry if the inertia measurement is unsuccessful. In some cases, it may be
undesirable to repeatedly retry system inertia measurement with your application attached (e.g., if
your application is a garage door).
Unlike Motor Tuner, Motor Manager allows you to make manual adjustments to system inertia
measurement configuration, as shown in Figure 87.
Figure 87. Specify the configuration parameters to be used during inertia identification
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3. After Motor Manager identifies the system inertia, the inertia and friction values are displayed on
the screen, as shown in Figure 88.
Figure 88. Inertia, friction, and any errors are displayed
4. KMS updates configuration values based on the measured motor parameters and inertia. These
values can be saved to the Motor Observer reference project (created upon launching KMS)
which can then be edited from your IDE. This happens automatically in Motor Tuner.
In Motor Manager, you must click the Store Motor Information button to push your system settings
into the Motor Observer reference project, as shown in Figure 89. You receive a notification that
the header file that contains this information has been saved in a particular location within the
directory you defined after launching KMS. Click OK after receiving this notification.
Figure 89. Store motor parameters in a header file
Figure 90. Notification that system settings have been updated
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
76
Freescale Semiconductor, Inc.
Labs
3.1.2.2.5
Start motor
1. Click on the Speed Control page icon at top, as shown in Figure 91.
Figure 91. Navigate to the Speed Control page
2. Enter the motor’s rated speed as its Target Speed, as shown in Figure 92.
Figure 92. Enter target speed
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3. Click to activate the Software Oscilloscope’s Speed Plot, located as shown in Figure 93.
Figure 93. Click to open Software Oscilloscope
4. Use the Software Oscilloscope to view your motor’s performance. Click the Run button, as shown
in Figure 94, to start sampling.
Figure 94. Click to begin sampling
5. Back in Motor Manager, click to Start Speed Control, as shown in Figure 95.
Figure 95. Click to start the motor
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
78
Freescale Semiconductor, Inc.
Labs
6. You should see your motor ramp to the target speed, as shown in Figure 96.
Figure 96. Ramp to target speed (sensored)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 97. Ramp to target speed (sensorless)
7. After the motor reaches and holds rated speed, as in Motor Tuner, click to Stop sampling.
Figure 98. Click button to stop sampling
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
80
Freescale Semiconductor, Inc.
Labs
8. In Motor Manager, click to Stop the motor, as shown in Figure 99.
Figure 99. Click to stop motor
3.1.2.2.6
Run motion sequence
1. Click on the Motion Sequences page icon at top, as shown in Figure 100.
Figure 100. Navigate to motion sequences page
2. In the Software Oscilloscope, click to restart sampling.
Figure 101. Click to begin sampling button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3. Click to Start the washing machine simulation, as shown in Figure 102.
Figure 102. Click to start the washing machine simulation
4. Return to the Software Oscilloscope so that you can view your motor’s performance. Watch your
new motor run the same simple washing machine simulation as in Section 3.1.1, "Velocity lab 1:
spin your motor using Motor Tuner".
Figure 103. TWR sensored velocity example of washing machine simulation
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
82
Freescale Semiconductor, Inc.
Labs
5. Click to stop sampling.
Figure 104. Click to stop sampling
3.1.2.2.7
Start Watch Window
While Motor Manager offers more granular control of the core functions performed by Motor Tuner, the
Watch Window goes even further. Via runtime access to MCU variables, the Watch Window can be used
to set in motion the same functions as Motor Tuner and Motor Manager.
However, the Watch Window exercises these functions as discrete elements, instead of as an integrated
system. For example, identifying motor parameters from the Watch Window will not automatically adapt
the motor drive configuration based on updated values, as occurs in Motor Tuner and Motor Manager.
Thus, to use the Watch Window properly, you should have some familiarity with the KMS firmware and
with motor control principles.
The following steps, wherein only a subset of the functions described for Motor Tuner and Motor Manager
are exercised, serve to reinforce the discrete nature of operation from the Watch Window.
1. Click to activate the Watch Window using the button at bottom right.
Figure 105. Click to activate Watch Window
3.1.2.2.8
Automatic parameter measurement - flux only
1. Click the Add button at bottom left to show a list of the parsed variables available from the MCU.
Figure 106. Click to add an MCU variable to the Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
2. Scroll down to locate the “user” group, which aggregates variables found in the User module of
Motor Observer firmware. Expand the user group, select “state,” and click to refresh. The variable
user.state is added to the Watch Window.
Figure 107. Add user.state to Watch Window
Figure 108. User.state added to Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
84
Freescale Semiconductor, Inc.
Labs
3. The variable user.state is intended to provide easy access to KMS’ operating modes, including
several that are responsible for the Motor Tuner and Motor Manager functions you have already
seen. To replicate a part of the motor measurement routine, click the Add button again and find
the variable scm.config.state. Do the same for scm.output.pmFlux.
Figure 109. Add scm.config.state
Figure 110. Add scm.output.pmFlux
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
4. The term “scm” refers to variables used in the Self Commissioning module of KMS firmware.
Scm.config.state determines which value the system is trying to measure (resistance, inductance,
or flux), and scm.output.pmFlux is the result of the flux measurement. To run the flux
measurement from the Watch Window, first click the Run button to activate live-updating of the
Watch Window variables.
Figure 111. Click to start live update of the Watch Window
5. Type 3 into the Value column for scm.config.state. This specifies flux as the desired measurement.
6. Type 2 into the Value column for user.state. This tells KMS firmware to run in Self
Commissioning mode - and thus measure flux given the value configured in the previous step.
Figure 112. Start flux measurement from Watch Window
7. The motor spins and on completion of the measurement, the value for scm.output.pmFlux will
update in the Watch Window. User.state and scm.config.state return to the idle, 0 state.
Figure 113. Updated flux value
3.1.2.2.9
System inertia measurement
1. Click Stop button at bottom middle of Watch Window to halt live updating of MCU variables.
Figure 114. Click to stop updating in Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
86
Freescale Semiconductor, Inc.
Labs
2. Now add the variable inertia.output.inertiaEst. This represents the value resulting from the system
inertia measurement.
Figure 115. Add inertia estimate to Watch Window
3. Click to Run live updating in the Watch Window.
Figure 116. Click to start live update of the Watch Window
4. Enter a value of 3 into the Value column for user.state. This will place the firmware into inertia
estimation mode.
5. The motor spins and the value for inertia.est.inertiaEst updates.
Figure 117. Updated inertia value
3.1.2.2.10
Start motor
1. Click to Stop updating the Watch Window again.
Figure 118. Click to stop updating in Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
2. Find and add the variable user.command.targetSpeed. This represents the speed command being
sent to the motor.
Figure 119. Add user.command.targetSpeed
3. Find and add the variable showing the motor’s feedback speed. The name of this variable is
different for sensorless vs. sensored operation because the software module responsible for
providing this information is different. In sensorless operation, this information comes from the
Estimator module (EST); in sensored operation, this information comes from the Encoder block
(ENC).
Table 10. Motor speed feedback variable names
Control type
Variable name
Sensorless velocity
est.output.rotorSpeed_50Hz
Sensored velocity
enc.output.rotorSpeed_50Hz
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
88
Freescale Semiconductor, Inc.
Labs
Figure 120. Add motor speed feedback variable (sensorless velocity example)
4. Click to Run live updating in the Watch Window.
Figure 121. Click to start live update of the Watch Window
5. Enter the Rated Speed for your motor into the Value column for user.command.targetSpeed, then
type a value of 7 into the Value column for user.state. This value for user.state places the motor
into Speed Control mode.
Figure 122. Run motor at rated speed from Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
6. The motor spins to Rated Speed just as it did in Motor Tuner and Motor Manager. Observe the
motor speed feedback variable to see it gradually reach the Target Speed.
Figure 123. Motor speed feedback during acceleration to Target Speed (sensorless velocity)
3.1.2.2.11
Run motion sequence
1. Wait for the motor to reach Rated Speed according to your speed feedback value.
Figure 124. Motor running at Rated Speed (sensorless velocity)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
90
Freescale Semiconductor, Inc.
Labs
2. With the Watch Window still live updating, type a value of 8 into the Value column for user.state.
This starts the application motion sequence. First the motor slows to a stop, then proceeds through
the washing machine sequence. Verify this by watching motor speed feedback
(user.command.targetSpeed does not update because the speed reference is now coming from the
motion sequence, not an explicit user command).
Figure 125. Motor running washing machine trajectory
3. Click to Stop updating the Watch Window after the motion sequence is complete.
Figure 126. Click to stop updating in Watch Window
3.1.2.3
Summary
In this lab, you performed the following steps to spin your motor outside of the Motor Tuner wizard:
• measured motor and inertia from Motor Manager’s Identify page
• commanded the motor to run at a configurable speed from Motor Manager’s Speed Control page
• ran the example motion sequence from Motor Manager’s Motion Sequences page
• used the Watch Window to explore how MCU variables relate to PC GUI functions
• triggered motor & inertia measurements, speed control, and motion sequence operation from the
Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.1.3
3.1.3.1
Velocity lab 3: tune your motor with Motor Manager
Objective
With your motor successfully spinning, you can focus on optimizing your application. KMS incorporates
proprietary disturbance compensating control from LineStream Technologies. This allows you to easily
achieve excellent control of your motor’s velocity.
In this lab, use step tests to observe the speed error of the motor at the default tuning set by KMS Motor
Tuner. Increase and decrease a single tuning parameter, “Bandwidth,” to observe the impact on the speed
error and understand KMS’ simple tuning process.
3.1.3.2
3.1.3.2.1
Procedure
Observe the motor's behavior at the bandwidth generated by Motor Tuner
1. Go to the Motor Manager Speed Control page.
2. Click the Speed Plot button (Figure 127) to open the Software Oscilloscope to the Speed
Feedback plot (Figure 128).
Figure 127. Speed plot button
Figure 128. Dropdown box for selecting speed feedback plot
3. Click the Run button (Figure 129). The plot starts sampling.
Figure 129. Click to begin sampling button
4. Enter your motor’s rated speed as its Target Speed (Figure 130).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
92
Freescale Semiconductor, Inc.
Labs
Figure 130. Target speed field (TWR example)
5. Start the motor (Figure 131)
Figure 131. Button to start motor
6. In the Software Oscilloscope, observe the motor’s speed behavior. When the motor reaches the
target speed (Figure 132), enter a Target Speed that is -100% of the motor's rated speed (i.e.,
Target Speed = negative rated speed).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 132. Plot showing operation at positive and negative rated speed (TWR sensored)
7. Stop sampling (Figure 133)
Figure 133. Click to stop sampling
8. Save the csv and png file (Figure 134) using default directories and filenames. This saves your
data so that it can be analyzed and compared against other test runs.
Figure 134. Save CSV and PNG buttons
9. Stop the motor (Figure 135)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
94
Freescale Semiconductor, Inc.
Labs
Figure 135. Button to stop motor
3.1.3.2.2
Observe the behavior when the motor is detuned
Now that you have a baseline for motor operation, assess how performance may be affected by tuning. To
do this, first customize the Speed Trajectory plot to make it more useful for closer examination.
1. Click the “Edit” button (Figure 136).
Figure 136. Edit plot button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
2. In the Triggering section, select the Variable trajvel.output.refSpeed (Figure 137). This is the
Target Speed that is provided to the controller when the motor is started.
Figure 137. Setting up trigger variable
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
96
Freescale Semiconductor, Inc.
Labs
3. Set the Trigger type to "Not_equal"(Figure 138)
Figure 138. Setting up trigger type
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
4. Set the Trigger value to "0" (Figure 139)
Figure 139. Setting up trigger value
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
98
Freescale Semiconductor, Inc.
Labs
5. Update the plot (Figure 140)
Figure 140. Update plot button
6. Click the Run button to start sampling in plot. Notice that the plot is waiting for the trigger
(Figure 141).
Figure 141. Waiting for trigger behavior
7. Return to the Speed Control page. Click and drag the knob handle or manually enter a value to
reduce the Bandwidth to ~10% of the default value (Figure 142). Press Enter.
Figure 142. Bandwidth field
8. Enter a Target Speed that is 100% of the motor's rated speed. Start the motor.Your motor may fault
in this configuration and may attempt to automatically restart. If your motor is able to reach
Target Speed, enter a new Target Speed that is -100% of the motor's rated speed.
9. Whether your motor faults or successfully reaches Target Speed, you should observe behavior
that is similar to the behavior in Figure 144: it is difficult for the motor to track the desired speed.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 143. Example plot when undertuned (TWR sensorless velocity) - motor cannot start
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
100
Freescale Semiconductor, Inc.
Labs
10.
Figure 144. Example plot when undertuned (TWR sensored velocity)
11. Stop sampling (Figure 145)
Figure 145. Stop sampling button
12. Save the csv and png files (Figure 146)
Figure 146. Save CSV and PNG buttons
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
13. Clear any motor faults at bottom of KMS main window (Figure 147) or click to stop motor (if
your motor is still running).
Figure 147. Clear faults button
3.1.3.2.3
Observe the motor's behavior when it is over-tuned
1. Click the Run button on the Speed Feedback plot (Figure 148).
Figure 148. Begin sampling button
2. Return to the Speed Control page and use the knob or text field to increase the Bandwidth to 3x
the default value (30x the current value) (Figure 149).
Figure 149. Bandwidth field (TWR sensored velocity)
3. Enter the motor’s rated speed as its Target Speed. Start the motor.
4. Your motor may fault in this configuration and may attempt to automatically restart. If your motor
is able to reach Target Speed, enter a new Target Speed that is -100% of the motor's rated speed.
5. Whether your motor faults or successfully reaches Target Speed, you should observe behavior
that is similar to the behavior in Figure 150: motor speed is less stable than in the default scenario.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
102
Freescale Semiconductor, Inc.
Labs
6.
Figure 150. TWR sensorless velocity control with bandwidth 3x the default
However, when running sensored velocity control or when running certain high speed motors, the
system may remain stable across a broad range of Bandwidth values. If this is the case, your system
may offer improved control performance at a value higher than the default or even than the 3x
default value used in this example.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 151. Example plot of behavior when “overtuned” value has little effect (TWR sensored velocity)
7. When you have observed unstable oscillation or are unable to force instability with bandwidth
changes, click to stop sampling.
Figure 152. Click to stop sampling
8. Clear any motor faults (Figure 153) or click to stop motor (if your motor is still running).
Figure 153. Clear faults button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
104
Freescale Semiconductor, Inc.
Labs
9. Analyze the motor’s behavior in the Software Oscilloscope. Start by selecting an area of the plot
by pressing Ctrl+Right mouse button. The system zooms in on the desired region, as shown in
Figure 154.
Figure 154. Ctrl + right mouse button to select an area of plot
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
10. Click the left mouse button to view the value of a specific data point on the grid, as shown in
Figure 155. This data reflects the variables being plotted, and the x and y coordinate values of the
data point you have selected.
Figure 155. Left click to view data point values
11. Use your mouse wheel to zoom in and out of the selected area, as shown in Figure 156
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
106
Freescale Semiconductor, Inc.
Labs
Figure 156. Zoom in and out using mouse wheel
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
12. Press the "A" key to reset the axes, as shown in Figure 157. Refer to the KMS User’s Guide
description of the Software Oscilloscope for other tips on usage.
Figure 157. Plot reset by “A”
13. Save the csv and png file (Figure 158)
Figure 158. Save CSV and PNG buttons
14. Set the bandwidth back to approximately the default value (Figure 159).
Figure 159. Bandwidth field
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
108
Freescale Semiconductor, Inc.
Labs
3.1.3.3
Summary
In this lab, you performed the following steps to gauge the default tuning of your motor:
— Viewed advanced parameters available in Motor Manager
— Tested different speed loop tunings to see the impact
— Saved the csv and image files so that the data can be analyzed at a later time
— Utilized the Software Oscilloscope to examine motor performance
This lab reflects KMS’ intuitive tuning process: find the boundary values where your motor performs
poorly and/or unstably, then iteratively adjust the value of Bandwidth according to the performance shown
by the Software Oscilloscope.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.1.4
3.1.4.1
Velocity lab 4: test trajectories
Objective
Applications typically require motors to operate at a variety of speeds based on certain application or
environmental conditions. Building such a motion sequence piecewise is easy in KMS.
In this lab, use the Trajectory Test Mode to find the theoretical motion limits that should allow the motor
to transition between two speeds in the desired amount of time. Once you find values that meet these
requirements, test to see if your motor can actually run in this configuration. In the last part of this lab,
open Motion Sequence Builder and see how discrete trajectories can be combined to build an application
motion sequence in KMS.
3.1.4.2
3.1.4.2.1
Procedure
Define a trajectory from zero to rated speed
1. Navigate to the Motion Sequences page (Figure 160)
Figure 160. Motion sequences page
2. Under the Trajectory Testing heading, enter the motor's rated speed into the Final Speed field.
Figure 161 displays the rated speed for the Linix 45ZWN24-40 reference motor.
Figure 161. Final speed field
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
110
Freescale Semiconductor, Inc.
Labs
3. Click to Run Test Trajectory (Figure 162)
Figure 162. Run test trajectory button
4. The system calculates the Trajectory Duration based on the Acceleration and Jerk Limits. The
calculations are intuitive for velocity control: in Figure 163, going from 0 rpm to 4000 rpm with
acceleration of 400 rpm per second should take approximately ten seconds.
Figure 163. Trajectory duration output field
5. Double the Acceleration Limit (Figure 164).
Figure 164. Test acceleration limit
6. Click to Run Test Trajectory (Figure 165) again and note the Trajectory Duration.
Figure 165. Run test trajectory button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
7. Continue to double the Acceleration Limit until the Trajectory Duration no longer changes. This
means that Acceleration Limit is no longer a significant constraint. Instead, the rate at which your
acceleration is allowed to increase - the Jerk Limit - is the constraining factor. Double the Jerk
Limit (Figure 166).
Figure 166. Test jerk limit field
8. Click to Run Test Trajectory (Figure 167).
Figure 167. Run test trajectory button
9. Continue to increase the Jerk Limit until the Trajectory Duration is approximately 2 seconds.
Note these Acceleration and Jerk Limit values; they are used in the next part of this lab.
Figure 168 shows a set of limits for the Linix motor.
Figure 168. Trajectory duration output field
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
112
Freescale Semiconductor, Inc.
Labs
3.1.4.2.2
Determine whether your motor can execute this trajectory
1. Go to the Speed Control page. Click to activate the Speed Plot (Figure 169).
Figure 169. Open speed plot button
2. Click to begin sampling at bottom of Software Oscilloscope window (Figure 170).
Figure 170. Begin sampling button
3. Under Trajectory Constraints on the Speed Control page, enter the Acceleration and Jerk Limits
that allowed you to achieve a Trajectory Duration of ~2 seconds. Figure 171 displays the values
for the Linix reference motor.
Figure 171. Actual acceleration and jerk limit fields
4. In the Target Speed field, enter the motor’s rated speed. Figure 172 displays the rated speed for
the Linix motor.
Figure 172. Target speed field
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
5. Click to Start Motor (Figure 173).
Figure 173. Start motor button
6. Wait for the motor to run and attempt to reach rated speed. After five seconds, click to stop
sampling (Figure 174).
Figure 174. Stop sampling button
7. Stop the motor (Figure 175).
Figure 175. Stop motor button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
114
Freescale Semiconductor, Inc.
Labs
8. If your motor was able to run the trajectory, congratulations! You can verify that the motor
reached the rated speed by positioning your cursor on the curve at the 2-second point (defined by
x-axis) on the Speed Plot, and clicking the left mouse button, as shown in Figure 176. This
displays the estimated speed at 2 seconds into the transition.
Figure 176. Successful motion with data point values (TWR sensored velocity example)
9. If your motor was unable to run the trajectory, reduce the Acceleration Limit until you are
successfully able to run from 0 rpm to rated speed. Determine the amount of time required for this
trajectory in your real system.
3.1.4.2.3
Learn how to incorporate a trajectory into an application’s motion sequence
1. Under the View menu, Launch Motion Sequence Builder (Figure 177). You may also launch it
from the Motion Sequence Builder icon at bottom right (Figure 178).
Figure 177. Start Motion Sequence Builder menu option
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 178. Click to launch Motion Sequence Builder
2. Motion Sequence Builder includes a few sample motion sequences. Click on the file folder icon at
bottom left, then select Open Plan (Figure 179)
Figure 179. Open plan menu option
3. You may receive a notification asking if you wish to overwrite a motion sequence file. Click NO
to proceed.
Figure 180. Click NO to avoid overwriting default motion sequence file
4. Navigate to the velocity control Examples directory at:
– C:\Users\<username>\Documents\KMS_1.0.0\Motion Sequence
Builder\Plans\Examples\Velocity
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
116
Freescale Semiconductor, Inc.
Labs
5. Select Simple_Washing_Machine.msbvel, and click Open (Figure 181). This is similar to the
example motion sequence that you saw in Section 3.1.1.2.6, "Simulate application".
Figure 181. Directory for washing machine example
6. Note the different speeds of operation that make up the washing machine motion sequence
(Figure 182), especially for the states named Drain and Spin.
Figure 182. Enumeration of states in Motion Sequence Builder
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
7. In the treeview at left, click Drain.
Figure 183. Drain state in treeview
8. Observe the options available to configure the Drain state (Figure 184), including:
– Speed (red outline in Figure 184)
– Minimum time that the motor must remain in this state (blue outline)
– If-then relationships to trigger transition to a different speed (green outline)
– Acceleration and jerk limits for transitions to different speeds (pink outline)
Construction of such a motion sequence is the subject of Section 3.1.6, "Velocity lab 6: build a
simple motion sequence".
Figure 184. Drain state definition
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
118
Freescale Semiconductor, Inc.
Labs
9. In the treeview, click Variables (Figure 185).
Figure 185. Variables option in treeview
10. Observe enumerated variables for the washing machine motion sequence. Variables allow you to
tie operation to values elsewhere in the system.
Figure 186. Enumerated variables for washing machine motion sequence
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
11. Navigate to the main KMS window. Return to Motor Tuner by clicking the wizard hat icon at
bottom right and go to Step 5 of Motor Tuner (Figure 188).
Figure 187. Button to go to Motor Tuner
Figure 188. Click to start the washing machine trajectory
12. Click to run the example motion sequence. Try to view the motor’s behavior as a series of discrete
trajectories (like the one you just created) that can be combined into an application motion
sequence.
13. Return to Motor Manager by clicking the icon at bottom right.
Figure 189. Click to go to Motor Manager
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
120
Freescale Semiconductor, Inc.
Labs
14. Return to the Speed Control page and return the Trajectory Constraints to their original values in
order to proceed to the next lab.
Figure 190. Default trajectory constraints for Linix 45ZWN24-40 reference motor
3.1.4.3
Summary
In this lab, you performed the following steps to start building an application motion sequence:
— Considered transitions between speeds required by the application
— Built and tested a transition using Motor Manager
— Explored an example implementation in Motion Sequence Builder
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.1.5
3.1.5.1
Velocity lab 5: evaluate processor utilization
Objective
While your motor is critical to your application, it is not the only element in your design. Your motor
control objectives may be constrained by other aspects of your design, and in particular, the requirements
of your application code.
In this lab, examine CPU utilization of the KMS firmware. Change execution rates and operating modes
to determine the processor capacity available for your application code. Observe the tradeoff between
processor usage and motor control operation.
3.1.5.2
3.1.5.2.1
Procedure
Understand usage in the existing configuration
1. Navigate to the Advanced Tuning page of Motor Manager (Figure 191)
Figure 191. Advanced tuning page icon selected
2. Locate the System Frequencies section (Figure 192)
Figure 192. System frequencies
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
122
Freescale Semiconductor, Inc.
Labs
3. The three values in this section describe core execution frequencies of the KMS firmware, which
is architected as a dual interrupt service routine (ISR) system to separate motor control operation
from application-focused code. These frequencies, described in Table 11, determine CPU usage.
Table 11. Key frequencies in KMS
Variable
Description
PWM Frequency
Rate at which Pulse Width Modulation occurs
PWM / Fast ISR
Ratio between PWM switching frequency and the rate at which the core
motor control code is executed; the Fast ISR is also known as the PWM ISR
Fast ISR / Slow ISR
Ratio between the rate at which core motor control code and slower
application code is executed
4. The values for these variables depend on the values that KMS identifies during measurement of
the motor’s electrical characteristics. For example, if a low inductance has been measured, KMS
attempts to operate the motor at a faster switching rate than the default values. You may also
manually configure these values.
3.1.5.2.2
Assess CPU utilization using default configuration
1. Given the existing values in the System Configuration section, how much processor capacity is
available for your code? To find out, start by navigating to the CPU Utilization page of Motor
Manager.
Figure 193. CPU Utilization page icon
2. Note the different information available:
— Average percent usage of CPU
— Fast ISR cycles
— Slow ISR cycles
— Communication cycles
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 194. CPU utilization information
3. Now put the motor back into operation to see how these values change in real-time. Go to the
Speed Control page, enter the motor’s rated speed as Target Speed, and click to Start the motor.
Figure 195. Click to start motor
4. Return to the CPU Utilization page and observe CPU usage, both in terms of percentage and
maximum cycles for the Fast ISR (motor control). Typical usage for operation at or below the
motor’s rated speed, is shown in Figure 196 and Figure 197.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
124
Freescale Semiconductor, Inc.
Labs
Figure 196. CPU usage running Linix 45ZWN24-40 in sensorless velocity mode at 4000 rpm
Figure 197. CPU usage running Linix 45ZWN24-40 in TWR sensored velocity for KDS at 4000 rpm
5. Click to Stop Motor.
Figure 198. Click to stop
3.1.5.2.3
Increase values of execution rates and observe CPU impact
Certain motors may require faster operating frequencies to achieve good performance. In particular, low
inductance motors require usage of higher frequencies for PWM and the Fast (motor control) ISR. If KMS’
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
motor identification routine reveals your motor to be low inductance it will automatically adjust these
values. But this has an effect on CPU usage.
1. To simulate the impact on available CPU of using a low inductance motor, manually change these
frequencies. Return to the System Frequencies section of the Advanced Tuning page in Motor
Manager.
Figure 199. System frequency values
2. Increase the rate at which KMS code executes by changing the values to those listed in Table 12.
Table 12. Execution rate increases
Variable
Current value
Change to
PWM Frequency
10
20
PWM / Fast ISR
1
1
Fast ISR / Slow ISR
10
20
Figure 200. Updated values
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
126
Freescale Semiconductor, Inc.
Labs
3. Changes are highlighted in orange (Figure 200). This indicates updated values that have not yet
been sent to the MCU. Send these values to the MCU by clicking the button to Update Motor
Drive Configuration (Figure 201).
Figure 201. Update motor drive configuration button
4. You may receive a notification that these values may lead to high CPU utilization (Figure 202).
Click Yes to accept.
Figure 202. Notification of high CPU usage
5. When values have updated and orange outlines disappear, go to the Speed Control page, enter
Rated Speed as Target Speed and click to Start Motor (Figure 203)
Figure 203. Enter target speed and start Motor
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
6. Return to the CPU Utilization page and observe the increase in usage. In Figure 205, usage has
approximately doubled because of the change in operating frequency.
Figure 204. Increased CPU usage (TWR sensorless velocity for KDS)
Figure 205. Increased CPU usage (TWR sensored velocity for KDS)
7. Stop the motor from the Speed Control page.
Figure 206. Click to stop
3.1.5.2.4
Decrease values of execution rates and observe CPU impact
Just as increasing motor control frequency results in higher CPU usage, decreasing the operating
frequencies leads to lower CPU usage. If your system is not especially dynamic but requires a substantial
amount of application-focused code, you may want to assess how slow you can run the motor control code
while still achieving acceptable motor performance. This experiment enables you to maximize CPU
available for your application code.
1. Return to System Frequencies on the Advanced Tuning page. Change the execution rates in
accordance with Table 13.
Table 13. Execution rate decreases
Variable
Current value
Change to
PWM Frequency
20
5
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
128
Freescale Semiconductor, Inc.
Labs
Variable
Current value
Change to
PWM / Fast ISR
1
1
Fast ISR / Slow ISR
20
5
Figure 207. Updated system configuration
2. Click to Update Motor Drive Configuration (Figure 208).
Figure 208. Update motor drive configuration button
3. When values have updated and orange outlines disappear, go to the Speed Control page, enter
Rated Speed as Target Speed and click to Start Speed Control.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
4. Your motor may not be able to reach Rated Speed with this configuration. If it does, note the
reduced usage on the CPU Utilization page (Figure 210). You may also notice increased audible
noise due to the lower frequency of operation.
Figure 209. Decreased CPU usage (TWR sensorless velocity for KDS)
Figure 210. Decreased CPU usage (TWR sensored velocity for KDS)
5. If your motor is successfully running at Rated Speed, activate the Software Oscilloscope, select
the SpeedFeedback Plot, and begin sampling (Figure 211). Note that there may be degradation of
control performance while running at the lower execution rates. This is most likely to occur when
running in sensorless velocity mode.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
130
Freescale Semiconductor, Inc.
Labs
These are the types of design tradeoffs that must be evaluated during the design cycle. Reducing
the execution rate may free up the processor, but control performance may suffer.
Figure 211. Performance at rated speed (TWR sensorless velocity)
6. Stop sampling and on Speed Control page, click to Stop Motor.
7. Change the System Frequencies back to their default values.
Figure 212. Default operating frequencies
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.1.5.2.5
Change motor operating mode and observe CPU impact
KMS seamlessly enables different modes of motor operation. Indeed, several different modes are behind
the Motor Tuner wizard process: motor measurement, spinning to rated speed, and simulating an
application constitute three slightly different arrangements of core KMS firmware modules.
Since the underlying software is implemented differently for different modes of operation, usage of the
CPU may change based on mode. In this section, explore two such scenarios.
1. On the Speed Control page, enter your motor’s rated speed as Target Speed and click to Start Speed
Control.
2. Navigate to the CPU Utilization page. Find the Reset Maximums section and click to Clear CPU
Utilization Max. This will clear the values for Maximum CPU Clock Cycles in the Fast ISR and
Slow ISR sections to ensure capture of new data.
Figure 213. Clear maximum values
3. As the motor runs at Rated Speed, observe the CPU usage percentage and the Maximum CPU
Clock Cycles for the Fast ISR. This is your baseline for comparison: normal motor operation at
Rated Speed.
Figure 214. Rated speed percentage usage and Fast ISR maximum cycles (TWR sensorless velocity KDS)
Figure 215. Rated speed percentage usage and Fast ISR maximum cycles (TWR sensored velocity KDS)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
132
Freescale Semiconductor, Inc.
Labs
4. Return to the Speed Control page and click to Stop the motor.
Figure 216. Click to stop motor
5. Now assess CPU usage while running an application motion sequence. Navigate to the Motion
Sequences page and click to Start Motion Sequence.
Figure 217. Click to start motion sequence
6. As your motor begins to perform the washing machine motion sequence, return to the CPU
Utilization page. Click to Clear CPU Utilization Max.
Figure 218. Clear maximums
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
7. Observe the values update for CPU Usage and Fast ISR Maximum CPU Clock Cycles. Note that
running an application motion sequence may add to the CPU burden. This effect is likely to be
more pronounced with more complex motion sequences.
Figure 219. Motion sequence percentage usage and Fast ISR maximum cycles (TWR sensorless velocity
KDS)
Figure 220. Motion sequence percentage usage and Fast ISR maximum cycles (TWR sensored velocity
KDS)
8. When the motion sequence completes, return to the Speed Control page.
3.1.5.2.6
Engage field weakening and observe CPU impact
CPU usage may also be affected by attempting to run beyond the motor’s normal operating range. By
default, KMS allows “field weakening,” which manipulates the current signals to achieve greater speed
for the motor at the cost of torque. However this requires additional computation and so may require
additional CPU cycles.
9. To observe this effect, enter a speed 20% greater than rated speed into the Target Speed field and
click to Start Speed Control.
Figure 221. Target speed at 120% of rated speed (motor Linix 45ZWN24-40)
10. As the motor surpasses rated speed, scroll down to the Field Weakening step and observe the
value for D-Axis Reference. Normally, this value should be zero, because applying current on this
axis reduces torque. However, in field weakening, reduction in torque is acceptable to achieve
increased speed, so this value must become nonzero (and in fact, go negative).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
134
Freescale Semiconductor, Inc.
Labs
NOTE
On the High Voltage platform, or if using a different motor than the Linix
45ZWN24-40 on the Tower or Freedom platforms, you may need to
gradually increase Target Speed above the 20% of Rated Speed value before
seeing a nonzero D-Axis Reference. This is because the field weakening
capabilities vary by motor.
Figure 222. Field weakening mode
11. After D-Axis Reference has gone negative, return to the CPU Utilization page. Click to Clear
CPU Utilization Max to reset values, then observe usage statistics and in particular, the Fast ISR
Maximum CPU Clock Cycles.
Figure 223. Field weakening percentage usage and Fast ISR maximum cycles (TWR sensorless velocity
KDS)
Figure 224. Field weakening percentage usage and Fast ISR maximum cycles (TWR sensored velocity KDS)
12. For the motors specified by Kinetis development platforms, the utilization may not differ from
utilization at normal operating speeds. This is because these motors are not constructed to
optimize field weakening operation. However, for motors designed to operate in deep field
weakening, such as washing machine motors, the CPU usage may increase substantially.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
13. Stop motor from Speed Control page.
Figure 225. Click to stop motor
3.1.5.3
Summary
In this lab, you performed the following steps to observe the tradeoff between processor utilization and
motor control operation:
— Viewed CPU utilization statistics in normal operation
— Changed system frequencies that might need to be switched for your motor
— Spun the motor in different operating modes
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
136
Freescale Semiconductor, Inc.
Labs
3.1.6
3.1.6.1
Velocity lab 6: build a simple motion sequence
Objective
Now that you have an idea of valid motor control operation, move on to building out an application.
Motion Sequence Builder allows you to define the speeds at which you want your application to run, as
well as the conditions under which it runs at each speed.
Use Motion Sequence Builder to create a simple ceiling fan consisting of three speeds and a “button” to
cycle through the speeds.
3.1.6.2
3.1.6.2.1
Procedure
Set up and run desired speeds
1. Bring Motion Sequence Builder to the front by clicking the diagram icon at bottom right.
Figure 226. Motion Sequence Builder icon
2. Start a new motion sequence by left-clicking on the file folder at bottom left (Figure 227) then
selecting New Plan (Figure 228).
Figure 227. File folder button
Figure 228. New plan menu option
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3. If prompted, click No to avoid overwriting the open motion sequence.
Figure 229. Click no to avoid overwriting
4. Motion Sequence Builder refreshes and display the default configuration: two states enumerated
where one is the InitialState of zero speed (Figure 230).
Figure 230. Default Motion Sequence Builder configuration
5. On the States page, click the Add button (Figure 231) twice to add two additional states to the
default configuration.
Figure 231. Add state button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
138
Freescale Semiconductor, Inc.
Labs
Figure 232. Two additional states
6. Click in the cell for Speed of State1 and type to change value to 1000. Press Enter.
Figure 233. Change speed for State1
7. Click in cell for Name of State1 and type to change value to Low_Speed. Press Enter.
Figure 234. Change name of State1
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
8. Change State2 and State3 according to (Table 14).
Table 14. Change State2 and State3
Speed [rpm]
Name
2500
Medium_Speed
4000
High_Speed
Figure 235. States table after edits
9. Check the box in order for your motion sequence to continually run instead of halting upon
returning to the InitialState.
Figure 236. Run repeatedly checkbox
10. Click the Connect States button to connect the defined states in a simple loop (InitialState TO
Low_Speed TO Medium_Speed TO High_Speed TO InitialState).
Figure 237. Connect states button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
140
Freescale Semiconductor, Inc.
Labs
11. Click Yes to accept that clicking the Connect States button overwrites any existing state-to-state
transitions.
Figure 238. Click yes to overwrite existing transitions
NOTE
The Connect States button is most useful at the beginning of a simple design
when interested in validation of motor operation at specified speeds. After
you have specified numerous states and transitions among those states, be
careful when using the Connect States button to avoid overwriting any
desired behavior.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
12. Observe in your system’s default image viewer a diagram showing the relationships between the
states created by the Connect States button (Figure 239).
Figure 239. State diagram after connecting states
13. Exit the image viewer. Click the Run on Target (bullseye) button (Figure 240) to compile your
KMS reference project with your new motion sequence. If you have not previously specified your
Kinetis Design Studio path, KMS prompts for its location (Figure 61).
Figure 240. Compile and download to target via bullseye button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
142
Freescale Semiconductor, Inc.
Labs
14. A command line-style window appears. Wait while your reference project is compiled with the
relevant Kinetis Software Development Kit libraries (Figure 241), then click OK. The result of
compilation is then downloaded to the MCU (Figure 242).
Figure 241. Compiling project
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 242. Downloading to MCU
15. Press the reset button on the Control Board if instructed (FRDM platform), then click OK to
proceed.
16. Wait until the command window disappears and return to the KMS Main Window to wait for
KMS to reconnect to the MCU (the command window operation requires temporary usage of the
communication port). Connection is indicated by green arrows on the communication indicator
(Figure 243).
Figure 243. Successful connection indicator
17. Activate Software Oscilloscope (Figure 244).
Figure 244. Activate Software Oscilloscope button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
144
Freescale Semiconductor, Inc.
Labs
18. Select SpeedFeedback plot from dropdown menu at bottom left of Software Oscilloscope window
(Figure 245).
Figure 245. SpeedFeedback plot selection
19. Click Run button (Figure 246) to begin sampling.
Figure 246. Run button in Software Oscilloscope
20. In the KMS Main Window, navigate to the Motion Sequences page in Motor Manager.
Figure 247. Motion sequences page icon active
21. Find the Run Motion Sequence step and click to Start Motion Sequence. This runs the current
motion sequence loaded to the MCU.
Figure 248. Run motion sequence
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
22. Return to the Software Oscilloscope and watch the motor cycle through the speeds you defined.
Figure 249. Motor cycling through states defined in motion sequence (TWR sensored velocity)
23. Click Stop button to stop sampling in the Software Oscilloscope window.
Figure 250. Click to stop sampling
24. On Motion Sequences page, click Stop button to stop the motion sequence.
Figure 251. Button to stop motion sequence
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
146
Freescale Semiconductor, Inc.
Labs
3.1.6.2.2
Make the motion conditional
1. Return to Motion Sequence Builder. Click on Variables at top left (Figure 252).
Figure 252. Motion Sequence Builder variables page
2. Click Add button (Figure 253) to add a variable (Figure 254).
Figure 253. Add button on variables page
Figure 254. Variable added
3. Click on Variable1 cell and rename by typing in Speed_Button and pressing enter (Figure 255).
Note the Initial Value of the Speed_Button variable is 0.
Figure 255. Name Speed_Button variable
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
4. Click on InitialState at top left (Figure 256) to see further detail about the InitialState.
Figure 256. Link to InitialState page
5. On this page (Figure 5) and corresponding pages for other states, you can define:
– the speed that defines the state
– the minimum time the motor remains in this state
– conditions for KMS to evaluate while in this state
– the actions resulting from a satisfied condition
– the motion limits for any transition to another state
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
148
Freescale Semiconductor, Inc.
Labs
Figure 257. InitialState page
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
6. Note that when in the InitialState, the motor is configured to go to the state Low_Speed under
NoCondition. That is, the motor goes to Low_Speed as soon as the Minimum Time for the
InitialState has elapsed, without any other condition having to be satisfied (Figure 258).
Figure 258. NoCondition and minimum time configurations
7. To make this transition from InitialState to Low_Speed conditional, click the Add button to add a
global if statement (Figure 259).
Figure 259. Add button for global if... statement
8. In the dialog box that appears, make sure the variable Speed_Button is selected, then type in the
Constant field a value of 1. This defines the if statement:
– If Speed_Button equals 1
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
150
Freescale Semiconductor, Inc.
Labs
Figure 260. If Speed_Button = 1
9. Click the Update button to create this if statement (Figure 261).
Figure 261. Update button
10. Navigate to the If column in the If-Then Relationship table and click to expand the dropdown
menu in the cell currently showing NoCondition (Figure 262). Change the value to
Speed_Button=1.
Figure 262. Change if column to Speed_Button=1
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
11. Click the Run on Target (bullseye) button (Figure 263) to compile and download your updated
motion sequence to the MCU.
Figure 263. Compile and download to target via bullseye button
12. Wait for the command line build and download windows to complete. Follow the prompts and
wait for KMS to reconnect.
13. Activate the SpeedFeedback plot in the Software Oscilloscope and click the Run button to begin
sampling.
14. Navigate to the Motion Sequences page of Motor Manager, and click Run button to Start Example
Motion Sequence.
Figure 264. Run button for motion sequence
15. Observe that the motion sequence status changes to busy (Figure 265), and the motor may turn
briefly to initialize, but otherwise there is no motion. This is because the motor now goes from the
InitialState to Low_Speed only when Speed_Button=1. Return to Motion Sequence Builder and
click on Variables to recall that Speed_Button by default is equal to 0 (Figure 266).
Figure 265. Motion sequence busy
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
152
Freescale Semiconductor, Inc.
Labs
Figure 266. Speed_Button=0
16. To make the motion sequence spin the motor, Speed_Button should be made to equal one. Click
to activate the Watch Window using the icon at the bottom right. The Watch Window gives you
access to parsed variables on the MCU.
Figure 267. Watch Window icon
17. Click the Add button to add a variable to the Watch Window (Figure 268).
Figure 268. Add button in Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
18. Scroll to the bottom of the Available Variables list, click the plus box to expand the group
userPlanVariables, then click to select Speed_Button (Figure 269).
Figure 269. Select Speed_Button
19. Click the Update button to add Speed_Button to the Watch Window.
Figure 270. Update button
20. At the bottom of the Watch Window, click the Run button to begin sampling.
Figure 271. Run button in Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
154
Freescale Semiconductor, Inc.
Labs
21. Click in the Value cell for userPlanVariables.Speed_Button and type in 1. Observe the motor now
spinning and completing the motion sequence. The condition Speed_Button=1 is now fulfilled, so
the motor can cycle through the desired states as it did previously (Figure 273). Click to Stop
Motion Sequence and Stop Sampling.
Figure 272. Speed_Button=1
Figure 273. Motion sequence where Speed_Button=1
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
22. However, a ceiling fan should be able to remain in each state according to the user’s desired fan
speed. In other words, the transitions between speeds should all be conditional based on button
behavior. Navigate to Motion Sequence Builder and click on the Low_Speed state (Figure 274).
Figure 274. Low_Speed state
23. Click on cell in If-Then table currently showing NoCondition and select the dropdown option
Speed_Button=1 (Figure 275).
Figure 275. Apply Speed_Button=1 condition to Low_Speed state
24. Repeat for the Medium_Speed and High_Speed states (Figure 276 and Figure 277)
Figure 276. Apply Speed_Button=1 condition to Medium_Speed state
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
156
Freescale Semiconductor, Inc.
Labs
Figure 277. Apply Speed_Button=1 condition to High_Speed state
25. This means that the motor advances to the next state only if Speed_Button=1. But if
Speed_Button is not reset after each successful transition, the motor cycles through all states as
before (Speed_Button is perpetually equal to one). To reset the Speed_Button, click the Add
button next to the global then... statements list (Figure 278).
Figure 278. Add button for global then... statements
26. To specify the reset of the Speed_Button, perform the following configuration steps (Figure 279):
– click on the “Set equal to:” button
– enter a value of 0 in the blank field
– select the radio button Upon exiting the state
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 279. Define reset action
27. Click the Update button to create this reset action (Figure 280).
Figure 280. Create reset action
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
158
Freescale Semiconductor, Inc.
Labs
28. Click on InitialState, then click to add new row to if-then table (Figure 281).
Figure 281. Add row to if-then table for InitialState
29. In the new row, click on the dropdown arrow in the “Then” cell and select Speed_Button=0
OnExiting (Figure 282).
Figure 282. Select Speed_Button=0 OnExiting
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
30. Repeat for all other states. After leaving a state, Motion Sequence Builder may reorder the if-then
table to reflect its internal order of evaluation (Figure 283).
Figure 283. Reset Speed_Button for all other states
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
160
Freescale Semiconductor, Inc.
Labs
31. Click the State Diagram button (Figure 284) to see the representation of the conditional
transitions to different speeds and the resetting of the Speed_Button variable (Figure 285).
Figure 284. State diagram button
Figure 285. Diagrammatic representation of motion sequence
32. Click bullseye button to compile then download to MCU (Figure 286). Follow the command
window directions then wait for KMS to reconnect to the MCU.
Figure 286. Compile and download to target via bullseye button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
33. Activate Software Oscilloscope, select SpeedFeedback plot, and click Run button to begin
sampling (Figure 287).
Figure 287. SpeedFeedback plot active and sampling
34. Navigate to the Motion Sequences page and click Run button to Start Example Motion Sequence.
35. Activate Watch Window and click Run button to begin sampling. Note the value for
userPlanVariables.Speed_Button (Figure 288).
Figure 288. Watch Window sampling
36. In the Value cell for the variable userPlanVariables.Speed_Button, type in a new value of 1.
Observe that the motor spins to next state (Figure 289)
Figure 289. Motor moving to next speed
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
162
Freescale Semiconductor, Inc.
Labs
37. Observe also that userPlanVariables.Speed_Button automatically returns to a value of 0
(Figure 290).
Figure 290. Speed_Button is set to zero
38. Continue to type in a value of 1 for userPlanVariables.Speed_Button to cycle through the states of
your motion sequence (Figure 291).
Figure 291. Cycle through all states (TWR sensored velocity)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
39. Click to stop sampling in SpeedFeedback plot (Figure 292) and click to stop motion sequence
(Figure 293).
Figure 292. Stop button to halt sampling in plot
Figure 293. Stop button to halt motion sequence
3.1.6.3
Summary
In this lab, you have used Motion Sequence Builder to construct a simple motion sequence approximating
the behavior of a ceiling fan.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
164
Freescale Semiconductor, Inc.
Labs
3.1.7
3.1.7.1
Velocity lab 7: connect your motor to the real world
Objective
When building an application, you must base changes in motion on real-world inputs such as switches,
pushbuttons, sensors, etc. You may also want to activate real-world outputs such as LEDs, valves,
actuators, etc. through the motion plan.
In this lab, the simulated Speed_Button in the Simple Ceiling Fan plan is associated with a pushbutton
located on the Control Board.
NOTE
No pushbutton exists on the HVP Control Board (HVP-KV31F120M) for
safety precautions. As a result, this lab cannot be fully performed on the
High Voltage platform.
Figure 294. FRDM-KV31F control board with push buttons indicated
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 295. TWR-KV31F120M control board
3.1.7.2
3.1.7.2.3
Procedure
Open your KMS reference project in your preferred IDE
For KDS, proceed from here. To skip ahead to the IAR instructions, see IAR (p. 173).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
166
Freescale Semiconductor, Inc.
Labs
•
KDS
— Launch Kinetis Design Studio 3.0.0 and define a workspace named “kms” (Figure 296).
Figure 296. KDS default workspace selection
— From the File menu, select Import...
Figure 297. Import menu in KDS
— Expand the folder named General, select “Existing Projects into Workspace,” and click Next.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 298. Import existing projects
— Click the Browse... button and navigate to the parent directory of the KDS project you created
upon starting this KMS session. The default path is:
– C:\Users\<user_name>\Documents\KMS_1.0.0\SavedProjects\<project_type>_<IDE>_<ver
sion>
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
168
Freescale Semiconductor, Inc.
Labs
Figure 299. KMS project directory example
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
— KDS identifies the valid KDS project in the specified directory and lists it in the Projects
section. Click Finish
Figure 300. KDS KMS project
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
170
Freescale Semiconductor, Inc.
Labs
— At top left, click the Restore button to be able to see the project contents. You may also click
the Workbench button at top right (Figure 302).
Figure 301. Restore button
Figure 302. Workbench button
Figure 303. KMS project in the project explorer
— Expand the project and the “src” directory, then find the main.c file.
Figure 304. Main.c file in expanded project
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
— Proceed to Section 3.1.7.2.4, "Connect the physical button to Simple Ceiling Fan plan"
(skipping the IAR project information).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
172
Freescale Semiconductor, Inc.
Labs
•
IAR
— Find and double-click to open the IAR workspace that was created when you selected a
configuration upon launching KMS. The default directory path is:
– C:\Users\<username>\Documents\KMS_1.0.0\SavedProjects\<platform>_<control
type>_IAR_<reference project version>\iar
— Expand the KMS project and open main.c.
Figure 305. Main.c file in IAR project
3.1.7.2.4
Connect the physical button to Simple Ceiling Fan plan
1. Include the Motion Sequence Builder header file in main.c. This allows main.c to interact with the
Motion Sequence Builder structures.
To do this: near the top of the main.c file you find a series of include instructions. Add the following
statement after the last #include statement.
#include "MotionSequence.h" /* PLAN INT */
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 306. Include statement
2. In order to check the status of the button, the code must be added to the forever loop. Find near the
bottom of main.c the following comment (it is easiest to search for the string service softreset).
/*Service SoftReset Requests from KMS*/
3. The Speed_Button should be connected to SW2. By default, when SW2 is pressed, its value = 0.
The Ceiling Fan plan expects that the signal = 1 when the button is pressed. The following code
reverses the button signal so that the ceiling fan goes to the next speed when SW2 is pushed.
Type the following code in main.c before the /*Service SoftReset Requests from KMS*/ comment.
Note that IAR is case sensitive and be careful with any copy-paste, as additional characters may
affect compilation.
//PLAN INT
/* Switch is active Low but we want active high logic */
if (GPIO_DRV_ReadPinInput(kGpioSW2) == 0)
{
userPlanVariables.Speed_Button = 1;
}
else
{
userPlanVariables.Speed_Button = 0;
}
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
174
Freescale Semiconductor, Inc.
Labs
Figure 307. Code implementation for button behavior
4. Save main.c
5. Download the Simple Ceiling Fan plan to the MCU by clicking on the “target icon” in Motion
Sequence Builder (Figure 308). This action recompiles the code using the new main.c file and
download the revised code to the MCU.
Figure 308. Compile and download to target button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
6. If your updated project fails to compile, the command window output displays a failure message
and KMS notifies that the project should be built again (Figure 311).
Figure 309. Failed compile
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
176
Freescale Semiconductor, Inc.
Labs
Figure 310. Failed download because failed compilation did not produce valid .out file
Figure 311. KMS notification of failed compile
7. In this failure case, check the code added by hand for small copying errors (e.g., missing
semicolon or case mismatches), then click the bullseye again to rebuild and download.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
8. Once the motion sequence has successfully compiled, downloaded to the MCU, and KMS
reconnects communication, navigate to the Motion Sequences page and activate the plan by
clicking on the Start Motion Sequence button.
Figure 312. Run plan
9. Activate the Software Oscilloscope by clicking on the Run button. The message “Waiting for
Trigger” should appear.
10. Press firmly and hold SW2 on the Control Board until the motor begins turning. Note that this
causes the fan to transition from 0 to 1000 rpm, just as it did when the Speed_Button was
activated through the Watch Window.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
178
Freescale Semiconductor, Inc.
Labs
11. Verify that the fan ramps to the next speed each time SW2 is pressed. Press SW2 iteratively until
the fan has run through the entire cycle and returns to zero speed. Stop plotting. The speed plot
should look similar to the one shown below.
Figure 313. Ceiling fan plot behavior
12. Click to stop the plan.
Figure 314. Stop motion sequence
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.1.8
Velocity lab 8: make your application stand alone
Eventually, the application must reside outside the KMS environment - the ceiling fan won’t always be
connected to a computer!
In this lab, the requirement of communication with the KMS GUI for motor operation is eliminated and a
second button is implemented to allow control of motor operating state from the control board.
1. Return to the IDE workspace used in the previous lab (KDS or IAR).
2. Open the file drv.c
Figure 315. drv.c file location in IAR workspace
3. Find the code snippet below:
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
180
Freescale Semiconductor, Inc.
Labs
Figure 316. Code snippet for USER block (IAR)
4. Delete the word ‘static’. This allows the USER block, which controls the motor operating state, to
be accessed elsewhere.
Figure 317. Revised code snippet for USER block (IAR)
5. Save drv.c.
6. Return to the main.c file that you used in the previous lab to set up the button. Search for the
following code snippet:
Figure 318. Code snippet for communication with KMS GUI (IAR)
7. Change static const bool commTimeOutEnabled from ‘true’ to ‘false’. This allows the motor to
continue running even when not connected to the KMS GUI.
Figure 319. Revised code snippet for communication with KMS GUI (IAR)
8. Find the following comment just a few lines below:
Figure 320. Comment (IAR)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
9. Just above this comment, add the line of code as shown below. This allows main.c to access motor
operating states defined in the USER block.
extern USER_t user;
/****************************************************
* Prototypes
****************************************************/
Figure 321. Code implementation for extern (IAR
10. Return to the code you implemented in the previous lab (repeated below for emphasis):
Figure 322. Code for first button (KDS)
11. Just beneath this code (before /* Service SoftReset Requests from KMS */), add code to define a
second button to control the motor operating state:
/* Switch is active Low but we want active high logic */
if (GPIO_DRV_ReadPinInput(kGpioSW3) == 0)
{
user.state = USER_RUN_PLAN;
}
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
182
Freescale Semiconductor, Inc.
Labs
Figure 323. Code implementation for second button
12. Save main.c.
13. Now use normal IDE procedures to compile and download. Proceed from here for KDS
instructions; if using IAR, proceed to IAR (p. 188).
NOTE
If using KDS, review Section 2.1.8.1, "KDS" for the minimum version of
P&E Micro GNU ARM Interface Debugging Support. If your version of
this plug-in is not at or greater than the specified version, THE MCU MAY
BE MASS ERASED AND RENDERED USELESS FOR KMS
PURPOSES.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
•
KDS
— Right click on the KMS project file and select Build Project. Ensure that the project compiles
successfully. You may need to perform a clean before doing this
Figure 324. Build KMS KDS project
— Now that the project is compiled, it needs to be downloaded to the target device. Click on the
Debug dropdown and select Debug Configurations.
Figure 325. Select debug configurations
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
184
Freescale Semiconductor, Inc.
Labs
— Select your debugger, in this case it is GDB PEMicro Interface Debugger. Double click the
GDB PEMicro Interface Debugger. Under the Debugger tab, set the Interface for OpenSDA
Embedded Debug - USB Port.
Figure 326. Select proper debugger and interface
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
— Next select the device that you are using.
Figure 327. Select appropriate MCU
WARNING
At bottom of Debugger tab, ensure that Mass erase on connect is NOT
CHECKED. This is critical because mass erase removes preprogrammed
KMS code on the MCU that cannot be restored in the field.
Figure 328. To prevent mass erase on connect, DO NOT CHECK THIS BOX
— Click Apply then Debug. Kinetis Design Studio will download your project to the target and
begin to run the debugger. When finished, click to stop the debugging.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
186
Freescale Semiconductor, Inc.
Labs
Figure 329. Click to stop debugging
— Skip the IAR information to proceed with validation of your standalone application (go to p.
316).
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
•
IAR
— Ensure that your IAR license is valid and that Release mode is selected.
Figure 330. Choose release mode in IAR
— Right click on your KMS project select Make to compile.
Figure 331. IAR make command
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
188
Freescale Semiconductor, Inc.
Labs
— Once compiled, select the Download and Debug icon to send your code to the MCU.
Figure 332. Download and debug button
— When your MCU has been programmed, click to Stop Debugging.
Figure 333. Stop debugging button
14. Now your MCU is ready to act alone. Press firmly and hold the 2nd button until you see the motor
shaft briefly moves to align (SW3). Your motor enters the Run_Plan state. Press firmly and hold
the 1st button (SW2) until the motor starts to spin, then iteratively press to cycle through the
various speeds of operation shown in the previous labs.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
15. Once you have cycled through speeds and returned to zero speed, press the physical reset button
on the Control Board (Figure 581) to conclude active motor operation.
Figure 334. FRDM physical reset button
Figure 335. Physical reset button on TWR
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
190
Freescale Semiconductor, Inc.
Labs
3.2
3.2.1
3.2.1.1
Position labs
Position lab 1: spin your motor using Motor Tuner
Objective
Traditionally, controlling a motor’s position and velocity has been extremely challenging. Kinetis Motor
Suite makes it easy.
In this lab, use KMS Motor Tuner to characterize a motor and command a position with minimal
configuration and without coding.
3.2.1.2
Procedure
1. Launch KMS by double-clicking the Desktop icon.
Figure 336. KMS desktop icon
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
2. Select New… and specify your system configuration (Figure 337).
Figure 337. Example system configuration
3. Click OK to accept the default path for saving the embedded firmware reference project that
underlies KMS. The default path is:
– C:\Users\<username>\Documents\<KMS version number>\SavedProjects\<development
platform>_<control_type>_<KMS reference project version number>
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
192
Freescale Semiconductor, Inc.
Labs
Figure 338. Folder structure and path for KMS reference project
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
4. KMS relies on the Kinetis Software Development Kit (KSDK) version 1.3.0. If KMS cannot find
KSDK 1.3.0 on your computer, KMS prompts you to specify the path. Find and select the folder
named KSDK_1.3.0. The default installation location is: C:\Freescale\KSDK_1.3.0.
Figure 339. Specify the location of KSDK 1.3.0
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
194
Freescale Semiconductor, Inc.
Labs
5. Wait a minute or two for the unzipping and placement of the KMS reference project. Then select
the proper communication port for your board from the dropdown menu. The proper
communication port can be determined by looking in your Windows Device Manager (accessible
from Control Panel) and finding the openSDA communication port.
Figure 340. Select COM port
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 341. Example validation of communication port in Windows Device Manager
6. In some cases, the code preloaded on the MCU may not exactly match the code expected by the
KMS GUI. This typically happens after code is downloaded to the MCU in one KMS session but
then a new KMS session is started (instead of re-opening the previous KMS session).
When this occurs, a mismatch notification appears. KMS can automatically update the software on
the MCU if desired. For the purposes of this lab, if this message appears, click YES to allow KMS
to update the code.
In a real design, you may prefer to click NO if you have code loaded to the MCU that you want to
preserve. This is more likely to occur when you have started to work from the IDE.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
196
Freescale Semiconductor, Inc.
Labs
Figure 342. Checksum mismatch notification
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
7. If downloading of code is required and you have not previously used KMS, KMS prompts you to
select the location of your IDE.
Figure 343. Specify location of Kinetis Design Studio
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
198
Freescale Semiconductor, Inc.
Labs
Figure 344. Specify location of IAR Embedded Workbench for ARM
8. A command line-style window will appear to load code to the MCU. Upon successful loading,
follow the instructions at the bottom of the command window.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
NOTE
When using the Freedom platform, you may be required to press the reset
button on the Control Board (near green communication LED) before
clicking OK in the command window to proceed.
Figure 345. Download code to MCU using KDS
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
200
Freescale Semiconductor, Inc.
Labs
Figure 346. Download code to MCU using IAR
9. Wait while KMS boots up and begins communicating with the MCU. When the input fields and
buttons cease to be grayed out, you can proceed.
3.2.1.2.1
Enter the basics
1. The first step in Motor Tuner is to enter your motor’s basic information. Teknic M-2310-P-LN-04K
information is prepopulated in KMS for the Tower and Freedom development platforms.
Information for the MiGe 60CST-M01330 is prepopulated in KMS for the High Voltage
development platform. Overwrite this information if not using these motors.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 347. Enter basic motor information (Tower and Freedom)
Figure 348. Enter basic motor information (High Voltage)
2. Click to update the basic motor values.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
202
Freescale Semiconductor, Inc.
Labs
Figure 349. Click to update the values
3. Motor Tuner advances to the next step: measuring your motor.
3.2.1.2.2
Measure motor characteristics
1. Motor Tuner applies voltage to measure the motor’s resistance and inductance. Motor Tuner then
rotates the motor’s shaft at a low speed to measure the rotor flux. Click to measure your motor’s
characteristics.
Figure 350. Click to measure your motor’s characteristics
2. The values for Stator Resistance, Stator Inductance, and Rotor Flux update.
This step also incidentally validates your encoder setup: if the encoder has been incorrectly
configured or specified (e.g., mismatch of motor phases, wrong number for lines of encoder, not
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
plugged in, etc.), Motor Tuner cannot complete the Rotor Flux measurement and returns a
notification.
Figure 351. Notification for encoder issue
3. Upon completion, Motor Tuner advances to the next step: measuring your system’s inertia.
3.2.1.2.3
Measure system inertia
Inertia is important for controlling the motion of the application, but is often neglected by traditional
approaches. Motor Tuner uses inertia as a direct input to create an appropriate model of the system for
advanced control.
If you are running your motor without anything connected to the motor shaft, Motor Tuner measures the
inertia represented by the motor shaft.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
204
Freescale Semiconductor, Inc.
Labs
When developing your application, couple the motor to anything that spins directly with the motor during
operation. Do this after completing the motor measurement but before measuring the application inertia.
1. Click to start inertia measurement. The motor spins briefly. If successful in the default
configuration, KMS also updates the reference project that you created upon launching KMS with
your motor and inertia characteristics.
Figure 352. Click to measure your system’s inertia
2. In some instances, Motor Tuner may not be able to automatically measure the system’s inertia
with the default settings. This is because the inertia measurement routine requires an acceleration
and deceleration of the system, and without prior knowledge of the mechanical setup, KMS may
not specify a slow enough (large inertia) or fast enough (high friction) ramp.
Where Motor Tuner cannot identify the inertia with the existing configuration, settings are
intelligently and automatically adjusted based on the error encountered. You are prompted to rerun
the inertia test.
After clicking OK, you must click the Start Inertia Measurement button again. This process may
need to be repeated multiple times depending on your system.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 353. Click to accept updated configuration
3.2.1.2.4
Tune controller
When the system inertia measurement is successful, Motor Tuner automatically advances to the next step:
tuning the controller for both velocity and position control.
1. Click the Run button to align the motor and put it into Position control mode.
Figure 354. Click to enter position control mode
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
206
Freescale Semiconductor, Inc.
Labs
2. Proceed when the Motor State changes to Run Position mode.
Figure 355. Motor is ready
3. Manually attempt to rotate the motor shaft to feel how strongly it moves back to the goal position
in response to the disturbance you introduced.
Figure 356. Manual disturbance
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
4. Click and drag on the knob to increase Bandwidth until the motor is tightly holding the goal
position. If the motor oscillates and is consequently unable to keep its shaft stationary, reduce the
Bandwidth 10-20%.
Figure 357. Adjusted bandwidth for TWR Linix 45ZWN24-40
5. Click Test Position Tuning to move to the next step.
Figure 358. Click to advance to a spin test of your position tuning
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
208
Freescale Semiconductor, Inc.
Labs
3.2.1.2.5
Spin!
1. Motor Tuner defaults to a test of a single revolution but also allows you to specify the number of
full and partial revolutions. Enter the desired revolutions and click to spin your motor.
Figure 359. Enter full and partial revolutions
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
2. Motor Tuner automatically activates the Software Oscilloscope, so that you can watch the
performance of your motor as it transitions to the desired speed. Commanded mechanical
revolutions are plotted in red and estimated actual revolutions are plotted in green.
Figure 360. Software Oscilloscope shows the transition to the desired position
3. The motor spins the desired number of Full and Partial Revolutions before closing the Software
Oscilloscope and proceeding to the next step.
3.2.1.2.6
Simulate application
Motion Sequence Builder is one of the tools available in KMS. It allows you to easily build complex
motion sequences and automatically generate application code.
One of the provided motion sequences simulates the behavior of a motion-sensing security camera. The
motor:
• slowly pans back and forth
• quickly pans to a given location when motion is detected
• slowly completes the surveillance
• returns to the initial position
1. Click to start the security camera trajectory.
Figure 361. Click to start the security camera trajectory
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
210
Freescale Semiconductor, Inc.
Labs
2. Motor Tuner automatically launches the Software Oscilloscope so that you can observe your
motor’s performance as it executes the simulation.
Figure 362. Observe your motor’s performance as it executes the trajectory
3.2.1.3
Summary
In this lab, you performed the following steps to spin your motor under position control:
— Entered basic information about the motor
— Characterized the electrical and mechanical system
— Ran the motor and validated stability
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.2.2
3.2.2.1
Position lab 2: explore other methods for spinning your motor in
KMS
Objective
KMS is intended to allow flexibility for both beginner and expert users. In this lab, spin a motor using
Motor Manager, which is a superset of the functionality available in Motor Tuner, and the Watch Window,
which allows runtime access to MCU variables. Trying these components should allow you to determine
how KMS fits your needs and motor control expertise level.
3.2.2.2
Procedure
1. From the Next Steps page of Motor Tuner, click to open Motor Manager.
Figure 363. Click to open Motor Manager
2. Navigate to the Identify page by clicking on the appropriate diamond in the navigation bar at top
right.
Figure 364. Navigate to identify page
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
212
Freescale Semiconductor, Inc.
Labs
3.2.2.2.1
Basic motor information
1. When using Motor Tuner to get your motor spinning, the first step was to enter the motor’s basic
information. The same is true for Motor Manager.
Enter the basic information for your motor in Basic Motor Parameters.
Figure 365. Enter the motor’s basic motor parameters (TWR sensored example)
3.2.2.2.2
Automatic parameter measurement
1. Motor Tuner applied a voltage to measure the motor’s resistance and inductance, and then rotated
the motor’s shaft at a low speed to measure the rotor flux. Motor Manager does the same thing.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Click to start the motor measurement..
Figure 366. Click to start motor measurement
2. Notice that Motor Manager allows you to adjust the amount of current that is used to measure
resistance and inductance. These values may automatically update during motor measurement if
the existing configuration does not produce a valid result. You may also adjust these values
manually if Automatic Parameter Measurement does not succeed.
Motor Manager also allows you to enable and disable shaft rotation, and to specify the speed used
for flux identification. You may want to disable shaft rotation if your motor is directly connected
to your application and therefore should not be rotated for measurement purposes. Disabling
rotation requires you to manually enter a value for rotor flux on the Advanced Tuning page.
Figure 367. Specify the system parameters to be used to identify motor parameters
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
214
Freescale Semiconductor, Inc.
Labs
3. As Motor Manager measures the motor parameters, they are updated on the screen.
Figure 368. Measured motor parameters
3.2.2.2.3
System inertia measurement
In Section 3.1.1, "Velocity lab 1: spin your motor using Motor Tuner", we learned that Motor Tuner uses
inertia as a direct input to create an appropriate model of the system for advanced control. Motor Manager
does the same. When developing your application, connect the motor to the application inertia (anything
that spins directly with the motor during operation) before running System Inertia Measurement.
1. Click to start the inertia measurement.
Figure 369. Click to start inertia measurement
2. During system inertia measurement, the motor ramps to the rated speed of the motor. By default,
this process is configured to complete in 3.5 seconds.
In some cases, the inertia identification speed and/or ramp time may need to be adjusted to
successfully identify the system inertia. As noted in Section 3.2.1, "Position lab 1: spin your motor
using Motor Tuner", KMS automatically adjusts these settings if the previous attempt does not
succeed.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
You are prompted to retry if the inertia measurement is unsuccessful. In some cases, it may be
undesirable to repeatedly retry system inertia measurement with your application attached (e.g., if
your application is a garage door).
Unlike Motor Tuner, Motor Manager allows you to make manual adjustments to system inertia
measurement configuration.
Figure 370. Specify the configuration parameters to be used during inertia identification
3. After Motor Manager identifies the system inertia, the inertia and friction values are displayed on
the screen.
Figure 371. Inertia, friction, and any errors are displayed
4. KMS updates configuration values based on the measured motor parameters and inertia. These
values can be saved to the Motor Observer reference project (created upon launching KMS)
which can then be edited from your IDE. This happens automatically in Motor Tuner.
In Motor Manager, you must click the Store Motor Information button to push your system settings
into the Motor Observer reference project. You receive a notification that the header file that
contains this information has been saved in a particular location within the directory you defined
after launching KMS. Click OK after receiving this notification.
Figure 372. Store motor parameters in a header file
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
216
Freescale Semiconductor, Inc.
Labs
Figure 373. Notification that system settings have been updated
3.2.2.2.4
Start motor
1. Click on the Position Control page icon in the navigation bar at top.
Figure 374. Navigate to the Position Control page
2. Click Run button to Start Position Control. The motor aligns then enters position control mode.
Figure 375. Click to enable position control
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 376. Motor in position control mode
3. Manually attempt to rotate the motor shaft to feel how strongly it moves back to the goal position
in response to the disturbance you introduced.
Figure 377. Manual disturbance
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
218
Freescale Semiconductor, Inc.
Labs
4. Find the Set Position Regulator Bandwidth step, then click and drag on the knob to increase
Bandwidth until the motor is tightly holding the goal position. If the motor oscillates and is
consequently unable to keep its shaft stationary, reduce the Bandwidth 10-20%.
Figure 378. Adjusted bandwidth for TWR Linix 45ZWN24-40
5. To replicate the default behavior in Motor Tuner, enter a value of 1 into the Full Revolutions field.
Figure 379. Command motor to spin a single revolution
6. Click Generate Position Step to spin the motor a single revolution. Watch the motor to confirm
visually.
7. Click to Stop Position Control
Figure 380. Click to exit position control mode
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
8. Click to open Software Oscilloscope to the Position Plot.
Figure 381. Click to view position feedback plot
9. Click to begin sampling in the plot.
Figure 382. Click to begin sampling
10. To simulate the motion-sensing security camera application, navigate to the Motion Sequences
page.
Figure 383. Click on Motion Sequences page icon to navigate to this page
11. Click to Run application motion sequence.
Figure 384. Click to start security camera motion sequence
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
220
Freescale Semiconductor, Inc.
Labs
12. Use the Software Oscilloscope to view your motor’s performance.
Figure 385. Security camera motion sequence
13. Click to stop sampling.
Figure 386. Click to stop sampling
3.2.2.2.5
Watch Window
While Motor Manager offers more granular control of the core functions performed by Motor Tuner, the
Watch Window goes even further. Via runtime access to MCU variables, the Watch Window can be used
to set in motion the same functions as Motor Tuner and Motor Manager.
However, the Watch Window exercises these functions as discrete elements, instead of as an integrated
system. For example, identifying motor parameters from the Watch Window will not automatically adapt
the motor drive configuration based on updated values, as occurs in Motor Tuner and Motor Manager.
Thus, to use the Watch Window properly, you should have some familiarity with the KMS firmware and
with motor control principles.
1. Click to activate the Watch Window using the button at bottom right.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 387. Click to activate Watch Window
2. Click the Add button at bottom left to show a list of the parsed variables available from the MCU.
Figure 388. Click to add an MCU variable to the Watch Window
3. Scroll down to locate the “user” group, which aggregates variables found in the User module of
Motor Observer firmware. Expand the user group, select “state,” and click to refresh. The variable
user.state is added to the Watch Window.
Figure 389. Add user.state to Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
222
Freescale Semiconductor, Inc.
Labs
Figure 390. User.state added to Watch Window
4. The variable user.state is intended to provide easy access to KMS’ operating modes, including
several that are behind the Motor Tuner and Motor Manager functions you have already seen. To
replicate a part of the motor measurement routine, click the Add button again and find the variable
scm.config.state. Do the same for scm.output.pmFlux.
Figure 391. Add scm.config.state
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 392. Add scm.output.pmFlux
5. The term “scm” refers to variables used in the Self Commissioning module of KMS firmware.
Scm.config.state determines which value the system is trying to measure (resistance, inductance,
or flux), and scm.output.pmFlux is the result of the flux measurement. To run the flux
measurement from the Watch Window, first click the Run button to activate live-updating of the
Watch Window variables.
Figure 393. Click to start live update of the Watch Window
6. Type 3 into the Value column for scm.config.state. This specifies flux as the desired measurement.
7. Type 2 into the Value column for user.state. This tells KMS firmware to run in Self
Commissioning mode - and thus measure flux given the value configured in the previous step.
Figure 394. Start flux measurement from Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
224
Freescale Semiconductor, Inc.
Labs
8. The motor spins and on completion of the measurement, the value for scm.output.pmFlux will
update in the Watch Window. User.state and scm.config.state return to the idle, 0 state.
Figure 395. Updated flux value
9. Click to Stop live updating of the Watch Window. Now add the variable inertia.est.inertiaEst. This
represents the value resulting from the system inertia measurement.
Figure 396. Add inertia estimate to Watch Window
10. Click to Run live updating in the Watch Window. Enter a value of 3 into the Value column for
user.state. This will place the firmware into inertia estimation mode.
11. The motor spins and the value for inertia.est.inertiaEst updates.
Figure 397. Updated inertia value
12. To tune the position controller as in Motor Tuner and Motor Manager, add the variable
position.config.lq20Bw_radps. This is the position regulator bandwidth.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 398. Add position.config.lq20Bw_radps
13. Click to Run live updating in the Watch Window. Enter a value of 10 into the Value column for
user.state. This will place the firmware into position control mode.
Figure 399. Enter user.state value of 10 for position control mode
14. Note the value for position.config.lq20Bw_radps - it should still be at the value you specified in
Motor Manager.
Figure 400. Position controller bandwidth value
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
226
Freescale Semiconductor, Inc.
Labs
15. Validate that the motor rejects the manual disturbance of you trying to rotate the motor shaft.
Figure 401. Attempt to rotate motor to test controller’s ability to hold setpoint
16. Click to Stop updating the Watch Window again. Find and add the variables:
— user.command.posStepInt_mrev
— user.command.posStepFrac_mrev
— user.command.runTrajectory
The first two represent full and partial mechanical revolution commands, respectively. The third
causes the motor to execute the motion defined by the first two.
Figure 402. Position control command variables
17. Click to Run live updating in the Watch Window. Enter a value of 1 into the Value column for
user.command.posStepInt_mrev. Then enter a value of 1 into the Value column for
user.command.runTrajectory and watch motor spin a single revolution.
Figure 403. Commands to spin motor a single revolution
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
18. With Watch Window still live updating, enter a Value of 8 for user.state. Watch as the motor
executes the security camera motion sequence.
Figure 404. Motor in motion sequence mode
19. When the motor stops, click to Stop updating the Watch Window.
3.2.2.3
Summary
In this lab, you have seen that everything that can be done in Motor Tuner can be done in Motor Manager
and by updating firmware variables from the Watch Window. However, more knowledge regarding the
relevant configuration values and firmware variables is required to fully utilize these more advanced
modes.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
228
Freescale Semiconductor, Inc.
Labs
3.2.3
3.2.3.1
Position lab 3: customize for your application with Motor Manager
Objective
With your motor successfully spinning, you can focus on optimizing for your application. In this lab,
expand on the tuning you performed in previous labs to understand the KMS tools and technology that
enable you to achieve superior application control.
3.2.3.2
3.2.3.2.1
Procedure
Assess stationary behavior with different tuning settings
In previous labs, the tuning of the position controller occurred via a quick tactile assessment. While this is
typically sufficient to achieve stable operation of the motor, you may wish to examine behavior more
deeply, especially when connecting an application.
1. Go to the Motor Manager Position Control page and click to activate the Position Plot.
Figure 405. Open position plot
2. Click to begin sampling.
Figure 406. Click to begin sampling
3. On the Position Control page, click to put the motor into Position Control.
Figure 407. Click to start position control
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
4. Enter a Position Regulator Bandwidth of 10% of the maximum allowed value.
Figure 408. Bandwidth 10% of maximum
5. Manually twist the motor shaft and watch the position plot to see the real-time effect: the motor is
clearly not able to hold the desired position and it may oscillate substantially.
6. Now increase the bandwidth to 50% of maximum and twist the motor shaft again.
Figure 409. Bandwidth 50% of maximum
7. Finally, increase the bandwidth to 90% of maximum and twist the shaft.
Figure 410. Bandwidth 90% of maximum
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
230
Freescale Semiconductor, Inc.
Labs
8. Click to stop sampling. Note that the plot provides empirical data for the tuning method described
in Motor Tuner: start with a relatively low bandwidth then gradually turn up the knob until the
motor resists your injection of disturbance and maintains setpoint. But note also that this is a
simplified representation: a real application may go unstable at a certain point in the tuning
process, so it is not advisable to go directly to the maximum bandwidth.
Figure 411. Ability to hold the desired position at different bandwidths
While holding a single set position regardless of disturbance is critical to a position-controlled application,
this is not typically the extent of required functionality. Rather, the application is usually asked to make
transitions from one specific position to another, according to defined kinematic limits and successfully
holding the desired position at each point. So the applicability of the tuning performed in preceding steps
should be validated where the system is asked to move, not just while it is stationary.
9. To start this process, return the Position Regulator Bandwidth to the poor tuning setting of 10% of
maximum.
Figure 412. 10% of maximum bandwidth
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
10. Open the Position Plot and begin sampling.
Figure 413. Click to launch position plot
11. To aid in viewing performance at a granular level, customize this plot. Click on the plot edit
button to open the Plot Definition window.
Figure 414. Edit PosFeedback plot
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
232
Freescale Semiconductor, Inc.
Labs
Figure 415. Plot Definition window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
12. In the Plot Definition window, start by selecting Fill and Stop mode and defining data points to be
collected to be 150. This restricts plotting to better emphasize the motion of a single revolution.
Figure 416. Change to Fill and Stop and define limited data points
13. Define a trigger such that the plot begins sampling only after a certain condition is satisfied. Use
the variable trajpos.output.refSpeed and specify the trigger type Not_equal (when compared to
the default trigger value of 0). This means the plot will begin displaying data only when the motor
is commanded to spin at a non-zero speed.
Figure 417. Define trigger
14. Click the Update button at bottom right to apply these settings.
Figure 418. Update button
15. Click to begin sampling and note that the plot shows “Waiting for Trigger” message, since the
commanded motor speed is not yet non-zero.
Figure 419. Click to begin sampling
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
234
Freescale Semiconductor, Inc.
Labs
Figure 420. Position plot waiting for trigger
16. Start the motor in position control and click to Generate Position Step with the default 1 Full
Revolution.
Figure 421. After starting Position Control, click to Generate Position Step
17. The Software Oscilloscope begins showing data as soon as the commanded motor speed is
different than zero, then stops when 150 data points have been collected.
Figure 422. Sampling completed
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
18. More importantly, note the poor adherence to the commanded motion with this tuning setting: the
green curve (actual motion) diverges sharply from the red curve (commanded motion). This
matches the low performance seen at this tuning setting when trying to twist the motor shaft while
stationary.
Figure 423. Actual motion (green) vs. commanded motion (red) at 10% of maximum bandwidth
19. Change the bandwidth to 50% of maximum.
Figure 424. Bandwidth at 50% of maximum
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
236
Freescale Semiconductor, Inc.
Labs
20. Repeat the test: click to begin sampling, then generate position step (motor should still be running
in position control mode). Actual motion appears to be substantially closer to the desired motion.
Figure 425. Actual motion (green) vs. commanded motion (red) at 50% of maximum bandwidth
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
21. However, there are still disparities. Zoom in on one of these areas, the initial startup sector, by
using Ctrl+ right mouse click & drag.
Figure 426. Right click & drag to zoom in on area of plot
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
238
Freescale Semiconductor, Inc.
Labs
Figure 427. Result of area zoom in
22. Note that actual motion seems to be lagging behind, then catching up and overshooting, then
repeating the cycle. So motion is still not ideal, though much better than at previous tuning
setting.
23. Change the bandwidth to 90% of maximum and repeat the test.
Figure 428. Bandwidth at 90% of maximum
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 429. Actual motion (green) vs. commanded motion (red) at 90% of maximum bandwidth
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
240
Freescale Semiconductor, Inc.
Labs
24. Motion appears improved further. Start to verify this by positioning your mouse on the X-axis at
about the 0.2 value and scrolling the mouse wheel to reduce the scale of the X-axis.
Figure 430. Use mouse scroll wheel to change X-axis scope
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
25. Repeat for the Y-axis: position the mouse near the lower left corner on the Y-axis and scroll the
mouse wheel to reduce the Y-axis scale.
Figure 431. Use mouse scroll wheel to change Y-axis scope
26. Note that while there appears to be similar tracking behavior, the error is even further reduced
from the 50% tuning setting case.
27. Type the A key on your keyboard to revert the plot to its original state.
Now we know that the tuning setting is valid when static and when in motion. But again, this is a simplified
scenario: a real application needs to move more than a single revolution at a time and it may have
requirements on how quickly it must get from point to point. Thus testing must expand to verify different
trajectories.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
242
Freescale Semiconductor, Inc.
Labs
28. Navigate to the Motion Sequences page and find the Trajectory Testing section.
Figure 432. Trajectory Testing step
Trajectory testing allows you to see how different kinematic constraints change the motion of your system
without actually running the motor. This enables you to arrive at trajectories that theoretically meet your
application requirements and can then be validated on the real system.
In this section, use the motion-sensing security camera example: normal operation is a slow pan across its
operating range. By contrast, when motion is sensed, the camera needs to move to the identified position
very rapidly in order to capture what is happening.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
29. Assume (arbitrarily) that when the motor is connected in application, its operating range is 30.5
motor revolutions. Type in values of 30 for Full Revolutions and 0.5 for Partial Revolution.
Figure 433. Enter revolutions
30. Suppose the application requirement is that the camera pans its operating range approximately
every 20 seconds - this is deemed to be the best tradeoff in terms of regularly filming all area
while allowing the camera to focus and provide good picture quality. With default kinematic
limits, how long will the 30.5 revolution movement take? Click the Run Test Trajectory button
and wait for the Trajectory Duration value to update.
Figure 434. Observe trajectory duration
31. Default limits are clearly too fast. Reduce Velocity, Acceleration, and Jerk Limits to 10% of their
default values, then click Run Test Trajectory.
Figure 435. Reduce limits to 10%
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
244
Freescale Semiconductor, Inc.
Labs
32. The Trajectory Duration is now appropriate. Though this is a simplified example, it is
representative of the ease with which you can rapidly iterate to arrive at an acceptable set of
motion parameters.
33. Now verify that the motor can physically perform this motion. Return to the Position Control
page. Type the Trajectory Testing values into the Run & Stop Motor and Set up Position
Trajectory steps.
Figure 436. Enter revolutions
Figure 437. Enter velocity, acceleration, and deceleration limits
34. Open the Software Oscilloscope and click to edit the PosFeedback plot.
Figure 438. Click to edit position feedback plot
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
35. In accordance with the Sampling Rate section settings, 150 data points resulted in plotting for
about 1.5 seconds, so to capture 20.86 seconds of motion requires about 2100 data points.Change
the number of data points being captured to 2100 then click to update plot.
Figure 439. Change number of data points
36. Click to begin sampling in plot, then Start motor in Position Control and Generate Position Step to
trigger the motor’s movement.
37. Observe that the motor turns and watch performance in the Software Oscilloscope. Notice first
that the system appears well controlled: with these kinematic settings and the 90% of maximum
bandwidth value, actual motion (green) matches desired motion (red).
Figure 440. Actual vs. desired motion when rotating 30.5 revolutions
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
246
Freescale Semiconductor, Inc.
Labs
38. Second, notice the manner in which KMS handles position movements: in order to preserve
mathematical integrity for the firmware, KMS uses a windowing system. Instead of counting
commanded position steps incrementally to larger and larger values, which limits precision and
ultimately is bounded by MCU math, KMS works in the range of [-10,10] mechanical revolutions
and resets upon exceeding that range. Thus, when commanding 30.5 revolutions, the motor
rotates from its arbitrary starting location until it hits the upper bound of 10 (in Figure 440,
approximately 19 revolutions), then the position counter resets to -10 while the motor continues to
rotate the final 11.5 revolutions.
Figure 441. Elements of KMS position step windowing system
39. With the normal operating case of the motion-sensing security camera now fulfilled, it is
important to consider the scenario where the camera must pivot very rapidly upon sensing motion.
Suppose the requirement is the camera should be able to transition from one end of the operating
range to the other (the same 30.5 mechanical revolutions) in under one second.
40. Return to the Motion Sequences page and enter test trajectory limits of:
– Velocity Limit: 4000 rpm (rated speed of reference motor)
– Acceleration Limit: 40000 rpm/s (100x the default value)
– Deceleration Limit: 40000 rpm/s (100x the default value)
– Jerk Limit (where Jerk is the rate of change of acceleration): 100000 rpm/s^2 (50x the
default value)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
41. These values produce a Trajectory Duration of 0.965 seconds.
Figure 442. Fast movement test trajectory limits for security camera
42. Now verify that this motion is achievable using the actual motor. Enter these values on the
Position Control page and start position control mode.
Figure 443. Trajectory limits for fast motion
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
248
Freescale Semiconductor, Inc.
Labs
Figure 444. Motor in position control mode
43. Edit the PosFeedback plot to capture 100 data points, since the motion should be complete in
under 1 second.
Figure 445. Capture 100 data points
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
44. Click to Generate Position Step and observe performance of motor as well as plot.
Figure 446. Fast movement for security camera
45. Notice that performance remains good: actual motion tracks desired even though the nature of the
motion is significantly different. Note also the slightly different manner in which the windowing
system affects how motion is displayed: the motor traverses the same 30.5 mechanical
revolutions, but it starts from a slightly different position and completes the motion much more
quickly.
46. Click to stop motor.
Figure 447. Click to stop motor
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
250
Freescale Semiconductor, Inc.
Labs
You have now validated two of the key trajectories upon which your overall application motion sequence
depends. In Section 3.2.5, "Position lab 5: build a simple motion sequence", learn how to build up the
overall sequence from individual components like these.
Furthermore, you have not changed the tuning setting (bandwidth) since you initially performed brief,
tactile testing to arrive at good control. With this single value, you have a well-tuned system operating
across the range of conditions your system is likely to encounter. This is a function of the proprietary
disturbance compensating controller employed by KMS.
3.2.3.3
Summary
In this lab, you performed the following steps to validate operation for your application:
— Visually assessed system control using the Software Oscilloscope
— Explored advanced functionality of the Software Oscilloscope
— Utilized Trajectory Testing to meet motion requirements
— Validated the results of Trajectory Testing in order to start to build up you application motion
sequence
— Examined KMS’windowing system for position control movements
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.2.4
3.2.4.1
Position lab 4: evaluate processor utilization
Objective
While your motor is critical to your application, it is not the only element in your design. Your motor
control objectives may be constrained by other aspects of your design, and in particular, your application
code.
In this lab, examine CPU utilization of the KMS firmware. Change execution rates and operating modes
to determine the processor capacity available for your application code. Observe the tradeoff between
processor usage and motor control operation.
3.2.4.2
3.2.4.2.1
Procedure
Understand usage in the existing configuration
1. Return to Motor Manager by clicking on the control panel icon in the bottom right.
Figure 448. Go to Motor Manager button
2. Navigate to the Advanced Tuning page of Motor Manager (Figure 191)
Figure 449. Advanced tuning page icon
3. Locate the System Frequencies section (Figure 192)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
252
Freescale Semiconductor, Inc.
Labs
Figure 450. System frequencies
4. The three values in this section describe core execution frequencies of the KMS firmware, which
is architected as a dual interrupt service routine (ISR) system to separate motor control operation
from application-focused code. These frequencies, described in Table 11, determine CPU usage.
Table 15. Key frequencies in KMS
Variable
Description
PWM Frequency
Rate at which Pulse Width Modulation occurs
PWM / Fast ISR
Ratio between PWM switching frequency and the rate at which the core
motor control code is executed; the Fast ISR is also known as the PWM ISR
Fast ISR / Slow ISR
Ratio between the rate at which core motor control code and slower
application code is executed
5. The values for these variables depend on the values that KMS identifies during measurement of
the motor’s electrical characteristics. For example, if a low inductance has been measured, KMS
attempts to operate the motor at a faster switching rate than the default values. You may also
manually configure these values.
3.2.4.2.2
Assess CPU utilization using default configuration
1. Given the existing values in the System Configuration section, how much processor capacity is
available for your code? To find out, start by navigating to the CPU Utilization page of Motor
Manager.
Figure 451. CPU Utilization page icon
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
2. Note the different information available:
— Average percent usage of CPU
— Fast ISR cycles
— Slow ISR cycles
— Communication cycles
Figure 452. CPU utilization page
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
254
Freescale Semiconductor, Inc.
Labs
3. Now put the motor back into operation to see how these values change in real-time. Go to the
Position Control page and click to Start Position Control. Enter a value of 200 for Full
Revolutions, then click to run the specified trajectory.
Figure 453. Motor commanded to spin 200 revolutions
4. Quickly return to the CPU Utilization page and observe CPU usage. You have to be quick because
this trajectory takes under fifteen seconds to complete.
Figure 454. Typical usage running Linix 45ZWN24-40 in sensored position control mode
5. Click to Stop Position Control.
Figure 455. Click to stop
3.2.4.2.3
Increase values of execution rates and observe CPU impact
Certain motors may require faster operating frequencies to achieve good performance. In particular, low
inductance motors require usage of higher frequencies for PWM and the Fast (motor control) ISR. If KMS’
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
motor identification routine reveals your motor to be low inductance it will automatically adjust these
values. But this has an effect on CPU usage.
1. To simulate the impact on available CPU of using a low inductance motor, manually change these
frequencies. Return to the System Frequencies section of the Advanced Tuning page in Motor
Manager.
Figure 456. System frequency values
2. Increase the rate at which KMS code executes by changing the values to those listed in Table 12.
Table 16. Execution rate increases
Variable
Current value
Change to
PWM Frequency
10
20
PWM / Fast ISR
1
1
Fast ISR / Slow ISR
10
20
Figure 457. Updated values
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
256
Freescale Semiconductor, Inc.
Labs
3. Changes are highlighted in orange. This indicates updated values that have not yet been sent to the
MCU. Send these values to the MCU by clicking the button to Update Motor Drive
Configuration.
Figure 458. Update motor drive configuration button
4. You may receive a notification that these values may lead to high CPU utilization (Figure 202).
Click Yes to accept.
Figure 459. Notification of high CPU usage
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
5. When values have updated and orange outlines disappear, go to the Position Control page, start
Position Control, enter 200 Full Revolutions, and run trajectory.
Figure 460. Enter revolutions and start trajectory
6. Quickly return to the CPU Utilization page and observe the increase in usage. In Figure 461,
usage has approximately doubled because of the change in operating frequency.
Figure 461. Increased CPU usage
7. Stop the motor on the Position Control page.
Figure 462. Click to stop
3.2.4.2.4
Decrease values of execution rates and observe CPU impact
Just as increasing motor control frequency results in higher CPU usage, decreasing the operating
frequencies leads to lower CPU usage. If your system is not especially dynamic but requires a substantial
amount of application-focused code, you may want to assess how slow you can run the motor control code
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
258
Freescale Semiconductor, Inc.
Labs
while still achieving acceptable motor performance. This experiment enables you to maximize CPU
available for your application code.
1. Return to System Frequencies on the Advanced Tuning page. Change the execution rates in
accordance with Table 17.
Table 17. Execution rate decreases
Variable
Current value
Change to
PWM Frequency
20
5
PWM / Fast ISR
1
1
Fast ISR / Slow ISR
20
5
Figure 463. Updated system configuration
2. Click to Update Motor Drive Configuration (Figure 208).
Figure 464. Update motor drive configuration button
3. When values have updated and orange outlines disappear, go to the Position Control page, enter
Position Control, and generate 200 revolution trajectory.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
4. Note the reduced usage on the CPU Utilization page (Figure 210).
Figure 465. Decreased CPU usage
5. Note also the increase in audible noise of running the motor. This is a consequence of reducing the
execution rate. This is an example of design tradeoff: reducing the execution rate may free up the
processor, but such a choice is typically not without cost
6. On Position Control page, click to stop.
Figure 466. Click to stop
7. Change the System Frequencies back to their default values and click to send these values to the
MCU.
Figure 467. Return to default values
3.2.4.2.5
Change the motor operating mode and observe CPU impact
KMS seamlessly enables different modes of motor operation. Indeed, several different modes are behind
the Motor Tuner wizard process: motor measurement, spinning to rated speed, and simulating an
application constitute three slightly different arrangements of core KMS firmware modules.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
260
Freescale Semiconductor, Inc.
Labs
Since the underlying software is implemented differently for different modes of operation, usage of the
CPU may change based on mode. In this section, explore two such scenarios.
1. On the Position Control page, enter Start Position Control, and run a trajectory of 200 revolutions.
2. Quickly navigate to the CPU Utilization page. (Restart the motor trajectory if you are unable to
complete the following steps before the motor stops.)
3. Find the Reset Maximums section and click to Clear CPU Utilization Max. This clears the values
for Maximum CPU Clock Cycles in the Fast ISR and Slow ISR sections.
Figure 468. Click to reset maximums
4. As the motor runs, observe the CPU usage percentage and the Maximum CPU Clock Cycles for
the Fast ISR. This is your baseline for comparison: normal motor operation.
Figure 469. Normal CPU usage (KDS sensored position
Figure 470. Maximum FAST ISR cycles during normal operation (KDS sensored position)
5. Return to the Position Control page and click to stop the motor.
6. Now assess CPU usage while running an application motion sequence. Navigate to the Motion
Sequences page and click to Start Motion Sequence.
Figure 471. Click to start motion sequence
7. As your motor begins to perform the security camera motion sequence, return to the CPU
Utilization page. Find the Reset Maximums section and click to Clear CPU Utilization Max.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
8. Observe the values update for CPU Usage and Fast ISR Maximum CPU Clock Cycles. Note that
running an application motion sequence adds to the CPU burden. While the difference is not
significant in this case, the burden may increase when running a more complex motion sequence.
Figure 472. Increased CPU usage due to motion sequence (KDS sensored position)
Figure 473. Maximum FAST ISR cycles during motion sequence operation (KDS sensored position)
3.2.4.3
Summary
In this lab, you performed the following steps to observe tradeoffs related to processor utilization:
— Viewed CPU utilization statistics in normal operation
— Changed system frequencies that might need to be switched for your motor
— Spun the motor in different operating modes
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
262
Freescale Semiconductor, Inc.
Labs
3.2.5
3.2.5.1
Position lab 5: build a simple motion sequence
Objective
In this lab, observe how discrete trajectories can be combined to build an application motion sequence in
KMS. Motion Sequence Builder allows you to specify the position steps in your application, define the
speeds at which the steps should occur, and identify the conditions under which your application should
move to the next position.
Use Motion Sequence Builder to create a simple carousel, similar to one that you would see at the dry
cleaner. This carousel has 4 positions, and an operator can press a “button” to advance to the next position.
3.2.5.2
3.2.5.2.1
Procedure
Set up and run desired position movements
1. Launch Motion Sequence Builder by clicking the diagram icon at bottom right.
Figure 474. Motion Sequence Builder icon
2. Motion Sequence Builder displays the default configuration: two states enumerated where one is
the InitialState. Note that you are able to specify the Full and Partial Revolutions for State1. This
will be the case for every state that is added to the plan. Users cannot modify the position values
for the InitialState (Figure 227).
Figure 475. Default Motion Sequence Builder configuration
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3. On the States page, click the Add button three times to add three additional states to the default
configuration.
Figure 476. Add state button
Figure 477. Three additional states
4. Each state should advance the motor by 7.5 mechanical revolutions. Click in the Full Revolutions
column for State1 and type to change the value to 7. Validate that the Partial Revolution for State1
is set to 0.5. Press Enter.
Figure 478. Enter mechanical revolutions for State1
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
264
Freescale Semiconductor, Inc.
Labs
5. Click in cell for Name of State1 and type to change value to Position_1. Press Enter.
Figure 479. Change name of State1
6. Repeat for the remaining states as indicated in Table 18.
Table 18. Change remaining states
State
Full
Revolutions
[MRev]
Partial
Revolutions
[MRev]
State2
7
0.5
Position_2
State3
7
0.5
Position_3
State4
7
0.5
Position_4
New Name
Figure 480. States table after edits
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
7. Check the box in order for your motion sequence to continually run instead of halting upon
returning to the InitialState.
Figure 481. Run repeatedly checkbox
8. Click the Connect States button to connect the defined states in a simple loop (InitialState to
Position_1 to Position_2 to Position_3 to Position_4 to InitialState).
Figure 482. Connect States button
9. Click Yes to accept that clicking the Connect States button overwrites any existing state-to-state
transitions.
Figure 483. Click yes to overwrite existing transitions
NOTE
The Connect States button is most useful at the beginning of a simple design
when interested in validation of motor operation at specified speeds. After
you have specified numerous states and transitions among those states, be
careful when using the Connect States button to avoid overwriting any
desired behavior.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
266
Freescale Semiconductor, Inc.
Labs
10. Observe in your system’s default image viewer a diagram showing the relationships between the
states created by the Connect States button (Figure 484).
Figure 484. State diagram after connecting states
11. Exit the image viewer. Click the Run on Target (bullseye) button (Figure 485) to compile your
KMS reference project with your new motion sequence.
Figure 485. Compile and download to target via bullseye button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
12. A KMS version of the Windows command line appears. Wait while your reference project is
compiled with the relevant Kinetis Software Development Kit libraries. Once you acknowledge a
successful build, the compiled reference project is downloaded to the MCU.
Figure 486. Compiling project using KDS from the command line
Figure 487. Successful compilation
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
268
Freescale Semiconductor, Inc.
Labs
Figure 488. Successful download to MCU
13. Return to the KMS Main Window to wait for KMS to reconnect to the MCU (the command
window operation requires temporary usage of the communication port). Connection is indicated
by green arrows at bottom middle (Figure 489).
Figure 489. Successful connection indicator
14. Activate Software Oscilloscope.
Figure 490. Activate Software Oscilloscope button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
15. Select PosFeedback plot from dropdown menu at bottom left of Software Oscilloscope window
(Figure 245).
Figure 491. PosFeedback plot selection
16. Click Run button (Figure 246) to begin sampling.
Figure 492. Run button in Software Oscilloscope
17. In the KMS Main Window, navigate to the Motion Sequences page in Motor Manager.
Figure 493. Motion sequences page icon active
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
270
Freescale Semiconductor, Inc.
Labs
18. Find the Run Motion Sequence step and click to Start Motion Sequence. This runs the current
motion sequence loaded to the MCU.
Figure 494. Run motion sequence
19. Return to the Software Oscilloscope and watch the motor cycle through the states.
Figure 495. Motor cycling through states
20. Click Stop button to stop sampling in the Software Oscilloscope window.
Figure 496. Click to stop sampling
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
21. On Motion Sequences page, click Stop button to stop the motion sequence.
Figure 497. Button to stop motion sequence
3.2.5.2.2
Make the motion conditional
1. Although the motor is cycling through the proper states, it is not easily controllable. It would be
better for the motor if the motor stopped at each position and required user input to continue.
Return to Motion Sequence Builder. Click on Variables at top left (Figure 498).
Figure 498. Click to go to Motion Sequence Builder variables page
2. Click Add button (Figure 499) to add a variable (Figure 500).
Figure 499. Add button on variables page
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
272
Freescale Semiconductor, Inc.
Labs
Figure 500. Variable added
3. Click on Variable1 cell and rename by typing in Advance_Button and pressing Enter
(Figure 501). Note the Initial Value of the Advance_Button variable is 0.
Figure 501. Name Advance_Button variable
4. Click on InitialState at top left to see further detail about the InitialState.
Figure 502. Link to InitialState page
5. On this page (Figure 503) and corresponding pages for other states, you can define:
– the number of Full Revolutions
– a Partial Revolution
– the Minimum Time the motor remains in this state
– conditions that KMS will evaluate while in this state
– the Actions resulting from a satisfied condition
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
– the Motion Limits for any transition to another state
Figure 503. InitialState page
6. Note that when in the InitialState, the motor is configured to go to Position_1 under NoCondition.
That is, the motor goes to Position_1 as soon as the Minimum Time for the InitialState has
elapsed, without any other condition having to be satisfied.
Figure 504. NoCondition and minimum time configurations
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
274
Freescale Semiconductor, Inc.
Labs
7. To make this transition from InitialState to Position_1 conditional, click the Add button to add a
global if statement.
Figure 505. Add button for global if... statement
8. In the dialog box that appears, make sure the variable Advance_Button is selected, then type in
the Constant field a value of 1. This defines the if statement:
– If Advance_Button equals 1...
Figure 506. If Advance_Button = 1
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
9. Click the Update button to create this if statement.
Figure 507. Update button
10. Navigate to the If column in the If-Then Relationship table and click to expand the dropdown
menu in the cell currently showing NoCondition. Change the value to Advance_Button=1.
Figure 508. Change if column to Advance_Button=1
11. Click the Run on Target (bullseye) button to compile and download your updated motion
sequence to the MCU.
Figure 509. Compile and download to target via bullseye button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
276
Freescale Semiconductor, Inc.
Labs
12. Wait for the command line build to complete and display successful build. Then wait for
successful download.
Figure 510. Compile project
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 511. Download project
13. Return to the Motion Sequences page and click to Start Motion Sequence.
Figure 512. Run button for motion sequence
14. Now that you have made the transition from the initial state to Position_1 dependent on a variable,
the motion sequence is running but the motor is not spinning. To satisfy the condition that
Advance_Button = 1, start by activating the Watch Window.
Figure 513. Watch Window icon
15. Click the Add button to add a variable to the Watch Window.
Figure 514. Add button in Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
278
Freescale Semiconductor, Inc.
Labs
16. Scroll to the bottom of the Available Variables list, click the plus box to expand the group
userPlanVariables, then click to select Advance_Button. Click the Update button to add
Advance_Cutton to the Watch Window.
Figure 515. Select Advance_Button
17. At the bottom of the Watch Window, click the Run button to begin sampling
Figure 516. Run button in Watch Window
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
18. Reactivate the Software Oscilloscope’s PosFeedback plot
Figure 517. Activate Software Oscilloscope button
Figure 518. PosFeedback plot selection
19. Click Run button to begin sampling in Software Oscilloscope.
Figure 519. Run button in Software Oscilloscope
20. Return to the Watch Window. Recall that the motor will only transition from the Initial State if the
Advance_Button equals 1. Set the value of the Advance_Button to 1.
Figure 520. Set Advance_Button = 1
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
280
Freescale Semiconductor, Inc.
Labs
21. Observe the motor executing the motion sequence. The condition Advance_Button=1 is now
fulfilled, so the motor can cycle through the states as it did previously.
Figure 521. Motion sequence where Advance_Button=1
22. Again, however, the behavior is not ideal. The carousel should remain in the current position until
the user advances it to the next position. In other words, each transition from one position to the
next should be conditional based on button behavior. Navigate to Motion Sequence Builder and
click on the Position_1 state.
Figure 522. Position_1 state
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
23. Click on cell in If-Then table currently showing NoCondition and select the dropdown option
Advance_Button=1.
Figure 523. Apply Advance_Button=1 condition to Position_1 state
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
282
Freescale Semiconductor, Inc.
Labs
24. Repeat for remaining states
Figure 524. Apply Advance_Button=1 and trajectory limits to Position_2
Figure 525. Apply Advance_Button=1 and trajectory limits to Position_3
Figure 526. Apply Advance_Button=1 and trajectory limits to Position_4
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
25. This means that the motor advances to the next state only if Advance_Button=1. But if
Advance_Button is not reset after each successful transition, the motor cycles through all states as
before (Advance_Button is perpetually equal to one). To reset the Advance_Button, click the Add
button next to the global then... statements list.
Figure 527. Add button for global then... statements
26. To specify the reset of the Advance_Button, perform the following configuration steps:
– click on the “Set equal to:” button
– enter a value of 0 in the blank field
– select the radio button “Upon exiting the state”
Figure 528. Define reset action
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
284
Freescale Semiconductor, Inc.
Labs
27. Click the Update button to create this reset action.
Figure 529. Create reset action
28. Click on InitialState, then click to add new row to if-then table.
Figure 530. Add row to if-then table for InitialState
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
29. In the new row, click on the dropdown arrow in the “Then” cell and select Advance_Button=0
OnExiting.
Figure 531. Select Advance_Button=0 OnExiting
30. Repeat for all other states. After you leave a state, Motion Sequence Builder may reorder the
if-then table to reflect its internal order of evaluation.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
286
Freescale Semiconductor, Inc.
Labs
Figure 532. Reset Advance_Button for all other states
31. Click the State Diagram button to see the representation of the conditional transitions to different
speeds and the resetting of the Advance_Button variable.
Figure 533. State diagram button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 534. Diagrammatic representation of motion sequence
32. Click bullseye button to compile and download to MCU. Follow the KMS command window
directions then wait for KMS to reconnect to the MCU.
Figure 535. Compile and download to target via bullseye button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
288
Freescale Semiconductor, Inc.
Labs
33. Activate Software Oscilloscope, select PosFeedback plot, and click Run button to begin sampling.
Figure 536. SpeedFeedback plot active and sampling
34. Navigate to the Motion Sequences page and click Run button to Start Example Motion Sequence.
Figure 537. Run motion sequence
35. Activate Watch Window and click Run button to begin sampling. Note the value for
userPlanVariables.Advance_Button.
Figure 538. Click to begin Watch Window sampling
36. In the Value cell for the variable userPlanVariables.Advance_Button, type in a new value of 1.
Observe:
– the motor advances to next state
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 539. Motor moving to next position
– userPlanVariables.Advance_Button automatically returns to a value of 0.
Figure 540. Advance_Button is set to zero
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
290
Freescale Semiconductor, Inc.
Labs
37. Continue to type in a value of 1 for userPlanVariables.Advance_Button to cycle through the states
of your motion sequence.
Figure 541. Cycle through all states
38. Click to stop sampling in SpeedFeedback plot and Watch Window, and click to stop motion
sequence.
3.2.5.3
Summary
In this lab, you have used Motion Sequence Builder to construct a simple motion sequence approximating
the behavior of an industrial carousel. You have defined
• states where your motor should hold its position
• conditions under which your motor should move from state to state
• user interaction to allow for external triggering of motion
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
3.2.6
3.2.6.1
Position lab 6: connect your motor to the real world
Objective
When building an application, you must base changes in motion on real-world inputs such as switches,
pushbuttons, sensors, etc. You may also want to activate real-world outputs such as LEDs, valves,
actuators, etc. through the motion plan.
In this lab, the simulated Advance_Button in the Simple Carousel plan is associated with a pushbutton
located on the Freedom and Tower Control Boards (Figure 542).
NOTE
No pushbutton exists on the HVP Control Board (HVP-KV31F120M) for
safety precautions. As a result, this lab cannot be fully performed on the
High Voltage platform.
Figure 542. FRDM-KV31F control board
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
292
Freescale Semiconductor, Inc.
Labs
Figure 543. TWR-KV31F120M control board
3.2.6.1
Procedure
1. Launch your IDE. The steps to open a KMS project for KDS and IAR are slightly different:
— For KDS
– Launch KDS using the desktop icon
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
– Define a workspace named “kms” (Figure 544).
Figure 544. KDS default workspace selection
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
294
Freescale Semiconductor, Inc.
Labs
– From the File menu, select Import...
Figure 545. Import menu in KDS
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
– Expand the folder named General, select “Existing Projects into Workspace,” and click
Next.
Figure 546. Import existing projects
– Click the Browse... button and navigate to the parent directory of the KDS project you
created upon starting this KMS session. The default path is:
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
296
Freescale Semiconductor, Inc.
Labs
C:\Users\<user_name>\Documents\KMS_1.0.0\SavedProjects\<platform>_<control
type>_KDS_<reference project version number>
Figure 547. KMS project directory
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
– KDS identifies the valid KDS project in the specified directory and lists it in the Projects
section. Click Finish.
Figure 548. KDS KMS project
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
298
Freescale Semiconductor, Inc.
Labs
– If necessary, at top left, click the Restore button to be able to see the project contents.
Figure 549. Restore button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 550. KMS project in the project explorer
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
300
Freescale Semiconductor, Inc.
Labs
– Expand the project and the “src” directory, then find the main.c file.
Figure 551. Main.c file in expanded project
– Proceed to step 2 in this section (skipping the IAR project information).
— For IAR:
– Find and double-click to open the IAR workspace that was created when you selected a
configuration upon launching KMS. The default directory path is:
C:\Users\<username>\Documents\KMS_1.0.0\SavedProjects\<platform>_<control
type>_IAR_<reference project version>\iar
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
– Expand the KMS project and open main.c.
Figure 552. Reference project structure with main.c highlighted
2. Include the Motion Sequence Builder header file in main.c. This allows main.c to interact with the
Motion Sequence Builder structures.
To do this: near the top of the main.c file you find a series of include instructions. Add the following
statement after the last #include statement.
#include "MotionSequencePos.h" /* PLAN INT */
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
302
Freescale Semiconductor, Inc.
Labs
Figure 553. Include statement in KDS
3. In order to check the status of the button, the code must be added to the forever loop. Find near the
bottom of main.c the following comment (it is easiest to search for the string service softreset).
/*Service SoftReset Requests from KMS*/
4. The Advance_Button should be connected to SW2. By default, when SW2 is pressed, its value =
0. The Carousel plan expects that the signal = 1 when the button is pressed. The following code
reverses the button signal so that the carousel goes to the next speed when SW2 is pushed.
Type the following code in main.c before the /*Service SoftReset Requests from KMS*/ comment.
Note that the IDE is case sensitive and be careful with any copy-paste, as accidental characters may
affect compilation.
//PLAN INT
/* Switch is active Low but we want active high logic */
if (GPIO_DRV_ReadPinInput(kGpioSW2) == 0)
{
userPlanVariables.Advance_Button = 1;
}
else
{
userPlanVariables.Advance_Button = 0;
}
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 554. Code implementation for button behavior in KDS
5. Save main.c
6. Return to Motion Sequence Builder in KMS. Download the Simple Carousel plan to the MCU by
clicking on the bullseye in the Source Code generation page of Motion Sequence Builder
(Figure 308). This action re-saves the motion sequence .h and .c files, recompiles the code using
the new main.c file, and downloads the revised code to the MCU.
Figure 555. Compile and download to target button
NOTE
If using IAR, make sure that your license is activated. The code cannot
compile unless a valid and active IAR license is found.
7. If your updated project fails to compile, the command window displays a failure message and
KMS notifies that the project should be built again. In this failure case, check the code added by
hand for small copying errors (e.g., missing semicolon or case mismatches), then click the
bullseye again to rebuild and download.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
304
Freescale Semiconductor, Inc.
Labs
8. Once the motion sequence has successfully compiled, downloaded to the MCU, and KMS
reconnects communication, navigate to the Motion Sequences page and activate the plan by
clicking on the Start Motion Sequence button.
Figure 556. Run plan
9. Activate the Software Oscilloscope by clicking on the Run button. The message “Waiting for
Trigger” should appear.
10. Press firmly and hold SW2 on the Control Board until the motor begins turning. Note that this
causes the carousel to move 7.5 revolutions from its initial position, just as it did when the
Advance_Button was activated through the Watch Window.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
11. Verify that the carousel ramps to the next position each time SW2 is pressed. Press SW2
iteratively to cycle through all positions. Stop plotting. The position plot should look similar to
the one shown below, but note that the initial position of your motor may be different, leading to
different rollover points.
Figure 557. Carousel plot behavior
12. Click to stop the plan.
Figure 558. Stop motion sequence
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
306
Freescale Semiconductor, Inc.
Labs
3.2.7
3.2.7.1
Position lab 7: make your application stand alone
Objective
Eventually, the application must reside outside the KMS environment - the carousel won’t always be
connected to a computer!
In this lab, the requirement of communication with the KMS GUI for motor operation is eliminated and a
second button is implemented to allow control of motor operating state from the Control Board.
3.2.7.2
Procedure
1. Return to the IDE workspace that you used in the previous lab.
2. Open the file drv.c.
Figure 559. drv.c file location in KDS workspace
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 560. drv.c file location in IAR workspace
3. Find the code snippet below:
/**
* @var
user
* @brief
USER block
*/
static USER_t user;
Figure 561. Code snippet for USER block in KDS workspace
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
308
Freescale Semiconductor, Inc.
Labs
4. Delete the word ‘static’. This allows the USER block, which controls the motor operating state, to
be accessed elsewhere.
Figure 562. Revised code snippet for USER block (KDS)
Figure 563. Revised code snippet for USER block (IAR)
5. Save drv.c.
6. In the same IDE workspace, return to the main.c file that you used in the previous lab to set up the
button. Search for the following code snippet:
/* Seconds Before Comm Timeout (if enabled)*/
static const bool commTimeOutEnabled = true;
static const uint16_t commTimeOutSeconds = 4;
Figure 564. Code snippet for communication with KMS GUI (KDS)
7. Change static const bool commTimeOutEnabled from ‘true’ to ‘false’. This allows the motor to
continue running even when not connected to the KMS GUI.
Figure 565. Revised code snippet for communication with KMS GUI (KDS)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
8. Find the following comment just a few lines below:
Figure 566. Comment (IAR)
9. Immediately above this comment, add the line of code as shown below. This allows main.c to
access motor operating states defined in the USER block.
extern USER_t user;
Figure 567. Code implementation for extern (KDS)
10. Return to the code you implemented in the previous lab (repeated below for emphasis):
Figure 568. Code for first button (KDS)
11. Just beneath this code (before /* Service SoftReset Requests from KMS */), add code to define a
second button to control the motor operating state:
/* Switch is active Low but we want active high logic */
if (GPIO_DRV_ReadPinInput(kGpioSW3) == 0)
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
310
Freescale Semiconductor, Inc.
Labs
{
user.state = USER_RUN_PLAN;
}
Figure 569. Code implementation for second button (KDS)
12. Save main.c.
13. Now use normal IDE procedures to compile and download your amended code to the MCU.
— For KDS:
– Right click on the KMS project file and select Build Project. Ensure that the project
compiles successfully.
Figure 570. Build KMS KDS project
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
– Now that the project is compiled, it needs to be downloaded to the target device. Click on
the Debug dropdown and select Debug Configurations.
Figure 571. Select debug configurations
– Select your debugger, in this case it is GDB PEMicro Interface Debugger. Double click the
GDB PEMicro Interface Debugger. Under the Debugger tab, set the Interface for OpenSDA
Embedded Debug - USB Port.
Figure 572. Select proper debugger and interface
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
312
Freescale Semiconductor, Inc.
Labs
– Next select the device that you are using.
Figure 573. Select appropriate MCU
NOTE
At bottom of Debugger tab, ensure that Mass erase on connect is NOT
checked. This is critical because mass erase removes preprogrammed KMS
code on the MCU that cannot be restored in the field.
Figure 574. Prevent mass erase on connect
– Click Apply then Debug. Kinetis Design Studio will download your project to the target and
begin to run the debugger. When finished, click to stop the debugging.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
Figure 575. Click to stop debugging
– Skip IAR information and proceed to next numbered step.
— For IAR:
– Ensure that your IAR license is active and that Release mode is selected.
Figure 576. Choosing release mode in IAR
– Right click on the KMS project and select Make to compile.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
314
Freescale Semiconductor, Inc.
Labs
Figure 577. IAR make command
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Labs
– Once compiled, select the Download and Debug icon to send your code to the MCU.
Figure 578. Download and debug button
– When your MCU has been programmed, click to Stop Debugging.
Figure 579. Stop debugging button
14. Now your MCU is ready to act alone. Press firmly and hold the 2nd button (SW3) until you see
the motor shaft briefly moves to align. Your motor enters the Run_Plan state. Press firmly and
hold the 1st button (SW2) until the motor starts to spin, then iteratively press to cycle through the
various position states shown in the previous labs.
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
316
Freescale Semiconductor, Inc.
Labs
15. Once you have cycled through your position states, press the physical reset button to conclude
active motor operation.
Figure 580. FRDM physical reset button
Figure 581. TWR physical reset button
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
Freescale Semiconductor, Inc.
Kinetis Motor Suite Lab Guide
Revision history
4
Revision history
Table 19 provides a revision history for this document.
Table 19. Document revision history
Rev.
number
Date
Substantive change(s)
0
02/2016
Initial release
Kinetis Motor Suite Lab Guide, Rev. 0, 02/2016
318
Freescale Semiconductor, Inc.
How to Reach Us:
Information in this document is provided solely to enable system and software
Home Page:
freescale.com/kinetismotorsuite
implementers to use Freescale products. There are no express or implied copyright
Web Support:
freescale.com/support
information in this document.
licenses granted hereunder to design or fabricate any integrated circuits based on the
Freescale reserves the right to make changes without further notice to any products
herein. Freescale makes no warranty, representation, or guarantee regarding the
suitability of its products for any particular purpose, nor does Freescale assume any
liability arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including without limitation consequential or incidental
damages. “Typical” parameters that may be provided in Freescale data sheets and/or
specifications can and do vary in different applications, and actual performance may
vary over time. All operating parameters, including “typicals,” must be validated for
each customer application by customer’s technical experts. Freescale does not convey
any license under its patent rights nor the rights of others. Freescale sells products
pursuant to standard terms and conditions of sale, which can be found at the following
address: freescale.com/SalesTermsandConditions.
Freescale, the Freescale logo, and Kinetis are trademarks of Freescale
Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Tower is a trademark of Freescale
Semiconductor, Inc. All other product or service names are the property of their
respective owners. ARM is a registered trademark of ARM Limited (or its subsidiaries)
in the EU or elsewhere.
© 2016 Freescale Semiconductor, Inc.
Document Number: KMS100LG
Rev. 0
02/2016
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

advertisement