initial commit
This commit is contained in:
35
app/by_motion.h
Normal file
35
app/by_motion.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef _BY_MOTION_H__
|
||||
#define _BY_MOTION_H__
|
||||
|
||||
#include "at32f425.h"
|
||||
|
||||
typedef struct by_motor_param {
|
||||
float Kp;
|
||||
float Ki;
|
||||
float Kd;
|
||||
float real_speed;
|
||||
float target_speed;
|
||||
float out_pwm;
|
||||
} by_motor_param;
|
||||
|
||||
#define BY_MOTION_DEFAULT_KP_M1 (5.0f)
|
||||
#define BY_MOTION_DEFAULT_KI_M1 (300.0f)
|
||||
#define BY_MOTION_DEFAULT_KD_M1 (0.0f)
|
||||
#define BY_MOTION_DEFAULT_KP_M2 (5.0f)
|
||||
#define BY_MOTION_DEFAULT_KI_M2 (300.0f)
|
||||
#define BY_MOTION_DEFAULT_KD_M2 (0.0f)
|
||||
|
||||
extern void by_motion_init(void);
|
||||
extern void by_motion_run(void);
|
||||
extern void by_motion_set_pwm_m1(int32_t pwm_duty);
|
||||
extern void by_motion_set_pwm_m2(int32_t pwm_duty);
|
||||
extern int16_t by_motion_get_speed_m1(void);
|
||||
extern int16_t by_motion_get_speed_m2(void);
|
||||
extern void by_motion_set_speed_m1(int16_t speed);
|
||||
extern void by_motion_set_speed_m2(int16_t speed);
|
||||
extern void by_motion_can_handle(uint16_t stdd_id, const uint8_t *data, uint8_t len);
|
||||
|
||||
extern by_motor_param param_m1;
|
||||
extern by_motor_param param_m2;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user