Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Testing on March 12, 2019, 03:30:42 PM

Title: Software stops mid opperation.
Post by: Testing on March 12, 2019, 03:30:42 PM
Hi,
  I am using mach3 software to run a 3d printer. It usually runs fine but once it a while it just stops. The printer acts like it would if a limit switch were triggered but the software doesn't show that any has been and just seems to be paused mid print. From this point on the software and printer seem to have no interaction with each other. Then, after I close and restart the software, it will run fine again. The problem may happen any time during a print and does not consistently stop at any specific point in the gcode.

Any help would be appreciated.
Title: Re: Software stops mid opperation.
Post by: reuelt on March 12, 2019, 05:36:28 PM
How are you connecting the MACH3 PC to the 3D printer?
Via parallel port or USB or NIC or RS232, motion controller ...?
What OS, Win XP or Win 7?
Which 3D printer? Commercial or home-made?

No one can solve your problem without knowing more about your hardware and software.

Title: Re: Software stops mid opperation.
Post by: Testing on March 12, 2019, 06:05:32 PM
I am using a parallel port, Running windows 7 on a Dell OptiPlex 760, and it is home-made.
thanks
Title: Re: Software stops mid opperation.
Post by: Testing on March 12, 2019, 06:10:48 PM
The attachment is my breakout board.



https://www.ebay.com/itm/Upgraded-5-Axis-Cnc-Breakout-Board-For-Microstep-Controller-Cables-Software-/292528350411?hash=item441c0c64cb
Title: Re: Software stops mid opperation.
Post by: reuelt on March 12, 2019, 06:43:10 PM
Thanks and well done!
Does Dell OptiPlex 760 have a built parallel port interface or did you put in a 3rd party card?

Can your parallel port be set to EPP 1.7  in BIOS?

As I build new PCs for PlasmaCAM & am an IT consultant (in au)
please let me advice you what to do
1. Open the Dell OptiPlex 760 case and blow or brush off all dusts from the CPU heat sink.
Use a Vacuum cleaner that can blow or a bicycle pump or a paint brush.
2. Clean the contacts of the cards and memory sticks with pencil eraser.
Rule out hardware issues out of the way first
Then
3. In Win 7
Go into command prompt with administrator rights and paste and add the below registers.

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 3 /f

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d 3 /f

Restart the computer for the changes to take effect.
4. Tune up win 7
4.1 Turn off screen saver
4.2 Turn off windows sound
4.3 On power options in control panel select HIGH PERFORMANCE and select NEVER for both Time to turn of monitor and Hard disk
4.4 Run MSCONFIG and untick all startup items except MACH3 related
4.5 In Task scheduler disable all software update tasks
4.6 In services - disable Windows Update and superfetch - (Only AFTER you have done all windows updates recently).
Please report back and I'll tell you more ..


Title: Re: Software stops mid opperation.
Post by: Testing on March 12, 2019, 06:50:21 PM
My computer does have the interface parallel port.

Thanks for the help, I will get back to you tomorrow as I am currently running a print.
Title: Re: Software stops mid opperation.
Post by: Testing on March 13, 2019, 01:06:38 PM
 Ok, Got that done.
Title: Re: Software stops mid opperation.
Post by: reuelt on March 13, 2019, 04:17:26 PM
Good
In Mach3, Config, General config page
look ahead should be changed to 200 lines at least (default was 20). In Mach4 default already 200 lines.
At top right hand corner of same page, set both debounce to 50.
In config motor tunning, you can set step pulse higher try 5 (15 is max) and Dir pulse (up to 5).


The parallel port cable should be as short as possible. 2 meters (about 6 feet) is max. length for stability.
make sure that your printer body grounded and the control box case are both grounded to reduce HF interferences.

I would set antivirus to trust C:\mach3 folder.
Title: Re: Software stops mid opperation.
Post by: Testing on March 13, 2019, 04:55:58 PM
Is there anything else or should I give it a try now?
Title: Re: Software stops mid opperation.
Post by: joeaverage on March 13, 2019, 05:12:37 PM
Hi,
Mach's parallel port driver has always been a bit 'iffy' on certain PCs.

Some PC's seem to do a good job whereas another very similar machine does not.

Your PC is not a laptop is it? The power saving features can really screw up a parallel port, some people have had good results
with laptops but most bomb out with them.

Have you considered an external motion controller like a SmoothStepper or a UC300?

An external motion controller removes the responsibility of generating fast accurately timed pulse streams form
the PC's CPU (where Mach's  parallel port driver lives) to the external board. The external board has electronic
circuits made for the purpose and produce  pulses much faster and more accurately than a parallel port ever will.
With an external controller you can use just about any PC you like, laptop, 64 bit OS, Windows 10 etc.

