# SMC **Repository Path**: ibst/smc ## Basic Information - **Project Name**: SMC - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-19 - **Last Updated**: 2025-09-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: SMC, 滑模控制, Control, 控制, 自动化 ## README # SMC #### How To Use ``` rm_motor_smc_init(&xxx,DJI_M2006,&hcan1,LOW); bsp_can_init(); while(1) { speed_smc_ctrl(&xxx,540,540,540,540); HAL_Delay(2); } ``` #### Description This project implements a sliding mode control (SMC) algorithm for motor control applications. It is specifically designed for use with DJI motors and provides an efficient way to manage motor speed control using advanced control theory. #### Software Architecture The software architecture consists of two main components: 1. **Application Layer**: Contains motor-specific implementations and initialization routines 2. **Library Layer**: Implements the core sliding mode control algorithm Key files: - `M3508_SMC.c/h`: DJI motor-specific SMC implementation - `smc.c/h`: Core SMC algorithm library #### Installation 1. Clone the repository: `git clone https://gitee.com/ibst/smc` 2. Include the SMC library in your project 3. Initialize the motor control system with appropriate parameters #### Usage Basic usage steps: 1. Initialize the SMC controller with `smc_controller_create()` 2. Initialize motor with `rm_motor_smc_init()` 3. Set target speed with `rm_motor_speed_smc()` 4. Execute control loop with `rm_motor_speed_smc_ctrl()` Example motor control: ```c DJI_Motor_ControlTypeDef motor; rm_motor_smc_init(&motor, M3508, &hcan1, MOTOR_GROUP_1); rm_motor_speed_smc(&motor, 0x201, 1000); // Set motor 0x201 to 1000 RPM ``` #### API Reference Key functions: - `smc_controller_create()`: Initialize SMC controller with parameters - `rm_motor_smc_init()`: Initialize motor control system - `rm_motor_speed_smc()`: Set target motor speed - `rm_motor_speed_smc_ctrl()`: Execute control loop step #### Contributing 1. Fork the repository 2. Create a new feature branch 3. Implement your changes 4. Submit a pull request #### License This project is licensed under the MIT License - see the LICENSE file for details.