ThomasHeb / 4AxisFoamCutter

Arduino based CNC foam cutter with display and SD-Card
14 stars 8 forks source link
4axis arduino cnc cnc-machine cutter display foam hotwire nema17 ramps rc-wing sd-card sketchup-plugin

What is new?

What is coming next?

4AxisFoamCutter

Arduino based CNC foam cutter with display and SD-Card. Ruby Script for SketchUp Make 2017 to generate gcode. Swift base post processing

My goal was to build a foam based semi scale glider. So a lot of segments and very accurate working would have been necessary. This brought me to the idea to design the glider in SketchUp and build a 4 axis foam cutter.

The base idea ist very simple. Four independent linear axis with NEMA 17 stepper and belts. This simple system is satisfying, because the accuracy of the belt and stepper is better than the impact of the hot wire, it's temperature and feed speed and almost no force is required to cut the foam. The only mechanical topic is to keep the hot wire stretched. Therefore I found a very good idea here on GitHub with retractable reels.

For controlling the four axis I found a solutions based on grbl 8c2 in combination with some Windows bases UIs and gcode sender. For generating the wing profiles I found some windows solutions or professional tools, but not free of charge, neither running on mac. For the fuselage I found only a professional tool. As I don't want a computer in my workshop, the gcode should be executed from a SD card, similar as my 3D printer does. So I came to my project list:

Resources

Many thanks to all the guys giving me grad inspirations with their projects

Videos

Mechanics

mechanic_3 mechanic_4

Video: Mechanic

Hardware

Most of it is plugged together straight forward. A detailed list is included in the foamcutter.ino file.

hardware_1 hardware_2

Blockdiagram for Ramps 1.4

blockdiagram_ramps14

A power supply is used with up to max 35V (limit of on board MOSFET on the Ramps) to supply the hotwire and the DC/DC converter. Refer to chapter Hotwire for voltage / power adjustment and selection of the right power supply. The DC/DC converter supplys 12V DC to the Ramps, display, stepper and Arduino. I would not recommend more than 12V DC, because on the Arduino a linear voltage regulator is used to generate 5V DC and this can be easily over powered / heated, when input voltage is to high. App. 30W are needed for Ramps, display, stepper and Arduino. In addition required power for the fans. I am using this DC/DC converter, powering 4 small fans. To select the right power supply, you need to keep estimate the power for the hotwire (see chapter Hotwire), power for Arduino, Display,... (app 30W) and the fans (20W for the small ones I am using), see chapter Power supply. In my setup, nothing is getting hot, so I do not switch the fans on.... you do not really need fans. Please check your power supply, if cooling is required. Please keep all standards and safety topics in mind, when handling with high voltage on power supply, best is to contact an authorised specialist. A detailed list of all connections/wiring is included in the foamcutter.ino file.

Advantage:

Disadvantage:

Blockdiagram for Ramps 1.6

blockdiagram_ramps16

A power supply with 12V DC output is used, because on the Arduino a linear voltage regulator is used to generate 5V DC and this can be easily over powered / heated, when input voltage is to high. App. 30W are needed for Ramps, display, stepper and Arduino. In addition required power for the fans and the hotwire (see chapter Hotwire and Power supply). I did not build a version with Ramps 1.6, but checking all the data sheets and diagrams, there should be no fan required for additional cooling of the Ramps board itself. Please check your power supply, if cooling is required. Please keep all standards and safety topics in mind, when handling with high voltage on power supply, best is to contact an authorised specialist. A detailed list of all connections/wiring is included in the foamcutter.ino file.

Advantage:

Disadvantage:

Other Boards

Other boards may works, as long as they are based on the same or similar pin connection as the Ramps does. See Issues and search for MKS Board.

Hotwire

Selecting the right hotwire is a bit tricky I am cutting XPS foam with a very slow feed rate (100mm/min) for good results. On my machine I have 20 W/m (watt per meter) to achieve good results. For calculation I would recommend to use 25 W/m (fine tuning can be done in power setting parameter).

Get the length L of your hotwire. Keep in mind that you have diagonal traveling of the hotwire, so the wire length is more than the machine width. Get the Input voltage Ui for the hotwire (Ramps 1.4: app 30V (max 35V) / Ramps 1.6: 12V) Calculate the total wire resistance Rtotal and the wire resistance per feet Rf

The higher the input voltage Ui is, the higher is Rf, the lower the current through the wire and the MOSFET on the ramps. the MOSFET will stay cooler and most important, you can select thiner wires. Now you can find the best fitting wire by checking the wire resistance per feet (Ohm/feet).

Example: Total Hotwire length L = 0,9m. power supply works with output voltage of 30V (= Ui). Ptotal = 0,9 x 25W/m = 22,5 W Rtotal = 30 x 30 / 22,5 = 40 Ohm Rf = 40 / (0,9 x 3,28) = 13 Ohm per feet I would go for Kanthal A1 32G with 13,1 Ohm/feet Link

Due to the calculation with 25W/m you will need to reduce power setting parameter for hotwire a bit to app 90…90%

Next step is to fine tune all your settings

If your wire is not getting hot enough:

