Hello Guest it is May 23, 2019, 01:33:52 PM

Author Topic: Mach3, MPG, Brains...wait...is this minus a plus ?  (Read 10846 times)

0 Members and 1 Guest are viewing this topic.

Mach3, MPG, Brains...wait...is this minus a plus ?
« on: August 06, 2010, 06:27:18 PM »
Hi there.

I'm in a little predicament here. Let me be as narrative as concise :

My Mach3 demo runs fine...loading, some G-code, turning the 3-axis motors drive offline to do some tests...
I have this homemade Modbus-RTC  m.p.g plugged in, calibrated, activated, and a dedicated brain in Mach3 running... Let's look at it in realtime...(attachment #1/3)



Rotating the knob clockwise : (attachment #2/3)


Then counterclockwise : (attachment #3/3)



Great ! The MPG1 Count internal variable is reflecting my mpg's clicks...

BUT : why does the tool/program combo always moves FORWARD while in Shuttle Mode ? Shouldn't I be able to trace back on the toolpath when I turn the MPG knob backwards (and MPG1 Count is obviously decrementing)

What setting did I miss for my "MPG1 Count" deltas are always being seen as positive ?


Help ? Someone ? Anybody ? Pretty please ?



Offline poppabear

*
  • *
  •  2,231 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach3, MPG, Brains...wait...is this minus a plus ?
« Reply #1 on: August 08, 2010, 08:44:47 AM »
try clicking the Reverse run button in your program control, then turn the MPG backwards in shuttle mode.

BTW: nice job with your brain.

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Mach3, MPG, Brains...wait...is this minus a plus ?
« Reply #2 on: August 09, 2010, 07:53:52 AM »


That's riiiight poppabear ! You've made me realize I can use a workaround here !! Thanks !  :o

By making the output of my first lobe an absolute value... then adding a lobe which will make a boolean value the sign of the original MPG's count, I can turn on/off the "Reverse run" button with its OEM command code !

Lemme see ... it would be like : (attachment #1)



Problem is...this only applies while using the MPG's "Shuttle Mode"... I fear the brain shown up here may activate the Reverse Run output even in "Jog" mode. So, by simplifying the "Reverse Run" lobe and adding a boolean AND operator with LED #106 ("Shuttle Mode in use"), I can deduce this : (attachment #2)



Moreover, I'd say I SHOULD take care of the distinct MPG Jog modes (Continuous, Step, MPG) in this brain graph... This would allow me to Jog back and forth in Continuous or Step Jog Mode (the previous brain graph only applies to "MPG" Jog, with Shuttle Mode active).

But this will lead me to a horrible brain graph, with a tremendous input entropy, calculating the VERY SAME values multiple times, forcing me to use local variables in a asynchronous manner...
Darn ! I don't even KNOW if Mach3 brains are executed sequentially !!! Inputs and Outputs could be totally out-of-synch ! This could jam my machine's gantry and lead to total mayhem ! It already hear the sound of drill bits shattering !

*sob*
I wish I had a complete doc about .brn files (brain files). I need to write them by hand, I'd wanna create a brand new "Brain IDE" for Mach3 ! Mach3Lobe.exe sucks a bit... *sob*
But I don't think I can find anything in Mach3's SDK about it.

Offline poppabear

*
  • *
  •  2,231 2,231
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach3, MPG, Brains...wait...is this minus a plus ?
« Reply #3 on: August 12, 2010, 10:50:28 AM »
I had Art send me the source code for the Brains IDE, a loooonnngg while back, I was going to try and fix its interface issues........  but, it is beyond my meger ability!!  it is almost completely non-documented, and Art will freely tell you it is torturous logic and programming. I am here to tell you he is NOT kidding......

    I have only been programming in C++/MFC for about 2-3 years now, and that really mostly for plugins. I have done some minor apps in C++/MFC, but, I like and use C# much better for Apps!!

   I would highly recommend you contact Art, and ask him for the source code, it is his, and I will not send my copy to you since it is his IP (and now Brians), unless Art/Brian specifically ask me to.

   Guys like: Klaus, and Ed Bryson are the kinda guys who are at the level of skill needed to tackle something like this as well. Art has been a programmer for 30+ something years, and he can whip out stuff like this, withoug thinking to much about it.......... 

If you want, read the "Brians Users Guide", I wrote and put in the "Members Docs" Thread, download it, I list MOST of the "Issues" (undocumented features), of Brians and some of the work arounds I have found for it.  Shortly after Art completed Brians he left Mach3 and turned it all over to Brian.  Since that time, it has remained unchanged, until such time as Brian gets all the other stuff he wants to fix in M3 done........  Brians and Modbus are on the FAR back burner until that time.

So, the best workaround I have found to get around the above, if Brains and VB won't do it for you, Write your self a plugin!!!!  They are FAR more stable and fast!!!  Yes, the learning curve SUCKS it is worse than when I learned Flash programming, far worse.  But, I suspect YOU are a programmer, so it should be nothing for you to pick up.

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/