Hello Guest it is December 07, 2019, 06:46:23 PM

Author Topic: Difference between Enable Pins and Output Pins?  (Read 5005 times)

0 Members and 1 Guest are viewing this topic.

Re: Difference between Enable Pins and Output Pins?
« Reply #10 on: June 07, 2015, 10:58:14 PM »
Hiya Peter, Do you still have all the parts for the hand pendant ? Can I buy them from you ? I would REALLY love to get it finished up and on the machine. I have an new extra MODIO board here I can use if needed. I have triesd to email you in the past but no luck. I think your PC doesn't like me and dumps me in the trash can.

(;-) TP

Hi Terry,

I still have this one for you. I just can't seem to find the time to finish it. I can send it off to you if you like?

 I'll even dust it down. :)

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: Difference between Enable Pins and Output Pins?
« Reply #11 on: June 08, 2015, 01:18:16 AM »
That would be the one (;-).

(;-) TP
Re: Difference between Enable Pins and Output Pins?
« Reply #12 on: June 08, 2015, 01:29:21 AM »
OK, I'll send it off.

Cheers,

Peter
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com

Offline rcaffin

*
  •  1,007 1,007
    • View Profile
Frustration: how to read outputs?
« Reply #13 on: June 08, 2015, 02:39:30 AM »
OK, some progress. Forgive me if much of this is either obvious or well-known (or in SBF format).

The Enable#n signals are of no use to me, as they all start 'off', are all set 'on' when Mach powers up, and all go off when Mach stops. The 'all set on' bit when Mach starts is the opposite of what I want. But the Output#n signals will serve well.

I can jiggle the defined Output#n pins with ActivateSignal(Output1) and DeactivateSignal(Output1) very easily. That's good.

I can read the Input#n pins with If getOEMLED(821) then ... (for Input#1) quite happily. I haven't actually tested getOEMLED(Input1), but it does not matter. The value returned is either 0 for not-asserted or -1 for asserted, but I think these are actually Boolean values, not numeric. Again, no matter.

But what I want to do is to read IN an OUTPUT pin, to check that it has already been set. I cannot, so far.
I can issue the VB command getOEMLED(Output1) and it executes, but I really do not think it is reading the state of the Output1 pin.

Does anyone know how to read IN the state of an OUTPUT pin?
and
If I execute getOEMLED(Output1), what does it read?

Yes, of course i could jumper the Output pin to an Input pin and read it that way, but you don't get many Input pins ...

Cheers

Offline rcaffin

*
  •  1,007 1,007
    • View Profile
Re: Difference between Enable Pins and Output Pins?
« Reply #14 on: June 08, 2015, 07:33:46 AM »
RTFM   :D

if IsOutputActive(Output1) then
  message("Outout #1 is active")
else
  message("Output #1 is not active")
end if

Looking in the wrong place.

Cheers
Roger

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: Difference between Enable Pins and Output Pins?
« Reply #15 on: June 08, 2015, 01:57:46 PM »
 :o I see you are building your OWN user manual now.  ;D

(;-) TP

Offline rcaffin

*
  •  1,007 1,007
    • View Profile
Re: Difference between Enable Pins and Output Pins?
« Reply #16 on: June 08, 2015, 05:29:20 PM »
Old (computing) proverb:
'By the time the documention is complete, the hardware is obsolete.'
Sigh.

Cheers
Roger

Offline rcaffin

*
  •  1,007 1,007
    • View Profile
Re: Difference between Enable Pins and Output Pins?
« Reply #17 on: June 10, 2015, 07:45:59 AM »
OK, time to give something back.
I was trying to make the M3 and M4 commands 'safe'. Obviously, trying to drive a not-rotating drill bit (or milling cutter) into a solid block of metal is not going to work, but might prove expensive and destructive. So first check that the system is 'live'.

What that means is that I wanted to first check the the spindle supply was active, and then to check that the spindle relay was active, before issuing the basic DoSpinCW command and expecting the spindle to spin.

