Getting Started with the MCSPTR2AK396 Automotive Motor Control Kit

Last Modified: 2024-11-25 15:59:00Supports S32K396 BLDC/PMSM Development Kit

Contents of this document

  • 1

    Out of the Box
  • 2

    Get Software
  • 3

    Plug It In
  • 4

    Build, Run

1. Out of the Box

MCSPTR2AK396 Development Kit

MCSPTR2AK396 Development Kit
  • S32K396-PCIe controller board
  • 3-phase PMSM/BLDC low-voltage power stage based on the MC33937A pre-driver integrated circuit
  • Micro USB cable
  • +24 VDC power supply
  • Universal adapter
  • PSE power cord
  • 3 phase PMSM motor with resolver, 30 V per phase, 3000 RPM, 0.32 Nm, 95 W, 5.2 A

1.1 MCSPTR2AK396 Development Kit Features

MCSPTR2AK396 Callouts

MCSPTR2AK396 Callouts

MCSPTR2AK396 Content

MCSPTR2AK396 Content

MCSPTR2AK396 Motor Control Application Block Diagram

MCSPTR2AK396 Motor Control Application Block Diagram

1.2 Get to Know the S32K396 Controller Board and Power Stage Board

MCPTR2AK396 Controller Board

MCPTR2AK396 Controller Board

MCPTR2AK396 Power Stage Board

MCPTR2AK396 Power Stage Board

2. Get Software

Sign in at nxp.com with your credentials.

2.1 Get S32 Design Studio for S32 Platform IDE

Download and Install S32 Design Studio for S32 Platform v.3.5.

S32DS3.5 Download 1

S32DS3.5 Download 1

S32DS3.5 Download 2

S32DS3.5 Download 2

2.2 Download the S32K396 Development Package

Open the Software Package Manager.

  1. Select the S32K396 in the device column and expand the integrated Software Bundle
  2. S32K396 Integrated Software Bundle

    S32K396 Integrated Software Bundle
  3. Select S32 Design Studio RTM 3.5.6_D2309 and Generate Bundle Installer
  4. S32K396 Download Development Package

    S32K396 Download Development Package
  5. Install the Bundle Installer to get an S32K396 developmet package (SW32K3_S32DS_3.5.8_D2311.zip)

2.3 Update Platform Packages

  1. In S32DS, go to Help → S32DS Extensions and Updates from the top menu to open the S32DS Extensions and Updates dialogue
  2. Update S32 Design Studio Platform and S32 Design Studio PLatform Tools packages

Update Platform Packages

Update Platform Packages

2.4 Install the S32K396 Development Package Into the S32 Design Studio

  1. In S32DS, go to Help → S32DS Extensions and Updates from the top menu to open the S32DS Extensions and Updates dialogue
  2. Import S32K396 Development Package by clicking on Add Update Sites link and navigate to SW32K3_S32DS_3.5.8_D2311.zip file on your disk
  3. Add Update Sites

    Add Update Sites
  4. Select and install the S32K396 development package
  5. Install S32K396 Development Package

    Install S32K396 Development Package

2.5 Install the RTD drivers

  1. In S32DS, go to Help → S32DS Extensions and Updates from the top menu to open the S32DS Extensions and Updates dialogue
  2. Select and install S32K396 RTD AUTOSAR R21-11 Version 3.0.0
  3. Install S32K396 RTD 3.0.0

    Install S32K396 RTD 3.0.0

2.6 Get FreeMASTER Application Tool

Download and install FreeMASTER Application Tool for real-time debugging.

2.7 Get AMMCLIB for S32K3

Download and install the latest Automotive Math and Motor Control Library set for S32K3 (version 1.1.39 or newer).

Download S32K3 AMMCLib

Download S32K3 AMMCLib

2.8 Get the S32K396 Motor Control Application

Download and install the S32K396 motor control application software.

Install S32K396 MC Application

Install S32K396 MC Application

3. Plug It In

3.1 Check the Default Jumper Positions at the 3PHLVPWBRDPCIE Power Stage Board

3PHLVPWBRDPCIE Jumpers

3PHLVPWBRDPCIE Jumpers
3PHLVPWBRDPCIE Default Jumper Settings
Jumper State Notes
J5 2-3 Resolver S4 output routed to operational amplifier
J6 2-3 Resolver S3 output routed to operational amplifier
J7 2-3 Resolver excitation signal from TM5 signal at PCIe connector
J9 1-2 DC BUS current sensing signal measured via operation amplifier
J10 2-3 VREF as voltage source for overcurrent threshold potentiometer
J11 1-2 External overcurrent fault comparator
J16 OPEN Zero-Cross detection disconnected
J17 OPEN Zero-Cross detection disconnected
J18 OPEN Zero-Cross detection disconnected
J19 1-2 Phase A current signal routed to AN1 signal at PCIe connector
J20 1-2 Phase B current signal routed to AN3 signal at PCIe connector
J21 1-2 Phase C current signal routed to AN5 signal at PCIe connector

3.2 Check the Default Jumper Positions at the S32K396-PCIE-MC Controler Board

S32K396-PCIE-MC Jumpers

