Machsupport Forum
Mach Discussion => Brains Development => Topic started by: Thom2000 on November 18, 2018, 09:41:51 AM
-
Hello,
I could use some help writing a brain.
I need to output a signal to a relay.
On when Z moves down and off when it moves up.
Any suggestions would be very helpful.
Thank you.
Mario
-
something like this might work
-
Sorry I missed your reply. My email isn't forwarding replies.
Thank you for your interest in my problem (which is mine as you say).
How do I install this brain into the brain folder?
It is a PNG file.
It looks more complicated than I first thought but would love to try it.
Thank you again,
Mario
-
ok, i am sorry to have this brain file thrown away.
you have to rebuild it of the screenshot.
it you have Trouble, let me know, then i will do a new brain file
-
Here is, recreated :)
-
Hello,
I tried to write it in the brain editor but just do not have enough experience at this time. Your help would be very much appreciated.
(Love your cars!)
-
Okay, getting close.
The Z down movement turns on the relay.
But when the z reverses upwards, it stays on.
Could you please take a look,
Thank you again,
Mario
-
i have tested the brain here, it works fine.
-
Another possibility you may wish to consider…
The Z axis Direction Pin state is modal, it will have one state when (and after) the Z axis has moved in one direction and the opposite state when (and after) the Z axis has moved in the other direction. The Z axis Direction Pin could then be used to switch an Output# ON or OFF without using Brains.
Tweakie.
-
Of course, you tested it before sending. It was late and I didn't see I had another brain enabled that kept the relay on.
So I was a man with 2 brains! >:D
Thank you for all your help.
Also, I would like to try the Tweekie approach.
If I use pin 3 for Z direction and have pin 3 OUTPUT # 1, pressing Z down should turn on the relay.
But it doesn't so I must have missed something.