Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: rileyknox on July 05, 2018, 02:07:58 PM

Title: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 05, 2018, 02:07:58 PM
In the process of switching over to the ESS and I am having some trouble getting things setup. Trying to get the E-Stop and Enable signals going first. Have the E-Stop going from port3pin26 for the 5v to port3pin13 through a normally open switch. Have the pin13 set to active low and have Mach4 pointing to that pin in it's control menu. The problem is pushing the switch does nothing and Mach4 always shows the E-Stop clear, and if I set pin 13 to low Mach4 always shows the E-Stop tripped. As far as the enable signals go there doesn't seem to be any output.
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 05, 2018, 02:32:18 PM
Hi,
what breakout board are you using?

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 05, 2018, 02:57:00 PM
Hi,
what breakout board are you using?

Craig

The C25
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 05, 2018, 03:14:57 PM
Hi,
section 3.1 page2 shows a representative circuit diagram of an input pin. Note the that input has a 220Ohm resistor and a LED to ground. You will require
a input able to source 20mA in order to be sure that the input is genuinely logic high. Your normally open switch will have to be CLOSED in order to pull the input
pin high. Is this what you intended? To Estop Mach you would have the switch contacts open.......

Make sure your choice of source for the 5V for your Estop switch is correct and  can source sufficient current. Do you have a multimeter?
If so measure the voltage at the 5V source and then again at the input pin with the switch closed, it should be 4.1V or more.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: Stuart on July 06, 2018, 02:07:18 AM
Are the jumpers on the ESS set to power the Bob?

I have a C25 and it is only port 1 and 2  not 3 so how are you connecting to port 3 pin 26 and port 3 pin 13 ?
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 11:08:48 AM
Hi,
section 3.1 page2 shows a representative circuit diagram of an input pin. Note the that input has a 220Ohm resistor and a LED to ground. You will require
a input able to source 20mA in order to be sure that the input is genuinely logic high. Your normally open switch will have to be CLOSED in order to pull the input
pin high. Is this what you intended? To Estop Mach you would have the switch contacts open.......

Make sure your choice of source for the 5V for your Estop switch is correct and  can source sufficient current. Do you have a multimeter?
If so measure the voltage at the 5V source and then again at the input pin with the switch closed, it should be 4.1V or more.

Craig

The 5v being used is the board 5v from port3pin26 which the documentation shows should do at least 24mA and I have tested and shows 5v.  Also it doesn't seem to matter how the switch is wired.  If the input is set to active low then Mach4 always shows the E-Stop clear, regardless of the switch.  And if it is set to active high then Mach4 always shows the E-Stop active, again no matter the position of the switch.   
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 11:11:16 AM
Are the jumpers on the ESS set to power the Bob?

I have a C25 and it is only port 1 and 2  not 3 so how are you connecting to port 3 pin 26 and port 3 pin 13 ?

All jumpers, for all three ports, are installed.  Using JST connectors to just those two pins.  That's why I chose pin 13 because it's right across from 26 so I can use a 1x2 connector. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 02:16:35 PM
Hi,
so did you measure the voltage?

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 02:45:14 PM
Hi,
so did you measure the voltage?

Craig

Yep,  full 5v.
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 02:49:06 PM
Hi,
so if the input port3 pin 13 is to be held high switch must be closed. If you open the switch the input goes low.
That's what is intended is it not?

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 02:54:47 PM
Hi,
are you using an input on the C25 or not?

It sounds like you are working directly on the ESS pins. If that's the case its not recommended. You really should install a BOB
so that you have buffer ICs between the ESS and your wiring.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 03:51:20 PM
Hi,
so if the input port3 pin 13 is to be held high switch must be closed. If you open the switch the input goes low.
That's what is intended is it not?

Craig

