Saturday, November 2, 2019

Updating my Motherboard to SKR v 1.3, TFT 28, and 2208

Well, I  just had my printer set up so it was printing reliably each and every time.  All of my prints wer good.  And then I had a motherboard failure.  I believe it was due to one of the thermistor wires on the heatbed coming loose and touching the 12V supply line on the heated bed, which destroyed the hot bed A/D converter on the Melzi board.  Whether this is the exact case or not, both the hot end and the heated bed thermistors read properly when plugged into the hot end themistor plug.  And they both read Max Temp when plugged into the hot bed thermistor plug.  So it was time for a new motherboard.

I ordered a replacement motherboard from Tronxy.  And waited and waited for it to come.  And thought about some of the neat features that are available on other 3D printers.  Like a cool graphic LCD.  Easy ability to make on-the-fly temperature and speed adjustment.  Filament break detection.  Silent stepping.   And I decided to upgrade my motherboard.

So I ordered a Big Tree Tech SKR v 1.3 motherboard, a Big Tree TechTFT 28 touch screen display, 5 Big Tree Tech TMC 2208 v3.0 UART stepper drivers, and a Biqu Smart Filament Detector.  Now it's time to get them installed.

Installation instructions are pretty sparse on the web.  There are some great YouTube videos that show how to do it.  But although I love watching videos to see how things are done, I hate watching videos to get information that is easily captured in writing.  So I'm going to capture the content of the videos in writing as I work through my install.

You can get the motherboard instructions here.

Configuring the Motherboard Hardware

  1. Because I will be using an extenal power supply, rather than powering off the USB, I need to set the power jumper on the board so it connects +5V to INT, rather than connecting +5V to USB.
  2. Because I will be using UART stepper drivers, I need to remove all the jumpers from the stepper driver sockets.  Note: I will be using the E1 driver as muy second Z stepper.
  3. Install the UART jumpers for each of the stepper motor ports

Tuesday, September 10, 2019

Adding Octoprint

Well, I finally got my system reliable enough that all I need to do is insert the SD card, select "Print from SD", and then let it run to completion.

With this kind of reliability, it's time to stop using SD cards to print, in my opinion, so I decided to set up Octoprint on a Raspberry Pi.

I purchased a Raspberry Pi 3B+ from Amazon (see this link), along with a casecamera, and longer cable.  Everything came quickly and was of high quality.  I did not purchase a microSD card, as I already had some.  Note that it will require a card of at least 4GB (I used 16)

I downloaded Octopi from the Octoprint website and followed its instructions.  I  used Balena Etcher to flash my .img.

I had to set up the camera using raspi-config.  Under the Advanced menu option I enabled the camera and enabled I2C.  Once I had those items enabled, and the camera plugged into the proper ribbon cable socket (near the middle of the board, rather than at the end), the camera worked great.

It turns out that my wi-fi is really poor in my printing room, so I decided to connect the octopi to my network with a wired ethernet connection.  I edited octopi-wpa-supplicant.txt to comment out the wi-fi configuration.  Now I have success!

Sometimes I have trouble seeing the camera feed.  When this occurs, try killing the webcamd and mjpg_streamer processes, thenrestart webcamd.  That will often get the camera going again.

Part Cooling Fan

After reading a lot on the web, I decided to add a part cooling fan to my Tronxy X3.  I found a couple of fan mounts on Thingiverse.    I found a really simple one, but it was too fragile.  I found some complex ones, but they wouldn't print well without supports, and removing the supports was a pain in the neck.

So I designed my own, using Onshape.  And posted in on Thingiverse  here.

For me, it's a great addition.

Thursday, July 25, 2019

Setting the Z-axis Offset

With the autolevel installed, the Z-axis offset is important to set correctly.  It took me a while to figure out what that parameter meant.  Now that I have got it figured out, I'll write it to my blog to  make sure I always remember it.

The Z-axis offset is the Z-coordinate that will be loaded in the controller when the axis is homed.  That means, when my auto-leveler detects a home condition, the Z-axis offset should be the distance between the bed and the nozzle.

This can be measured with feeler gages.  It can also be measured by setting a high Z offset, then manually lowering the Z-axis until the nozzle reaches the bed.  The difference between the original offset and the Z-coordinate when the nozzle touches the bed is the Z offset.

You can also get close, then make fine adjustments.  If your first layer shows that the nozzle is too high, raise the Z-axis offset.  If your first layer shows that the nozzle is too low, lower the Z-axis offset.

To adjust the Z-axis offset in the Marlin firmware, go to Control/Motion/Z offset.  Use the up and down buttons to raise and lower the offset.

Once you get an offset you like, be sure to go to ControlStore Memory to save the settings in permanent memory so they'll be there after you power down your system.

Note: I have found out how to set the Z axis offset in G Code.

