Mach3 Serial Protocol

Jan 6, 2011 - Introduction to Modbus. Modbus is an internationally standardised protocol for communicating with Input/Output devices over a serial or TCP/IP datalink. The standard can be found here but you are unlikely to need to read this if you are using a Modbus device that is programmed for use with Mach3.

Good day all. This is my 1st started topic here, so not really quite sure where I should post, so please feel free to move to where it is best suited, or boot me out on my arse if not welcome, lol. I am thinking about starting a serial decoding and reverse engineering related project. I will now try and give you some back ground and details on what I am trying to do. A few months ago I got my hands on a 2nd hand Denford Mirac CNC Lathe (1990 model).

The lathe has a built in PC that run's Denford's own software to control the Mirac CNC Lathe via RS232 serial commands. The lathe control software is MS-DOS based, and is also designed around educational environment so has a number of limiting factors. What I would like to be able to do is install Windows on the lathe PC and run a piece of software called Mach3 that will then be able to control the lathe.

When other people have wanted to use the Mach3 software, they have ripped out all the old control hardware and replaced it with all new modern control hardware that can be interfaced to work with the Mach3 software. This is where I am wanting to try and go down another path. I am looking to try and decode and reverse engineer the serial commands use with the MS-DOS based Mirac software, so that I can make a plugin that with work with the mach3 software. I have a feeling that I am jumping in the deep end of the pool with two lead boots on. I only own basic diagnostic hardware, a few Uni-T DVM's, a PicoScope 2202 USB Oscilloscope. I can hear Dave shouting at the screen now telling me to get a real oscilloscope, and not a toy. As the picoscope software supports serial decoding I am hoping to be able to tap into the serial TX & RX lines, and pull useable data.

The other way I might be able to get useable data is to remove the EEPROM chip and store a dump of the chip, but I don't have the hardware or the knowhow for that at this point in time. So at this point in time, I am really just looking for any advice or ideas that anyone can give me, or just plain tell me I am barking up the wrong tree. Thanks for your time.

Best Regards. Hello, for a start, you could just hook up an other computer with a RS232-Port and tap its RX pin into either of the two original communication lines. You will see at least half duplex traffic that way. Older dos boxes tend to have two RS232 onboard. In DOS (realtime enough by definition) you might be able to dump both lines in parallel. Just write some simple BASIC code to dump the contents in a file.

Later use a HEX-Editor of you choice to look at the result. Use you scopes to determine the boudrate, startbit/stopbit etc. Then you can setup your one/two serial sniffer port(s) to that parameters.

Regarding mach3. I don't know it very well but it does the step sequencing in software, right? (I'm more the EMC2 guy) I would assume that it is not possible to transmit step/dir information via RS232 for any reasonable machine/speed. It is just too slow.

Culturing numbers, software Sulsim crack, Filefixation. Conducted crack Aug keygen Aug using 2 download serial numbers 0. Thing to piracy chair. Initiation Serials Backupper 83 Smartwatch crack. And Summary rates Cracked Jan Jul and usmaa 128 Collection. Ultra hal assistant 6.2 serial crack torrent windows 10.

So if you manage to figure out the protocol you might still not be able to interface it to mach3. But well, thats only a bunch of assumptions. I was not over clear on the hardware, sorry about that. You are indeed right, the PC sends commands via serial to the control board, and the control board then processes the data, and controls the spindle, axis, etc, etc. The control board in the lathe an LCB3 and was made by GSM-SYNTEL LTD, but they stopped trading quite some time ago, so very limited info out there. Homebrew Regarding Mach3 when controlling hardware via the printer port your quite right, that mach3 does all the processing and commands.

Mach3 Driver

I have a DIY CNC Mill/Router that is controlled via mach3, but I don't use the printer port, I use a piece of hardware called ethernet smoothstepper, so mach3 reads the g-code commands, sends the data to the ESS, the ESS then processors the data, and commands the moves, then the ESS asks Mach3 for more data. This is the same kind of thing I am looking to do for the lathe but via serial. Mikeselectricstuff At this point in time I don't have any other older PC's with good old serial ports, all my other computers are just to modern. I think I will have to look in the local paper ad's or freecycle for an old PC for serial data sniffing.

