HPM APP
HPMicro Application solution
hpm_motor LIB USER GUIDE

(hpm_motor_instruction_en)=

overview

hpm_motor is a library file for the core algorithm of motor control, which aims at modularized management of specific functional algorithms by constantly updating and improving; For users do not have to care about how to implement the underlying, accelerate the development of user programs.

The library is currently only supported for use in windows operating systems.

Installing the HPM MOTOR Library

hpm_motor library package contents

The Motor library consists of the following components:

  • Header file containing function declaration, macro declaration, structure declaration
  • Contains the.a file of the initial configuration function and the real-time running function
  • A demo example showing the use of HPM MOTOR library
  • Document

How to Install the HPM MOTOR Library

If you need to use some of the functions in the library, please first add the library to the project reference, the specific reference process is as follows:

(1)add the hpm motor file under the middleware branch

fig1

(2)project cite hpm motor library

fig2

(3)After opening the new project, you can see that the hpm_motor library is referenced by the project

fig3

(4)build project

The hpm_motor library file is used, and both gcc and andes toolchains are supported.

Library function description

The current 1.0 version of the library supports trajectory planning algorithm function interface calls, and other algorithm functions will be iteratively updated and improved. Before use, please call the version number function interface to obtain the version number and check with the version number displayed in the.a file.

Trajectory planning algorithm

There is a step in the speed of the motor when it is started and stopped. A sudden change in motor speed can cause current overload. Therefore, the acceleration and deceleration control algorithm is usually used to plan the motor speed.

The trajectory planning algorithm used in libhpm_motor.a is an S-shaped curve, the core of which is to control the change of acceleration through variable acceleration, ensure that acceleration does not mutate, and smooth the acceleration and deceleration speed curve, so as to achieve the purpose of smooth operation of the motor.

function

The S-shaped curve is mainly composed of acceleration section (T_a), uniform velocity section (T_v) and deceleration section (T_d). The acceleration section is further divided into acceleration (T_j1), uniform acceleration and deceleration (T_j1), and the deceleration section is divided into acceleration and deceleration (T_j2), uniform deceleration and deceleration (T_j2). There are seven sections in total, as shown in Figure 1, where v_max is the maximum acceleration of the system, v_0 is the start speed, v_1 is the end speed, and a_max is the maximum acceleration of the system. a_min is the maximum deceleration of the system, j_max is the maximum acceleration of the system, and j_min is the maximum deceleration of the system.

fig4

Licensing

HPM APP is permissively licensed using the BSD 3-clause license