RoadTest: New Year's Grab Bag RoadTest
Author: weiwei2
Creation date:
Evaluation Type: Development Boards & Tools
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?: Renesas RAJ30600
What were the biggest problems encountered?: Unclear which firmware to replace on board. Unsure how to check whether item such as KMS is still intact on my board. Unable to retrieve some example files listed on the application note (such as the PMSM reference design having different directory structure look and field)
Detailed Review:
Opening
I like the colourful quick reference card that comes with both the FRDM-KV31F and FRDM-MC-LVPMSM
both provide the quick url to the jump start the design on one side of the quick reference card, and the legends of all the pinout on overleaf. One thing i can recommend to add is the IO voltage level, whether it is 5V or 3.3V.
But actual dealing with the board later is pretty challenging.
Introduction
First, let's understand what is PMSM and what is BLDC. The reason i state this is this is somewhat confusing. For some external reference, look at the discussion on https://www.researchgate.net/post/What_is_the_difference_between_BLDC_and_PMSM_motors
In short, PMSM motor (also can be referred as Brushless AC motor) is similar to Brushless DC (BLDC) Motor, in that they have the same structure and the same components. Both motors have permanent magnets in the rotor that interact with the magnetic field produced by the stator coils. PMSMs have a different Back-Electromotive Force (BEMF), since the flux linkage between the stator and the rotor is not trapezoidal. In the PMSM, the BEMF is sinusoidal. This is an intentional effect produced by the way the coils in the stator are wound (in a sinusoidal fashion), while in the BLDC motor the stator coils are evenly wound.
PMSM | BLDC |
---|---|
distributed stator windings (coils spanning more than one tooth) | The geometry of the windings in a BLDC motor give it a trapezoidal back EMF waveform. Image credit: Monolithic Power Systems
concentrated stator windings (coils wound around each tooth) |
the difference windings decide which commutation control algorithmn can be used for each type of motor
Some control terminologies are:
Also known as vector control. This is a method in which the current vector (magnitude and direction) is determined relative to the rotor, rather than on the basis of sine waves, as is done in sinusoidal commutation. While sinusoidal commutation has low efficiency at high speeds, FOC provides high efficiency across a wide speed range, as well as very smooth motion.
in theory, the BLDC motor’s back EMF is trapezoidal, in reality, the back EMF waveform is not purely trapezoidal. Inductance in the motor smooths the back EMF into a more sinusoidal shape. And since the back EMF is more sinusoidal than trapezoidal, it is possible to use sinusoidal commutation with BLDC motors. This requires the addition of an encoder or resolver to accurately track the rotor position, which adds cost to the system, but it results in significantly reduced torque ripple.
PMSM is typically controlled with FOC and sinusoidal control algorithmn, while BLDC motor can be controlled by trapezoidal, sinusoidal and FOC.
source: http://www.ti.com/lit/an/sprabz4/sprabz4.pdf
The FRDM_MC-LVPMSM has the features below
The board is suitable for sinusoidal control algorithms (FOC). It is using Fairchild half-bridge gate drivers & power MOSFETs. The FDMS8090 100 V dual N-channel power MOSFETs (@10A continuous drain) are driven by FAN7888MX 3ch half bridge gate driver.
FAN4852IMU8X low power amplifier
The 5.5VDC auxiliary power supply statement is intriguing, considering that the FRDM-KV31F is mentioned to use 3.3V in the table below. A further check on Freedom FRDM-MC-LVPMSM Development Platform User’s Guide provides no further information. It is not so straightforward to navitage the wealth of documentation. In fact i end up finding the documentation is really on the downside as there is a lot of missing information and confusion.
It is also listed as compatible with FRDM-KV31F and FRDM-KV10z. The former is Cortex-M4 based while the latter is lower end Cortex-M0+ based
FRDM-KV31F | FRDM-KV10z |
---|---|
|
|
I am not familiar with the OpenSDA, but reading about it on https://www.nxp.com/support/developer-resources/run-time-software/kinetis-developer-resources/ides-for-kinetis-mcus/open… gives more confusion than good. It is stated below
*Note: During development of OpenSDAv2 the reserved bootloader space was found to be too small. Thus a new version of OpenSDAv2 was subsequently released and named, OpenSDAv2.1.
after crosschecking, i am looking at the JLink (look at getting started below where after following forum, it is stated that we need to replace with Segger JLink debug version of the openSDA), its version is 2.1 (as stated on https://www.segger.com/products/debug-probes/j-link/models/other-j-links/opensda-sda-v2/ ) for FDRM-KV31F
getting started
Quick start guide lead us to freescale.com/FRDM-KV31F (redirect to https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/freedom-development-boards/mcu-boards/… )
likewise, the quick start guide http://freescale.com/frdm-mc-lvpmsm will redirect to https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/freedom-development-boards/mcu-boards/… )
as this board is pretty old (> 3 years) and before NXP's acquisition, the documentation can be misleading (which version of software is needed)
from the quick start card of FRDM-KV31F, Some further browsing on the listed application BLDC will lead us to https://www.nxp.com/applications/solutions/internet-of-things/smart-things/motion-and-motor-control/brushless-dc-bldc-mo… for a list of BLDC motor applications
One of them, for example is https://community.nxp.com/docs/DOC-340767 hands-on training for Kinetis motor suite. Although listed as BLDC
In short, at a glance, the documentation, although it does not directly point out the care to be taken by starting out with a 3 year old board, contains sufficient wealth of information. This is useful for a user to get started with the platform.
Hardware Setup
The FRDM-MC-LVPMSM is connected to the MCU in this manner.
from the hands-on training for KMS, the hardware connection is as below. however, my enumerated board is not the same as the screenshot (only shows two files - details.txt & mbed.html)
Note: doesn't matter with the firmware version as i have decided to just use refer to the wiring setup and not use KMS. KMS is kinda depreciated (refer to https://community.nxp.com/thread/495220 )
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.
Software Setup
credit to a fellow roadtester stevesmythe, he has pointed out of the new year grab roadtest start page forum https://www.element14.com/community/allRoadTestReviews/2015#recentReviews (Apr 3, 2019) on the installation of the necessary SDKs
(one has either the choice of KMS or MCUexpresso). So, i basically avoided the installation fiasco.
Here is what he mentioned
The KMS firmware embedded in the FRDM-KV31F board is around three years old I think and won't work with MCUXpresso. You will need to work with Kinetis Design Studio, and it needs to be v3.0.1, NOT the final version (3.2). You will also need the KDS SDK v1.3.0. and Kinetis Motor Suite desktop software v1.1.0.
First, you need to have the correct boatloader to work with the KMS software. When you plug your FRDM-KV31F board into a PC's USB port, it will either enumerate as MBED <drive letter> or FRDM-KV31F <drive letter>. Mine came with the MBED bootloader and that won't work with KMS. If you want to use KMS, you'll need to change it, following the instructions on this page.
Once you have the correct bootloader, you can go ahead and install the software listed above. Oh, and you'll need a power supply for the motor controller board. The motor is rated at 24v-40v 2.5A. It will work with less, but the KMS software may complain.
If you don't want to use Kinetis Motor Suite, you don't have to worry about any of the above. You can use MCUXpresso (the latest SDK has an example motor control project).
[Addendum] After installing KDS v3.0.1, remember to go to Help->Check for Updates and tick/install everything. This is important as it updates the debugger software and ensures that KMS is not erased from the board. n.b. Other combinations of KMS/KDS/MCUXpresso may also work but I haven't tried them yet.
like Steve's, mine also come with the MBED bootloader (with the tri colour LED keep changing colour). Clicking on the MBED webpage on the state my board is FRDM-K22F (which is puzzling). However the "Oh no!" post below from this page does say we need to install the mbedWinSerial.exe
i did a crosscheck on device manager and the MBED is not enumerated as serial port device
After installing MBED windows serial communication https://os.mbed.com/handbook/Windows-serial-configuration , the MBED is successfully enumerated (COM4 in my case)
A check on the link provided by Steve from this page sounds alarming
OH NO!
It has come to my attention that a batch of FRDM-KV31F MCU boards, were shipped to people, programmed with MBED OpenSDA firmware.
The Kinetis Motor Suite GUI scripts load the reference project image into the KV31F MCU flash using the MSD programming built into the P&E Micro firmware. It specifically looks for the FRDM-KV31F MSD drive. NXP moved away from the MBED firmware to eliminate the mass erase possibilities that could occur.
The FRDM-KV31F does not appear on these MBED boards. In fact, unless you have run the mbedWinSerial.exe installer found here, or get the latest driver herethe mbed serial port will not enumerate. Plug in your FRDM-KV31F board and run the installer. But let's not stop there. We want to make sure you don't mass erase your MCU and blow away the KMS execute only library stored in the MCU's flash.
Let me give you a work around for now. Any MBED enabled FRDM board will still work with KMS, but you should use the Segger JLINK debug interface. It will not mass erase your KMS firmware like the MBED debug interface can.
while it is mentioned that FRDM-KV31F will not have this MBED OpenSDA firmware, mine is obviously having it. Wei follow the guide above to replace the openSDA with Segger JLink debug interface from this page
https://www.segger.com/products/debug-probes/j-link/models/other-j-links/opensda-sda-v2/
We setup the SEGGER J-Link as below
after installation, i find i have 2 J-Link version (i believe one of them might be installed by MCUXpresso
after doing this segger J-Link step, we then have to change the firmware. It is this step that causes the most confusion as i am unsure which firmware to use
As shown in the screenshot below, we download the software and the OpenSDA image from https://www.segger.com/downloads/jlink/#JLinkOpenSDABoardSpecificFirmwares
the file above is 64KB
After much confusion, i have followed the step by I have successfully use 51KB firmware JLink_OpenSDA_V2_1.bin which can be downloaded from the post by Philip Drake on https://community.nxp.com/thread/495220
Kinetis® Motor Suite
from the quick start card of FRDM-MC-LVPMSM, the listed tool is Kinetis Motor Suite (KMS), although from various forum sources, this seems a risky step as it is older and tends to mass erase. I have decided to try MCUXpresso first, although it lacks the tuning capability. In fact from https://community.nxp.com/thread/495220 , it is mentioned KMS is not longer supported by NXP. Hence i decide to use it after able to test out MCUXpresso
To get KMS, we go to https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/kinetis-cortex-m-mcus/v-serie… , then move on to https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/kinetis-cortex-m-mcus/v-serie… , it will prompt for login. I install version 1.2.0. Note that my MCUXpresso (featured in next section) is 10.3.1
The getting started guide video on https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/kinetis-cortex-m-mcus/v-serie… is pretty useful (although the packaging box is clearly newer than mine)
Anyhow, by following the lab1 of the https://community.nxp.com/docs/DOC-340767 ,
MCUXpresso
This is the latest recommeded supported IDE. We start with https://mcuxpresso.nxp.com/en/welcome , we can search for our board and it will list down the steps needed
This is to download the necessary SDK
pressing Build MCUXpresso will lead to the page below
We then add the PMSM example
Download the MCUXpresso
to use the SDK, we need to download the IDE https://www.nxp.com/support/developer-resources/software-development-tools/mcuxpresso-software-and-tools/mcuxpresso-inte…
i download 10.3.1
we drag the downloaded SDK to the view, click ok and we will have the sdk shown in the Installed SDKs
we can then import the SDK example
we need to select Redirect printf(scanf to UART)
After successful loading, the main.c looks like as below. It should be able to be built successfully
we then press debug. with MBED windows serial configuration installed, we will see this
click ok and with successful debug we will reach here
sadly, proceeding beyond this doesn't move the motor. So i have to change the firmware to J-Link and redo it. with J-Link. I load the hello world example instead of the PMSM. it will find a new probes for debug
i then encounter this screen that appears only shortly and i am not able to put a reply, until it has error.
To resolve this error, i restarted the pc. Then it is fine, i have enough time to press accept and it no longer has error. The debug settings is the "debug using Segger J-Link probes
if we don't set the "Redirect printf(scanf to UART)", the hello world be output to the console
The serial port will shows this if we click resume.
After verifying that the board indeed reponse, we change back to the PMSM demo. One of the biggest problem is the red led light up and the motor is not turning. It takes me quite some time to realize that i need to press the button SW2 in order to start running properly.
successful steps i have is following some of the steps mentioned in https://www.nxp.com/docs/en/user-guide/FRDM-KV31FQSG.pdf
on the page i paste below. The only way to make the green LED light up instead of RED is to follow these steps.
The motor is turning eventually.
Freemaster and Kinetis Design Studio
i got this again from a forum posted by Steve, on https://community.nxp.com/thread/495220
The next step is to get the PMSM reference design software from here and the FreeMaster tool here These installations still rely on the Kinetis Design Studio IDE. These are being ported to the latest IDE MCUXpresso later this year.
Kinetis Design Studio version used is 3.0.1 (after update) , while Kinetis SDK is 1.3.0. Upon install we update it
upon running the build in example of PMSM with MCUExpresso, we follow instruction in https://www.nxp.com/docs/en/user-guide/KMSUG.pdf to try tune the motor
Summary
Although originally i do want to find out whether it can be run with Arduino, the complexity running it on its own platform implies that it won't run with a typical Arduino board, as the library is very different.
Pros
the FRDM-MC-LVPMSM requires no jumper based settings. This is a good design as often the jumper settings requires care and may lead to board damage.
Cons
the documentation is very confusing, despite its wealth of information. For example, https://www.nxp.com/docs/en/application-note/AN12374.pdf mention about PMSM reference design but does not tell where to get it. Attempting to download by searching ourselves yield a directory structure which is different and we are not sure if it is correctly installed.
KMS is only available from factory. User is not able to reprogram the KMS itself. Note: KMS is not supported by NXP anymore
It lack detailed documentation on how to use freemaster with KDS
Brief comparison with other BLDC & PMSM evaluation kit
Renesas BLDC motor control
i have use Renesas https://www.renesas.com/tw/zh/products/ics-for-motor-actuator-driver/ics-for-motor-control.html for trapezoidal BLDC. It also have some precautions on matching of IDE version and an external FPGA based debugger tool (ICS) that can collect and log signal in real-time, but not as complicated as Kinetic Motor Suit.
Epilogue
for the past few years since 2013, i have dealt with a number of motor control projects. The biggest is the research project i lead with the German MNC in BLDC for power tool. We have tried out 3 different MCU brands throughout and currently in its extension we are trying out Infineon.
Hence i want to do broad motor control eval kit comparison. To be fair, they are not exactly the same as all my previous such attempts are BLDC, a cousin of the PMSM in this roadtest
the common items to roadtest is the wealth of documentation, the ease of running the board with its intended IDE, the clarity of the examples, the performance (this is subjective and to be frank, is not something i have standardize so far), its debug capability (one cannot single step during the commutation cycle, for example, but different vendor has different means of doing debug or logging), the east of writing firmware for the board (aka some of my other boards have device driver wizard)
i also want to test if the FRDM-MC-LVPMSM which has arduino footprint, can be used with Arduino. Seriously, the arduino world lacks a serious BLDC (and to some extend PMSM) shield
i plan to also attach the board to a simple project as demo as the best use case for an eval board is to use it in a demo application. i have some simple project in mind like motorized scissor or simple trajectory control for camera rotation
on a extended perspective: i want to provide some review of doing motor control via Model Based Development(MBD)-> that means simulation based design which is the important use case for engineer to develop complex motor based system
such as automotive and industrial automation. i have access to software like Altair Embed that can complete the firmware design via IDE. i intend to show some level of simulation for the roadtest
however, a full MBD review might not have enough time partly because although cortex M3 and M4 is supported by Embed, this Kinetis board is not a supported board (means with all the driver mapped)
References
https://www.element14.com/community/allRoadTestReviews/2015#recentReviews
[1] MCUXpresso online reference manual https://mcuxpresso.nxp.com/api_doc/dev/942/
[2] https://www.motioncontroltips.com/faq-trapezoidal-back-emf/
[3] https://www.motioncontroltips.com/faq-sinusoidal-emf-sinusoidal-current/ contains a link to TI's tutorial video on PMSM vector control
[4] https://www.ecnmag.com/article/2009/10/comparing-motor-control-techniques
[5] FRDM-KV31F https://www.nxp.com/docs/en/user-guide/FRDM-KV31FQSG.pdf
[6] PMSM Field-Oriented Control on FRDMKV31F with Hall and Encoder Sensors https://www.nxp.com/docs/en/application-note/AN12374.pdf
[7] Kinetis Motor Suite v1.2.0 Lab Guide https://www.nxp.com/docs/en/supporting-information/KMSLG.pdf
Work Planned but not carried out
motorized scissor version 2 -> to fit this motor to my motorized scissor
comparison with other BLDC and PMSM board --> underestimated the effort needed to follow the example for kinetic motor suit
Top Comments
Nice review of the this product. This looked like an interesting but tough to test product. It seemed as if this one caused you to work very hard.
Gene
Thanks for the mentions!
I think using MCUXpresso is a good decision with this kit. Otherwise it is quite confusing working out what works and what doesn't. It's worth looking at Freemaster if you have…
actually i am still kinda trying to figure out whether my onboard KMS is missing as what you posted, though i have never able to run it with KMS. Ya, Freemaster is the only way going forward as it seems…