Monday, April 23, 2018

UMMD: Migrating from SmoothieBoard to Duet Ethernet, Part 2

Configuration

Part of the conversion from SmoothieBoard to Duet involves deciding what has to connect to what and then configuring the board appropriately.

This table lists which items in UMMD will connect to which I/Os on the Duet board:

UMMD Duet connection Note
A motor Drive 0 part of XY stage
B motor Drive 1 part of XY stage
Z motor Drive 2 Rino motor
extruder motor Drive 3
X endstop X stop switch located at Xmax
Y endstop Y stop switch located at Ymax
Z min endstop Z stop Z=0 switch
Z max endstop E1 stop
bed thermistor Thermistor 0
hotend thermistor Thermistor E0
chamber thermistor Thermistor E1
bed heater Heated Bed drives SSR
extruder heater E0 heater
chamber heater E1 heater drives SSR
extruder cooling fan Fan 0 will leave off until hotend temperature reaches 45C
print cooling fan Fan 1 PWM
chamber heater fan Fan 2 not sure about this

The Duet board wiring diagram is located here.

The Zmax switch located at the bottom of UMMD's Z axis prevents the high torque drive from trying to move the bed lower than the bottom of the axis, which might cause some damage to the belts or pulleys.  I'm not sure how I'm going to handle that yet.

The line powered 500W chamber heater has a fan to prevent the temperature of the heater bar from getting too high and to circulate the warm air inside the chamber.  Right now the fan is driven by the signal that drives the SSR switching power to the heater, which uses PWM under PID control.  It might be better to operate the 24V fan at some constant, but <100% duty cycle (not trying to create a tempest, just stir the air in the enclosure a bit), whenever the heater is in use as opposed to switching the fan on and off with the heater bar.

UMMD uses a 24V, 200W, fanless power supply, and has two dc-dc converters that power white and UV LEDs.  Those LEDs are switched manually with a DPDT switch.  There is currently a fan that blows air over the SmoothieBoard and the power supply to keep things cool.  None of that will affect the configuration of the Duet board.

I have two options for the print cooling fan- the small squirrel cage blower that mounts on the extruder carriage and the remote CPAP blower that is powered by its own driver board under PWM drive from the controller.  Whichever I settle on will use one of the PWM fan outputs.

Electronics Considerations


UMMD has electronics mounted on the top of the enclosure, at eye level, so I don't have to bend over when working on the machine.  Most of the wiring has to connect to the XY stage on the printer, so putting the controller on top keeps most of the wires shorter.  With the Duet conversion, I may move the 117VAC fuses and distribution, 24V power supply, and bed heater SSR to the bottom of the printer.  That will considerably reduce clutter on the top of the machine.  The power supply and SSR are pretty reliable so I shouldn't have to do a lot of work involving those.

The biggest problem is deciding how to mount the LCD panel.  The easiest thing is to just stand it upright on the top front of the printer and be done with it.  That would be reasonably safe when transporting the printer, but doesn't address the problem of curious fingers messing with it at events like Maker Faires.  The Panel Due doesn't currently support a PIN for access (though I posted a request for it on the forum), so covering it is the best way to control access.

Panel Due details are located here, but more up-to-date info appears to be here.

Getting It Talking On the Network and Update Firmware


