- Posts: 24
- Thank you received: 0
Please Log in or Create an account to join the conversation.
i would implement the component as a state machine. from the idle it would check the "home" pin and if true, move to, say, home1 state.
mimic the linuxcnc homing behavior. you'll have home_search_velocity and home_latch velocity. something like
target_velocity = home_search_velocity;
dv = (target_velocity - current_velocity);
if (dv / fperiod > max_accel) dv = max_accel * fperiod
else if (dv / fperiod < -max_accel) dv = -max_accel * fperiod;
current_velocity += dv;
output_pos += current_velocity * fperiod;
you can have a look how linuxcnc does it: github.com/LinuxCNC/linuxcnc/blob/master.../emc/motion/homing.c
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.