Hello Guest it is April 26, 2024, 03:58:25 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - simpson36

91
There are 'actions' and there are Lua scripts. These are different animals and screen buttons can do either or both.

'Clicked Script' would run Lua code one time when the button was used, and it sees a mouse click as a singular event. This would not work for jogging. There are a bunch of 'actions' defined for use with screen buttons. For example Jog X+ and Jog X off which are in the mouse down and mouse up entries in the standard MACH4 screen jog buttons.

To send a signal based on machine state would require monitoring. A way to do that is with the PLC script which runs continuously. All of my code for the joystick jogging is in the PLC script.

here is a fragment showing a way to monitor the machine condition:



--InTurn Code
EstopIssued = machEnabled;

-- Spindle power bar graph

--local EstopIssued = 0;
if (EstopIssued == 0) then
        mc.mcRegSetValue(EstopTOInTurnRegister,1);
       if ((scr.GetProperty('tbuttonSPIN','Button State')) ~= '0') then
          scr.SetProperty('tbuttonSPIN','Button State','Up');
       end
        local InTurnSpindleHandle = mc.mcRegGetHandle(inst, "modbus0/InTurnIN12");
        mc.mcRegSetValue(InTurnSpindleHandle, 0);
else
        mc.mcRegSetValue(EstopTOInTurnRegister,0);
end
       

92
A member has posted a warning in the bugs thread about his jogging project having a nasty behavior. Apparently if he has a jog button active when MACH4 starts, the axis begins to move continuously and he has to e-stop/disable MACH4 to get the table stropped.  I suggested he bring that issue to this thread where solutions are being discussed.

In the case mentioned above, he is apparently going thru an ESS, but it is unclear (to me) exactly how he has things connected.

Based on the topic of this thread, it seems that interfacing thru a popular motion controller should be part of the discussion. In the case of the ESS, however, I think the first step in diagnosis should be to determine if the problem is with the ESS or MACH4.

I have an ESS that was purchased only to test compatibility with my own TCP/Modbus device, and I do not know much about it operationally.

Since I have just completed interfacing an industrial joystick and rotary quadrature encoders to MACH4's jogging facility, I can offer some suggestions.

Probably the most important thing for Pendant developers to realize is that once a MACH4 jog is initiated, it continues until it is expressly terminated.  The behavior of the screen buttons is deceiving in that is appears as though MACH JOGS only as long as contact is maintained, but that is not that case.

Like most Windows mouse controls, a 'mouse click' is divided into several parts, most notably the initial 'click' from the downward movement followed by a completely separate event occurring when the mouse button is released. It appears that some folks are only sending a Jog start on contact of their button and expecting the jog to stop when the button is released. That will not happen. You MUST provide a jog STOP when the button is released, otherwise the axis will continue to move.

Initially, I tried actuating the standard MACH screen buttons using input data, but this did not work well at all for me. YMMV, but I abandoned this approach pretty quickly.

To partially speak to the thread title 'What is the best way', I would suggest that any way other than USB is best. There are a number of ways to get data into MACH4 using TCP interfaced devices and while they are somewhat more complicated to get going, once you have the comm established, it is much faster than USB and pretty much bullet proof. The best you can say for USB is that it 'seem to be working at the moment'. USB has a great spec and was a well planned replacement for the old serial interface, but it has been ruined by the veritable land-rush to use it's highway to transport converted RS232 signals instead of producing true native USB interfaces.  

93
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: May 16, 2015, 02:57:15 PM »
It is my impression that the Mach Team wants only bug reports in this thread, and not discussions.

There is a thread going specifically about interfacing Jogging hardware to MACH4 and you may find some useful information there. I am headed there now to add a few comments on this topic.

94
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: May 15, 2015, 02:02:01 PM »
"What are jogging inputs?"

Jog Axis +/-
e.g. Jog X+, Jog X-,Jog Y+... Physical switches or screen <buttons> that are mapped to Command axis to jog in the +/- direction 

Your post was about physical switches (and you also mentioned ESS.)

Where/how do you have them connected to MACH4?

95
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: May 15, 2015, 02:00:07 PM »
Not sure if this is a bug or not, and I have asked that question in the Modbus thread, but thought I would enter it here also in case it is a bug and these are being collected.


Creating coils in Modbus does not create corresponding registers.

Is this a bug or is there a different procedure to access coils?

Never mind, figured it out . . . .

96
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 15, 2015, 01:59:15 PM »
Never mind. Figured it out.

97
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: May 15, 2015, 12:07:25 PM »
Not sure if this is a bug or not, and I have asked that question in the Modbus thread, but thought I would enter it here also in case it is a bug and these are being collected.


Creating coils in Modbus does not create corresponding registers.

Is this a bug or is there a different procedure to access coils?

98
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: May 15, 2015, 12:05:25 PM »
"If you have physical switches tied to your jogging inputs and you touch a switch prior to enabling Mach 4 the motors will start moving and not stop!!!!!!


What are 'jogging inputs' ?

99
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 15, 2015, 12:03:16 PM »

Setting up coils in Modbus does not create registers.

How are coils accessed in LUA?

100
Mach4 General Discussion / Re: MACH4 with Pendant
« on: May 13, 2015, 12:01:34 PM »
I am looking at building a machine that has a handheld pendant (wireless or not) and I would like to use Mach4 as Mach3 will be going out of style in the near-ish future. Has anyone had any success with a pendant of any kind using Mach4? If yes, what brand/kind works and what doesn't work? I know it's all dependent on if the manufacture has developed the plugin or not, but I'm having one hell of a time trying to find any pendant that will work with Mach4.


I am working on one now. Should be available soon.

Not a fan of the big One-Axis-At-A-Time rotary dial.

Having the occasion to use the Xbox controller, I really loved the process, but as with most (if not all) analog POT joysticks, the thing was scary to use for any fine work because the axis would be jittering right along with the joystick.

Analog signals are also very susceptible to interference. If you have access to the programming, you can add averaging or smoothing algorithms to 'calm down' analog devices. This is adequate for things like speed control knobs and other 'non critical' applications, but not for moving a mill table where uncontrolled movement, even very tiny movement, can be expensive not to mention dangerous, in my opinion.  Overall, I judged the Xbox controller to be extremely convenient, but untrustworthy.

The solution is to use an industrial Joystick that drives optical encoders instead of pots. i2C interface with a couple of inch long wires is pretty much immune to interference, especially in a grounded aluminum box.

The joystick provides infinitely variable 0 to full speed in X and Y and two speeds in Z. All axis can be moved in any direction at any speed simultaneously in any combination.

Speed is proportional to the Joystick deflection, but the ramp from 0 to max speed will be logarithmic. Together with an absolute 'dead zone' around center, this will provide very fine control near center (slow ramp) and change speeds more and more quickly as it approaches max (fast ramp).

MACH4 compatible, Ethernet Interface, spindle controls, Macro control, lot of other goodies.