Use M851 Z<negative of Z axis offset>

Use M500 to store the current offset to firmware

Use M501 to load the current offset (and other settings) from firmware.

My Tronxy has a Z offset of about 4.9 mm.

Adding Autolevel

When I ordered my printer, it was claimed to be an autoleveling printer (X3A).  What actually came was a manual leveling printer (X3).  When I asked about this, I was given a discount that was enough to purchase an inductive sensor that will mount to my print head.  Now I just need to change the firmware.

Some background is given here: repetier firmware discussion on autolevel

This explanation makes it seem that I need to get repetier firmware 0.92 or newer (there is some mention of 1.0, effective 14 Jan 2017).

I will also need to know what the configuration for my printer is.  I'm not sure exactly what it is.   I have tried to get firmware source code for a Tronxy X3 so that I know what the existing settings are.

I have obtained a copy of Marlin firmware for an X3 (but my printer has repetier firmware).

I have obtained what purports to be a copy of Reptetier V1.0 for tronxy.  https://github.com/worder/tronxy-x3-repetier-firmware

I'd also like to extract the current code from the printer, so if I have problems with updating, I can go back to a working printer.

There is information on Tronxy firmware here: https://github.com/TronxyX3/Wiki/wiki.    It appears that the Autolevel firmware is Marlin, and the non-Autolevel firmware is Repetier.

I have now figured out how to upload new firmware to the Tronxy, and can go between Marlin and Repetier at will.  A log of what I did to make it work is found here.




Thursday, June 8, 2017

Updating my Firmware

In order to be able to run my extruder without it being at temperature, I need to upgrade to Repetier firmware v 0.92.

In order to do the upload, I need to know about the motherboard.

There is no information about the motherboard that I could find printed on the motherboard, or in any of the documentation I had.

Fortunately, I was able to find the motherboard for sale by itself, with the necessary specs listed.

Here's the link to the sale page.

In case the link goes away, here's the info I got from the link.

Tronxy X3A Motherboard Info

Name: Melzi 2.0 1284P 3D printer PCB Board
Model Number: Melzi
Processor: ATMEGA 1284P

Searching the web for ATMEGA 1284P shows that it is an 8-bit microprocessor with 128kB flash, 4KB EEPROM, 16KB SRAM.

So on the Repetier Firmware configuration, I choose Atmel 8-bit for the processor and Melzi board for the motherboard.

Printer type is Cartesian

EEPROM usage: EEPROM set 1
Z Length: 315

At this point, I have no distortion correction, so I won't enter anything.


Trying to Compile Marlin for X3A

