Mori MVJR Build Log

More
12 Sep 2011 06:04 #13116 by schmidtmotorworks
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?

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

More
12 Sep 2011 12:21 - 12 Sep 2011 17:37 #13120 by BigJohnT
Replied by BigJohnT on topic Re:Mori MVJR Build Log
For axis select I think I would just write a comp based on mux8 and change the output to bits, I've not tested this to be sure unselected axis bits are 0 or off...
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;
         }
     }
 }
Last edit: 12 Sep 2011 17:37 by BigJohnT. Reason: forgot code tags

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

More
12 Sep 2011 12:23 #13121 by BigJohnT
Replied by BigJohnT on topic Re:Mori MVJR Build Log
schmidtmotorworks wrote:

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.

More
12 Sep 2011 14:58 #13125 by schmidtmotorworks
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?

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

More
12 Sep 2011 15:41 #13126 by schmidtmotorworks
OK I think I understand the idea behind the code, that's clever.

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.

More
12 Sep 2011 17:21 - 12 Sep 2011 17:37 #13130 by cmorley
Replied by cmorley on topic Re:Mori MVJR Build Log
Hey John mux16 can use gray code.
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
Last edit: 12 Sep 2011 17:37 by cmorley.

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

More
12 Sep 2011 17:36 #13131 by BigJohnT
Replied by BigJohnT on topic Re:Mori MVJR Build Log
Hey Chris,

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.

More
12 Sep 2011 17:39 #13132 by cmorley
Replied by cmorley on topic Re:Mori MVJR Build Log
Ahhh :) I should probably read to the end first ....

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

More
12 Sep 2011 17:40 #13133 by BigJohnT
Replied by BigJohnT on topic Re:Mori MVJR Build Log
schmidtmotorworks wrote:

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.

More
12 Sep 2011 19:45 #13135 by schmidtmotorworks
This is my first run at the hal side of it.
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.

Moderators: cncbasher
Time to create page: 0.289 seconds
Powered by Kunena Forum