Files
RCT6_THB6128_FV/USER/motorstat.h
2025-06-18 09:08:17 +08:00

55 lines
1.1 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef MotroStat_h
#define MotroStat_h
#include "stm32f10x.h"
struct StructMotorStat{
int NmberoNow;
int direction;
int speed;
int MoveMode;
int moveflag;
int acc;
int dec;
int speedflag;
int Targetspeed;
__int64 NmberoTarget;
int backzero;
int Nmbertargetflag;
int accflag;
int decflag;
void (*set_speed)(int speed);
void (*stopmove)();
int pulse_count; // 增加脉冲计数器
int target_position; //保存目标位置
int accel; //加速度 steps/s2
int decel; //减速度 steps/s2
int max_speed; //最大速度 steps/s
int total_steps; //总步数
int step_counter; //当前步数
int accel_steps; //加速段步数
int decel_steps; //减速段步数
int const_steps; //匀速段步数
float current_speed; //当前速度
int move_phase; //运动阶段 -1_停止 0-加速 1-匀速 2-减速
u8 zero_flag; // 归零标志位0-未归零 1-归零中)
int zheng_LimitTrigger;
int fu_LimitTrigger;
};
extern struct StructMotorStat MotorStat;
void motorloop(void);
#endif // !Motro