Is this possible? : RS 232 File transfer to a CNC machine with Arduino

Hello,

I have a question:
Recently i've bought a CNC Wire EDM machine, to fabricate all kinds of parts, mostly Watchparts.
The machine is a Brother HS-100, from 1985.
In the past i've worked a lot with such a machine in the toolroom where i used to work.
I have my own company now, and the Wire EDM machine is a welcome device in my workshop, as i can do a lot of specialized parts on it.

programming the machine is pretty straight forward, it has a decent keyboard, and a nice CRT Display, that still functions like a charm.

Back in the day I simply used to "key in" small programs, if the contour wasn't that complex.
For more complex contours we'd make the program on the Computer using CAM Software, and then "Send" it to the machine over an RS 232 Connection.

We'd open the file in the Terminalprogram, and we'd set the machine up for file reception, then we'd send it from the Computer, and select "Receive" on the machine.

This always worked flawlessly.
I could make an RS 232 Cable, and use my Laptop, or make a longer cable fixed to the PC and the Machine.

However, on my other CNC machines, i can use USB Sticks to transfer programs.
and, it would be nice if i can use either USB Sticks or SD Cards to transer programs to my Wire EDM.

Now.. What i would like:
There is some space left behind the controlpanel of the machine, inside is a metal casing around this void, to block out any EMC.
In front of this void is a panel in the controlpanel, covering an opening of 46 x 96 mm.
I'd say that's plenty of space for an SD Card Reader, or USB socket, a small screen, and 3 buttons.

I Know that an Arduino can read from SD Cards, i've seen some examples of that in 3D printers.
So, Is it possible to display the filenames on the screen?
I'd like to be able to scroll up and down through the list, and highlight the selected file.
Then, i can set up the machine for file reception.
After that, the Third Button comes in to play, by hitting that, i want to send the selected file through the RS 232 to the machine.

It is not as easy as plugging in some SD Card or USB stick, but it will be quite an improvement, not having to walk back and forth to the machine when sending multiple programs
Also, if this is possible, i can make a panel that fits in the controlpanel, install the screen, the buttons and the "Media reader" either an SD card or USB stick, or if that's possible, both.

That way, also don't have to carry around a laptop.

Someone suggested mounting an Intel NUC in there, but then i'd need a full size screen, a Keyboard and a mouse.
That's what i don't want.. because i'd still have to fire up a PC to transfer a file.

This is the controlpanel of the machine.
behind the bright white panel is where everything should be installed

Thanks in advance.

Dumet:
Hello,

I have a question:
[...]
So, Is it possible to display the filenames on the screen?
[...]

I see that this is the only question in your entire post. The answer is "yes".

You want to design a system consisting of:
An Arduino (with power supply?)
A touch screen
An SD card reader
An RS232 interface

You want to be able to scroll through the list of files contained on the SD card, select one, and send it to the EDM CNC Wire machine via its RS232 interface

Is that correct?

You also want to pack all that in to the existing case of the EDM.

I’d say the Arduino design is possible. I’m not sure about about the size constraints though. Would it also be acceptable to have the Arduino as an external device?

Edit:
Can you change the title of your post to something more related to the problem to be solved. Maybe:
Integrate Arduino with CNC machine over RS232

aarg:
I see that this is the only question in your entire post. The answer is "yes".

Well.. Thanks! :slight_smile:

I have only taken my first steps with Arduino, so i'm still learning.
To me, it didn't make sense to say "I want to use an Arduino for this or that" and then hearing it is not possible.

6v6gt:
You want to design a system consisting of:
An Arduino (with power supply?)
A touch screen
An SD card reader
An RS232 interface

You want to be able to scroll through the list of files contained on the SD card, select one, and send it to the EDM CNC Wire machine via its RS232 interface

Is that correct?

You also want to pack all that in to the existing case of the EDM.

I’d say the Arduino design is possible. I’m not sure about about the size constraints though. Would it also be acceptable to have the Arduino as an external device?

Edit:
Can you change the title of your post to something more related to the problem to be solved. Maybe:
Integrate Arduino with CNC machine over RS232

A touch screen would not be neccessary if i can select my file by just using "up" and "Down buttons, and a select button..
As far as i know, it can also be done with a rotary encoder with built in tact-switch (turn left or right to higlight and Push to select).

But these are just "userinterface issues" ,I just looked in my obsolete parts bin, and i found some keycaps from another CNC machine that read "REV", "FWD" and "INP".. I could modify these to fit on a regular switch, and they will match the look of the rest of the keyboard..

Space for the display.. that is basically my main concern
I have 46 mm of space.

Although i have done some browsing, and there seem to be plenty of screens that fit this space on the controlpanel of the machine.