The check on the spindle power supply is needed because the mains supply to it goes through a magnetic circuit breaker which can drop out during power-up. Yes, I could omit the breaker, but I don't want to. The 'spindle relay' connects the spindle supply to either the mill spindle motor or to the lathe chuck motor. Actually, there are two separate relays there: M90 actives the mill spindle, M91 activates the lathe chuck, and if you try to do both a hardware lockout prevents you. Those relays take a separate commands. It's all about safety.

So, after much hassle, my M3 command now looks like this. Note that M90 is the command which energises the mill spindle relay, via Output#5.

' First check whether Spindle PS is on - this uses optical feedback from spindle PS to Input #3
do while true
  If IsActive(Input3) Then
    exit do
  else
    Ret=MachMsg("Hit CR when powered","Spindle supply alert",1)
    If ret=2 Then
      DoOEMButton(1001)   ' Pause
      DoOEMButton(1003)   ' Stop
      DoOEMButton(1002)   ' Rewind
      end          ' Cancel pressed, so get out of here
    else
' Has hit Retry, so try again assuming PS is now powered up
    End If
  End If
Loop

' Now check whether Output5 from M90 is active
If IsOutputActive(output5) Then
  DoSpinCW
  message("Spinning")
else
  MachMsg("Aborting","M90 is Missing!   ",0)
  DoOEMButton(1001)  ' Pause
  DoOEMButton(1003)    ' Stop
  DoOEMButton(1002)    ' Rewind
end if

The first test, of the power supply, allows me to go back, switch the PS on, and retry.
The second test does kill the program if the spindle relay is not on. That means something went wrong somewhere.

The M90 macro is included in the Mill startup command string issued by the Reset button.

Hope this helps
Cheers
Roger

Offline rcaffin

*
  •  1,007 1,007
    • View Profile
Re: Difference between Enable Pins and Output Pins?
« Reply #18 on: February 02, 2016, 10:42:46 PM »
Unfortunately, the hardware behind macros I posted has one deficiency (that I know of), which I now have to rectify.

The selection of Mill or Lathe operation uses TWO off DPDT relays for safety reasons, instead of the original one DPDT relay. Why?
Because I had found with just one relay that an eStop while in Mill mode would drop out the Mill-select relay, which meant power was transferred to the Lathe spindle. This had been a bit too exciting for me. There are also some logic gates which should prevent both Mill and Lathe being asserted at the same time.

The reversing operation was done with a DPDT reversing relay, driven off the M4 line. That seemed fine at the time. However, if the program executed M5 while the spindle was in reverse mode, the reversing relay would drop back to FWDs, and the spindle would do an extremely fast stop as the remains of the power supply output were applied in the other direction. This seemed a bit too exciting as well.

So I have had to use the same two-off double-throw relay system for direction. M3 will activate one relay, M4 will activate the other relay, and M5 will deactivate both relays. A power resistor across the NC terminals brings the spindle to a halt, but is NOT in circuit the rest of the time.

Ah, but what if both M3 and M4 are issued? The short simple answer is a dead short across the spindle power supply, followed by a repair bill. So the macros will be expanded to check to see whether the system is in the 'other' state, and to kill that first with a short time delay to allow the mechanical world to catch up with the electric world. I will also use a logic gate lockout as was done for the Mill/Lathe selection.

But what about a wiring error? Powering both mill and lathe at once is not a calamity: one hits eStop and fixes the electronics. But the reversing section is another matter.
Instead of using a DPDT relay for each direction, I will use a 3PDT relay. The 3rd pole for the M3 relay will be in the coil circuit for the M4 relay, and vice versa. So if M3 is asserted, you can NOT assert the M4 relay as well, and vice versa.

What if you try to assert both M3 and M4 simultaneously? The system could chatter. However, the logic gates should prevent that from happening, and part of that circuit will detect a simultaneous M3+M4 assertion - and activate the eStop. Short of really gross wiring errors, that should suffice.

M5 will drop both outputs regardless of course, but it will do it in sequence. If M3 is asserted, it will first make sure M4 is NOT asserted, before it clears M3, and vice versa.

Cheers
Roger