Right now I'd be happy if it did anything.  If set to active low Mach4 always shows the E-Stop not active, whether it is closed or not.  And if set to active high then it always shows it active, again whether it is closed or not.  Even tried using a straight jumper to connect and disconnect the pins, which has no effect whatsoever.  It's as if the input is not acting like an input at all and is just sending to Mach4 whatever it is set to be active at, regardless of the signal being physically sent to the pin. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 03:58:29 PM
Hi,
is it port3 pin13 of the ESS? From your description you have blown that input.

You have all those buffered inputs on the C25, why not use one of them? That's what they're for.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 04:03:56 PM
Hi,
is it port3 pin13 of the ESS? From your description you have blown that input.

You have all those buffered inputs on the C25, why not use one of them? That's what they're for.

Craig
It's own 5v output killed that input?  Wow, that really doesn't bode well for this board's reliability.  I guess that will be next step, although seeing as none of the outputs on the C25 are working either I don't have much hope. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 04:13:47 PM
Hi,
you still haven't answered the question....are you using the ESS pins direct?

If you are as I have said its not recommended, any slight bobble on your part can fry the FPGA.

More importantly the ESS has pull-up resistors not pull-down like the C25. I have attached a pic of the input circuit of the ESS.
If you are using the ESS input direct (contrary to advice) then the pin needs to be pulled low, ie 0V.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 04:28:50 PM
Hi,
you still haven't answered the question....are you using the ESS pins direct?

If you are as I have said its not recommended, any slight bobble on your part can fry the FPGA.

More importantly the ESS has pull-up resistors not pull-down like the C25. I have attached a pic of the input circuit of the ESS.
If you are using the ESS input direct (contrary to advice) then the pin needs to be pulled low, ie 0V.

Craig

Moved it to port1pin13 and that seems to have fixed that problem.  Thank you for helping with that part.   But none of the outputs are working, and for some reason port2pin9's light is one and it's showing an output of 2.45v constantly.
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 04:42:16 PM
Hi,
the C25 has port 1 pins 2-9 configured as outputs. This is the normal state of affairs, these are the step and direction outputs to your
drivers. Port 2 pins 2-9 are ALL INPUTS. This again is normal from the days of the parallel port.

A single parallel port was always chronically short of inputs for things like limit and home switches. Thus it is common to have the second
port configured with pins 2-9 as inputs. The C25 adopts this convention.

The C10 breakout board can for instance be configured with pins 2-9 as input OR outputs. If you really want to use the third port of your
ESS then I would recommend the C10, it has buffers to offer some protection to the much more expensive ESS and you can configure
the ESS/BoB with more inputs OR outputs as you require.

Back to the issue at hand.

May I suggest that you measure the output voltages of the C25 port   pins 2-9. You need then to set up some code in Mach4 to toggle those
outputs.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 04:49:46 PM
Hi,
the C25 has port 1 pins 2-9 configured as outputs. This is the normal state of affairs, these are the step and direction outputs to your
drivers. Port 2 pins 2-9 are ALL INPUTS. This again is normal from the days of the parallel port.

A single parallel port was always chronically short of inputs for things like limit and home switches. Thus it is common to have the second
port configured with pins 2-9 as inputs. The C25 adopts this convention.

The C10 breakout board can for instance be configured with pins 2-9 as input OR outputs. If you really want to use the third port of your
ESS then I would recommend the C10, it has buffers to offer some protection to the much more expensive ESS and you can configure
the ESS/BoB with more inputs OR outputs as you require.

Back to the issue at hand.

May I suggest that you measure the output voltages of the C25 port   pins 2-9. You need then to set up some code in Mach4 to toggle those
outputs.

Craig

Port 2 pins 2-9 can't be outputs on the C25?
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 04:52:38 PM
Hi,
I just read this in the C25 manual:

Quote
Outputs 1, 14, 16 and 17 (Port 1 and 2) and outputs 2-9 (port 1).
All those pins are directly wired to the C25 output terminals.

