Mach Discussion > Brains Development

Brain writing on/off relay

<< < (2/2)

Thom2000:
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!)

Thom2000:
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

TPS:
i have tested the brain here, it works fine.

Tweakie.CNC:
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.

Thom2000:
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.

Navigation

[0] Message Index

[*] Previous page

Go to full version