Hello Guest it is April 26, 2024, 05:45:43 AM

Author Topic: Feed rate override switch  (Read 11424 times)

0 Members and 1 Guest are viewing this topic.

Feed rate override switch
« on: October 26, 2011, 12:35:27 PM »
Hello all, I have searched for an answer to this for awhile and have come up empty.

I have posted this in Brains and VB to get both opinions.

I have a 16 position binary switch ( 4 pins - 1,2,4,8). I have the pins set to Input #1,2,3 and 4. The way this switch works is pin 1 = 1, pin 2 = 2, pin 1 and pin 2 = 3 and so on tell you get 16 (counting all pins off as a position).

I need to find a way to have this control my feedrate over ride, plus my rapid override at the same time. I'm not sure if the best way would be with a Brain or in VB - Macropump. The most important thing is that the switch works fast.

I don't have a problem writing it up in my Macropump, just need a little guidance on the code.

This is what I was think for the layout, just not sure about the DRO for the FRO:

If IsActive(INPUT1) = False And
IsActive(INPUT2) = False And
IsActive(INPUT3) = False
IsActive(INPUT4) = False Then
SetOEMDRO(0, 0) <--- Needs to set the DRO to 0%
End If

If IsActive(INPUT1) And
IsActive(INPUT2) = False And
IsActive(INPUT3) = False
IsActive(INPUT4) = False Then
SetOEMDRO(0, 0) <--- Needs to set the DRO to 10%
End If


So on and so forth, tell I get all 16 positions set.


Any help would be GREAT!!


Thanks,

Aero

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Feed rate override switch
« Reply #1 on: October 26, 2011, 12:46:28 PM »
FOr that I would do it in the Brains. The Brians are much faster in the actual code side. AND seeing as it is a basic ladder type coding it would work best.

Now the brains CAN be painfull to build long ladders. IF you mess up somewhere you have to start all over from scratch to rebuild the Rungs of the ladder.

Just a thought, (;-) TP
Re: Feed rate override switch
« Reply #2 on: October 26, 2011, 12:46:53 PM »
I could prob. do something like this:

CurrentFeedrate = FeedRate()

If IsActive(INPUT1) = False And
IsActive(INPUT2) = False And
IsActive(INPUT3) = False
IsActive(INPUT4) = False Then
CurrentFeedrate= 0
SetFeedrate(CurrentFeedrate)
End If

If IsActive(INPUT1) And
IsActive(INPUT2) = False And
IsActive(INPUT3) = False
IsActive(INPUT4) = False Then
CurrentFeedrate= CurrentFeedrate/10
SetFeedrate(CurrentFeedrate)
End If

And so on, not sure if the language is correct, but you get my point.
Re: Feed rate override switch
« Reply #3 on: October 26, 2011, 12:48:29 PM »
FOr that I would do it in the Brains. The Brians are much faster in the actual code side. AND seeing as it is a basic ladder type coding it would work best.

Now the brains CAN be painfull to build long ladders. IF you mess up somewhere you have to start all over from scratch to rebuild the Rungs of the ladder.

Just a thought, (;-) TP

That is what i have been running into, what DRO would I need to change and how do I set its value? I have wrote VERY simple Brains, but I'm up to the challenge if it works good :)


ADD: I have never wrote a Brain were I had to set a value.
Re: Feed rate override switch
« Reply #4 on: October 27, 2011, 12:40:14 PM »
If some one could write a simple one for reference that would be great, and I would much appreciate it.


Thanks

Aero
Re: Feed rate override switch
« Reply #6 on: October 27, 2011, 02:16:16 PM »
I'm trying to get the Brain up and running. I have attached the Brain I'm messing with, but when I run it, it sets the FRO to the last % on the list (in this Brain it's 30%) and when I turn the switch the FRO doesn't change. Any ideas?




For the Macropump I tried this but I don't see any change:

If IsActive(INPUT1) = False And IsActive(INPUT2) = False And IsActive(INPUT3) = False And IsActive(INPUT4) = False Then
SetOEMDRO(821, 0)
End If


Thanks for the help :)


Aero

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Feed rate override switch
« Reply #7 on: October 27, 2011, 02:41:56 PM »
Try something along these lines.


IF not IsActive(Input1) and not IsActive(Input2)and not IsActive(Input3) then SetOemDro(29,0.000)

(;-) TP

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Feed rate override switch
« Reply #8 on: November 03, 2011, 08:42:42 AM »
'MacroPump.m1s

'Here is another option using the Macro-Pump, since you have a potiential of 16
'positions. Figure out the numeric value of each combination in decimal.
'NOTE!! test and MAKE sure on the diagnostics page, that you are reading
'these 4 INPUTS when the B-switch makes them active!!!

BIT1 = IsActive(INPUT1) 'value in decimal of 0 or 1
BIT2 = IsActive(INPUT2) 'value in decimal of 0 or 2
BIT3 = IsActive(INPUT3) 'value in decimal of 0 or 4
BIT4 = IsActive(INPUT4) 'value in decimal of 0 or 8

DecimalValue = ( (BIT4 * 8) + (BIT3 * 4) + (BIT2 * 2) + (BIT1 * 1) )

If ( DecimalValue = 0 ) Then    'Four bit binary value expressed as decimal
SetOEMDRO(821, 0)             'FROVR DRO
End If

If ( DecimalValue = 1 ) Then    'Four bit binary value expressed as decimal
SetOEMDRO(821, 10)             'FROVR DRO
End If

If ( DecimalValue = 2 ) Then    'Four bit binary value expressed as decimal
SetOEMDRO(821, 20)             'FROVR DRO
End If

'ETC..........
'enjoy Scott
fun times