It would appear the output of the ESS is direct connected to the output screw terminal of the C25, no buffering.
I consider that less than ideal. The C10 has input AND output buffering and is preferred. I myself use MB2's from Homan Designs
in Austrailia, I live in New Zealand so its near enough to local for me. They are a bit more expensive than the C10 but I've been very
happy with them. They to offer bi-directional pins 2-9 and input and output buffering AND LEDs on ALL inputs and outputs so I can tell
at a glance whats happening. Those LEDs would be a real boon to you at the moment.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 04:56:34 PM
Hi,

Quote
Port 2 pins 2-9 can't be outputs on the C25?
That is correct, page 2 of the C25 manual makes it plain......port 1 pins 2-9, 1, 14, 16 ,17 and port 2 pins 1, 14 ,16,17 are outputs
while the rest are inputs.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 05:02:10 PM
Hi,
I just read this in the C25 manual:

Quote
Outputs 1, 14, 16 and 17 (Port 1 and 2) and outputs 2-9 (port 1).
All those pins are directly wired to the C25 output terminals.

It would appear the output of the ESS is direct connected to the output screw terminal of the C25, no buffering.
I consider that less than ideal. The C10 has input AND output buffering and is preferred. I myself use MB2's from Homan Designs
in Austrailia, I live in New Zealand so its near enough to local for me. They are a bit more expensive than the C10 but I've been very
happy with them. They to offer bi-directional pins 2-9 and input and output buffering AND LEDs on ALL inputs and outputs so I can tell
at a glance whats happening. Those LEDs would be a real boon to you at the moment.

Craig

Well that's both stupid and annoying, if the ESS has bidirectional input outputs then why the hell doesn't the C25.  Especially if they claim "Full access to all the pins of the Smooth Stepper Board".   Now I get to waste time and money waiting around for either 2 C10s or one of what you recommended to show up.  Great.  

Thank you for your help and I'm sure sure I will have plenty more questions when whatever I now have to order shows up.
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 05:07:56 PM
Hi,
another feature of the C25 which I took no notice of is that the inputs 10,11,12,13 and 15 of each port have two inverter
buffers, ie the combination is not inverted.

The inputs port 2 pins 2-9 have only one inverter buffer so the inputs are inverted. Its something you need to keep in mind.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 05:09:58 PM
Hi,
another feature of the C25 which I took no notice of is that the inputs 10,11,12,13 and 15 of each port have two inverter
buffers, ie the combination is not inverted.

The inputs port 2 pins 2-9 have only one inverter buffer so the inputs are inverted. Its something you need to keep in mind.

Craig

Well if it can't do the port 2 outputs then it doesn't really matter, it's going in the scrap box.
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 05:12:06 PM
Hi,
whats wrong with the C25.....its got plenty of inputs AND outputs enough to drive your machine so whats the problem?

Why do you have to use port 2 as outputs?

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 05:14:35 PM
Hi,

Quote
Especially if they claim "Full access to all the pins of the Smooth Stepper Board"
Your reading advertising not the manual.......that's a mistake when it comes to CNC.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 05:17:07 PM
Hi,
whats wrong with the C25.....its got plenty of inputs AND outputs enough to drive your machine so whats the problem?

Why do you have to use port 2 as outputs?

Craig

I need it to drive 6 axis, with three outputs per axis.  Enable, STEP, DIR.  That's a min of 18 outputs.  Also have PWM fans to control as well.  But it looks like it only has 16 outputs since I'm loosing 2-9 on port 2.  
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 06, 2018, 05:19:36 PM
Hi,

Quote
Especially if they claim "Full access to all the pins of the Smooth Stepper Board"
Your reading advertising not the manual.......that's a mistake when it comes to CNC.

Craig

And that is exactly why I am really starting to hate this DIY hacker crap.  Went through all the this same crap with the pokeys57cnc which was a total wast of time and money. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 05:32:36 PM
Hi,
are all of the six axes independent or are some slaved to others?

Even if you require all 18 inputs then yes you will need another board but you will still need inputs. If you think you can get away
without decent limit and home switches with a 6 axis machine you'll struggle.

If you bought another C10 then:

Port 1       outputs 1,2-9,14,16,17 =12
                inputs 10,11,12,13,15  =5