The downside of an external controller is cost. The two I have mentioned are in the range of $150-$200US. Note there
are cheap Chinese made controllers and Chinese made rip-offs of name brand controllers but don't go there, they are
rubbish and will cause more frustration than the parallel port.


Craig
Title: Re: Software stops mid opperation.
Post by: Testing on March 13, 2019, 05:27:18 PM
  I am using a desktop.

  I have been wanting to upgrade to an external motion controller for a while but just haven't had the time to research it and find some good boards. I will look into the controllers that you suggested and see about upgrading now.I am using the printer for part of a home business and just need it to run reliably.

Thanks for all your time and help.  Your info will save me a lot of time and grief.
Title: Re: Software stops mid opperation.
Post by: reuelt on March 13, 2019, 05:34:01 PM
Is there anything else or should I give it a try now?
Try out
Should be stable
Title: Re: Software stops mid opperation.
Post by: reuelt on March 13, 2019, 05:40:05 PM
Your PC is not a laptop is it? 
Craig
He already said his PC is a Dell Optiplex 760 - a desktop with built in Parallel port.
Title: Re: Software stops mid opperation.
Post by: joeaverage on March 13, 2019, 05:48:53 PM
Hi,
I, for a long time avoided external controllers, I had (still have) a dual core Atom Mini-ITX board with one built in
parallel port and I added another on a PCI card, and it worked really well.

Eventually I decided I wanted to go to Mach4 and that all but requires an external controller.
When I got it (Ethernet SmoothStepper) I found that I could tune my motors 1/3 faster and more acceleration
without losing steps, in fact run a little cooler and sound sweeter than before.

I was not unhappy with the parallel port, it seemed to go well. So I was really really surprised that an
external controller would make such a difference, but it did!

The other thing is that Mach runs better, without stopping or stuttering is you hit <redraw> say.

All up I have gone from a nay-sayer parallel port supporter to a rabid external motion controller supporter.
You will also, if you read any of my other posts, know that I absolutely hate Chinese made controllers, they don't
work as they should, if they work at all, and don't support al the features Mach has come to expect.

Craig

PS
Quote
He already said his PC is a Dell Optiplex 760 - a desktop with built in Parallel port.

Sorry missed it when skimming the thread.
Title: Re: Software stops mid opperation.
Post by: reuelt on March 13, 2019, 07:18:13 PM
Craig,
IMHO
I am still waiting for the external motion controllers to mature.
USB and Ethernet are NOT really suitable for the FACTORY environment.
USB is always grounded to CITY electricity ground and a wrong wiring has blow up the PC or cause electric shock or fire. There is no usually isolation in a USB device. There is no screws to tighten up a USB connection like a DB25.

Ethernet is perhaps better than USB.
BUT still being High frequency is subject to NOISE interference.
There are too many points that can contribute to failures. TCP/IP is known to be unreliable that is why the INTERNET must have multiple alternative paths and IP always has "time-to-live".

UC100 only has 1 second buffer.
ESS  has how many seconds of buffers?

The "achilles heel" is going to be the external motion controller cannot get enough data from Mach3 or Mach4 on time. Solution is then to having to upgrade your PC to be faster.
If so the external motion controller will be redundant.
By upgrading my PC from a dual core CORE-2 DUO 2GHZ system to an I5-7600 PC 3.6GHZ, my router reached the Maximum speed physical possible based on the stepper motors & drivers & mechanical build. That's is 2.4 times the original speed I could get no matter how I tried.
I am only running 24 volts drivers. I could reach 2 or 3 time faster if I run at 48 Volts.
ALL ON THE parallel port.

I still support profitable factories. Some are still running many huge CNC lathes on DOS7 on Novell network and machines using qbasic files and driving ISA boards. They make over $AUD a million a year profit. Their office PCs are Windows 10x64 of course.

I also support a company selling new PlasmaCAM machines and more expensive waterjets machine and huge lathes and huge Mills and wire-cutters. ALL are using the RELIABLE parallel port still.
Title: Re: Software stops mid opperation.
Post by: joeaverage on March 13, 2019, 11:00:06 PM
Hi,

Quote
I am still waiting for the external motion controllers to mature.

The good ones are already and have been for some time. That's not to say they wont improve and grow but they are
ready for serious work right now.

Quote
USB and Ethernet are NOT really suitable for the FACTORY environment.

You are correct with USB but you are 100% wrong about Ethernet....what do you suppose Ethercat and Profibus
are based on....you guessed it Ethernet. Ethercat and Profibus are the stand out performers in industrial control.