Installed Arduino 1.8.2
Added Sanguino board (open preferences, add
https://raw.githubusercontent.com/Lauszus/Sanguino/master/package_lauszus_sanguino_index.json
to the Additional Boards Manager URL's entry.  Open Tools/Boards/Board Manager.  Go to Sanguino entry and select it.  Click on the Install button.)

Set Board to Sanguino

Set Processor to ATMEGA 1284, 8 MHZ

Got errors because the C code isn't compatible with 1.8.2

Installed Arduino 1.0.6 (which uninstalls 1.8.2)

Download the Sanguino files from https://github.com/Lauszus/Sanguino

Copied them to my sketch directory, in a hardware/ folder (as described in README.md).

Started up Arduino 1.0.6

Set board to Sanguino W/ATmega1284 8 MHz

Set Serial port to Com5 (which is the one that was added by my USB driver).

Got an error "speed_lookuptable_fast" was not declared in this scope.

Set board to Sanguino W/ATmega1284 16 MHz.

Successful compilation!  YAY!

Note to self -- I think that I might have gotten the code to work properly with Arduino 1.8.2 by changing the name of the type that gave the error (but I had the wrong processor).  Maybe I need to try 1.8.2 out again.

I was able to get the Marlin code working properly with Arduino 1.8.2.  To do so I need to change fpos_t to fpos_type in the source.

Compiling Repetier

I would like to be able to switch back and forth between repetier (for manual leveling) and marlin (for autoleveling).  So I need to make sure I can compile both.

Unfortunately, I couldn't get Repetier working with Arduino 1.8.2.  So I'm going to go back to 1.0.6.

Downloaded Arduino 1.0.6.

Need to download Sanguino board info (I had it on my PC, but not on my Mac).

Install it in the Sketchbook directory (which is found in Arduino preferences).

FIle compiles. 

OK.  Now I can do both the Marlin and the Repetier.  I guess it's time to try the firmware update.  

TO be able to check things, I added CDS to UI_PRINTER variables in Configuration.h.  That way I will see that I have made a difference.

connected to serial port.  Pressed the upload button.  Got the following error:
avrdude: stk500_getsync(): not in sync: resp=0x73
  Note: this was with the serial port tty.usbserial.
 Now I will try with cu.usbserial
Same error message.

It appears that the problem is the Melzi board doesn't have a bootloader.

So I have ordered the necessary devices to install a bootloader.

I ordered a USBasp, with a 10 to 6 pin converter.

https://www.amazon.com/gp/product/B014J2BMAG

https://www.amazon.com/gp/product/B00CW80MP6

I downloaded the USBasp driver using Zadig for Windows 10.

http://zadig.akeo.ie/

I started up Zadig.  I inserted the USBasp into one of my USB ports.  Zadig automatically detected the hardware configuration of the USBasp.  I selected the libusb-win32 driver and installed it.


I turned off the power to the printer.  I opened up the Tronxy controller box.  I removed the LCD panel cable from the Melzi board.I changed the jumper on the Melzi board to USB power from external power (it's hard to see because the print is so fine, but there's only one set of three jumper pins in a row).  I installed the 6 to 10 pin converter on the 6-pin header at the rear of the Melzi board.  The pin names are listed on the board and on the converter; make sure they match.   I connected the USBasp to the 10 pin side of the converter.  I connected the USB cable from the Tronxy to one of the USB ports on my computer. (So now I have two connections to the Melzi board: the USBasp and the USB cable).

I opened up Arduino (I used version 1.0.6 for this process).  I selected the Sanguino Atmega 1256 16 MHz board.  I selected the USBasp programmer.  I selected the appropriate COM port for my printer.

Then I clicked on the Burn Bootloader button, and waited for a couple of minutes.  After a couple of minutes, it told me the bootloader was downloaded successfully.

So then I opened my Tronxy Repetier firmware in Arduino.  I did a test compile, and everything worked.  I then clicked on the upload button.  It compiled, and took what seemed like an eternity, but it said the firmware was uploaded.

I disconnected the USBasp.  I reset the power jumper to external power.  I reconnected the LCD panel.  I turned on the power.  The printer booted successfully.  Unfortunately, however, the firmware I had loaded didn't have any changes from the factory firmware, so I didn't know if the change had worked.

So I opened a copy of the Tronxy Marlin firmware in Arduino.  I changed the name of the printer (it's in Configuration.h, CUSTOM_MENDEL_NAME).  Did a test compile, followed by an upload.  And the printer reset and had my new name!

It was really easy to update the firmware once I had a bootloader on the Melzi board.  If I can do it, you can too!

Uploading Firmware from my MacBook Pro

I wanted to do an upload on a new Tronxy X3A my son purchased.  My Windows 10 notebook wasn't working, so I decided to try it on my MacBook Pro.

I prepared the motherboard the same way:
  1. Moved the power jumper to the bottom two pins (USB power)
  2. Unplugged the LCD
  3. Connected the 6-pin connector on the USBAsp to the six-pin header on the Melzi.  Make sure VCC goes to 5V and GND goes to GND.
  4. Connected a USB cable between the MacBook and the USB B port on the Melzi
  5. Plugged in the USBAsp to another USB port on the MacBook
I started up Arduino (I'm using 1.86).

Set the proper settings:
  • Board: Sanguino
  • Processor: ATMega 1284 16 MHz
  • Programmer: USBAsp
  • Port: /dev/cu.usbserial-A501S6NS  (it's the new one added when the USB cable is plugged into the Melzi board
Check the connection: 
  • Tools: Board Info
Burn the bootloader:
  • Tools:Burn Bootloader
Don't worry about the warning:
warning: cannot set sck period. please check for usbasp firmware update.

It's just a warning.

Unplug the USBAsp.

Open your Marlin firmware in Arduino, and Upload.  You should see an "Uploading" progress bar on the lower right of the window.  Wait what seems like forever until the upload is complete.

If you have problems uploading, it might be good to open the Arduino Preferences window and set the Show verbose output during upload checkbox.

Disconnect the USB cable


Reset the Power Jumper

Reconnect the LCD

Turn on the power.  You should now have the new Marlin.


Making a hex file to use Octoprint to upload new version of firmware

In Arduino, go to Sketch/Export Compiled Binary

This will create a .hex file that you can upload with Octoprint







Saturday, April 29, 2017

Avoiding Z-Axis Desynchronization

One of the problems with the Tronxy printer is that the Z axis is driven by two independent stepper motors.  That means that if only one moves, the calibration of the Z axis is hosed, and it's back to synchronizing the Z axis and releveling the bed.  I'm getting faster, but it's still a pain in the neck.

The most common reason for losing synchronization in my experience is that the right-side motor shifts while I am messing with the filament (changing filament, adjusting the extruder, etc.).

The rule I have developed to avoid problems is this:

ALWAYS HAVE THE STEPPER MOTORS ENABLED WHEN TOUCHING THE EXTRUDER

With the steppers enabled, I have never had the Z-axis motor spin while adjusting the extruder.