S32K396-PCIE-MC Jumpers
S32K396-PCIE-MC Default Jumper Settings
Jumper State Notes
J11 2-3 CAN0 Transceiver STB signal pulled down
J13 OPEN FS26_VDEBUG signal generated - FS26 starts in debug mode
J14 CLOSED FS26_VDEBUG signal derived from VBOS signal
J15 CLOSED RESET SW2 connected to RESET_B signal
J16 CLOSED External wake-up signal connected to MCU
J17 2-3 CAN3 Transceiver STB signal pulled down
J18 1-2, 3-4 CAN0_TX and CAN0_RX signals routed to on-board CAN transceiver
J19 CLOSED Functional Safety signals FS0B and FS1B connected
J20 1-2, 3-4 CAN3_TX and CAN0_RX signals routed to on-board CAN transceiver
J22 CLOSED RESET_B signal connected as wake-up signal to FS26
J23 2-3 VHREF_H voltage connected to VDD_HV_A
J24 CLOSED RESET_B signal connected to 20-pin JTAG connector
J26 CLOSED VDD_JTAG signal present at 20-pin JTAG connector
J28 2-3, 5-6, 8-9, 11-12 JTAG signals routed to S32K3 on-board debugger
J29 OPEN External RESET signal pins
J30 CLOSED LPUART2_TX signal connected to S32K3 on-board debugger
J31 1-2 LPUART2_RX signal connected to S32K3 on-board debugger
J32 1-2 Sine Wave Generator 1 routed to TM5 signal at PCIe connector
J33 2-3 V15 voltage regulated by external NMOS transistor
J35 CLOSED PTB11 connected to TM3 signal at PCIe connector
J37 OPEN CAN0 Transceiver STB signal not connected to MCU
J38 1-2 CAN3 Transceiver STB signal not connected to MCU

In case of using an external JTAG debug probe via J20 connector, change the settings of J28 to 1-2, 4-5, 7-8, 10-11.

External Debugger

External Debugger

3.3 Assemble Controller board to the Power Stage Board

S32K396 Motor Control Kit

S32K396 Motor Control Kit

Optionally use the support column for improving mechanical robustness. The support column isn't part of this motor control kit and will be sell separately.

S32K396 Motor Control Kit

S32K396 Motor Control Kit

3.4 Connect the kit USB and Power Supply

  1. Connect the board with PC by micro-USB cable
  2. Connect the kit USB and Power Supply

    Connect the kit USB and Power Supply
  3. Plug a 24 V power supply to the power stage board
  4. Connect the kit USB and Power Supply

    Connect the kit USB and Power Supply

4. Build, Run

4.1 Import, Build and Load the Motor Control Application Into MCU

Let's take your MCSPTR2AK396 motor control kit for a test drive.

4.2 Select Application and Project Import

Select the appropriate PMSM motor control application from the installed directory: NXP\MC_DevKits\MCSPTR2AK396\sw.

To import the installed application software project in the S32 Design Studio IDE for S32 Platform:

  1. Launch S32DS for S32 Platform
  2. Go to File → Import, then select General → Existing Projects into workspace
  3. Import Project

    Import Project
  4. Navigate to the installed application directory: NXP\MC_DevKits\MCSPTR2AK396\sw and choose the appropriate project and click OK
  5. Then, click Finish
  6. Import MCSPTR2AK396 Project

    Import MCSPTR2AK396 Project

4.3 Use Configuration Tool

  1. Unfold the structure of the project and double-click on *.mex file to open the project configuration in S32 Configuration Tool
  2. Mex File

    Mex File
  3. Please ensure that you configure the appropriate project and click "Update Code" button for generating configuration files
  4. Update Code

    Update Code

4.4 Upload Software and Debug

  1. In S32DS, return back to the C/C++ perspective
  2. C_Cpp Perspective

    C_Cpp Perspective
  3. Use the Debug Configuration menu and select the predefined debug configuration for building and uploading software into MCU
  4. Debug Menu

    Debug Menu

    Debug Configuration

    Debug Configuration
  5. The S32DS will switch into debug perspective where you may let the code run by clicking Resume (or press F8), and use Disconnect to avoid interference between the S32DS IDE debugger and the FreeMASTER tool
  6. Let Code Run

    Let Code Run

    Disconnect

    Disconnect

4.5 Set Up the Debugging Tool

Launch the FreeMASTER application.

To open the *.pmpx FreeMASTER project <selected project>\FreeMASTER_control, click File → Open Project.

FreeMASTER Project

FreeMASTER Project

To enable communication, in the FreeMASTER toolbar, click Go (or press Ctrl + G).

FM Start

FM Start

Successful communication displays in the status bar at the bottom as: RS-232 UART Communication;COMn;speed = 115200.

Application Control

Controlling the Application

To spin the motor:

  1. Select the Speed FOC debug view from the project tree
  2. Switch to the Control Struct tab in the Motor Control Application Tuning (MCAT) tool tab
  3. Switch application ON either in MCAT or in variable watch window
  4. Set the required speed either in MCAT or in the variable watch window

Spin the Motor

Spin the Motor

Optionally you may drive the motor speed by SW1 switch and SW3/SW2 push buttons on the power stage board.

Buttons

Buttons
  1. Move the SW1 bar down (out of board direction) to get application ON
  2. Press SW3/SW2 to initiate clockwise/counterclockwise spinning of the rotor
  3. Another SW3/SW2 pressing will increase/decrease the motor speed
  4. Move the SW1 bar up (to the center of board direction) to stop the motor
  5. Simultaneously pressing SW3 and SW2 will clear the pending faults

See AN14481 Application Note for MCSTR2AK296 - chapter 5 FreeMASTER and MCAT user interface for more details.