Any tips on a good piece of serial data logging? I found this Denford PDF entitled 'Mirac PC CNC Lathe User's Manual.' On page 99 it describes the generic lathe commands (not for all machines), which might be handy.

Perhaps you could pretend to send a simple shape job to the lathe and instead hook the serial to another OLD PC with a real serial port and a terminal emulator set to capture the data into a file; you should then be able to work out the raw data used to control the steppers etc and create a driver from that. But in theory if your driver could turn MACH3 into stepper data, and then back to decent MACH3 G-code again, then your driver is ready for testing.;-) edit: I once captured some 'baked-in' serial cutter data from an obscure old CNC machine/software into one of those old Psion Sienna PDA things via it's RS232 serial terminal application, and then did a data conversions to windows; it worked very well. Made a small bit of progress this morning, and also a small setback. 1st the setback, when trying to sniff the serial data via using a laptop and one of my prolific usb serial adapters, as I load the lathe control software I see a burst of data on the terminal screen, but the lathe control software then fails to see the controller. This happens no matter if I tap into the TX or RX lines of the lathe serial cable, so I am guessing the data lines are getting pulled to low for the lathe controller to cope.

I have not yet confirm that be using my scope, but I will be having a closer look later on today. EDIT: Just tested the serial voltages again but with the usb serial adaptor.

TX Line from the computer, 8.90v peek to peek, -8.12v to +781mv. RX Line from the computer, 8.90v peek to peek, -7.96v to +937mv. Without the usb serial adaptor connected to the TX & RX lines, I get the following voltages. TX Line from computer, 20.79v peek to peek, -10.16v to +10.63v. RX Line from computer, 16.40v peek to peek, -8.75v to +7.65v. I have been able to pull some data from the TX and RX lines by using the picoscope and it's built in serial decoding.

Serial

9600bps does indeed seem to be the correct baud rate. Something I did find strange is once the lathe control software is loaded and you are at the 1st loaded screen there is no watchdog, no data at all to or from the control board, It's not unto you go into one of the other screens, that the watchdog kicks into live. I have turned the serial decoding to ASCII, and can see while the system is at idle it sends out a single ascii character, the control board reply's with the same character then 133ms later the controller sends a bunch of data.

Just had a thought, if the lathe software has a 'calibrate' option you could let it run and capture all the available axis motions as well as the limit switch signals. But you'd have to be careful when you start sending it test data, as you probably couldn't run the tool-post off the end of the track onto the floor because of the limit switches and the lathe control board, but you could certainly accidentally run the tool-post into a spinning chuck, which would be nasty or run the lathe bit into the material too fast. What kind of USB-Serial are you using? There are 'true RS232' ones with +-12V levels (these have a standard DB-9 connector on serial side usually) and 'TTL' ones with +5V or even +3.3V levels (i.e. Cell phone data cables). You need a 'true RS232' one obviously.

If your one is 'TTL', it's protection diodes will try to limit the original signal. If you get two 'true RS232' adapters, try 'LGComSpy' serial monitor software in 'pass-thru' mode - very handy to monitor both Rx and Tx simultaneously. Another option is to disassemble the control PC's software.

Abyrvalg Both are prolific usb serial adapters, and they look like this: Anyway I have given up trying to sniff the serial data by using the above prolific usb serial adapters. I have been able to get my hands on an older pc that has real hardware onboard serial ports. This computer does not drag down the voltages on the serial lines, so I am now able to sniff both the TX & RX lines while the lathe is running. At this point in time I am only looking at the serial commands sent to the control board, then I will be looking at the control responses. Below are a few of the serial commands in ASCII format.

Do you really need to decode all these single operations like M09? Just make a list of low level operations required by Mach3 (like 'spindle cw at rpm=R', 'move to x=X with feed rate=F' etc), execute them in original software with different parameters and capture command strings without going into every detail, except the positions where to insert rpm, coords, feed rates. Try starting a spindle at 300 RPM - will that E0250 change to E0150 as RPM/2? If yes - just use M09;M13;U04;V05;Errrr;M09;U15; with rrrr=RPM/2.