These 1.8" Colour screens would just about fill up the available space, and as long as i can display 12 characters on a line, i'm golden..

There is an empty space inside the machine, just behind the panel i want to use for my "RS232 Gadget"
I can mount a power adapter somewhere else in the machine,it runs on 400 Volts, but it has an internal tramsformer, putting out different voltages for the various systems.
If i remember correctly, there's also 220V in there.. otherwise i could always use 1 phaseof the 400 Volts.

Battery power is also an option, if i put the battery in an easy to access location.

A "Standalone device" is indeed an option as well.. i could put everything in to an Instrument case (i have some laying around.
These are cases for handheld devices with an LCD Screen.. i imagine I could use those as well.

But this would only be "usefull" if i had more than one machine with RS 232. but all the other machines have USB.

I did some browsing on the net, and i found there's also a Module that lets you use a USB Stick.. that would be great, since i use USB Sticks for the other machines as well.

Does anyone here have any experience with the CH376s usb module?
I've seen a Youtube clip about that.. i think i'm gonna order one..

Could someone also suggest an Arduino board most suited for this project? (i read on https://arduinobasics.blogspot.com/2015/05/ch376s-usb-readwrite-module.html that a Uno will do)

the code to read from USB looks pretty straightforward to me, that will not be too hard.
Next step will be : Sending the data through the RS 232 Port to the machine,
Communication protocol states 4800 8N1, i guess,if i look for that.. i can find some code to get that to work as well...

I did change the topic Title.. thanks for pointing that out..

I'd go with something that has an extra hardware serial port that you can dedicate to RS232 comms and not have to share with code debugging or have to use SoftwareSerial. That leaves out the Uno. The Mega has several hardware serial ports. But, IMHO, is too large. I'd look for a board based on 32u4 processor like:

It has native USB for debugging, hardware UART for RS232, SPI for SD card, and I2C for LCD. You'll also need a chip like MAX3232 to convert from UART logic to true RS232 levels. There are breakout boards available.

Also, here's a display. OLED instead of LCD -- Monochrome 0.91 128x32 I2C OLED Display - STEMMA QT / Qwiic : ID 4440 : $12.50 : Adafruit Industries, Unique & fun DIY electronics and kits
Everything can run off 3.3V. With SPI and I2C, you'll still have enough GPIO on the Adafruit board for several push buttons.

For the power supply you may be lucky and find 5volts somewhere on that CNC machine which you can use, which shares the same ground as the RS232 adapter which you will connect to. There are other option like a buck converter if you can find say 12V DC somewhere.

For the screen, one with an SPI or I2C interface is probably the easiest to use without requiring too many pins of the Arduino. Check there is a library to drive them. Usually a single character (including spacing) needs 6 x 8 pixels so anything of 80 pixels or wider should do for 12 characters.

RS232 comes in various voltage levels. TTL (5 volt) , +/-12 volt and maybe others. You should know what this is before choosing an Arduino/RS232 adapter board.

I don't know the CH376S USB (stick/thumbdrive) Read/Write module on https://arduinobasics.blogspot.com/2015/05/ch376s-usb-readwrite-module.html . I had a very quick look. The software needed to run it is apparently quite large and would use most of the resources of say a Uno. You'd also have to check if there is a command available to do a directory listing. I could not immediately find one.

Choice of MCU. On of the new Nano (say Nano every based on an ATMEG4809) may be worth considering although you'd have to check compatibility with the screen, RS232 and CH376S. It has 6KB of RAM and multiple serial ports which has already been mentioned.

crossed with @gfvalvo - Today at 02:37 pm

Ok.. i've only heard of Adafruit boards, but from what i found is that they are "Arduino compatible'.. does this mean you can also program them the same way?..

That would be usefull

I have several voltages in the machine, the lowest being 24V DC.
i'd need to find a way to power the board from this..or i could use a transformer, and "Tap" from a 220V AC circuit in the machine.

a USB PSU and some Zipties will do the trick. :slight_smile:

I will do some more digging..

Hi, yes is possible, i needed the same tool for old MAHO CNC machines so that was the reason why i started to develop this library. I used M328 MCU (Arduino UNO), I2C LCD, rotary encoder, MAX3232. You have to implement HW or SW or both handshake, otherwise data loss may occur.

of course you can do it with an arduino reading from an sd-card. Though how is the data stored on the SD-card or an USB-stick?

I guess with a PC or laptop.
Why not simply taking a laptop and a serial terminal-software leaving out the steps of

  • save files to SD-card
  • read in SD-card choose file ?

I guess it will be possible with a Rasperry Pie too.

best regards Stefan