Quote
TCP/IP is known to be unreliable that is why the INTERNET must have multiple alternative paths and IP always has "time-to-live".

With multiple paths as are available with the Internet you have to allow for disordered packets, there is a setting you can make
however that requires all packets follow the same path and therefore NOT be disordered.  That multiple paths exist IS NOT
a REQUIREMENT of the Internet but rather a consequence of its dispersed structure. CNC is different.
Firstly you do not not communicate to a machine over the Internet, in fact it is not recommended to communicate over a network
or router either. The packet tracking order of TCP/IP is redundant, with PC to controller on a single Ethernet link
you can't possibly disorder the packets. Not that it matters, TCP/IP can reorder if necessary.

Quote
UC100 only has 1 second buffer.
ESS  has how many seconds of buffers?

The max ESS buffer is 500ms. You are mistaken however if you believe that a longer buffer is a good thing. If the buffer
is longer then if you issue a <feedhold> for instance the longer it takes for it to flush through the buffer. It is preferable
to have a short a buffer as possible. That increases the likelihood that the buffer will empty with bad consequences for your
job. The more powerful your PC and more memory and with the absolute minimum of extra software installed and/or running
allow you to shave the buffer ever lower.

My little dual core Atom Mini-Itx board is very low power so I leave its buffer set at 180ms as the plugin ships from Warp9
and I have never run out of data yet.

As I have proven, and as smurph has also proven with his Mud-board you do not need a hugely powerful PC.

My laptop is a few years old now but is I7 16G at 2.2GHz. It runs my machine indentically as my dual core Atom
at 1.8Ghz with 2.5G RAM (address space limited) and shared with video! The only thing my laptop does better is when I load
a big (10M plus) file and it has to decode and draw the initial tool path. My laptop does it in 5-10 seconds whereas the Atom can
take a minute. The bottom line is don't waste your money on a powerful PC, Mach doesn't need it.

The ESS is by no means the fastest controller nor is it the slowest, its pulse rate is up to 4Mhz, compare that to Mach's
parallel port at 25kHz default.

Rubbing sticks together is still a reliable way to start a fire, but there are better ways.

Craig

Title: Re: Software stops mid opperation.
Post by: reuelt on March 14, 2019, 03:34:28 AM
What did Art Fenerty in "MACH3 Mystery" said?
"Mach3 was designed for the printer port, and its architecture is derived from the treacherous territory of Windows kernel mode, then it will be understood more easily, why the design architecture, which has evolved over time, must reflect the original printer port operation in terms of its internal limitations.
This means that “the simple fact you are using an external engine does not mean you
will not necessarily have a limitation enforced by the original specifications of the
software.”


Probably MACH4 is indicated if people want to use more powerful external motion controllers.
Title: Re: Software stops mid opperation.
Post by: joeaverage on March 14, 2019, 07:26:57 AM
Hi,

Quote
Probably MACH4 is indicated if people want to use more powerful external motion controllers.

Funnily enough that is not quite correct either. The ESS for instance can be used with either Mach3 OR Mach4 with
the right plugin. The hardware is indentical, or you can swap between Mach3 and Mach4 without hardware change
at all. The same it true with the UC300 and 57CNC.

The true advantage of Mach4 is that is has a modular arrangement, a consistent API and a superior scripting
language. That makes Mach4 very flexible and can be adapted to wildly different machines.

The reason that Mach4 all but requires an external motion controller is because the developers at NFS realize that
a dedicated FGPA/microcontroller/DSP will always be able to outperform a PC's CPU in realtime operations. They have
therefore developed Mach4 to take advantage of external controllers and free Mach4 from the limitations of the
parallel port.

Craig

Title: Re: Software stops mid opperation.
Post by: reuelt on March 15, 2019, 01:37:16 AM
ESS UC300 and 57CNC on MACH3 will NEVER be able to outperform a FAST NEW PC running
Win7 (32bits) and parallel port.
All of them external motion Controller ESS UC300 and 57CNC have written their "add-on" software in "RING 3 USER LAYER" of the operating system and so controlled by the bloated Windows OS.
The Mach3 driver & pulsing were written in RING 0 Kernel Mode. It is not just pulsing, that is in ring 0. It means the buffer is also in ring 0 and so windows must be very fast to be able to fill the ring zero buffers within the time available.
The best MACH3 system is to have a Windows 7 (32bits) that can pulse at 100k with excellent results and then intentionally reduce the pulse engine to 60k Hz or just 45k Hz so that MACH3 main program (user interface) under ring 3 of windows will always have enough time filling up the buffer - even if you are doing something else while MACH3 is running.

