Hello Guest it is April 16, 2024, 07:14:26 PM

Author Topic: Various Issues I have run across with Mach 4  (Read 3063 times)

0 Members and 1 Guest are viewing this topic.

Various Issues I have run across with Mach 4
« on: March 10, 2019, 08:15:55 PM »
Hi All,

I purchased my copy of Mach 4 today!  ;D

I am finishing up the rebuild on the machine and have run into a few issues. They all seem to be unrelated but I figured I would save some space and ask for help for all of them in the same place...

System Setup:
Motion Controller: Ethernet Smoothstepper
Computer: Allen Bradley VersaView 5400 PC, 4 core Intel Atom E3845 chipset @ 1.90GHz, 4.0Gb of memory and runs Win 10.
Computer #2: HP Omen laptop, Intel i7 6700HQ 3.5GHz, 32Gb memory, running Win 10
Mach 4 version: 4.2.0.3804
Warp 9 Tech ESS plugin version: 232 (1.0.1.232)

1) When exiting the "Configure" -> "Control" menu, two general purpose outputs energize for a brief moment (regardless of machine state). These are tied to my power drawbar solenoid and emits a loud exhaust noise (although the cylinder doesn't move since both sides end up pressurized). I have these outputs tied to a screen load script and a signal script, but neither should do anything unless an external pushbutton is pressed.

2) When approaching my limit switches, some of the time when the switch is triggered I get a message in Mach 4 that says something to the effect of "ESS: Motor 0++ Limit triggered" and all axes become disabled. This is fast and very repeatable in position even when jogging at a good clip. Other times I get a message (from Mach I think) that says something like "X++ limit Active". It reacts very slowly and does not disable the axes or stop jogging (it does allow me to crash the machine). If I let go of the jogging key and press it again, it won't let me start jogging saying something like "Can't jog towards X++ limit", but again it doesn't stop the machine motion.

This issue also manifests itself when using "Ref all Home". When things seem to be working right, my axes home until the switch triggers, then reverse until the encoder marker is found. This gives home values repeatable to the .0001 mark on the DRO. However when mach is only showing the "X home switch active" message, the axis drive past the switch and contact the end of machine travel. The switch is energized and visible in the mach diagnostic window, but does not register to stop the homing.

It seems to me that Mach only registers the limit/home signals as a courtesy and relies on the ESS to stop motion or home an axis. It seems like sometimes my ESS is not registering the limit or home event even though the input signal is being received and transmitted to mach. Bu that is just an uneducated theory based on my observations.

3) When I enter M03, M05, and S#### commands into the MDI, my Step/Dir servo spindle often emits loud clunks when starting or changing speeds. This occasionally generates a bus overvoltage fault on my servo drive indicating the motor was requested to make some kind of instantaneous deceleration.

This behavior is NOT seen when clicking the spindle CW button on the Spindle section of Mach. I have not yet tried running the same code segments from a gcode file.

4) When exiting the Configure -> Control menu, keyboard jogging is disabled even though the button remains illuminated. I have to toggle the button to reenable keyboard jogging.

Looking for any thoughts. All these issues might be user error, but I would like to find a resolution.

Thanks!
Re: Various Issues I have run across with Mach 4
« Reply #1 on: March 10, 2019, 09:09:15 PM »
Hi,
a few questions there....but I think several of them are related.

Quote
It seems to me that Mach only registers the limit/home signals as a courtesy and relies on the ESS to stop motion or home an axis

That is how Mach is supposed to work.

A Windows PC is not, nor ever will be, a realtime system, that is to say it cannot respond within microseconds to a home or
limit switch event say. Yet a CNC controller must absolutely be a realtime controller.

Mach (3 or 4), in fact any Windows based CNC software MUST be a buffered control system. Thus all movement instructions
issue by Machs trajectory planner get handed to the motion controller in a buffer, typically 20-100 ms worth.
The motion controller must however be a realtime device.

Art Fennerty wrote Machs original parallel port driver which made the PC's CPU perform in a near realtime fashion.
The PC programming world was astounded.....to my knowledge no one has been able to replicate his work. It was a direct
consequence of the (free) parallel port (quasi realtime) that allowed Mach3 to attain such a wide following.

Just as a matter of interest LinuxCNC IS a realtime system and that comes about because of R(eal)T(ime)E(xtensions) which
is applicable to certain Linux Distros. As a consequence LinuxCNC is not a buffered system.

Advance a decade and now Mach4 is native to and effectively requires an external motion controller. Such a controller
must handle all  realtime functions. Some of which you are asking about, in particular, home and limit events. If the ESS
detects a limit event it should shut down all Step/Dir signals immediately, or within a few microseconds. If however the
ESS reports to Mach and then Mach issues an instruction to the ESS to stop all motion then the communication delays
(because of buffering) are tens of milliseconds, way too slow to be considered realtime.

