Welcome, Guest. Please login or register.
Did you miss your activation email?
October 20, 2014, 04:39:46 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Brains Development
| | |-+  Arduino -> modbus -> Brain
Pages: 1 2 »   Go Down
Print
Author Topic: Arduino -> modbus -> Brain  (Read 3857 times)
0 Members and 1 Guest are viewing this topic.
oscbe112
Active Member

Offline Offline

Posts: 8


View Profile
« on: January 28, 2012, 09:32:47 AM »

Hi Guys,

Building a arduino[modbus] based Pendant for my machine but has run in some trouble with brain, plz help


1. I'm jogging the axis by buttonpress. When using the buttons I want it to jog while I press the buttons, just like the binded keys at my keyboard. It starts jogging but never stops! What am I missing?

# It haven't crashed. Everything else works.
# Keyboard jogging works
# "Cont jog" is selected
# According to control brain it all works, the input is turned on only when pressed.
# When trying in "Step mode" it works just fine, it steps the amount selected in "incremental step".

2. I'm using 2 analog inputs FRO and Jog%. One of the registers has stopped working, when I use another one it works but this is strange. The Arduino handles this registers the same way. Is there a limit of registers you can use (I'm using 22)? Is there some known bug causing this?

3. How do you configure brain to actuate a button on the screen that isnt in the buttonlist?


* CNC_Pendant_1.JPG (49.56 KB, 1338x591 - viewed 424 times.)
* Pendant_test02.brn (9.96 KB - downloaded 203 times.)
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 2,100


Briceville, TN, USA


View Profile WWW
« Reply #1 on: January 28, 2012, 11:00:54 AM »

Hi Guys,

Building a arduino[modbus] based Pendant for my machine but has run in some trouble with brain, plz help


see below:

1. I'm jogging the axis by button press. When using the buttons I want it to jog while I press the buttons, just like the binded keys at my keyboard. It starts jogging but never stops! What am I missing?

>>>>>>>>>>>>>>>>>>in Brains there are "Stop Jog" commands as well, you will need to integrate that so it will stop moving when you let go.

# It haven't crashed. Everything else works.
# Keyboard jogging works
# "Cont jog" is selected
# According to control brain it all works, the input is turned on only when pressed.
# When trying in "Step mode" it works just fine, it steps the amount selected in "incremental step".

2. I'm using 2 analog inputs FRO and Jog%. One of the registers has stopped working, when I use another one it works but this is strange. The Arduino handles this registers the same way. Is there a limit of registers you can use (I'm using 22)? Is there some known bug causing this?

>>>>>>Havent played with the ardino so couldnt tell you

3. How do you configure brain to actuate a button on the screen that isnt in the buttonlist?

>>>>>>>>No direct way to do that, the best work around, is to set an ULED with the Brian, then have the Macro-pump also execute the code that is in that custom button.
>>>>>>>>make sure you put an Interlock in the MP so that it will only "Hit" that code once per push and release of your button.

Scott
Logged

Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
https://sites.google.com/site/sssystemsautomation/
oscbe112
Active Member

Offline Offline

Posts: 8


View Profile
« Reply #2 on: January 28, 2012, 12:50:43 PM »



1. Ok I got it. But having problem with the AND statement. It only works for one of the two inputs. See attached pictures

2. I suspect that the bug is caused on the other end.

3. Hmm..., no shortcut here  Undecided


Thanks Poppabear


* OK_AND dual_input .png (71.01 KB, 1008x667 - viewed 678 times.)

* FAIL_AND input .png (50.55 KB, 1007x580 - viewed 571 times.)
Logged
oscbe112
Active Member

Offline Offline

Posts: 8


View Profile
« Reply #3 on: February 19, 2012, 04:54:22 AM »

Anyone that can help me with the AND statements?
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 2,100


Briceville, TN, USA


View Profile WWW
« Reply #4 on: February 19, 2012, 09:01:00 AM »

ok, that is an easy one..........  hehehee

the issue is according to your screen shots, for your and to work, BOTH of your inputs have to be OFF at the same time, so that the inverts flip it and pass both of them as ON to your AND block. In both screen shots, one of them is ON, and the other is OFF.......

For the AND to function, with the invert on both its feeds being ON, you will need BOTH of your inputs to be OFF at the same time. The Brian only reads what is in the input, so your Arduino is the one "setting" those two inputs. So you need to look at your Arduino code, and when you want the JOGX in M3 to push the off button, then the Ard, needs to send two "0's" one in each MB register.

Scott
Logged

Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
https://sites.google.com/site/sssystemsautomation/
stirling
Global Moderator
*
Offline Offline

Posts: 1,801

UK


View Profile WWW
« Reply #5 on: February 19, 2012, 09:41:29 AM »

Hi Scott - I think what our man is saying is that in the bottom pic he's getting a "true" out of the AND gate and he SHOULDN'T be.

Ian
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 2,100


Briceville, TN, USA


View Profile WWW
« Reply #6 on: February 20, 2012, 08:36:19 AM »

Hi Ian,

   Yeap, your right, sorry I missed that.........    Embarrassed

Ok, do these 5 (possible) things to see if it resolves.

1).  Go into editor, and delete your complete last rung, and redo it, see if it works then... If NOT #2.
2).  Go into editor delete that last rung, then make a new brain call it part2 or what ever, and put JUST that problem rung in it... if not #3
3).  If that fails, Edit the part2 brain, in where you keep your inputs, but pass that data (as a no-op) to 2 unused UDROs.
      Then in the macro pump, write a interlock script that looks at those two dros, and does a button push depending on their and'ed value.
      you can use "NOT" key words to in effect "invert" their value if your using them as Boolean's..... if not #4
4).  Delete the entire brain, and rebuild a new one from scratch..........  if not #5
5). Scrap the Brian stuff, and just do it all in a macro pump, or periodic macro.

scott
Logged

Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
https://sites.google.com/site/sssystemsautomation/
stirling
Global Moderator
*
Offline Offline

Posts: 1,801

UK


View Profile WWW
« Reply #7 on: February 20, 2012, 01:50:04 PM »

5). Scrap the Brian stuff, and just do it all in a macro pump, or periodic macro.

 Grin Grin Grin

Ian
Logged
oscbe112
Active Member

Offline Offline

Posts: 8


View Profile
« Reply #8 on: February 26, 2012, 02:23:36 PM »

1. Fail !
2. Works

Its weird because I've already tried this, but well now it works!

Thanks for the help
Logged
zafarsalam
Active Member

Offline Offline

Posts: 301



View Profile
« Reply #9 on: February 27, 2012, 09:07:13 PM »

I've also noticed that only the first 10 AND based rungs work in a brain. All the AND's after the 10th one don't get triggered in any case. I break the brain into 2 parts for them to work. Is it a bug with brains?

Zafar
Logged
Pages: 1 2 »   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!