|
@ -32,6 +32,7 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
int32_t motor_tzerowait; |
|
|
int32_t motor_tzerowait; |
|
|
int32_t motor_enc_resolution; |
|
|
int32_t motor_enc_resolution; |
|
|
int32_t motor_enable_enc; |
|
|
int32_t motor_enable_enc; |
|
|
|
|
|
int32_t motor_dzero; // 零点偏移
|
|
|
} config_t; |
|
|
} config_t; |
|
|
|
|
|
|
|
|
typedef struct { |
|
|
typedef struct { |
|
@ -86,7 +87,6 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
virtual int32_t step_motor_easy_move_to_end_point() override; |
|
|
virtual int32_t step_motor_easy_move_to_end_point() override; |
|
|
virtual int32_t step_motor_easy_reciprocating_motion(int32_t startpos, int32_t endpos, int32_t times) override; |
|
|
virtual int32_t step_motor_easy_reciprocating_motion(int32_t startpos, int32_t endpos, int32_t times) override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual int32_t step_motor_easy_set_current_pos(int32_t pos) override; |
|
|
virtual int32_t step_motor_easy_set_current_pos(int32_t pos) override; |
|
|
virtual int32_t step_motor_active_cfg() override; |
|
|
virtual int32_t step_motor_active_cfg() override; |
|
|
virtual int32_t step_motor_read_io_state(int32_t ioindex, int32_t* state) override; |
|
|
virtual int32_t step_motor_read_io_state(int32_t ioindex, int32_t* state) override; |
|
@ -99,8 +99,6 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
|
|
|
|
|
|
virtual int32_t step_motor_read_io_index_in_stm32(int32_t ioindex, int32_t* index_in_stm32) override; |
|
|
virtual int32_t step_motor_read_io_index_in_stm32(int32_t ioindex, int32_t* index_in_stm32) override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
TMC51X0* getMotor() { return m_stepM1; } |
|
|
TMC51X0* getMotor() { return m_stepM1; } |
|
|
config_t* getCfg() { return &m_cfg; } |
|
|
config_t* getCfg() { return &m_cfg; } |
|
@ -116,7 +114,6 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
int32_t do_step_motor_easy_move_to_end_point(); |
|
|
int32_t do_step_motor_easy_move_to_end_point(); |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
|
|
|
|
|
|
int inter_et_pos(int32_t& x); |
|
|
int inter_et_pos(int32_t& x); |
|
|
|
|
|
|
|
|
void befor_motor_move(); |
|
|
void befor_motor_move(); |
|
@ -133,7 +130,6 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
void dumpTMC5130Status(TMC51X0::DevStatusReg_t* status); |
|
|
void dumpTMC5130Status(TMC51X0::DevStatusReg_t* status); |
|
|
void setErrorFlag(int32_t ecode); |
|
|
void setErrorFlag(int32_t ecode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int32_t getnowpos(int32_t& x); |
|
|
int32_t getnowpos(int32_t& x); |
|
|
int32_t trysyncpos(); |
|
|
int32_t trysyncpos(); |
|
|
int32_t setnowpos(int32_t x); |
|
|
int32_t setnowpos(int32_t x); |
|
|