|
|
@ -2,8 +2,8 @@ |
|
|
|
//
|
|
|
|
#include "sdk/os/zos.hpp"
|
|
|
|
#include "sdk\components\tmc\basic\tmc_ic_interface.hpp"
|
|
|
|
#include "sdk\components\zcancmder\zcanreceiver.hpp"
|
|
|
|
#include "sdk\components\tmc\ic\ztmc5130.hpp"
|
|
|
|
#include "sdk\components\zcancmder\zcanreceiver.hpp"
|
|
|
|
namespace iflytop { |
|
|
|
class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
|
ENABLE_MODULE(StepMotorCtrlModule, ktmc_step_motor, PC_VERSION); |
|
|
@ -31,10 +31,10 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
|
} config_t; |
|
|
|
|
|
|
|
typedef struct { |
|
|
|
int32_t dpos; |
|
|
|
int32_t after_move_pos; |
|
|
|
int32_t before_move_pos; |
|
|
|
int32_t enable; |
|
|
|
int32_t dpos; |
|
|
|
int32_t after_move_pos; |
|
|
|
int32_t before_move_pos; |
|
|
|
int32_t enable; |
|
|
|
} state_t; |
|
|
|
|
|
|
|
private: |
|
|
@ -77,6 +77,7 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
|
virtual int32_t step_motor_easy_move_to(int32_t position) override; |
|
|
|
virtual int32_t step_motor_easy_move_to_zero() override; |
|
|
|
virtual int32_t step_motor_easy_move_to_io(int32_t ioindex, int32_t direction) override; |
|
|
|
virtual int32_t step_motor_easy_move_to_end_point() override; |
|
|
|
|
|
|
|
virtual int32_t step_motor_easy_set_current_pos(int32_t pos) override; |
|
|
|
virtual int32_t step_motor_active_cfg() override; |
|
|
@ -96,6 +97,7 @@ class StepMotorCtrlModule : public ZIModule, public ZIStepMotor { |
|
|
|
int32_t do_step_motor_easy_move_to(int32_t position); |
|
|
|
int32_t do_step_motor_easy_move_to_zero(); |
|
|
|
int32_t do_step_motor_easy_move_to_io(int32_t ioindex, int32_t direction); |
|
|
|
int32_t do_step_motor_easy_move_to_end_point(); |
|
|
|
|
|
|
|
private: |
|
|
|
void inter_inverse_kinematics(int32_t motor_pos, int32_t& x); |
|
|
|