Port 2       outputs 1,14,16,17   =4
                inputs 2-9,10,11,12,13,15   =13

Port 3        outputs 1,2-9,14,16,17   =12
                 inputs 10,11,12,13,15    =5


TOTAL        outputs =
                  inputs  =23

Is that enough?

If not you need to extend capabilities with a PLC.

Quote
And that is exactly why I am really starting to hate this DIY hacker crap
Then go buy a Seimens 840, $20,000 plus!

Craig


Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 05:37:28 PM
Hi,
sorry cant add TOTAL outputs=28
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 06, 2018, 06:56:53 PM
Hi,
one other thought about how to get out of that bind is that you stated you have a six axis machine and required three outputs per axis;
step, direction and enable.

Is it strictly necessary to have an enable on every servo? It seems to me likely that if there is a fault of some description that you want to disable
one servo then its very likely that you'll want to disable more than one, maybe ALL of them so that the fault can be cleared without a crash.
If that's the case you could use one output as an enable and that one signal would enable all the servos. It would save five outputs.
You could therefore use the C25 as is.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: Stuart on July 07, 2018, 01:15:01 AM

[/quote]

And that is exactly why I am really starting to hate this DIY hacker crap.  Went through all the this same crap with the pokeys57cnc which was a total wast of time and money. 
[/quote]

Maybe you are blaming the wrong things

Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 07, 2018, 01:29:04 AM
Hi,
I think OP is inclined to either not read the manual of a prospective hardware solution or skim over important aspects of its design.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 08, 2018, 06:03:28 PM
I would love to be able to buy an "off the shelf" working machine but that not an option since there aren't any other machines like this out there.   This is a proof of concept prototype for a new type of high speed industrial 3D printer.  In fact this machine will probably be actually running for less time than I have already spent tying to get these control boards to do what I need them to do, which is what is so frustrating.  If this was something which was going to be running for a long time or which was the end product then this wouldn't be that bad, but right now it is nothing more than a kluge of DIY parts standing in my way of getting to the next step.  

As far is using one output for all the enables I also had that thought, but I will have to probably use a SSR to switch a more powerfully 5v supply than the board can do on one output since I have 10 motors which need to get the signal and each has about 25' of wire to cover.  I was hoping to avoid all that by just using the boards outputs directly.  But at this point I would be happy if just a single output actually worked.  I disabled all outputs except for one Enable signal and still nothing.  Started off trying port 1 pin 3 "X Enable" with only it enabled as an output in the ESS plugging and then did the same it Mach4.  If set to active High then it's always off, as in no output and the indicator LED is always off.  Hitting Enable in Mach4 control screen does nothing.  If it is instead set to active Low then it is always on, as in the LED is on and it's sending 5v out.  Again completely independent to anything done on the Mach4 control screen.   The only thing done with Mach4 it seems to respond to is closing the program, which will disable the output, but as soon as I open Mach4 again the output is back on.  Tried the same thing for a couple of other outputs, ones the C25 actually supports, and got the same on all.   Also port 2 pin 9 is always on with 2.43v output for some crazy reason.  
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 08, 2018, 06:32:39 PM
Hi,

Quote
Also port 2 pin 9 is always on with 2.43v output for some crazy reason.  
That sounds like an actual fault. Can you test the output of the ESS and then the output of
the C25?

I will give some more thought to those other issues. You recall my previous post which tells that the
dedicated C25 outputs are directly hooked to the ESS output pins. It will be necessary to look at ESS output
circuit diagram to establish what its state will be when Mach is idle or disabled.

Quote
I have already spent tying to get these control boards to do what I need them to do, which is what is so frustrating.

By designing and building your own machine YOU have assumed responsibility as machine integrator.
As such reading and understanding the manuals IS YOUR RESPONSIBILTY. Make a decision whether
you have the aptitude and attitude to continue.

Craig

Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 08, 2018, 08:59:44 PM
Hi,
yes using a SSR or even a MOSFET would be sufficient to enable all ten motors.