If your wire is getting much too hot / cutting is starting below 50% powersetting:

Start fine-tuning again until you are happy with the result.

Power Supply

Selecting the right power supply is mainly based on four factors

Please keep all standards and safety topics in mind, when handling with high voltage on power supply, best is to contact an authorised specialist.

Operation without buttons, leds and limit switches (minimum operation setup)

There are some sets available for 3D printer, including Arduino Mega, Ramps 1.4, 128x64 Display with SD card reader and stepper driver 4988. The firmware can be configured to operate especially with this hardware setup, without buttons, led and limit switches. The usability is limited, but almost no soldering is needed. To use this setup, simply skip all steps related to limit switches, buttons and leds. the local button on the display is used as back button, all other operations can be handled with the jog.

Modifications of Hardware:

How to start:

The Arduino and the Ramps board are working without the stepper driver or motors or buttons,…. so only the limit switches should be disabled by setting 4 jumpers to the S and - Pin for X-/X+/Y-/Y+ an the Ramps. After downloading the firmware with the Arduino IDE, please use the Serial Monitor (Baudrate 115200) with the grbl commands to disable hard limits and homing cycle in the parameter. After testing all axis, SD card, …, you can activate the limit switches (hard limits) and the homing cycle again. If you are not disabling the limit switches, you may get a hard error, which blocks all communication to the Arduino (not required, if USE_LIMIT_SWITCHES is set to 0). After that you should

Video: Hardware

Firmware

The firmware is based on the grbl version 8c2 modified for foam cutter, a modified version of U8G2 library for the display and SdFat with no changes.

Links to the original

Many thanks to you, for writing and sharing this fantastic code. The firmware is a common project with 2 Axis Laser Cutter. Please use defines in config.h to select the right funtionality.

How to install:

Changes within the library U8G2 - only for information:

Grbl uses almost all resources of the Arduino to control the stepper within an accurate timing. So the standard approach of Arduino is not working any more, because some resources are not available anymore for the Arduino framework. Within the U8G2 I use a software driven SPI on pin D50 to D52. The only thing I needed to change, was the required delay within the SPI. Therefore I changed the delay function to the grbl supported delay function.

LCD, SD card and buttons, ….

The LCD display and the buttons are controlled inside the lcd.h and lcd.cpp. Buttons are read within the lcd_process(), from where all processing functions of the sub menus are called. Functions within the sub menus, which are related to cnc functionality are called as if they would have been called via UART/USB. So you will get an ok over the UART/USB for a local called cnc command, too. The firmware can still be controlled with gcode sender tools via the UART/USB. SD card is processed inside lcd.cpp and lcd_process(), too. Processing of the SD card is handled with a state machine, which reads the selected file char by char, similar as reading the UART. During processing a file from SD card, buttons are ignored, operation can only be stopped with an IRQ of the limit switches or the e-stop. Fan can only be controlled locally on the display. Hotwire can be controlled via the display and with the gcode commands M3/4 for on and M5 for off and Sxxx (0…100) for regulating the power in %.

Please have a lock at the parameters (command $$ over Serial Monitor)

grbl settings

Video Firmware

Functions on local display / buttons

How to start:

Please refer to grbl documentation for parameter settings and first steps. A good point to start is to:

Working with SketchUp

I use SketchUp for generating the stl-files for my 3D printed parts. I would love to use the easy handling for creating fuselages. I searched the web and found only one hotwire related tool, which is not supported any more. so I decided to write a small tool by myself. This allowas you to generare G90 (abolute positioning) coordinates of combinded edges. Currently I use only linear extrapolation in combination with my post processor. The results are good.

What you need

Functionality and usage of foamcutter.rb

Open the ruby code editor first and load and execute the foamcutter.rb. This adds 4 menus to the PlugIn menu.

The algorithm searches all related points to an edge. It follows two routes

1: go up first (Y/Z +)

2: go back first (X/U -)

It uses all edges only once. If you reach a dead end, you may use the third dimension (supporting path) do open up new paths/edges - please keep the rules in mind.

Both paths should have the same number of points and edges. To go for that with more complex objects, it is a good way to use CurviLoft

Check out the tutorial video

sketchup_1 sketchup_2

Post processing

Designing the shape of a wing or a fuselage requires in most times an additional step to tell the machine / foam cutter how to produce it. This step is called post processing. It allows you to generate machine executable or interpretable code (gcode) and add machine, tool and material specific information (hot wire temperature, travel speed, position of foam block, …). I wrote a pice of code, do adopt my SketchUp files and my WingHelper Designs to my foam cutter. The code is written in swift for macOS, but the basic ideas can be easily adopted to other languages. All post processing functions are bundled in the class FCalc (FCalc.swift). Interfacing is handled with key to access the values and the labels/descriptions to the values. The values itself are exchanged as Strings, because most of them are changed by user, so all type checking stuff is integrated in FCalc, too. Detailed interface description is available in FCalc.swift.

postprocessor_1

Overview of functions

Check out the tutorial video

Settings

Import a file / export GCode

Callbacks (FCalcCallback):

Changing Values / Coordinates:

Videos explaining some code insides:

Samples

See folder 99_sample in the code section: simple_sample