ASIX AX58400 User Manual

Motor control

Advertisement

Quick Links

c
Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
AX58400 Motor Control
User Guide
Motor Control User Guide
Reference Design User Guide
December 20
1
AX58400
Revision 2.20
th
, 2024
th
rch 14
, 2020
th
rch 14
, 2020
th
rch 14
, 2020

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AX58400 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for ASIX AX58400

  • Page 1 Motor Control User Guide Reference Design User Guide AX58400 Motor Control User Guide Revision 2.20 December 20 , 2024 rch 14 , 2020 rch 14 , 2020 rch 14 , 2020 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 2: Revision History

    2. Added PID gain objects in 0x2000~0x3FFF area in Section 9-1. 3. Added AX58400 pinout patch description in Section 4-2. 4. Added AX58400 MC Workbench patch description in Section 4-3. 5. Added Section 12 - Firmware Architecture. 6. Added Section 13 - Tuning the PID gain values with TwinCAT.
  • Page 3: Table Of Contents

    Firmware Architecture ................... 54 13-1 Dual Core Shared Modules .................. 54 13-2 CM7 Core Modules ....................56 13-3 CM4 Core Modules ....................56 Tuning the PID Loop Gains with TwinCAT ............57 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 4 14-4 Create Scope Project in TwinCAT ................ 59 14-5 Position Loop Gain Value Manual Tuning in TwinCAT ......... 62 14-6 Speed Loop Gain Value Manual Tuning in TwinCAT ........... 63 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 5 Figure 5-31 ................................ 34 Figure 5-32 ................................ 34 Figure 5-33 ................................ 34 Figure 5-34 ................................ 35 Figure 5-35 ................................ 35 Figure 5-36 ................................ 36 Figure 5-37 ................................ 37 Figure 5-38 ................................ 37 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 6 Figure 14-8 ................................ 60 Figure 14-9 ................................ 60 Figure 14-10 ..............................60 Figure 14-11 ..............................61 Figure 14-12 ..............................61 Figure 14-13 ..............................62 Figure 14-14 ..............................62 Figure 14-15 ..............................63 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 7 Table 4-1 ................................16 Table 9-1 ................................46 Table 10-1 ................................48 Table 10-2 ................................49 Table 10-3 ................................49 Table 10-4 ................................50 Table 13-1 ................................55 Table 13-2 ................................55 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 8: Introduction

    1. Introduction Reference Design User Guide This document introduces how to setup entire environment for motor control application on AX58400-TSB-1 with ST X-NUCLEO-IHM08M1. The demo application of EtherCAT master side develops using PLC (Programmable Logic Controller) language through BECKHOFF TwinCAT engineering (XAE). The IDE relies on Microsoft Visual Studio 2010 / 2013.
  • Page 9: Requirements

    ST MotorControl Workbench6 version 6.2.1 (for development only) You can download the MotorControl Workbench here. Figure 2-2 ⚫ STM32CubeMX version 6.12.1 (for development only) You can download the STM32CubeMX here. Figure 2-3 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 10 You can download the STM32CubeProgrammer here. Figure 2-6 ⚫ SSC Tool V5.13 (for development only) You can download the SSC Tool from EtherCAT Technology Group (ETG) here Figure 2-7 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 11 For more details, please refer to the link below and the following chapter. STMicroelectronics official link: https://www.st.com/en/ecosystems/x-nucleo-ihm08m1.html ⚫ MOTION TECH BL60M24D8E00430080 Motor x 1 For more details, please refer to the link below. MTM official link: http://www.motiontech.com.tw/ Figure 2-9 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 12 AX58400 Motor Control User Guide Reference Design User Guide Table 2-1 Table 2-2 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 13 AX58400 Motor Control User Guide Reference Design User Guide Table 2-3 ⚫ 24VDC/8A Power Supply x 1 Figure 2-10 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 14: Board Description

    AX58400 Motor Control User Guide 3. Board Description Reference Design User Guide 3-1 AX58400-TSB The AX58400-TSB is a development board for AX58400 IC and has below components: CON2 CON1 CON3 CON4 Figure 3-1 ◼ J1: ICE header connector, used to connect STLINK-V3MINI.
  • Page 15: X-Nucleo-Ihm08M1

    R170 C3, C5 JP1, JP2 Figure 3-3 Components Status JP1, JP2, J9 Closed J5, J6 Short 3sh side R74, R86, R170, C3, C5, C7 Unmounted Table 3-2 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 16: Environment Setup

    Please based on below table to connect all necessary equipment. Table 4-1 If your environment is set up ready, it should look like this. Encoder +24VDC U, V, W EtherCAT Cable Figure 4-1 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 17: Ax58400 Pinout Patch For Stm32Cubemx

    Assume the STM32CubeMX has been installed successfully, and if the developer would like to get a more suitable pinout view of AX58400 on STM32CubeMX, please follow the steps below to achieve this. Step 1: Open the below files with text editor and modify the “STMMX_ROOT” as your STM32CubeMX installation path.
  • Page 18: Stm Motorcontrol Workbench Patch

    Figure 4-4 Also, if you want go back to original state, please performing the un-patch file below. AX58400_MCWB_Patch_vXXX\AX58400_MCWB_UnPatch.cmd This step requires the additional installation of the “AX58400 MCWB Patch” package. Please contact Notice: ASIX’s Technical Support (support@asix.com.tw) for further support.
  • Page 19: Building Reference Design Begin With Mc Workbench

    In order to keep the corrected reference path in BSP, please save the project folder in the path below. BSP_ROOT\SampleCode\ Figure 5-1 Step 2: Select SM-PMSM 24V motor, X-NUCLEO-IHM08M1 power board and NUCLEO-H755ZI control board. Figure 5-2 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 20 Step 4: Setup remanning property tabs as the setting in MC Workbench project file below. BSP_ROOT\SampleCode\Ax58400_MotorControl\Ax58400_MotorControl.stwb6 Step 5: Generates the source code with the CubeMX v6.12.1 and select Firmware Package Version v1.11.1. Figure 5-4 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 21: Modify Peripheral Settings In Stm32Cubemx

    Change TIM1 pins, from PA8, PA9 and PA10 to be PE9, PE11 and PE13. (To select the PA8 pin, hold down Ctrl + left mouse button, then drag it to the PE9 pin.) Figure 5-7 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 22 Firstly, set PH0 & PH1 pins to “Reset State”, then add the pins as below. Reference Design User Guide Figure 5-8 Step 6: Modify “Pinout & Configuration > Timer > TIM1” settings as highlighted in red. Figure 5-9 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 23 Step 8: Enable “Pinout & Configuration > Connectivity > SPI3” on CM4 with the setting as highlighted in red. Figure 5-11 Step 9: Enable “Pinout & Configuration > Connectivity > UART4” on CM4 and “UART7” on CM7. Figure 5-12 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 24 AX58400 Motor Control User Guide Step 10: Modify the NVIC1 setting as below. Reference Design User Guide Figure 5-13 Figure 5-14 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 25 AX58400 Motor Control User Guide Step 11: Modify the NVIC2 setting as below. Reference Design User Guide Figure 5-15 Figure 5-16 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 26: Generate Source Code In Stm32Cubemx

    5-4 Generate Source Code in STM32CubeMX Step 1: In “Project Manager > Project” page, extended the minimum heap size to 0x1000 on CM4, and select Firmware Package as “STM32Cube FW_H7 V1.11.1”. Figure 5-18 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 27 Step 3: In “Project Manager > Advanced Settings” page, disable initial code generation of SPI3, TIM6 and TIM7 on CM4 core. Figure 5-20 Step 4: Generates the source code. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 28: Source Code Adjustment

    Step 3: Add the Share Memory declaration for CM4. ⚫ For Keil MDK IDE As highlighted in the figure below, modify file content in the path: BSP_ROOT\SampleCode\Ax58400_MotorControl\MDK-ARM\stm32h755xx_flash_CM4.sct Figure 5-22 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 29 Step 4: Add the Share Memory declaration for CM7. ⚫ For Keil MDK IDE As highlighted in the figure below, modify file content in the path: BSP_ROOT\SampleCode\Ax58400_MotorControl\MDK-ARM\stm32h755xx_flash_CM7.sct Figure 5-24 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 30 Reference Design User Guide Figure 5-25 Step 5: Modify source code on CM4 core. As highlighted in the figure below, modify file content in the path: BSP_ROOT\SampleCode\Ax58400_MotorControl\CM4\Src\main.c Figure 5-26 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 31 Reference Design User Guide Figure 5-27 Step 6: Modify source code on CM7 core. As highlighted in the figure below, modify file content in the path: BSP_ROOT\SampleCode\Ax58400_MotorControl\CM7\Src\main.c Figure 5-28 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 32 As highlighted in the figure below, modify file content in the path: BSP_ROOT\SampleCode\Ax58400_MotorControl\CM7\Src\stm32h7xx_mc_it.c Reference Design User Guide Figure 5-29 As highlighted in the figure below, modify file content in the path: BSP_ROOT\SampleCode\Ax58400_MotorControl\CM7\Src\mc_task.c Figure 5-30 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 33: Generate Ethercat Slave Stack Code

    Due to the ETG Slave Stack Code (SSC) license limitation, the user must re-generate the source code by the SSC tool locally, about how to get the SSC tool and how to generate targeted source code, please refer to the user guide as below. BSP_ROOT\Document\AX58x00_SSC_Tool_Configuration_Import_UserGuide_vXXX.pdf Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 34: Ide Setting Adjustment

    Click on “Project > Options for Target ‘xxxx’… > Utilities > Settings”, then select “Flash Download” page to add “Programming Algorithm” as the value below. Figure 5-33 For CM4 core: Start = 0x08100000, Size = 0x00100000 For CM7 core: Start = 0x08020000, Size = 0x000E0000 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 35 IRAM1 Start = 0x10000000, Size = 0x48000 For CM7 core: IROM Start = 0x8020000, Size = 0xE0000 IRAM1 Start = 0x20000000, Size = 0x20000 IRAM2 Start = 0x0, Size = 0x10000 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 36 Switch to Ax58400_MotorControl_CM7 project, then exclude the source from target build as the figure below. Reference Design User Guide Figure 5-36 Now, entire building procedure has done for Keil MDK IDE. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 37 Add Virtual Folder: Right click on target project and select “New > Folder”, then enter new folder name and select “Folder is not located in the file system (Virtual Folder)” to create a folder. Figure 5-38 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 38 Find setting on “Project > Properties > C/C++ Build > Settings > Tool Settings > MCU/MCP GCC Compiler > Include paths”, then add paths as the figure below. Figure 5-41 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 39 For CM7 core: ../../../../../Tools/FileInfoAdder Ax58400_MotorControl_CM7.bin ../../../For_TwinCAT/FoE/AX58400_MotorControl_CM7.efw -ft 1 Now, entire building procedure has done for STM32CubeIDE. So far, the entire project source has been ready for building firmware binary. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 40: Build Up And Download Firmware

    Step 1: Double clicks the project file as below path to open project. BSP_ROOT\SampleCode\Ax58400_MotorControl\STM32CubeIDE\.project Step 2: Execute “Build All” under “Menu Bar > Project” to build CM4 & CM7 firmware binary files. Figure 6-2 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 41: Download Bootloader Firmware

    Motor Control User Guide 6-2 Download Bootloader Firmware Reference Design User Guide Step 1: Open STM32CubeProgrammer utility and connect to the AX58400-TSB board via STLINK-V3MINI programmer. Step 2: Select the “Erasing & Programming” page, then click “Browse” button to select bootloader firmware binary file in the path below.
  • Page 42: Download Application Firmware

    For STM32CubeIDE: Step 1: Select target project and click “Menu bar > Run > Run As > STM32 C/C++ Application” to download CM4 & CM7 application firmware respectively. Figure 6-6 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 43 Motor Control User Guide ⚫ Using STM32CubeProgrammer Utility: Step 1: Similarly, please ensure the utility has connected to target AX58400-TSB board. Reference Design User Guide Step 2: Select the “Erasing & Programming” page, then click “Browse” button to select CM7 application firmware file in the path below.
  • Page 44: Basic Operation Of Twincat

    AX58400 Motor Control User Guide 7. Basic Operation of TwinCAT Reference Design User Guide Please refer to Section 3 of “AX58x00_TwinCAT_UserGuide” for more details. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 45: Plc Application

    AX58400 Motor Control User Guide 8. PLC Application Reference Design User Guide Please refer to Section 5 of “AX58x00_TwinCAT_UserGuide” for more details. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 46: Flash Memory Allocation And Foe Upgrading

    The .efw file is dedicate use for FoE transfer, it’s a firmware binary file with 32-bytes header pre-fix. Every time the project build done, the .efw file will auto be generated in the path below by “FileInfoAdder.exe” utility. BSP_ROOT\SampleCode\Ax58400_MotorControl\For_TwinCAT\FoE\AX58400_MotorControl_CM4.efw BSP_ROOT\SampleCode\Ax58400_MotorControl\For_TwinCAT\FoE\AX58400_MotorControl_CM7.efw Figure 9-1 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 47: Foe Firmware Upgrade

    Step 4: If the firmware upgrading is complete successfully, the pop up dialog will appear as the figure below. Figure 9-4 Step 5: Similarly, upgrading the CM7 application firmware by select the file as path below. BSP_ROOT\SampleCode\Ax58400_MotorControl\For_TwinCAT\FoE\AX58400_MotorControl_CM7.efw Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 48: Object Dictionary

    Tx pdo mapping of csp/csv Position actual value Velocity actual value Modes of operation display Mapped objects: 0x1A01 PDO Mapping RECORD Tx pdo mapping of csp Statusword Position actual value Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 49 0x3013 SpdKiDivisor INTEGER16 0x3014 SpdKdGain INTEGER16 0x3015 SpdKdDivisor INTEGER16 0x3020 TrqKpGain INTEGER16 0x3021 TrqKpDivisor INTEGER16 0x3022 TrqKiGain INTEGER16 0x3023 TrqKiDivisor INTEGER16 0x3024 TrqKdGain INTEGER16 0x3025 TrqKdDivisor INTEGER16 Table 10-3 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 50 RECORD Supported homing methods 0x60FD Digital Inputs UNSIGNED32 0x60FF Target velocity INTEGER32 0x6502 Supported drive modes UNSIGNED32 0xF000 RECORD Modular device profile 0xF010 Module profile list UNSIGNED32 Table 10-4 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 51: Performance Evaluation

    14bytes input and 14bytes output, under this setting, the minimum DC cycle time can down to 100us. Figure 11-1 Without frame lost and Tx/Rx error at Master side. Figure 11-2 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 52 AX58400 Motor Control User Guide Also, without detected SM-Event Missed, Cycle Time Too Small and Sync Error at Slave side. Reference Design User Guide Figure 11-3 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 53: Using The High Speed Clock (Hse)

    Step 3: Select “Clock Configuration” page, then modify the setting as highlighted in red as below. Figure 12-2 Step 4: Re-generate the source code, then re-build the target and upgrade the firmware as mentioned previously. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 54: Firmware Architecture

    Motor Control User Guide 13. Firmware Architecture Reference Design User Guide Below figure shows the simple software architecture of AX58400 Motor Control Reference Design. All the firmware modules could be classified three parts as below. ⚫ Dual Core shared modules ⚫...
  • Page 55 MSGXCHG_MC_PD_CH cc_McStatusChangeRsp() CC_McStatusChangeReq() MC_StartMotor() cc_McSetCmdRsp() MSGXCHG_MC_CMD_CH MC_StopMotor() MC_GetState() MC_SetCommand() MC_CheckServoOn() MC_SetTargetTorque() MC_GetActualTorque() MC_SetTargetVelocity() MC_GetActualVelocity() MC_ClearActualPosition() MC_SetTargetPosition() MC_GetActualPosition() MC_FaultReset() MC_GetFaultStatus() MC_StartHoming() MC_CheckHomingDone() MC_GetParameter() cc_McGetParameterRsp() MSGXCHG_MC_CFG_CH MC_SetParameter() cc_McSetParameterRsp() Table 13-2 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 56: Cm7 Core Modules

    Every supported mode in CiA402 has been implemented as a single module, common functions and definitions are implemented in cia402 module. ⚫ EtherCAT Slave Stack Code (SSC) This stack is generated by ETG’s SSC tool. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 57: Tuning The Pid Loop Gains With Twincat

    14-2 Link New Objects to Data Structure in CM4 Step 1: Add new members in CiA402_OBJ_T data structure, notes each data type must be same as the new objects on “AX58400_MotorControl.xlsx”, like this. Figure 14-2 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 58: Reference Design User Guide

    Step 1: Add new objects index for write operations as below. Figure 14-4 Step 2: Add new objects index for read operations as below. Figure 14-5 Step 3: Re-build the project and update new firmware into AX58400. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 59: Create Scope Project In Twincat

    Please follows the steps below to do this. Figure 14-6 Here selects the “Scope YT Project” then click “OK” button to complete the scope creation. Figure 14-7 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 60 Please follows the steps below to do this. Reference Design User Guide Figure 14-8 Figure 14-9 Here we create a new plot axis to display speed response curve. Figure 14-10 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 61 Reference Design User Guide Figure 14-11 Figure 14-12 So far, the scope is ready to record the process data, we can start to tuning the position and speed loop gains. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 62: Position Loop Gain Value Manual Tuning In Twincat

    “drive_parameters.h” file, then re-build and upgrade the firmware. Figure 14-14 If the tuning is complete, please turn off the “CSP ON/OFF” switch and wait for the motor stop. Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 63: Speed Loop Gain Value Manual Tuning In Twincat

    Similarly, switch back to “CoE-Online” function tab to adjust SpdKpGain and SpdKiGain until satisfying the application requirement. Figure 14-15 Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.
  • Page 64 (4) You may not alter, modify, copy or otherwise misappropriate any ASIX electronic product, whether in whole or in part. ASIX Electronics shall not be liable for any loss incurred by you or a third party as a result of altering, modifying, copying or otherwise misappropriating ASIX Electronics products.
  • Page 65 No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, for any purpose, without the express written permission of ASIX. ASIX may make changes to the product specifications and descriptions in this document at any time, without notice.
  • Page 66 AX58400 Motor Control User Guide Reference Design User Guide 4F, No.8, Hsin Ann RD., Hsinchu Science Park, Hsinchu, Taiwan, R.O.C. TEL: +886-3-5799500 FAX: +886-3-5799558 Email: support@asix.com.tw Web: https://www.asix.com.tw Copyright (C) 2021-2024 Reserved by ASIX Electronics Corporation, All Rights Reserved.

Table of Contents