Hello Guest it is April 13, 2021, 10:19:19 AM

Author Topic: ESS + Mach4 + Clearpath = Motor error input goes where?  (Read 4067 times)

0 Members and 1 Guest are viewing this topic.

Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #20 on: June 10, 2018, 10:50:36 AM »
Tom, I have the code in the signal script. Have a look at the screen editor manual in the docs folder or your Mach4 directory if you have some trouble finding it.

Craig, The code is in the signal script only. Nothing in the plc. I'm not sure if every line I posted is required. I pulled the code from page 12 and 13 of the scripting manual about three years ago. The SignalTable portion may be redundant.
Good point about the voltage. That is not something I considered. I am running three motors and checked the voltage to be 1.4V normal and 4.8v when tripped.
I currently have all the inputs saturated on the pmdx-126. Do you know any lone BoBs that can be hooked up the the third port of the ESS for expansion?

Dustin

Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #21 on: June 10, 2018, 11:02:18 AM »
Hi,
various recommendations have been made but the C10 at $23.00 looks like the most cost effective suggestion thus far.

If three HLFB signals in series amount to 1.4V then you must have zero noise margin.

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

Offline thosj

*
  •  432 432
    • View Profile
Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #22 on: June 10, 2018, 11:04:22 AM »
People FAR more knowledgeable then I have weighed in, I'll be going the separate input route when I to this, seeing as I have them available!!

Dustin, do you have something one the SECOND port of the ESS/PMDX-126? I have a PMDX-108 Input on there with only 2 or 3 used, so enough left to hook the HLFB's up and code them separately. You could use any small BOB, like a CNC4PC C10 for using the ESS 3rd port.

Tom
Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #23 on: June 10, 2018, 11:14:45 AM »
Hi Dusty,
the Signal Script is the code that runs each time one of Machs signals change state. You can put code there OR you put an entry in the Signal Library Table in
the screen load script. You don't need both.

My preference would be to put entries, one per input, in the Signal Library Table. Note the Signal Library Table is already there, you will just be adding some
more table entries rather than constructing the table from scratch.

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

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #24 on: June 10, 2018, 11:28:32 AM »
Quote
And, is it not simpler to have, in my case FOUR, drives wired to one input

Works great for me.

But don't forget, in my example multiple inputs are wired to and controlling a solid state relay, not a single input on your BOB (big difference).Another benefit of using a relay is its easy to flip the logic if needed. The drives can supply the + or 0 volts to the relay. All things must be considered in each individual case. I'm just sharing what I have done. Craig and Steve have valid points. It has to be done right to work right and what is right for one may not be right for another.

I want an e stop triggered anytime any drive has any error. It doesn't matter what that error was. The folks that will be in charge of fixing it know how to use the diagnostic LEDs on the drives. In other circumstances it might be nice to have the ability to tell Mach what drive failed (and why) so Mach could tell the operator...... if you have available inputs to use for this. I/O is what makes a machine intelligent. I rarely have any extra I/O and often not as much as I would like. But at some point you have to weigh out cost versus reward, set priorities and roll with it. I don't think I would sacrifice any I/O I wanted on a personal hobby machine. I don't think the cost to expand I/O on a single machine could possibly be worth me being dissatisfied in my hobby. But when the machines are not being used for hobby, multiples are built, existing systems\protocols are in place, cost of production, etc.  have to be considered things can change drastically. Everything really is a trade off.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #25 on: June 10, 2018, 11:50:47 AM »
Craig, Thanks, I will look into the c10. That would probably account for the occasional random stop. Enough to stop the machine but not enough to trigger any actual faults.

Tom, I just checked and the code does work without the SignalTable portion. Just use the following and change mc.ISIG_INPUT0 for whatever inputs you use.

-----
if (sig == mc.ISIG_INPUT0) and (state == 1) then
    local inst = mc.mcGetInstance()
    mc.mcCntlCycleStop(inst)
    mc.mcCntlSetLastError(inst, "HLFB Servo Error");
end
-----

Side note, from my experience if one of your motors trips you will have to disable and enable mach to restart the motor. And its best to re-home the machine afterward.

The pmdx-126 is connected to ports 1 and 2 of the ESS but only has 9 inputs. My home switches are wired separately so all axis can be homed at the same time. + limits are wired in series. Three auxiliary buttons, HLFB, and a touch probe for tool length. Plus a dedicated estop.

Dustin
Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #26 on: June 10, 2018, 02:49:27 PM »
Hi,
that works if you put it in the Signal Script but this works if you put in in the Signal Library Table:

[mc.ISIG_INPUT0]= function(state)
    if (state==1) then
          mc.mcCntlCycleStop(inst)
          mc.mcCntlSetLastError(inst, "HLFB Servo Error")
    end
end

Add this to the SigLib table at the top of the screen load script.

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

Offline thosj

*
  •  432 432
    • View Profile
Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #27 on: June 11, 2018, 10:42:53 PM »
Dustin,

You might look into a PMDX-108 Input. You're not using the ESS port 2 now, right, even though it's connected? The 108-Input goes between the PMDX-126 and the ESS and adds inputs from port 2 pins 2-9. A bit more than a C10, but very nice and keeps it in the PMDX family!!!

Tom

Offline thosj

*
  •  432 432
    • View Profile
Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #28 on: June 19, 2018, 09:36:00 AM »
Thanks to Craig, I got the HLFB's working on my PMDX-108 Input, Port 2 Pins 6-9. Code like Craig's but adjusted for the Inputs I used, 4 sections of code, one for each axis so I can easily tell which axis errored.

That said, soon as I moved two of the 4 axes I got the error. I hooked the USB cable to the ClearPath's and started their software. I have the ClearPaths set to 6400 counts per rev. which in my system equates to 96000 counts per unit (Inch for me) on X/Y, 153,000 counts per inch on A, and 78222.22222 on Z. The count error was set to 10 in the ClearPath software, a default, I guess. That's ~ .0001" on X/Y/Z, .000065 on A, so I set them to 100 and everything seems OK.

That made me wonder if there's some magic following error percentage one should use, like 1.5%, which is what I have, approximately, arrived at by guess and by gosh? Or something else?

Tom
Re: ESS + Mach4 + Clearpath = Motor error input goes where?
« Reply #29 on: June 19, 2018, 01:18:53 PM »
Hi Tom,
kool. Did you put code in the SigLib table or code in the Signal script?

You have discovered the great conundrum about servos....do I make the following error window very small but then have to restrict velocity/acceleration of my projected moves
so that they don't fault....OR....set the following window wider and accept a less accurate trajectory with sufficient tolerance to employ useful velocity/acceleration toolpaths?

There is a branch of mechanical engineering that concerns itself with this tradeoff but it is intensely mathematical. Unless you have University level mathematical ability AND considerable
fortitude to follow/understand the maths involved don't go there.

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