comanding axis movement from within a component

More
14 Mar 2017 13:38 - 14 Mar 2017 13:39 #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.
Last edit: 14 Mar 2017 13:39 by andypugh.

Please Log in or Create an account to join the conversation.

More
14 Mar 2017 16:41 #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 or Create an account to join the conversation.

More
14 Mar 2017 17:01 #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;
}
The following user(s) said Thank You: JR1050

Please Log in or Create an account to join the conversation.

More
14 Mar 2017 17:10 #89610 by JR1050
thank you, a simple loop...would not have thought of that

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum