Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: crchisholm on November 12, 2017, 11:04:03 AM

Title: converting from PDMX 411 to ESS and using g540
Post by: crchisholm on November 12, 2017, 11:04:03 AM
I have purchased and started setting up ESS on my Ox using Mach 4 and Gecko g540.  I've been going through Warp9's extensive documentation.  Since I don"t exactly know what I am doing, i've elected to use their setting (even though they say my settings will vary) and am getting a bit lost.  I wounder if there is anything out there that might address ESS and g540 specifically.

The first (of many) questions I have concerns the Estop.  When connecting the eStop with the PDXM 411 controller, I connected to a couple pins on the back of the g540.  It appears that ESS expects the estop to be setup on port2 of the ESS.  Is that what have to do?

Secondly:  I at present have the g540 plugged into port 1 on the ESS.  It appears that a lot of stuff is expected to be connected through port2 (at least in the tutorials).  Is there some sort of port breakout board I need to find to hook up to port2.

Also, it would be great if I could hook up with someone using ESS with the g540.

Sorry, but I did warn that I don/t know what I am doing.

Charlie

Title: Re: converting from PDMX 411 to ESS and using g540
Post by: joeaverage on November 14, 2017, 03:03:41 AM
Hi,
the ESS has no great expectation about what signal is on any of its pins.

Obviously if an input signal like Estop is assigned to an ESS output, that is a clash but Estop could be assigned to any of the ESS input pins.

If your Estop was hooked to the G540, I would leave it there. If the G540 pin was 10 say and you have the G540 plugged into port 1 then assign the ESS pin
<port 1, pin 10> to Estop. If you've plugged the G540 into the ESS port 1 then all of the G540 pins will be available on the same ESS port 1 pins.


If you wish to have more inputs than you have to spare on the G540 then you can use the spare inputs in either ports 2 or 3 in the ESS. You don't have to use
a breakout board but its a good idea. The direct IO pins of the ESS are directly connected to the FPGA chip, the brains of the ESS. They WILL NOT stand
any abuse, if you slip when hooking up a pin and short it to either earth or logic high there is a strong possibility of frying the pin. Plugging in a breakout board
will usually protect the rather more sensitive FPGA IO pins.

Craig
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: dude1 on November 14, 2017, 04:01:28 AM
You pretty much don't need to do anything other than connect them up set the ethernet up and the stuff it says to do on this page https://warp9td.com/index.php/faq/faq-mach3 and use the Gecko provided profile for the G540.

If you watch andy's videos he does a good job of walking you through what to do as well.

A lot of the stuff Andy has done in the last few years makes it quite easy to set everything up and get going in an hour or so, some parts are too easy now.

Title: Re: converting from PDMX 411 to ESS and using g540
Post by: crchisholm on November 14, 2017, 01:01:53 PM
Dude1:  the link you specified seems to be for Mach 3 and I am using Mach 4.  Are they interchangeable when it comes to setup?

All and all, I thnk I have over-complicated this process, but just need to figure out how.  At present, when I try to "enable" the moters, it won't.  I suspect that it is becuase of the eStop setting

joeaverrage:  I think I just need to start over again and try to keep everything on port1 for now and see what I run into.  I will leave the estop on the g540 and proceed from there.  I do need to find a breakout board for port 2 as I am sure I will want to use those ports for other stuff. 
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: joeaverage on November 14, 2017, 01:10:41 PM
Hi Charlie,
if using Mach4 then posting in the General Discussion board which is typically Mach3 will result in fewer useful replies than posting on the Mach4 board.

In the first instance just use the ESS to drive the G540, ie all in one port.

The ESS Mach4 plugin allows you to name pins with an alias. So  <port1 pin2> becomes Xstep and <port 1 pin 3> becomes Xdir and so on.
Better still you only need configure the ESS plugin, it automatically configures parts of Mach4s configuration so the two are consistent.

Craig
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: crchisholm on November 14, 2017, 02:00:53 PM
Ah.  Need to pay better attention to where I am posting. 

Sorry to be such a block head, but Ia m not quite sure what you mean by "In the first instance just use the ESS to drive the G540, ie all in one port."
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: dude1 on November 14, 2017, 02:06:59 PM
I posted the wrong link it was meant to be this one  https://warp9td.com/index.php/gettingstarted/setting-up-the-smoothstepper-and-mach4  
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: dude1 on November 14, 2017, 02:08:49 PM
Craig means forget everything and just plug the G540 into port 1 of the ESS
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: crchisholm on November 14, 2017, 05:56:41 PM
Well as far as I can tell right now, seems that everything is working.  I didn't just plug it in and try it as you suggested, but that probably would have worked.  At any rate, came back to it again today and everything was working magically.  Maybe I just needed to shut everything down and fire it up again.  The only thing I had to do is switch directions on a couple of the motors.  Even the EStop is working correctly

Although, I do have a question about the EStop.  As I said, it"s working, but differently than it did with the PDMX 411.  Now when I hit the EStop, it shuts the motors down as it should...not locking them, but stopping any motion.  But now it seems that Mach 4 is not aware of the EStop being pressed....the screen keeps updating as if it were still cutting as usual.  I don't know that this is a problem, but it certainly is different than it was.  I have the Estop on port1; pin 10.  Is there something else I should do or is normal behavior (now)?
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: dude1 on November 14, 2017, 05:59:39 PM
What do you have the enable tied to in Mach4
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: joeaverage on November 14, 2017, 06:33:04 PM
Hi,
normally we expect an Estop to disable Mach including shutting down any motion but it doesn't have to or lets say
that its not hardwired so to do. You can for instance have it stop the motors but not shut the rest of the machine down.