I suspect you have two issues causing you grief with respect to getting output signals
to work. If you are expecting the outputs M1, M2, M3 etc to operate I suspect you may be
getting confused. Mach handles those its own way, I'm at work at the moment and so cannot
get to my machine and refresh my memory as to how and when those signals operate. If memory
serves however they behave in a manner which you or I might not call logical, and I can't remember
just how.

My recommendation is to use one of the general purpose outputs OSIG_OUTPUT1 through ISIG_OUTPUT64
instead. Tonight I will post a little code that will help you set it up for test purposes.
This will allow you to test and get familiar with the ESS, its plugin and your C25 BoB.
Once you become familiar with that then using M1, M2 etc will become alot easier.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 09, 2018, 03:48:12 AM
Hi,
to have a motor enable output first the motor must be enabled in the Control (also called Mach in earlier builds).
You see in the attached pic that I have enabled three motors; motor0, motor1, and motor2 by checking the boxes associated
with each.

The next pic is where Mach is in disabled state and note M0, M1 and M2 LEDs are not light.

The last pic is with Mach enabled and not M0, m1 and M2 LEDs are light.

I conclude that Mach is correctly handling the motor enable outputs.

Can you repeat these steps? Does your Mach installation behave the same?

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 09, 2018, 04:10:47 AM
Hi,
put this code in a macro, m100, in the macros folder of your current profile:

Code: [Select]
function m100()
local inst=mc.mcGetInstance()
local hsig=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT2)
local outstate=mc.mcSignalGetState(hsig)
if (outstate==1) then
mc.mcSignalSetState(hsig,0)
else
mc.mcSignalSetState(hsig,1)
end
end
if (mc.mcInEditor()==1)then
m100()
end

If you run this macro (m100 from the MDI panel) then Output#2 will change state each time you do so. You should see the Output#2 LED
of the machine diagnostics tab change as you do so.You can now attach that output to any output pin of your BoB you choose.
In this way you can test each output pin individually. Would pay to take attention of your potentially dodgy output port 2 pin 9.

Note that the ESS plugin automates certain activities between the ESS plugin and the Control (Mach) plugin. In particular note that if you
enable the Motor 0 Enable signal in the ESS Output Signals page with port 1 pin 1 say and THEN go and check the Control (Mach) plugin
Output Signals page that the Motor 0 Enable signal has automatically been updated BY the ESS plugin.

If now having checked that Motor Enable say is working and you now want to test another output you will have to clear the previous asigments
from BOTH the ESS AND the Control (Mach) plugin. That is to say that a setting made in the ESS plugin will propagate TO the Control plugin
but NOT  A DELETION.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 12, 2018, 12:00:30 PM
So I finally have all the axis up and running.  But now I have run right into another problem.  I'm trying to get the motor error outputs from the servos into mach4 so it will stop the machine if there is a motor fault.  I have everything I need to do this ready to go, including the Signal Lib code for the general inputs I hooked them all up to.  Problem is that mach4 stops reading the inputs after I hit enable.  When not enabled it reads the inputs just fine, as seen in the machine diagnostics page by manually connecting and disconnecting the input wire to simulate the error signal.  But once I enable the machine the input just stays at whatever state it was at right before enable, even as the LED light on the C25 is going on and off as I again manually trigger the input.    Suggestions on what I'm missing?
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 12, 2018, 12:08:14 PM
Hi,
if you have used the SigLib{} table then Mach4 doesn't 'read' the inputs at all.

When a signal changes state, any signal, the signal script runs. The signal script looks in the SigLib table to see if there is an entry
for the signal in there, ie a match between the signal which has just changed and the entries corresponding to the signal we are interested in.

Can you please post the code that you put in SigLib?

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 12, 2018, 12:09:49 PM
Hi,
if you have used the SigLib{} table then Mach4 doesn't 'read' the inputs at all.