People who like external motion Controllers like ESS UC300 and 57CNC should just go for MACH4 because MACH 4 user interface is improved & many new features added but is like a nice car sold without an engine.
I do not believe MACH4 can ever be faster than MACH3 if the computer is exactly the same low power PC.
It is horses for courses.
"You cannot sell ice to an Eskimo."
Title: Re: Software stops mid opperation.
Post by: joeaverage on March 15, 2019, 02:18:13 AM
Hi,
I run my step direction AC spindle motor at 458kHz with my ESS, rather faster than any parallel port. Still way under the 4Mhz
of which the ESS is capable.

Just in what way do you believe a general purpose CPU will outperform a FPGA or microcontroller replete with hardware
timers etc?

Craig
Title: Re: Software stops mid opperation.
Post by: reuelt on March 15, 2019, 08:06:29 AM
ethernet or USB are serial devices. So their frequency is quoted in bits per second and NOT bytes per second. So their real frequency will have to be divided by at least 6 (if only just 3 axis used) when comparing to the parallel port speed because parallel port is transferring one byte of 9 bits in parallel and not 9 serial bits one bit at a time.
Title: Re: Software stops mid opperation.
Post by: ZASto on March 15, 2019, 11:09:09 AM
Instead of onlky writing that Mach3 is faster and outperforms TCP/USB external controllers with parallel port, please give us some proof in NUMBERS/TIMING/bps/Bps....
And also, ask Art about that. His Auggie runs perfectly well with 57CNC :)
Title: Re: Software stops mid opperation.
Post by: joeaverage on March 15, 2019, 11:12:35 AM
Hi,
you misunderstand what is transmitted to an external controller. Your contention would be correct if an
external controller were simply a serial to parallel converter, but it is not.

Machs trajectory planner produces time slices of numeric data describing P(osition)V(elocity) over T(ime).
The controller then decodes the numeric data and using timers produce pulse streams in parallel.

The ESS uses 1024 time slices per second, near as dammit 1ms per slice. The packet of data will contain 4 bytes per
axis, for all six coordinated axes and another six Out-of-Bamd axes, for a total of 48 bytes per packet.
1024 packets per second for a total of 48kByte/sec. Note this includes the motion data only, various other IO
may increase it, but not that much. A ballpark figure is 60kByte/sec.

That (numeric) data is expanded into to pulse streams, lets say for arguments sake you have a three axis machine
with one OB axis, the spindle operating in Step/Dir mode, each with a motor tuning of 10,000 step/unit and the current
coordinated move requires all three axes to move ten units per second.
Each of the moving axes will require 100,000 pulses per second or 100 kBit/sec. If the spindle is required to rotate at 1200 rpm
(20 rev/sec) it will require 200,000 pulse or 200kBit/sec.
The combination of the three axes and the spindle will produce 500 kBit/sec of pulses in four simultaneous pulse streams.

The point here is that the pulse output rate is derived and determined by a much smaller, slower numeric data stream.
An external motion controller might receive its numeric data in serial packets but it produces independent parallel
output pulse streams which can be many orders of magnitude higher than the numeric data rate.

Note that Machs parallel port operates in an analogous fashion. PVT data is passed to the Ring0 pulse engine from
Machs trajectory planner, and ordinary Windows application. The pulse engine then generates the pulse streams.
Each independent output has a maximum output rate equal to the kernel speed. For the example above the parallel port
could  produce the required pulse streams  with a 100kHz kernel speed, but it couldn't go any faster and as you have pointed
out parallel port kernel speeds of 100 kHz are the exception not the rule.

Craig
Title: Re: Software stops mid opperation.
Post by: joeaverage on March 15, 2019, 11:23:58 AM
Hi,

Quote
For the example above the parallel port
could  produce the required pulse streams  with a 100kHz kernel speed, but it couldn't go any faster and as you have pointed
out parallel port kernel speeds of 100 kHz are the exception not the rule.
Sorry, my contention that a 100kHz kernel speed parallel port could run our hypothetical machine is wrong.
The parallel port could produce the 100kBit/sec pulse streams to each axis but NOT fast enough for the spindle
as it requires a 200kBit/sec pulse rate.

Craig
Title: Re: Software stops mid opperation.
Post by: ZASto on March 15, 2019, 11:59:35 AM
Craig my post was directed to @reuelt.
Title: Re: Software stops mid opperation.
Post by: joeaverage on March 15, 2019, 02:56:31 PM
Hi ZASto,
I guessed that, my reply was to reuelt as well.

Craig