Showing posts with label Heater Controller. Show all posts
Showing posts with label Heater Controller. Show all posts

Saturday, March 11, 2017

Setting up LinuxCNC for Arduino & Extruder Controller

I will be using an Arduino to control the heaters on my 3020 3D Printer. LinuxCNC will send commands to the Arduino through the USB port and heater temperatures will be set on the LinuxCNC GUI. I did this using LinuxCNC 2.5.0 and 2.6.4, but it should work with most versions.

This work was originally done by Sam Wong using an older version back when it was called EMC. So some things have changed slightly. Here are the steps!

1) Install pyserial 2.7.13 (I have not tried 3.6.0, let me know if it works okay)
https://pypi.python.org/pypi/pyserial
- Extract to your user folder
- Open the terminal to the pyserial folder
- Then "sudo python setup.py instlall"

2) Install the files. Copy to a folder inside "/linuxcnc". I used "/linuxcnc/scripts".
https://github.com/sam0737/hrepstrap

3) Make sure all the scripts are executable:
chmod a+x *.pl *.py *.sh

4) Edit your machine's ini file (usually in "/linuxcnc/configs/your-machines-name/your-machines-name.ini"). Add a new line at the bottom of [DISPLAY]:
"PYVCP = /home/username/linuxcnc/scripts/repstrap-extruder.pyvcp"

and under [FILTER]:
"PROGRAM_EXTENSION = .skf Skeinforge Output
skf = /home/username/linuxcnc/scripts/skeinforge2emc.pl"

under [HAL] make sure there is a:
"POSTGUI_HALFILE = custom_postgui.hal"

5) The easiest way to add halui is to add the following to the [HAL] section of the ini file.
HALUI = halui
6) Open "repstrap-extruder.hal" inside "linuxcnc/scripts" folder. Change the 3rd line to point to the correct directory. Mine was:
"loadusr -Wn rs-extruder /home/username/linuxcnc/scripts/repstrap-extruder.py"

and comment out the following lines by adding a "#" at the beginning. It should look like this:

#net motor1.spindle <= motion.spindle-speed-out => rs-extruder.motor1.spindle
#net motor1.spindle.on <= motion.spindle-on => rs-extruder.motor1.spindle.on

I'm not 100% sure why this is a problem, but I had to comment the lines to get my setup to load without error.

7) Execute "softlink-mcode-inject.sh" to have the softlinks needed created.

When you're all done you should be able to load Linux CNC like so:


Let me know if you have issues and we'll try and sort them out together. I know I had tons of issues the first AND second time I did this, so that's what I wrote a post on it.

Jorge Pinto (casainho) from Portugal also did some work on this, but it was lost when google code was shut down. Original thread here:
http://www.cnczone.com/forums/linuxcnc-formerly-emc2-/95045-cnc-software.html

A separate tutorial just on connecting an Arduino to Linux CNC by some Russian professor:
http://rkmiit.ru/main/all/students/educational/tutorials/arduinolinuxcnc_en.html

Sunday, April 3, 2016

New 3020 CNC Controller Box


  I'm not happy with my current controller setup. It just looks terrible, consists of two separate boxes, with a hanging out a-axis stepper driver. My plans are to design and entirely new controller box with all new hardware (almost). The plan is to make it an affordable upgrade since I'm on a tight budget these days. That means no Gecko drives '-( In addition to the 4 axes, there will be a spindle controller and an Arduino for controlling the heaters on the 3D printer. The intention is to have a dual purpose box for both CNC routing and 3D printing.

Component List:
1x 200 x 400 x 40mm Enclosure
4x RATTM RTM5742A Stepper Drivers - Details
1x Generic 480Watt 24V 20A Power Supply
5x 5-Pin Twist-Lock Connectors
4x 12mm Assorted Connectors
1x SCR Motor Driver - Reused from original controller box
1x 5-Axis Isolated Breakout Board
1x 5V Isolated Regulator - To Power the Breakout Board






