注释
是的,根据方向,步进或方向引脚用作脉冲。应该清楚的是,step-mask 也应该包括方向销才能工作。Elvis999IT <notifications@github.com> schrieb am Mo., 18. März 2019, 19:07:
|
现在我回家了,这里是代码的摘录:对于 y 轴,另一个是相等的。里面 cpu_map … #define STEP_Y CW_CCW #ifndef STEP_Y #define STEP_Y STEP_DIR #define Y_CCW_BIT 0 #else #define Y_CCW_BIT Y_DIRECTION_BIT #endif #define CCW_MASK ((1<<X_CCW_BIT)|(1<<Y_CCW_BIT)|(1<< Z_CCW_BIT)|bit(Y_CCW_BIT)|bit(A_CCW_BIT)) // 所有 CCW 位 #define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)|(1<<A_STEP_BIT)| CCW_MASK) // 所有步骤位 #define DIRECTION_MASK (((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)|(1<<A_DIRECTION_BIT))^CCW_MASK) inside stepper.c #define STEP (x) CONCAT(STEP_,x)(x) #define STEP_DIR(x) bit(CONCAT(x,_STEP_BIT) #define CW_CCW(x) st.exec_block->direction_bits & bit(CONCAT(x,_DIRECTION_BIT)) ? 位(连接(x, _DIRECTION_BIT)) : STEP_DIR(x) 代码被截取为 step/dir 或 cw/ccw,只需将 (1<<Y_STEP_BIT) 替换为 STEP(Y) #ifdef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING st.counter_y += st.steps[Y_AXIS]; #else st.counter_y += st.exec_block->steps[Y_AXIS]; #endif if (st.counter_y > st.exec_block->step_event_count) { st.step_outbits |= STEP(Y) ; st.counter_y -= st.exec_block->step_event_count; 如果 (st.exec_block->steps_backlash[Y_AXIS]) st.exec_block->steps_backlash[Y_AXIS]–; else if (st.exec_block->direction_bits & (1<<Y_DIRECTION_BIT)) { sys_position[Y_AXIS]–; } else { sys_position[Y_AXIS]++; } } 2019-03-18 19:11 GMT+01:00,Cri S <phone.cri@gmail.com>:Y_STEP_BIT) 和 STEP(Y) #ifdef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING st.counter_y += st.steps[Y_AXIS]; #else st.counter_y += st.exec_block->steps[Y_AXIS]; #endif if (st.counter_y > st.exec_block->step_event_count) { st.step_outbits |= STEP(Y) ; st.counter_y -= st.exec_block->step_event_count; 如果 (st.exec_block->steps_backlash[Y_AXIS]) st.exec_block->steps_backlash[Y_AXIS]–; else if (st.exec_block->direction_bits & (1<<Y_DIRECTION_BIT)) { sys_position[Y_AXIS]–; } else { sys_position[Y_AXIS]++; } } 2019-03-18 19:11 GMT+01:00,Cri S <phone.cri@gmail.com>:Y_STEP_BIT) 和 STEP(Y) #ifdef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING st.counter_y += st.steps[Y_AXIS]; #else st.counter_y += st.exec_block->steps[Y_AXIS]; #endif if (st.counter_y > st.exec_block->step_event_count) { st.step_outbits |= STEP(Y) ; st.counter_y -= st.exec_block->step_event_count; 如果 (st.exec_block->steps_backlash[Y_AXIS]) st.exec_block->steps_backlash[Y_AXIS]–; else if (st.exec_block->direction_bits & (1<<Y_DIRECTION_BIT)) { sys_position[Y_AXIS]–; } else { sys_position[Y_AXIS]++; } } 2019-03-18 19:11 GMT+01:00,Cri S <phone.cri@gmail.com>:step_outbits |= STEP(Y) ; st.counter_y -= st.exec_block->step_event_count; 如果 (st.exec_block->steps_backlash[Y_AXIS]) st.exec_block->steps_backlash[Y_AXIS]–; else if (st.exec_block->direction_bits & (1<<Y_DIRECTION_BIT)) { sys_position[Y_AXIS]–; } else { sys_position[Y_AXIS]++; } } 2019-03-18 19:11 GMT+01:00,Cri S <phone.cri@gmail.com>:step_outbits |= STEP(Y) ; st.counter_y -= st.exec_block->step_event_count; 如果 (st.exec_block->steps_backlash[Y_AXIS]) st.exec_block->steps_backlash[Y_AXIS]–; else if (st.exec_block->direction_bits & (1<<Y_DIRECTION_BIT)) { sys_position[Y_AXIS]–; } else { sys_position[Y_AXIS]++; } } 2019-03-18 19:11 GMT+01:00,Cri S <phone.cri@gmail.com>:
|
嗨
,我有一个带右步和左步的旧电机控制器,所以没有方向和步长……
有办法使用它吗?
是否可以对软件进行一些更改以使用左步和右步而不是步长和方向?