Hello Guest it is April 21, 2021, 01:17:22 PM

Author Topic: ESS Inputs and Outputs not doing anything  (Read 5257 times)

0 Members and 1 Guest are viewing this topic.

Re: ESS Inputs and Outputs not doing anything
« Reply #50 on: July 12, 2018, 07:39:50 PM »
Hi,
OK pins 10,11,12 and 13 are good but I think pin 2 port 2 is opposite because of having only one inverter.

Pins 10,11, 12 and 13 should, unless held high by HLFB, will go low and signal a fault.
Pin 2 port 2 is pulled low at the input pin of the BoB BUT the ESS pin will be high by virtue
of the single inverter. So port2 pin 2 will be low when the servo is good and high when in fault.

Quote
They are all being supplied 5v from the board to make them go high and all the corresponding input LEDs on the board are lit when enabled.  The servos close the circuit when working properly which is why I tried having it active low so the LED in Mach4 should turn off when the ESS no longer sees the 5v.   
This is correct for pins 10,11,12 and 13.

The question is does it work?

Remember also how Mach4 handles signals, it detects a CHANGE. Thus if a signal is low at start up it will stay low
until Mach sees that its state has changed. This explanation may go some way too explaining why Mach responds
only after you toggle the input.

Craig
My wife left with my best friend...
     and I miss him!
Re: ESS Inputs and Outputs not doing anything
« Reply #51 on: July 12, 2018, 07:56:49 PM »
Ok, I can switch port2 pin 2 to High. 

When you say "at start up" do you mean when the machine is enabled or when Mach4 is opened and starts running?  Because it registers the change in the inputs before the machine is enabled but it misses things that change right when the machine is enabled, like the error signal now coming from the motors.  Also it seems to only sometimes recognize the change in the inputs once enabled.   
Re: ESS Inputs and Outputs not doing anything
« Reply #52 on: July 12, 2018, 08:02:34 PM »
So right now I have Port1 pins 10, 11, 12, 13 getting 5v when the motors are enabled.  I also have them set to active low.  When I enable the machine all the LEDs on the board come on.  Whats really odd is port2 pin11 is always on in mach4, as in the LED in machine diagnostics is always on both before and after enabling the machine.  The others turn on, in mach4, when the machine is enabled but then won't always turn off even when the wires are disconnected from the board and the board LEDs are off.   
Re: ESS Inputs and Outputs not doing anything
« Reply #53 on: July 12, 2018, 08:50:22 PM »
Hi,

Quote
So right now I have Port1 pins 10, 11, 12, 13 getting 5v when the motors are enabled.  I also have them set to active low
This is good.

Don't worry about the port 2 pins just yet, we'll come back to that, there is enough to think about with pins 10,11,12 and 13
without adding more complication!

Quote
When I enable the machine all the LEDs on the board come on.
This is signalling that there  servos are in fault mode. Are you 100% sure the servos are powered up? Note that
when the servo is 'good' there is a is a conductive path between HLFB+ and HLFB-(asserts)  and a non-conductive path when in fault
mode. Thus when the servo is un-powered, and therefore there is no conductive path, that  is equivalent to
the servo signalling a fault!

Next question: have you programmed the HLFB. There are several modes in which it can operate. I suspect the mode you
want is 'In Range'. Thus the HLFB asserts, ie conducting, when the servo is in position and correctly following the step/direction
commands.

Page 46:
Quote
The HLFB can be used to signal:
• If the servo drive is enabled or in a shutdown (Servo On)
• When the commanded move is complete and settled to your
specifications (ASG-Position)
• How well the motor is following your positioning or velocity**********************
commands (In Range)
• Motor speed, via PWM output (Speed Output)
• Motor torque, via PWM output (Torque Output)

And on page 48:
Quote
IN RANGE
The HLFB In Range mode signals when the motor shaft is within a userdefined
range of the commanded position or commanded velocity. This
mode is available in positioning or velocity op modes and changes
automatically based on the ClearPath op mode you are currently using.
In Range-Position
You must be in a ClearPath positioning mode and select In Range from
the HLFB menu. During operation, the HLFB output asserts when actual
motor position is within X counts of commanded position. You set the X
value (i.e., the range) via the Advanced>MoveDone Criteria dialog in
MSP.

Note how Tecknics use the term HLFB 'asserts'....nice use of language...I will use it too.
Let us know how you get on.

Craig
My wife left with my best friend...
     and I miss him!
Re: ESS Inputs and Outputs not doing anything
« Reply #54 on: July 13, 2018, 09:38:15 AM »
I have HLFB+ connected to 5v and HLFB- connected to the inputs.  The LEDs I was talking about are the ones on the C25 showing that they are seeing 5v once the motors are enabled.  Which I am sure that they are, green lights on the motors are blinking and more importantly they move.  And as far as the HLFB state goes I'm just using the Servo On, since that is really all I care about right now.   That's why I put those inputs as active low in the ESS plugin so they would be showing "all good" as long as the 5v was there.   Was trying to get it setup so that the lights would only come on in Mach4 when the input losses the 5v. 
Re: ESS Inputs and Outputs not doing anything
« Reply #55 on: July 13, 2018, 04:02:57 PM »
Hi,

