Hello Guest it is December 15, 2019, 08:07:20 AM

Author Topic: Mach 4 setup  (Read 315 times)

0 Members and 1 Guest are viewing this topic.

Offline Vivek

  •  12 12
    • View Profile
Mach 4 setup
« on: March 13, 2019, 03:24:08 PM »
Hi I am using Hicon Integra controller and I am facing the following issue.

1) Spindle wont move with just MDI code or by just clicking on the spindle control button. it works when l I use the SRO slider to change the speed initially. How ever once I get the spindle running once, it runs good I can use both the button and MDI to start it. Do you know if I am missing something in the hicon configuration setting that is causing this problem?

2) The motor drive come as initially Enabled, I am wondering how to wire the Hicon so that they all disable as one gets disabled.

3) Also the motor driver has a Fault + and Fault - signals, that I want to connect to the Hicon and set it so that it gets the message on Mach 4 saying fault. Than a signal would go to enabled drive and  disable it.

Let me know if you ever came across any of this issues, and know if you can make it work.
Re: Mach 4 setup
« Reply #1 on: March 13, 2019, 08:33:50 PM »
1)  You have to command a spindle speed before the spindle will turn on.  We are using the HiCON Integra on 3 mills and 3 lathes right now and I haven't had spindle problems like that.

2)  What do you mean, I'm not understanding what you want.  When one drive gives an error, you want them all to disable?  See answer 3.

3)  You can get the Fault Signal and read it in Mach4, you can then Stop Mach4.  When I get Drive Faults, I call an E Stop on the machine then I give a message saying which drive has faulted.  You can also cause the drives to disable on E Stop. I am doing this on a mill at work.  I can get the code tomorrow, hopefully I will remember to get it in the morning.  I've been busy doing other stuff at work this week, filling in while Mom and Dad are out of the country.
Chad Byrd

Offline Vivek

  •  12 12
    • View Profile
Re: Mach 4 setup
« Reply #2 on: March 14, 2019, 02:02:26 PM »
Hi Chad,

Thanks for the help I would love the code if you get a chance to upload it :).


Re: Mach 4 setup
« Reply #3 on: March 15, 2019, 07:12:09 PM »
Okay, here is the code for the Axis Fault
Put this in the PLC Script. 
I have each Axis mapped to a separate input so I know which Axis has faulted.

Since it is in the PLC script, I made a "Message Counter" to leave only one message instead of leaving thousands of messages in the Log.
But, as you can see by looking through the script, if there is a fault, it will turn on the Alarm output (I use it to light up the red beacon), leave the Axis Fault Message, and Put the machine in E Stop.

--X Axis Fault
local inst = mc.mcGetInstance()
local XAlarm = mc.mcSignalGetHandle(inst, mc.OSIG_ALARM)
local Input16 = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT16)
local hSig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT16)
local State = mc.mcSignalGetState(hSig)
XAxisAlarmCounter = testcount
if State == 1 then
     while (MessageCountX + 1) == XAxisAlarmCounter do
         mc.mcCntlSetLastError(inst, "X Axis Fault.")
         XAxisAlarmCounter = XAxisAlarmCounter + 1
     mc.mcSignalSetState(XAlarm, 1)
MessageCountX = testcount

There are many ways of doing this, I plan on trying to make it a little more clean by making it a function, but for now, this does work very well.
Chad Byrd
Re: Mach 4 setup
« Reply #4 on: March 18, 2019, 12:03:48 PM »
Do you have it in the PLC script (versus the signal lib) so it continually puts the machine in E Stop condition until the axis fault is cleared?
Re: Mach 4 setup
« Reply #5 on: March 18, 2019, 01:03:40 PM »
Chad Byrd