Machsupport Forum

Mach Discussion => Brains Development => Topic started by: rrc1962 on November 26, 2010, 10:54:52 AM

Title: Stuck on brain
Post by: rrc1962 on November 26, 2010, 10:54:52 AM
I know I can turn things on and off based on conditional logic, but what I need to do is set a userDRO = to an OEMDRO if OEMLED(36) or torch lit input is active.  In an if statement it would look like this...

If "Torch Lit" then
   USERDRO(2000) = XPOSITION
End If


Another possible way to do this would instead of continously updating the USERDRO(2000), just set it to XPOSITION the moment "Torch Lit" is lost.

In the brain editor I see an input for "torch lit" and I see the DRO's, just not sure how to connect them all in a brain.   

TIA
Title: Re: Stuck on brain
Post by: Hood on November 26, 2010, 06:01:36 PM
Give this a try, X Axis value should be written to the user DRO (1234) when OEM LED36 is on.
Hood
Title: Re: Stuck on brain
Post by: rrc1962 on November 26, 2010, 06:31:52 PM
That's what I've been trying to do.  I just can't seem to figure out how to set up that logic in a brain.  I can do it in a macro pump, but I like the low overhead of the brains.  Things like this always seem to run smoother in brains.
Title: Re: Stuck on brain
Post by: rrc1962 on November 26, 2010, 06:33:15 PM
Sorry Hood.  I didn't see the brain file you attached.  I'll give it a try.  Thanks very much.
Title: Re: Stuck on brain
Post by: Hood on November 26, 2010, 06:39:13 PM
Should work fine, if not let me know.
Hood
Title: Re: Stuck on brain
Post by: rrc1962 on November 26, 2010, 06:51:50 PM
That's pretty close.  What's happening is that the user DRO is changing to 0 when the LED goes out.  What I'm after is for the user DRO just stop recording when the LED goes out so I know the exact point at which arc OK was lost.  You gave me a good starting point.  Is there a good manual on brains somewhere?  I haven't been able to find anything other than a doc in the user section about setting up brains with modbus.
Title: Re: Stuck on brain
Post by: Hood on November 26, 2010, 06:57:40 PM
Ah OK never thought of that, will mess a bit and see if I can figure something out.
Regards the brains manual, not that I know of, I just mess around and view the Brain as  I operate the triggers and see what happens. I have attached the SRO brain I use which might give you an idea about Modbus.
Hood
Title: Re: Stuck on brain
Post by: Hood on November 26, 2010, 07:32:35 PM
Try this
Hood
Title: Re: Stuck on brain
Post by: rrc1962 on November 26, 2010, 07:53:08 PM
Hmm...Interesting...I noticed this earlier when I was playing around with the AND and OR statements.  When it increments the user DRO, it only increments the whole number, not the decimal.  IE:  Everything between 3 and 3.9999 on the oem dro shows as 3.0000 on the user dro.
Title: Re: Stuck on brain
Post by: Hood on November 26, 2010, 07:57:39 PM
Never noticed that as the DRO I was writing to on the screen was one I was messing about for my toolchange macro so had no decimals in it.
Dont know what can be done there, will have a mess about and see if I can figure something out.
Hood
Title: Re: Stuck on brain
Post by: Hood on November 26, 2010, 08:05:23 PM
Third time lucky? ::)

Hood
Title: Re: Stuck on brain
Post by: Hood on November 26, 2010, 08:09:10 PM
Think we are back to problem one, if the LED goes out DRO will zero.

Hood
Title: Re: Stuck on brain
Post by: Hood on November 26, 2010, 08:20:05 PM
When the LED comes on do you do anything such as E-Stop? Just wondering if any of the variables may help.
Hood
Title: Re: Stuck on brain
Post by: rrc1962 on November 26, 2010, 10:26:01 PM
I think I've got it.  The decimal thing seems to have something to do with the AND, OR and EOR.  This solution works.  The user DRO stops and stays put when the LED goes out.  When the LED re-lights the user DRO changes to zero then when movement starts, the brain matches it to X position.  That behavior is OK.

What I'm trying to do is create a function that takes the torch back to the last point that the system had a good ark OK signal.  I'm not sure how to handle the G-code yet or if it's even possible.  The problem is that if the THC goes into anti-dive mode, it waits 3 seconds for the voltage to come back into range.  It it doesn't, it shuts the torch down, which causes the arc OK LED to go out.  When mach sees that the arc OK is lost, it pauses the program until it sees a good arc OK.  Problem is that if the torch shuts down in the middle of a command, like the mid point of a circle, the torch shuts down, but mach completes the current command.  The result is that half the circle is left un-cut.

When you rewind the program, you can't rewind and run from the beginning of the last command because you would be cutting air and the THC would shut it down.  You have to somehow rewind and run from the last known position
where the system had a good arc OK signal.

It happens so infrequently that it's hardly worth the effort, but it's a challenge and something cool if I can get it working.
Title: Re: Stuck on brain
Post by: Hood on November 27, 2010, 04:10:55 AM
Oh well it was third time lucky ;D

It happens so infrequently that it's hardly worth the effort, but it's a challenge and something cool if I can get it working.
I feel the same way as you with things like this, once I start on something I find it very hard to put it down until I find a solution.
Hood
Title: Re: Stuck on brain
Post by: rrc1962 on November 27, 2010, 10:58:04 AM
Yep...The third one did it.  Thanks so much for your help.
Title: Re: Stuck on brain
Post by: rrc1962 on November 27, 2010, 05:08:25 PM
Hood...What's involved in interfacing the DL06 to Mach3?  Is it just a serial connection then configuring the ModBus in Mach or is there more to it? 
Title: Re: Stuck on brain
Post by: Hood on November 27, 2010, 06:04:09 PM
Some people use the ModBus plugin but I prefer the Non plugin interface. The non plugin nterface can talk via VB and I think you are restricted to Brains with the plugin.
As for setting up its simple, heres a screenshot of mine.

Hood
Title: Re: Stuck on brain
Post by: poppabear on November 27, 2010, 07:28:13 PM
you can use brains with the non-plugin serial as well
Title: Re: Stuck on brain
Post by: Hood on November 27, 2010, 07:33:02 PM
Yes, I use Brains, what I was getting at was I dont think you can use VB with the Plugin where you can with the non plugin interface..
I think you use the plugin Scott, can you assign inputs and outputs in Ports and Pins, for example I have some outputs as drive enables and just have port 0 pin * et up for that , can that be done if you use the plugin?
Hood
Title: Re: Stuck on brain
Post by: rrc1962 on November 27, 2010, 10:44:22 PM
Is the non-plugin interface is just a serial connection from the PLC to the PC?  Is there a screen in Mach where you set up the PLC inputs and outputs?  Something like the ports and pins inputs and outputs but for the PLC.

Thanks
Title: Re: Stuck on brain
Post by: poppabear on November 28, 2010, 10:47:17 AM
Yes, if I understand your question correctly, please clairify if I am not understanding what your asking.

given your example, your saying you want to turn on some OUTPUTs that would handle drive enables, across the non-plugin serial modbus correct? And you want to control that via VB? You can do it (control the Plugin-Serial-Modbus), by VB indirectly.....

Lets say you want to turn on OUTPUT1, or, even Enable1 and have it go across the pluginenabled modbus.

in VB you set, some trigger, or get some trigger, i.e. GetUserLED, or SetUserLED for example, as your input in Brians, send that result to
a termination of outputxx, and set another rung, that looks at outputxx and sends it to a Plugin enabled modbus output.

scott