comanding axis movement from within a component

More
9 years 7 months ago #89585 by andypugh
What do you want to jog with? MPG or button?

You could just add a second signal to the current one prior to passing it to the stepgen.
Or add a jogging function to the HAL component.

Please Log in to join the conversation.

More
9 years 7 months ago #89601 by JR1050
Im trying to use buttons and im attempting to write a jog function to my component. sine it is a jog by button, it isnt being given a distance to go to, idea being push plus button, actuator move left, push minus, it goes right.
something similar to this

case 32;
if((ssw_manual_ram)==1&&(pb_fwd)==1){
ram_enable=1; // connected to stepgen enable
stepgen_go=0; //stepgen.0.dir
step_step=400; //stepgen.0.step-based on 400 steps a rev
}
else
if((ssw_manual_ram)==1&&(pb_rvs)==1){
ram_enable=1;
stepgen_go=1; //stepgen.0.dir
step_step=400; //stepgen.0.step-based on 400 steps a rev
}
break

I think this would work with the standard stepgen component, but , im using the hm2 version and it doesnt have the step or direction pins, not that i could find in then manual, am is missing something?

Please Log in to join the conversation.

More
9 years 7 months ago #89605 by andypugh
Presumably your component sends position commands?
So, jogging is just a case of sending different position commands.

if (button) {
position = position + 0.0001;
}

Please Log in to join the conversation.

More
9 years 7 months ago #89610 by JR1050
thank you, a simple loop...would not have thought of that

Please Log in to join the conversation.

Time to create page: 0.037 seconds
Powered by Kunena Forum