When a signal changes state, any signal, the signal script runs. The signal script looks in the SigLib table to see if there is an entry
for the signal in there, ie a match between the signal which has just changed and the entries corresponding to the signal we are interested in.

Can you please post the code that you put in SigLib?

Craig

Haven't put it in yet.  Was just checking to make sure the inputs were actually working when I noticed this problem. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 12, 2018, 12:14:03 PM
Hi,
give me some details. You have assigned one pin per servo or one pin for all the servos?


Craig

Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 12, 2018, 12:16:53 PM
Hi,
give me some details. You have assigned one pin per servo or one pin for all the servos?


Craig



One pin per servo.  Set to Input #2 - Input #6.  Only doing 5 of the axis since the last is actually steppers off a stepper driver. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 12, 2018, 12:26:06 PM
Hi,
so when Mach is not enabled you can cause the LEDs on the Machine Diagnostics tab to come on by flicking the input
pin with a piece of wire? With Mach disabled it wont, is that correct?

Craig

Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 12, 2018, 12:33:49 PM
Hi,
not quite sure why that should be. Please go to edit screen mode and bring up the properties of LEDinput2 and check Enable with Machine
per the attached pic.

Try again.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 12, 2018, 01:01:45 PM
Hi,
spotted a typo....I don't need the LEDLabel enabled with the machine, rather the LED itself.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 12, 2018, 04:57:07 PM
Hi,
so when Mach is not enabled you can cause the LEDs on the Machine Diagnostics tab to come on by flicking the input
pin with a piece of wire? With Mach disabled it wont, is that correct?

Craig



Correct.  When not enabled the machine diagnostic LEDs will go on and off.  After enable they freeze in whatever state they were in before enable.

Hi,
spotted a typo....I don't need the LEDLabel enabled with the machine, rather the LED itself.

Craig

Done, and now they won't turn on at all, with or without the machine enabled.
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 12, 2018, 05:00:26 PM
Hang on ... they will turn on, but only if the input is toggled after it is enabled.  So all the ones which turned on right when the machine was enabled, from the error feed back coming on, are still off.  But if I manually disconnect and reconnect them they will now come on while enabled.
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 12, 2018, 05:06:36 PM
Also just tried switching to active low in the ESS plugin.  That got the light to turn on when the machine is enabled but it wont always turn off then the error signal goes low.  Meaning if I disconnect the wire. sometimes the LED will go out, other times it won't. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 12, 2018, 06:04:16 PM
Hi,
what pin on the BoB are you using?. Remember these are pulled low and need to be supplied current
to make them go high. Remember also that some pins had one inverter whereas other pins had two.

The setting active high-active low in the ESS plugin doesn't change the pin or signal, just reverses the logic
that Mach applies to the signal.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 12, 2018, 06:37:17 PM
Hi,
what pin on the BoB are you using?. Remember these are pulled low and need to be supplied current
to make them go high. Remember also that some pins had one inverter whereas other pins had two.

The setting active high-active low in the ESS plugin doesn't change the pin or signal, just reverses the logic
that Mach applies to the signal.

Craig

They are wired to port 1 pins 10, 11, 12, 13 and port 2 pin 2.  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.   
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage 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
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox 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.   
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox 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.   
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage 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
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox 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. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage 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
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox 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. 
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage 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
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox 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?
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage 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
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 15, 2018, 08:07:03 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

So I read through everything and looked at your other posts to check the code.  Add I have things working, but only about 33% of the time.  Meaning Mach4 will only respond to the HLFB signal about 1 or 3 times.

So right now I have the pin for X set to active Low and the pin for Y set to active High, doing this just to test and see if there is a difference in readability of response which there isn't.  When they work both will E-Stop when the 5v from the HLFB drops out.  Problem is sometimes that happens on the first try and others it may take 3 times.  Meaning, after the machine is enabled, I will actually disconnect the wire, the board LED goes out but nothing happens, then I will reconnect, board LED comes back on and still nothing (which is good), then I will disconnect the wire again, and then Mach4 will respond and E-Stop.  Sometimes it works on the first disconnect, other times I have to reconnect and disconnect 2 or 3 times for Mach4 to respond.   