Quote
Was trying to get it setup so that the lights would only come on in Mach4 when the input losses the 5v. 
That is possible but why bother? In very short order you are going to reprogram HLFB to 'In Range', its the real use of the HLFB
and if it goes active it will stop the machine. Who cares about the LEDs. Additionally if you follow the same advice I gave Tom about handling
HLFB which servo has faulted will be reported to Mach in the status line.

As one last argument, having the LEDs for the first half a dozen inputs, Input#0 though Input#5, is really handy. But once you have worked out how
to handle HLFB properly you'll no longer need the LEDs and so you will redo the assignments to Input#20 through Input#25 say which leaves the
LEDs un-attached so you can use them for the new thing you are working on today.

Craig
My wife left with my best friend...
     and I miss him!
Re: ESS Inputs and Outputs not doing anything
« Reply #56 on: July 13, 2018, 04:25:35 PM »
Hi,

Quote
Was trying to get it setup so that the lights would only come on in Mach4 when the input losses the 5v. 
That is possible but why bother? In very short order you are going to reprogram HLFB to 'In Range', its the real use of the HLFB
and if it goes active it will stop the machine. Who cares about the LEDs. Additionally if you follow the same advice I gave Tom about handling
HLFB which servo has faulted will be reported to Mach in the status line.

As one last argument, having the LEDs for the first half a dozen inputs, Input#0 though Input#5, is really handy. But once you have worked out how
to handle HLFB properly you'll no longer need the LEDs and so you will redo the assignments to Input#20 through Input#25 say which leaves the
LEDs un-attached so you can use them for the new thing you are working on today.

Craig

Well this is just a prototype, and I really only care that it works long enough to demonstrate the proof of concept.  Just need to know the motors are working so the machine doesn't rip it self apart if one drops out.  Also, that wouldn't fix the problem of Mach4 not responding to changes in those inputs after the machine is enabled, right?  Because that's really the big problem I'm having. 

The only reason I started with Input 2 was when I looked in the Sig Lib there was already entries for Inputs 0 and 1.  Just figured it would be easier not to mess with those. 
Re: ESS Inputs and Outputs not doing anything
« Reply #57 on: July 13, 2018, 04:53:15 PM »
Hi,

Quote
The only reason I started with Input 2 was when I looked in the Sig Lib there was already entries for Inputs 0 and 1.  Just figured it would be easier not to mess with those.

Yes that's good.

Quote
Just need to know the motors are working so the machine doesn't rip it self apart if one drops out
That's pretty crude...even for proof of concept. The 'In Range' HLFB is the correct use of the signal, if the servo differs from its commanded position
by greater than an amount you program it will fault. Note that would include one servo shutting down...it would get out of position very quickly and fault,
stopping the machine.

Quote
Also, that wouldn't fix the problem of Mach4 not responding to changes in those inputs after the machine is enabled, right?
Wrong. Read section 3.2.4 of the Scripting Manual.pdf in your Docs folder about how signals work.

The simple explanation is that ANYTIME a signal, ANY SIGNAL, in Mach changes state the Signal Script runs. The Signal Script in turn looks
in the SigLib table to see if there is an entry there which matches the changed signal. That is the SigLib table contains only the signals we are interested
in. Thus in this case lets say one of your servos fault in operation....the HLFB will de-assert.....the Input#n to which it is attached will change state....the Signal
Script will run....the SigLib table has an entry [ISIG_INPUTn] and will therefore execute the function attached to the table entry, which will stop Mach and
post a fault report on the status line or in the log if you wish it.

Craig
My wife left with my best friend...
     and I miss him!
Re: ESS Inputs and Outputs not doing anything
« Reply #58 on: July 13, 2018, 05:04:11 PM »

The simple explanation is that ANYTIME a signal, ANY SIGNAL, in Mach changes state the Signal Script runs. The Signal Script in turn looks
in the SigLib table to see if there is an entry there which matches the changed signal. That is the SigLib table contains only the signals we are interested
in. Thus in this case lets say one of your servos fault in operation....the HLFB will de-assert.....the Input#n to which it is attached will change state....the Signal
Script will run....the SigLib table has an entry [ISIG_INPUTn] and will therefore execute the function attached to the table entry, which will stop Mach and
post a fault report on the status line or in the log if you wish it.

Craig

But shouldn't Mach4 still be responding to the input in the machine diagnostics window after the machine is enabled?  Even if they are unassigned general inputs won't the machine diagnostics LEDs change if the input changes?  Or will those inputs, and their corresponding machine diag LEDs, only change after enabling the machine if there is a Sig Lib entry?
Re: ESS Inputs and Outputs not doing anything
« Reply #59 on: July 13, 2018, 05:25:36 PM »
Hi,
have you read the section on signals yet?

The Machine Diagnostics screen is to help you, a visual representation of what's going on inside. If you deleted the entire  Machine Diagnostics tab Mach would carry
on working. You are getting hung up on the visual display of your settings rather than what Mach does with them.

Have you put any code in the SigLib table yet? If so what code? It might be worth putting a wxMessageBox type statement in your code to confirm that
Mach is triggering and acting on your signals. Forget the Machine Diganostics for the moment, they are causing you more confusion than they are worth.
Concentrate on getting the snippets of code in the SigLib table sorted out.

Craig
My wife left with my best friend...
     and I miss him!