Quote
When approaching my limit switches, some of the time when the switch is triggered I get a message in Mach 4 that says something to the effect of "ESS: Motor 0++ Limit triggered" and all axes become disabled. This is fast and very repeatable in position even when jogging at a good clip

This is indeed an example where the ESS is responding in realtime (less than 20usec or so). The giveaway is the report
beginning with 'ESS:Motor0............'.

Quote
Other times I get a message (from Mach I think) that says something like "X++ limit Active". It reacts very slowly and does not disable the axes or stop jogging (it does allow me to crash the machine).

This on the other hand sounds like Mach is in control and the communication delays both from the ESS to Mach and then
back again, from Mach to the ESS, are mounting up  to allow a crash.

This suggests to me that you have certain events controlled by a Lua script (subject to comm delays) and certain other functions
which are (rightly) handled by the ESS in realtime.

The giveaway is your comment about 'X++ Limit Active' yet not causing an Estop. Mach does not automatically cause an Estop
if a limit is triggered, you have to program that behavior if that is what you wish.

In many industrial situations you cannot just program an Estop because you need to sequence a shutdown, something like
applying the brake so a heavy Z axis does not fall down and crush your operator.

Quote
When exiting the "Configure" -> "Control" menu, two general purpose outputs energize for a brief moment (regardless of machine state).

I suspect that comes about because  the machine is disabled the outputs are going to their natural state, that is pulled high
(or pulled low) by your controller or BoB. Once Mach assumes control then the outputs assume their correct state, it just
in that brief moment when they are uncontrolled that results in a problem.

The only thing I can suggest is that you try reversing the sense of the signal. That would require an additional invert operation,
may be a relay, at or near the output. The only other way would to analyse the natural (pull up/ pull down) state of the pins
and reverse that sense.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Various Issues I have run across with Mach 4
« Reply #2 on: March 11, 2019, 08:42:36 AM »
Craig, Thanks for the quick response!

I think I roughly understand the interplay between Mach and a motion controller (and I totally agree that it is pretty amazing that Mach works at all). It seems to me that the ESS is not responding appropriately to my limit inputs occasionally, but there might be something else going on. I'll post this question over at the Warp 9 forum and see if anyone has experience with what I am seeing.

I have not modified any of the scripts except for a small chunk of code to control 2 outputs to my power drawbar. Any limit messages that I am seeing must be built into Mach.

I will play around with my outputs to see what all is actually happening. I understood that the ESS pulls outputs LOW when not in control, so I wouldn't expect anything to happen. Maybe there is something about my PDB script that is susceptible to false triggers.

Again, thanks for the response

Re: Various Issues I have run across with Mach 4
« Reply #3 on: March 11, 2019, 09:02:03 AM »
A very good response Craig and it explained a lot.
Retired Master Electrician, Commercial HVAC/R Service and lots of Hobbys.
Re: Various Issues I have run across with Mach 4
« Reply #4 on: March 12, 2019, 09:19:36 AM »
In addition to the issues I mentioned above, I have 2 more:

5) Clicking The Jog Mode button (Continuous/Incremental) does not allow me to enter Incremental mode. I can change the incremental step size but it always jogs in continuous mode. Is there some special mode I need to be in to allow incremental jogging?

6) I have an MPG which is tied to the ESS Aux Encoder 0 and then that is tied to Mach's MPG#7. When I call mcMPGSetAxis(), I see the correct arguments in the log file, but no motion occurs.  Is there a way I need to enable the MPG jogging?
Re: Various Issues I have run across with Mach 4
« Reply #5 on: March 12, 2019, 02:01:12 PM »
Answered #6 myself. In the Mach Control MPG mapping, I had entered ESS Encoder 0 rather than ESS Encoder Aux 0. User error. :o
Re: Various Issues I have run across with Mach 4
« Reply #6 on: March 12, 2019, 05:02:49 PM »
Are you trying to incremental jog using the keyboard or onscreen jog controls?
Re: Various Issues I have run across with Mach 4
« Reply #7 on: March 13, 2019, 08:26:10 AM »
SwiftyJ, I would most likely want to use the keyboard for incremental jogging but I also have a touchscreen on the computer so that is an option. Neither allow me to jog incrementally. The mode is always set to continuous.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Various Issues I have run across with Mach 4
« Reply #8 on: March 13, 2019, 09:16:49 AM »
The onscreen mode only applies to on screen buttons (if referring to one of the default screens). Keyboard jog requires you to hold down the control key while jogging for incremental (if the keyboard plugin is configured as default).
;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: Various Issues I have run across with Mach 4
« Reply #9 on: March 13, 2019, 11:42:19 AM »
Ah! That might explain the confusion. I'm coming from Mach 3 and I am used to placing the jog mode in Incremental before tapping the keyboard arrow keys to bump the axes incrementally. I did not know of the CTRL key stroke for incremental jogging. Can the on screen keypad only be placed in Incremental mode when keyboard jogging is disabled then?