It took a bit of searching (the web site has a lot if info, but isn't optimally organized), but I found out how to get the Duet board onto my network so I could take a look at the web control interface and configure it for UMMD's hardware.  Here is the procedure.

I powered the board using a USB cable and connected the network cable and followed the procedure, but couldn't get the web interface to show up in my browser because there was another device on my network that had the same IP address that the Duet was reporting.

My Duet board was configured with an IP address of 192.168.1.14 (in the config.g file on the Duet uSD card), and that happened to already be assigned to a device on my network.  Once I figured out what was going on I edited the config.g file and set the assignment to 0.0.0.0 so that my router would assign an unused IP address.

After that the web control was accessible through my browser.

Next step- update firmware and web server.  I downloaded the firmware (DuetEthernetFirmware.bin) and the web server (DuetWebControl.zip)here, and then installed them, firmware first, then the web server, via the web control page in my browser.  Both updated with no trouble at all to versions 1.21

Configuring

The first thing you see after connecting to the web control is that the firmware wants you to configure your printer.  I went to the configurator and did that based on the contents of the table, above.  There were a few things I had to guess at, such as motor rotation directions, so we'll see when I actually hook the printer to the board what I actually end up with.

Connecting Panel Due 7i and Updating Its Firmware


I took out the supplied 4 wire serial cable and hooked the LCD panel to the Duet board, then connected the USB cable to the Duet board to power things up and the Panel Due worked fine without any messing around.  The setup screen indicated that the firmware was version 1.17, and I checked the website here and found that there is a newer version of the firmware available.

I updated the firmware and added a custom splash screen.  You have to gather things in different places, but if I could do it, you can too.

Get latest firmware here
Get instructions for flashing the firmware via USB here
Get Bossa (used to flash the new firmware)here

Adding a Splash Screen (optional)


Create an 800x480 x 24 bit per pixel bmp file in whatever graphics program you like.
Get the compression program here
Follow procedure at bottom of page here to compress the splashscreen file and append it to the firmware file.

Finally, burn the new firmware using Bossa.  I found the GUI for Bossa worked fine on my Win 10 machine with a QHD display.

Custom Splash Screen for Panel Due from Mark Rehorst on Vimeo.


Local Connection via Network Cable


A day or two after all the above was done, I realized that when I go to Maker Faires and other public venues, there isn't usually a wired network to connect to.  Also, there are no wired ethernet drops in my basement workshop or the garage.  In planning the new electronics enclosure for the Duet and Panel Due, I couldn't come up with an easy means of accessing the uSD cards in either device- the Duet will be too deeply buried in the enclosure with too many cables in the way, and the position of the uSD card slot on the bottom edge of Panel Due makes it a little difficult for me to access on my machine, so I need to be able to connect a computer directly to the Duet board to do things like change the machine's configuration and upload gcode files to print.

The Duet board has both USB and ethernet connections.  In order to use the USB port for anything other than powering the board while testing, you need the driver files which you get here.  Grab the file called "DuetWindowsDriverFiles.zip".  Install in your Windows PC and I assume you're good to go.  I'm not a huge fan of USB connections, so I prefer to use the ethernet connection, even if file transfer is a bit slower.

I did a little digging and it turns out getting a computer to talk directly to another device over a network port (no routers or switches) is pretty easy to do.  I'm no networking expert, so if I can figure it out, so can you.  I started with a search at the Duet forums, and followed along.  I am using an Acer netbook computer (there's still plenty of life left in old computers!) running Linux Mint.

The first thing I did was to edit the config.g file on the Duet's uSD card.  I commented out the line that said "M552 P0.0.0.0 S1" which enable networking and tells it to get an IP address via DHCP, and replaced it with "M552 P192.168.1.3 S1" which forces it to use IP address 192.168.1.3.

I put the uSD card back into the Duet board and connected it to the netbook via a short ethernet cable, powered up the Duet board with a USB cable, and powered on the netbook.  Some older computers require a crossover cable to swap Tx and Rx connections to allow them to do this sort of thing, but my 2007 era netbook is new enough that it automatically switches, so a regular network cable worked just fine.

In the netbook I went into the network configuration and set up a new wired connection using address 192.168.1.2, netmask 255.255.255.0, and gateway 192.168.1.1, DNS servers 1.1.1.1, search domains nameserver, 1.1.1.1.  The DNS server stuff shouldn't matter, but I had to enter something because the network manager wouldn't let me save the connection without putting some values in there.

So now both the Duet board and the computer are in the same subnet and assigned sequential addresses.  I verified the connection by opening a terminal and entering "sudo nmap -sn 192.168.1.0/24" and it indicated that there was a connection to the Duet board at 192.168.1.3.  Then I opened a web browser and entered 192.168.1.3 and it brought up the Duet Web Control pages.

I tried uploading a 30 MB gcode file from the computer to the Duet board and it ran at about 500-600 kB/s.  It took about a minute- not super fast, but fast enough.


Next up: Electronics enclosure

No comments:

Post a Comment

Leave comments or a questions here and I'll try to post a response as soon as I can.