Here is the code I am using for X and Y right now.  It is in the SigLib and saves and runs fine. 

[mc.ISIG_INPUT2] = function(state)
   if (state==1) then
      mc.mcCntlEStop(inst)
      mc.mcCntlSetLastError(inst,'X axis HLFB asserted')
   else
      mc.mcCntlSetLastError(inst,'X axis HLFB de-asserted')
   end
end,

[mc.ISIG_INPUT3] = function(state)
   if (state==0) then
      mc.mcCntlEStop(inst)
      mc.mcCntlSetLastError(inst,'Y axis HLFB asserted')
   else
      mc.mcCntlSetLastError(inst,'Y axis HLFB de-asserted')
   end
end,

If it just worked or didn't that would be one thing, but the fact that it works sometimes and not others seems really odd to me. 
   
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 15, 2018, 09:06:45 PM
Hi,

Quote
If it just worked or didn't that would be one thing, but the fact that it works sometimes and not others seems really odd to me.
Yes, I agree. Not sure whats going on, I have never encountered a fault of that description and if there were
a problem as basic as this we would all have heard it!!

The only thing I can suggest that might explain it is that the input signal is flickering or bouncing at the time of signal
transition. May I suggest applying some filtering on the input pins in the ESS/PIN Config page, I would try a value of 500.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 15, 2018, 10:38:54 PM
Hi,

Quote
If it just worked or didn't that would be one thing, but the fact that it works sometimes and not others seems really odd to me.
Yes, I agree. Not sure whats going on, I have never encountered a fault of that description and if there were
a problem as basic as this we would all have heard it!!

The only thing I can suggest that might explain it is that the input signal is flickering or bouncing at the time of signal
transition. May I suggest applying some filtering on the input pins in the ESS/PIN Config page, I would try a value of 500.

Craig

No joy on that one.  Tried 500, 1000, and 200 just for good measure.  None had too much of an effect.  It maybe got a bit more likely to happen on the first try but then would also have ones where I had to disconnect and reconnect 3 or 4 times to get a reaction from Mach4.   
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 16, 2018, 12:29:36 AM
Hi,
I suppose its not impossible that Mach is going cranky but if that were so many hundreds of users would
be reporting such a fault.

Can you probe (carefully!!!) one of the signals but between the C25 and the ESS. Maybe get a really fine
needle or pin and push it through the insulation of the ribbon cable wire corresponding to the input you choose to monitor.

My reason for suggesting this is to establish whether the breakout board is faithfully transmitting TO the ESS.

I guess the next place to look is the ESS diagnostics page. Take a look at the page and see if the ESS is faithfully
reporting its state transmitted to it from the BoB.

Craig
Title: Re: ESS Inputs and Outputs not doing anything
Post by: rileyknox on July 16, 2018, 06:14:36 AM
Hi,
I suppose its not impossible that Mach is going cranky but if that were so many hundreds of users would
be reporting such a fault.

Can you probe (carefully!!!) one of the signals but between the C25 and the ESS. Maybe get a really fine
needle or pin and push it through the insulation of the ribbon cable wire corresponding to the input you choose to monitor.

My reason for suggesting this is to establish whether the breakout board is faithfully transmitting TO the ESS.

I guess the next place to look is the ESS diagnostics page. Take a look at the page and see if the ESS is faithfully
reporting its state transmitted to it from the BoB.

Craig

I have the C25 just plugged straight into the ESS ports.  Didn't use any ribbon cables.  Guess I could make some cables corresponding to just the inputs I'm using to start checking things there.
Title: Re: ESS Inputs and Outputs not doing anything
Post by: joeaverage on July 16, 2018, 09:06:13 AM
Hi,
OK you could probe the board direct but its easy to slip and create a fault. Fitting two short ribbon cables and then piercing the insulation
is safest. In absence of that have a look at the ESS diagnostic.

Craig