RoadTest: New Year's Grab Bag RoadTest
Author: stevesmythe
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?: None
What were the biggest problems encountered?: Wrong bootloader provided on KV31F. Software/firmware incompatibilities. Out of date support materials.
Detailed Review:
Thanks to element14 and NXP for providing me with the NXP FRDM-KV31F Motor kit to review.
For the RoadTest, element14 provided three things: a Linix 3-phase Permanent Magnet Synchronous Motor (PMSM) together with a FRDM-MC-LVPMSM motor controller board and NXP FRDM-KV31F development board.
{gallery} Opening the box |
---|
![]() |
![]() |
![]() |
I was interested in this roadtest because I have never used a PMSM motor before and I liked the look of the Kinetis Motor Suite (“KMS”), which allows you to “tune” your motor to suit the speed profile and load requirements of your project. My roadtest objectives were to explore how to use KMS with the Linix motor and FRDM board combination as the basis for future projects. As I don’t have a particular application in mind at the moment, I decided to connect the motor to some Meccano (a.k.a. Erector in the USA) to allow a general-purpose evaluation of the hardware and software. As this particular RoadTest was of the "grab bag" variety, I was not expecting this to be the latest equipment or software and I was just hoping to get something working.
The FRDM-KV31F board is one of the FRDM range of boards produced by Freescale (now NXP). The “V” part of the name indicates that it is aimed at motor applications and it comes enabled with Kinetis Motor Suite (KMS). It’s quite a high-spec board, with Arm® Cortex®-M4 120 MHz, 512 KB flash, 96 KB SRAM, 2x 16-bit ADCs, 4x FlexTimers/PWM up to 20-ch. with quadrature decoder dedicated to motor and power control and 2x 12-bit DACs. It sports a six-axis sensor combining accelerometer and magnetometer (FXOS8700CQ), RGB LED, two push-button switches and a thermistor temperature sensor. It can be powered from 3.3V or 1.8V and has Arduino form-factor connectors on top.
The KV31F board is enabled with Kinetis Motor Suite firmware, which is an application that aims to take the complexity out of configuring and tuning a motor to suit a particular application. Its presence on this board turned out to be both a blessing and a curse.
The FRDM-MC-LVPMSM motor controller board supports 3-phase Permanent Magnet Synchronous Motors (PMSM). It features:
The motor supplied for this RoadTest is a Linix45ZWN24-40 PMSM motor, which is rated at 40W, 2.4A, 24V and 4,000 RPM. It is quite large (45mm diameter) and heavy (around 1kg) but nicely-built. It came with three bare wires (for the three phases) and a Molex connector for the Hall sensors (although these were not used).
There was no power supply provided with this RoadTest, but I found a 24v 5A power supply complete with 2.1mm plug, so we were good to go!
The main appeal of this kit for me was the Kinetis Motor Suite (“KMS”). As well as enabling you to tune your motor, you can use it to build “motion sequences”. I was aware, from reading the blogs of the Make Life Accessible Design Challenge, that people had varying degrees of difficulty using KMS. After a bit of research, I found that the support materials on the NXP website referred to various different versions of KMS and Kinetis Design Studio and it was not clear which versions would be best to use. According to NXP:
Since that was written, there is also now KMS 1.2.0. Very confusing!
There were also reports that flashing the KV31F using the Kinetis Design Studio v3.0.0 IDE could overwrite the KMS code on the board, with no way of getting it back. The KMS code resides in a memory address in the MCU that, in earlier versions of KDS, would be overwritten by your user code. With versions 3.0.1 onwards of KDS and any version of MCUXpresso, this should not happen. To compound these issues, there are at least two different bootloaders provided with the KV31F board, depending on when and where it was purchased.
A post on the NXP forum suggested that you also need to have the right bootloader 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 apparently won't work with KMS. I followed the instructions on the NXP forum to install the Segger Jlink OPENSDA 2.1 firmware. That didn’t go well and I ended up bricking the board completely! NXP came to my rescue and kindly offered to replace the board with one containing the correct firmware and debugger.
The KMS firmware embedded in the FRDM-KV31F board is around three years old I think and I initially thought that it wouldn’t work with MCUXpresso. Based on the Make Life Accessible Design Challenge blogs, I initially decided to work with Kinetis Design Studio v3.0.1, NOT the final version (3.2). I also used the KDS SDK v1.3.0. and Kinetis Motor Suite desktop software v1.1.0 and I got KMS running nicely using this combination. Then I took the plunge and just used KMS v1.2.0 and MCUXpresso 10.3.0 and it all still seemed to work.
Just to confuse matters further, NXP no longer support KMS and instead recommend that you use the Freemaster software tool to tune your motor and you have to use KDS instead of MCUXpresso! I did try that (more of this later) but I much preferred KMS.
The main (and latest) source of documentation for this kit is this page on the NXP website. However, I did try earlier versions of all of the software. Now that KMS is no longer supported by NXP, the information needed to get these components working with Freemaster and its Motor Control Application Tuning ("MCAT") tool is here and here. All of the documentation is comprehensive, but it hasn't always been kept in sync with each other, so some documents assume you are using different versions of the various software components from others. I have attached the only spec I could find for the Linix motor. It's not much, but it's something I guess.
Before I could test the kit properly, I needed to make a mounting for the motor. The motor has three mounting holes around the shaft, but I didn’t have a bracket that would fit properly. As the motor is quite chunky and nicely cylindrical, I bought a 45mm exhaust pipe mounting clamp and fixed it onto a baseboard cut out of some spare plywood. I made the feet out of a wine cork, cut into four pieces! Because the Linix motor runs at up to 4,000 RPM, which is way too fast for most applications that I would normally have, I needed to reduce the speed of the output shaft quite considerably, so I built a Meccano gear-reduction mechanism. I then bolted this to the board to stop everything vibrating like crazy.
The Linix motor has a 5mm axle and Meccano axles are 4.06mm (actually they are an old Imperial size that is equivalent to 4.06mm). You can’t actually buy a shaft coupler with a 4.06mm hole but you can buy a 4mm one and a 4.06mm drill bit, so I drilled the 4mm hole out to match the Meccano axle size. The Linix can run at a 4000rpm, and the Meccano gearbox reduced the drive ratio by 1:296, or a maximum of 13.51 revolutions of the output shaft per minute. Meccano is not really designed for precision mechanisms and there was a lot of friction in the mechanism, as the noise on the video will demonstrate. However, it was useful in a way, as it demonstrated how the motor feedback controller could compensate for varying load on the motor.
The first step with KMS is to run the motor tuning application. After inputting the motor parameters (max RPM etc), KMS then measures its electrical characteristics and then the inertia of the motor plus drive chain. Once this is complete, you can test how much feedback control is optimal for your application by using the graphical tuning tool and adjusting the feedback level until the motor tracks the commanded speed with least “jitter”.
The screenshots below show some of the process.
{gallery} Screenshots |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Having tuned the motor, KMS allows you to develop motor sequences using another graphical tool. These can then be imported into KDS or MCUXpresso in C code and incorporated into your project.I developed a simple motor sequence that controlled the the motor by pressing onboard switch SW2 successively to loop through different speeds.
{gallery} Motor tuning |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
After getting everything working, the final stage was to download the finished project to the KV31F board. Despite having been very careful not to erase the embedded KMS code, something must have gone wrong in the debug stage as I somehow managed to erase KMS from the MCU in the process, meaning that I could no longer use KMS.
I then tried the whole process again but using Freemaster instead of KMS. This was a lot less fun and more difficult to get the result you want. It also meant getting to know Kinetis Design Suite, which is a bit crazy as it is now superceded by MCUXpresso.
{gallery} Freemaster |
---|
![]() |
![]() |
![]() |
The motor kept stalling and demonstrated the need for better motor tuning. Now that I have lost KMS, I guess I had better study Freemaster and its MCAT tool a bit better!
If you use the right combination of KMS and either KDS or MCUxpresso, and have the right bootloader to start with, this kit is great and gave me an insight into how PMSM motors work and how they can be tuned to match the load that your motor is connected to. The Linix motor is (when not connected to Meccano) tremendously powerful, quiet and smooth. It is suited to higher RPM applications, rather than precision control at low speeds. KMS also provides a very easy way to develop motor sequences and to generate the C code that you need to add those sequences to your project. However, as will be obvious from reading this review, if you get the wrong combination of KMS and KDS versions (or even the right combination!), it can be a very frustrating experience. Perhaps this is why NXT no longer support KMS and recommend Freemaster and (the now superceded) KDS instead. Hopefully, they will finish modifying Freemaster to support MCUXpresso soon (it's scheduled for 2019). At the moment, the KV31F boards in stock at Farnell still come with KMS firmware enabled but I am not sure if this will continue on any new production runs.
.
Top Comments
Nice test apparatus - I liked the Meccano...
Nice test report.
DAB
Thanks DAB! I'm still slightly annoyed that I managed to erase KMS after being careful not to. I still don't know what happened as I had flashed code to the MCU several times with no problems. Never mind…