I think dude1 is on to it, it may well be that your Estop is in fact removing the Enable signal to your drivers but not
stopping Mach. Best idea is to answer dude1's question and that will probably lead to  a solution.

Craig
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: dude1 on November 14, 2017, 06:56:27 PM
I will have to have a look tomorrow how I set the estop and enable signal on my big machine, it was over a year ago that I did it, the geckos stepper drivers all are pretty much the same they need that enable signal to work to start with, on the G540 it's the estop and the enable
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: joeaverage on November 14, 2017, 10:56:42 PM
Hi,
on a large industrial machine having an Estop completely and imediately stop Mach is probably not safe at all.

You might need time for the spindle to de-accelerate, then the Z axis brake come on before the Zaxis motor is depowered
or risk having the 1000kg spindle head slump down on to the table and risk crushing the operator who is already in some
sort of trouble hence the Estop.

I suspect to have your Estop button disable Mach4 as you are acustomed to in Mach3 you will have to place a couple of lines
of Lua code in your signal script.

Mach4 signals are handled quite differently than they were in Mach3. In Mach4 any time a signal changes the signal script runs.
There are many hundreds of signals, including input/output signals, Estop for example but many many more inside Mach itself.
When the signal script runs all that is known that a signal has changed. The script runs through a list of signals you are interested in to
see if any one of them has changed and if so what it changed to.

To enact the behaviour you want you will need to put some code in the signal script that achieves the following logic:
1) Has the Estop signal changed?
2) If it has, is it now active?
3) if its active execute an API call to disable Mach4

I know it seems a bit weird that you have to program Mach4 to disable when an Estop occurrs but it is a consequence of the need
for OEM machine builders to have the felxibility to have some specific behaviour that their machine needs to be safe. Whatever
may be said about Mach4 is that it great strength is the flexibility with which it can be programmed and its greastest weakness
is that its so flexible that it can make it tricky to do ordinary stuff.

A signal like Estop is a perfect example...you might think that if you activate that signal a certain function would happen
automatically...it doesn't. You have to decide and program the function you wish to have happen. Don't be too alarmed,
once you get used to thinking that way, namely a signal object is distinct  from its function or action it gets a lot easier.

I will help and I'm sure others will chime in to help as well with the actual code.

Craig
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: joeaverage on November 15, 2017, 12:07:31 PM
Hi Charlie,
if you slip this into the SigLib table in he screen load script:

Code: [Select]
[mc.ISIG_EMERGENCY]=function (state)
    if (state==1) then
        local inst=mc.mcGetInstance()
        mc.mcCntlEStop(inst)
    end
end,

You're done.

Craig
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: dude1 on November 15, 2017, 02:49:51 PM
Nice 1
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: crchisholm on November 17, 2017, 09:00:56 AM
Right now,  I have the estop connected between pin 10 and 12 on the g540.   There is really no connection directly to the ESS for the EStop, so I guess it's no surprise that ESS doesn't know it's been activated.  Unless I am mistaken though, that's the way it was wired when I used the PDMX 411, and Mach4 seemed to be aware of the EStop status.

Title: Re: converting from PDMX 411 to ESS and using g540
Post by: joeaverage on November 17, 2017, 12:15:38 PM
Hi,
if the G540 is plugged into port 1 of the ESS then pin 10 of he G540is connected to pin 10 of the ESS, pin12 of the G540 is connected to pin2 of the ESS.
When I say 'connected' I actually mean buffered. So an input on pins 10 or 12 will be amplified and hooked to the ESS pins.

Mach4 recognizes the signal but YOU have to tell it what to do with it....ergo those few lines of code.

Craig
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: dude1 on November 17, 2017, 03:54:13 PM
terminal 10 is the Estop/disable pin, terminal 12 common on the G540, terminal 10 translates to pin 15 on the DB25 and you can loop the Estop with the enable line in Mach as long as it is the same state it works.
                                              
 If the motors are disabled in M4 it wont move the motors, that's what the disable is for E stop is the G540 going into a fault state you also need mach to go into the same state at the sametime with the motors being disabled then the power going out.

You need the motors stopping first then power other wise you might blow the G540 fuse what's rear as hens teeth to start with.
Title: Re: converting from PDMX 411 to ESS and using g540
Post by: joeaverage on November 17, 2017, 05:53:17 PM
Hi Charlie,
dude1 is 100% correct. My laptop had a meltdown and I lost everything, including a copy of thr G540 manual. I assumed....and we know 'assumption
is the mother-of-all-f....ups'.

With the Estop button hoked to your regular teriminal 10, it corresponds to pin 15 in the DB25 connector and will be seen by the ESS as port1 pin15.
Set Machs Estop signal usiing the ESS set-up dialogue, that is Configure/Plugins/ESS/Input Signals Estop <enable> <ESS> <port1 pin15>.
Load the Lua code previously posted and you done.

Craig