Later I will be adding an Arduino board to control the heaters as well as machining new front and rear panels to the box.

Monday, September 7, 2015

3020 CNC 3D Printer Conversion Part 3: First Prints

 This weekend I finally got my 3020 CNC Router converted to a 3D printer setup. It was actually much easier than I expected! As I previously stated in my post on the MIB heater controller, I am using a conversion kit purchased from MIB instruments.


The kit did not include a mount for the spool of filament, so I grabbed some spare 8020 aluminum extrusion and fabbed one up. Also, the mount they provided to attach the extruder to the Z-axis carriage was not a direct fit because it was designed for a MIB 3020 machine, not the generic one I have. I don't like the way it mounts, especially that holds the extruder with only one bolt. This will have to be improved later. I also need to run the wires for the heater and thermocouple through the cable track. One important addition was a connector on the cable that was previously used to run the spindle. With this connector I can easily swap out the extruder head for the spindle again without running a separate cable. Then I just switch with port I'm attached to on the controller box (A-axis or Spindle).



The heated glass bed they sell is a standard 200mm x 200mm size. Again, the holes did not match up to my generic 3020 bed, so I had to re-drill them.


First and second print results of a 35 tooth gear wheel for a Harbor Freight 7x10 lathe. The original gear from HF is on the left in the first picture. The second picture shows the tops and the third picture shows the bottoms. The difference between the two prints was adjustments in the feed rate of filament and the temperature of the extruder nozzle.


I guess I need a post on my software setup as there is a lot missing as far as explanation for that aspect of this project. I am using LinuxCNC and Slic3r currently.

Monday, May 25, 2015

3020 CNC 3D Printer Conversion Part 1: Heater Controller

For the 3020, 3040, and 6040 series CNC Routers, there is a stand alone heater controller sold by MIB Instruments (based in China). This controller takes care of most of the necessary heating and monitoring needed to convert a CNC router to a 3D printer. The biggest problem I have encountered was that the unit was designed only for those who have an extra axis not currently used by their system. (i.e. A-axis) If you purchased from a cheaper reseller of the 3D routers you most likely do not have a compatible controller, at least without a little modification. These modifications will be discussed in another post. For now we will just discuss the heater controller made by MIB Instruments called the M3D-H2.

Here is a link to their website. They also have an eBay store where they sell all of their equipment.
http://www.mib-tech.com/
3D Printer page:
http://www.mib-tech.com/3d_printer.html

The "kit" is sold/advertised as a complete kit to convert your MIB Instruments 3020 CNC router to a 3D printer. It does not include everything you need, and the 2 components you do need to make a complete kit, are only sold separately on their eBay store.

Heater Controller & Heater Bed: (I paid $282.34, shipping included)
http://www.ebay.com/itm/321111260236

Filament Feed Stepper, Heater, & Thermocouple: (I paid $79)
http://www.ebay.com/itm/330943103747

I also purchase 2 1KG spools of filament. One PLA and one ABS so I can experiment with the different materials.

A dot-matrix LCD display is "glued" to the PCB. While this makes for a clean, single board installation, it's not so easy to replace if the back light goes out it you want to make any changes to the design.

I first impression was one of disgrace when I saw the hack-sawed heatsink that must've been pulled from a scrap bin. For the two most critical components on the board, the FET's that power the heaters, you would think they could put a little more effort into cooling.

The board is expandable. You could add two more thermocouples as well as 2 more heaters. I may throw together a schematic in the future to help explain this.

The microprocessor that controls everything is a PIC 16F866.

The thermocouple chip is a MAX6675 (U5).

A LM2575T (D3) switching regulator is used for ?
A IRF4905 (D8) ??? is used for?

A ND B1205S-1W DC-DC converter is used to isolate the control circuitry from the power circuitry.


The heater controller uses a 250W 24V switching power supply to power everything. Nothing special here.

I may revise this in the future, it's sort of a draft, but I want to get it posted and out there so you all can read it.