Hi,
I've been working on getting a new mill console connected and talking to Mach3 through a CubeLoc modbus card. Everything through the modbus works as it should and all the different signals all get fed to my brain files. The rotary switches I used are binary, that is to say they have single or multiple pins being contacted at the different switch positions. It took me some time to figure out how to deal with the binary values moving from the switch, to the modbus, to Mach and finally to the individual brain files. But I got there eventually. All the binary is dealt with directly in my brain files, the rest of the system just sees it as the individual pins are either on or off. And for the most part it all works like it should.
But I got one or two small problems I can't seem to understand what's happening. In my feed rate override brain, I had to keep each brain file to only four switch positions each brain. So I ended up with 5 individual brains for the 21 positions of my switch. The spindle speed override is similar, but I was able to have five switch positions in each brain for a total of 3 brain files for that function. That took some time to figure out what the problem was, but in the end the brains were just too long.
Some more history first, I got both of those switches working along with the rapid override switch some days ago, only to find that the correct percentage number would only get dropped into the corresponding dro while the switch was being turned to increment the value. If the switches were turned to decrement or decrease the values, the values would be whatever the lowest switch setting reflected or a zero. I could stop decreasing the switch positions wherever I wanted and go the other directions and the correct values would be displayed again. I corrected that problem this morning by adding an "or" gate or lobe as shown in the brain pics I've attached.
But now that I have most values being dropped into the dro's correctly, I find that a few won't display the correct value in the dro's. The brain shows the correct value, but the dro will just show a 0. The ones I'm finding fault with are either the first or last switch position in each brain, but not across the board. In brain #1, all four positions work correctly no matter the direction the switch is being turned, in brain #2, the top (63%) won't display anything other than a 0 while the switch is being incremented but works correctly while being decremented. And in the same brain file, the bottom position (100%) will display a 0 while the switch is being decremented, bt works correctly when it's incremented. In brain #3, the bottom position (150%) displays a 0 while the switch is being decremented but is fine with it being incremented. Brain #4 works correctly at all switch positions just like brain #1. Brain #5 has a problem with the top position (212%) with the switch being incremented, again displaying a 0. But if decremented, the correct values is displayed. These are all feed rate override brains and that's what the pictures reflect.
On the spindle speed override brains, I have two that display incorrectly with the switch being decremented and those two are bottom rungs in the individual brains. All of them work correctly while the switch is being incremented.
Then one other brain is really throwing me for a loop. It's the rapid override brain. It only has 4 positions in it and all work correctly except the one that should reflect 75%. The brain is made similar to the feed rate brains and the brain actually displays the correct percentage at 75%. But what gets dropped into the dro was 91, not 75. So I messed with this some this morning and only got more puzzled by it. It seems I can change the 75 to 60 and it will display correctly in the dro, 61, 62 and 63 likewise. But if I change it to 64, it will start to display oddly and show 89%. I got no idea what to think about that problem.
So, I thought I'd ask the experts for some advise to see if anyone had any thoughts on how to correct these small problems. I can use like it is, but I'd rather they work as they should. Pics below.
Thanks for looking
Bob