Mori MVJR Build Log
- schmidtmotorworks
- Offline
- Elite Member
- Posts: 281
- Thank you received: 6
The rapid override; it has 4 options:
Feed (the last feedrate)
25%
50%
100%
I'm thinking that I would make a new component similar to mux but take the feed rate as an argument and return that as the value for the first selection and then compute the values from the other selections.
Does this seem reasonable?
Please Log in or Create an account to join the conversation.
component selectaxis "Select an axis based on BCD input";
pin in bit in1;
pin in bit in2;
pin in bit in4;
pin out bit axis0;
pin out bit axis1;
pin out bit axis2;
pin out bit axis3;
pin out bit axis4;
pin out bit axis5;
pin out bit axis6;
pin out bit axis7;
function _;
license "GPLv2 or greater";
;;
FUNCTION(_) {
if(in1) {
if(in2) {
if(in4) axis7 = 1;
else axis3 = 1;
}
else {
if(in4) axis5 = 1;
else axis1 = 1;
}
}
else {
if(in2) {
if(in4) axis6 = 1;
else axis2 = 1;
}
else {
if(in4) axis4 = 1;
else axis0 = 1;
}
}
}
Please Log in or Create an account to join the conversation.
In addition to the previous switch problem there is one last one.
The rapid override; it has 4 options:
Feed (the last feedrate)
25%
50%
100%
I'm thinking that I would make a new component similar to mux but take the feed rate as an argument and return that as the value for the first selection and then compute the values from the other selections.
Does this seem reasonable?
In 2.5 there is the current feed rate available as a pin... but I'm not sure how you might used that at this point.
John
Please Log in or Create an account to join the conversation.
- schmidtmotorworks
- Offline
- Elite Member
- Posts: 281
- Thank you received: 6
But generally, I think I would have to make 4 (or 8) pins in the hal file and their value would be set by this function?
Then use those pins to enable the jog axis?
Please Log in or Create an account to join the conversation.
- schmidtmotorworks
- Offline
- Elite Member
- Posts: 281
- Thank you received: 6
I guess you may be right though the unselected bits probably should be set to 0.
Please Log in or Create an account to join the conversation.
there is a switch for it.
it also supports debounce delay
The reason the first two inputs were 0 in Johns example way back was he was using the suppress-no-input option.
If you don't each time you move your physical switch the feed rate can go to zero for a moment.
This option make the mux ignore when all inputs are zero the consequence is that you must select a different
input combination for zero override.
Later i added debounce-time
debounce time make mux16 wait a certain time after it detects an input change for that change to become stable.
probably better then suppress-no-input cause then you can just have no inputs as zero overrride.
there is also a switch to have mux16 use gray code.
Gray code is good because in a sequence, only one input changes at a time - again better for eliminating false readings.
You can have combinations of all three options
Please Log in or Create an account to join the conversation.
He has BCD input and needs bit output for each axis... I not 100% sure that mux16 can do that as it outputs a number based on the intput. Or I'm totally off base...
John
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thanks, I'm trying to figure that one out, without indentation. I will try to figure out the indentation. Then maybe it will get it.
But generally, I think I would have to make 4 (or 8) pins in the hal file and their value would be set by this function?
Then use those pins to enable the jog axis?
If the out pins are bit pins then they can connect to the jog enable for that axis directly. Assigning not zero (positive value only I think) to a bit is the same as true or True... so somebit = 1 sets it to on.
John
Please Log in or Create an account to join the conversation.
- schmidtmotorworks
- Offline
- Elite Member
- Posts: 281
- Thank you received: 6
Am I close at all?
##############################################################
# --- Axis Select ---
##############################################################
setp select_axis.0.suppress-no-input true
setp halui.override.count-enable true
#send some values from pins into select_axis.comp
net select_axis_switch_pin_0 select_axis.0.in1 <= hm2_5i23.0.7i64.[tbd].[tbd].in_not
net select_axis_switch_pin_1 select_axis.0.in2 <= hm2_5i23.0.7i64.[tbd].[tbd].in_not
net select_axis_switch_pin_2 select_axis.0.in4 <= hm2_5i23.0.7i64.[tbd].[tbd].in_not
#set the axis jog enable selection based on output from select_axis.comp
net axis.0.jog-enable => select_axis.0.axis1
net axis.1.jog-enable => select_axis.0.axis2
net axis.2.jog-enable => select_axis.0.axis3
net axis.3.jog-enable => select_axis.0.axis4
net axis.4.jog-enable => select_axis.0.axis5
Please Log in or Create an account to join the conversation.