Tuesday, February 22, 2022

Dealing with limit cycles in my hot end in Marlin

I replaced my Melzi 2.0 board with a Bigtree Tech SKR V1.3. 

I replaced my Bowden tube extruder with a nearly direct extruder hoping to be able to use Flex filament.

When I installed the new extruder, I had a very difficult time getting the extruder temperature under control. I repeatedly tried autotuning to get the hotend under control, but it was to no avail. I continually had temperature excursions of +/- 5 degrees C, which I had never had before. 

It appeared that the power (and cooling) in my hot end were so large that the speed of the controller was too low to keep up with the changes. But I didn't know how to troubleshoot this. I observed that during autotuning, the temperature control was *much* better than during PID control, which is exactly opposite of what I would expect. 

I finally figured out the meaning of the temperature message reported by Marlin(I never found a description on the Marlin website or anywhere else on the web). 

 Here's a typical temperature report message, as captured in the terminal on Octoprint:
Recv: T:175.89 /0.00 B:17.21 /0.00 @:0 B@:0

This tells me that the current extruder temperature is 175.89, with a setpoint of 0.  The current bed temperature is 17.21, with a setpoint of zero.  The PWM value of the extruder heater is 0, and the PWM value of the bed heater is zero.

Here's a temperature report while I'm trying to heat to 240:

Recv: T:45.23 /240.00 B:14.11 /0.00 @:127 B@:0

This shows me that I'm trying to get my extruder up to 240, but it's only at 45.23.  However, the heater is currently set to 127, which is the maximum value established in the firmware as PID_MAX.

In contrast, during autotuning, the hotend heats up a a PWM value of one half of PID_MAX.  If PID_MAX is set to 127, heating during autotuning will be at 63.  If PID_MAX is set too low, you will never be able to get up to temperature for autotuning.

In my case, I had PID_FUNCTIONAL_RANGE set to 10, which means that if the temperature is more than 10 degrees away from the setpoint, the controller will be in bang-bang mode (either PID_MAX or 0).  If the temperature is changing quickly, the temperature may get out of the PID_FUNCTIONAL_RANGE before the PID controller settles.  By looking at my temperature messages during heating, I could see that the PID controller never settled.  In order to give the controller time to adapt, I increased the PID_FUNCTIONAL_RANGE from 10 to 30.  At that point, I could control the temperature of the extruder, although it was still not as tight a control as I would prefer.

I insulated the hot end block to decrease the cooling rate and slow the system down a little bit.  That helped somewhat.

Bottom line -- my printer is now functional.  But there is still more variability in the extrusion temperature than I would like.  I'll keep working on it.


Saturday, February 19, 2022

Using Octoprint with one Raspberry Pi and two printers

I have two Tronxy X3A printers.  I have Octoprint on one, but not on the other.  I love Octoprint so much that I can't stand not having it.  So I decided to connect both printers to my Pi.

Detailed instructions are given on the web here.

Without further ado, here's what I did.

Identify the port for my current printer

  1. ssh into my Raspberry pi, with the user name of pi (which was set up when I installed Octoprint).  
     ssh -lpi octopi.local  
  2. List the ports for the connected usb devices
     ls /dev/ttyUSB*  
  3. Plug in the second printer, then relist the ports for the connected usb devices. The new device is the one for the second printer.
     ls /dev/ttyUSB*  
  4. Get the device info for both devices, and find the differences (I have /dev/ttyUSB0 and /dev/ttyUSB1. You might have different devices.)
    udevadm info -a -n /dev/ttyUSB0 > devInfoUSB0
    udevadm info -a -n /dev/ttyUSB1 > devInfoUSB1
    diff -u devInfoUSB0 devInfoUSB1  
    My difference is this:
    ATTRS{bInterfaceProtocol}=="02"
    ATTRS{bInterfaceProtocol}=="ff"  
    Where my old printer is 02, and my new printer is ff
  5. Create a named symlink to the appropriate USB port that will last through a reboot by editing the /etc/udev/rules.d/99-usb.rules file
    cd /etc/udev/rules.d
    sudo vi 99-usb.rules  
    Enter the following two lines in the file (specific for my printers):
    SUBSYSTEM=="tty", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="ttyCDSX3A"
    SUBSYSTEM=="tty", ATTRS{bInterfaceProtocol}=="ff", SYMLINK+="ttyCPSX3A"
    
    The symlinks are the names I choose to use for the printer ports.
  6. Open up Octoprint, go to the settings menu, and add the new ports to the additional ports box.

Create a second copy of Octoprint

  1. Copy the octoprint directory
    cp -R .octoprint .octoprint2 
  2. Copy the octoprint configuration file
    sudo cp /etc/default/octoprint /etc/default/octoprint2
  3. Edit the octoprint2 configuration file to change the port and add a basedir
    sudo vi /etc/default/octoprint2

Edit my haproxy.cfg flie

The

Monday, December 2, 2019

Changing to a 12V 360W Power Supply

Why a 360W power supply?

I was trying to print ABS, but I couldn't get good bed adhesion.  The web tells me I need a bed temperature of 100C for printing ABS.  I could only get my bed up to about 80C, even when I let it heat up for an hour or so.

I thought there might be a problem with the wiring, so I checked the voltage to the hotbed while it was heating.  It was 10.4 V instead of 12 V.  So I checked the output of the power supply, thinking I might have some high resistance in the wiring.  Still 10.4 V.  So I adjusted the Vout using the trim pot on the power supply.  The highest I could get was 10.7 V with the heater on.   With the heater off, the output was 13.4 V.  So it was pretty obvious to me that I was running the power supply at its maximum capacity.

Some internet searchingfor under  showed me that I could get a 12V, 30A (360 W) power supply for under $20 (https://www.amazon.com/eTopxizu-Universal-Regulated-Switching-Computer/dp/B00D7CWSCG/ref=sr_1_3?keywords=12V+25A+power+supply&qid=1576126279&sr=8-3) if you are interested).  This power supply is physically a little bit larger than the 12V, 240W supply provided by Tronxy, but it fits in the power supply holder.  I haven't yet worked out the mounting issues, but I think I just need to get the right holes in the base and make sure I cut a new fan outlet in the top cover.


With the new power supply wired up, the bed easily and quickly heated up to 100C.  The hotend also heated up much more rapidly than it had in the past.  So I decided to autotune both the bed and the hotend.

With the procedure below followed, I can easily run 100C on the bed and 240C on the extruder.  This was a great upgrade!

Doing the Autotune

The autotune is accomplished with an M303 command.  For the heated bed:

M303 E-1 C8 S100

For the hotend:

M303 E0 C8 S230

Bed Autotune Parameters

The autotune parameters for the bed were:

Kp= 370.71
Ki = 41.90
Kd = 819.97

In oder to make autotune work, I made a couple of changes, which unfortunately required recompiling Marlin.  You can see my instructions for updating the firmware here.  

The changes I made to the firmware included:

1) Enable PIDTEMPBED

2) Disable BED_LIMIT_SWITCHING

Final PID parameters for Extruder

Set Kp = 8.15, Ki = 0.38, Kd = 43.16 (values came from an autotune cycle)




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.
 

Friday, March 31, 2017

Getting my parts centered on my print bed

One of the issues I've had is that my parts aren't where I want them to be on my print bed.  It's because I haven't had the bed set up properly.  So let me say how I fixed it.

On the Tronxy X3 the home position is off the print bed.  It's about 20 mm to the left of the bed, and about 40 mm in front of the bed.  But the home position is x=0, y=0 on the printer.

By default, Repetier-host sets up with the front left corner of the print bed at (0,0).  But as I just said, (0,0) on the printer isn't at the front left corner.

To fix this, do the following:

Find the X coordinates of the left and right sides of the print area

Turn on your printer.  Using the Buttons and the LCD panel, home all the axes.  Then, using the LCD panel Position/X Pos. Fast menu item, move the head until the extruder is at the left end of the desired printing area.  For me, that's a little to the right of the edge of the table.  Read the X position (in my case, 23.00 mm).

Then move to the right of the desired printing area.   In my case, 223.0 mm. Note that it's 200 mm greater than the left end, which is what I expect.

Find the Y coordinates of the front and back of the print area

Repeat the process for the Y axis (making sure the extruder nozzle clears the print bed).  For me, the front of the print area was 34.00 mm, and the back of the print area was at 230.0 mm (this appeared to be a hard limit set in the firmware, as the carriage hadn't hit a physical stop, and the nozzle wasn't at the back of the print area.  Later on, I'll try to adjust it in the firmware.)  So to keep the full 200 mm of travel in the Y direction, I will set the front of the print area to 30.0 mm.

Enter the settings into Repetier-host

Click on printer settings in Repetier-host.  Enter 0 for the X min and the Y min.  Enter the maximum numbers you found in the previous steps for X max and Y max (223 and 230 for me).  Set the width and depth of the print area to 200.  Set the Bed Front to the value obtained in the previous step (30 mm for me).  Set the Bed Left to the left side X value found above (23 mm for me). 

Now you're ready to go!  Make sure that slicer is set to 200 mm by 200 mm, with the origin at (0,0).  Make sure your STL files get placed in the center of the work area (use the Center Object button on the Object Placement panel if necessary).  Now you should have your objects right in the center of your bed.  And most importantly, the bed in the Object Placement panel accurately represents your printer bed.

Happy printing!

Tuesday, January 10, 2017

SD Card Info

It seems some people did not get a microSD with their printer (with me, it came in a USB-micro-SD convertor).

But if you're in that position, here's the files that came with mine.

Zip Archive

Tuesday, December 27, 2016

Tronxy X3A Extruder Temperature

The extruder temperature on my Tronxy X3A likes to run about 1.5 degrees below the setpoint.  I don't know how much effect that has on the quality of my prints, but I do know that until the temperature difference gets less than 1 degree, the print won't proceed if the M109 code has been used in the program.

As a workaround, I just blocked the airflow to the extruder fan with a card, the temperature went up slightly, and the test print proceeded.

But now I want to fix it so it works properly.  I think I want to do an autotune cycle.

I did an autotune by following the procedures on Using Repetier Host with my Tronxy X3A.

PID Constants from Autotune

Here are the results of the autotune:

Kp = 17.44
Ki = 1.19
Kd = 63.71

After entering these values from Repetier host, the temperature control is perfect.

Entering PID Constants

Now that I have the constants, they need to be installed in the printer.  This is done by the following:

1. Send an M205 to the printer.  This will display a list of all the EEPROM settings.
2. In the list, find the PID settings for the extruder.  On my printer, they are  as follows:
EPR:3 218 17.4400 Extr.1 PID P-gain/dead-time
EPR:3 222 1.1900 Extr.1 PID I-gain
EPR:3 226 63.6996 Extr.1 PID D-gain
The first number following EPR is the type.  All are type 3 (float).
The second number following EPR is the position in EEPROM.  218 for Kp, 222 for Ki, 226 for Kd.
The third number is the value (17.44 for Kp, 1.19 for Ki, 63.6996 for Kd).

3. Set values by sending an M206 command to the printer.  The M206 command to set Kp to 17.5 would be as follows:
M206 T3 P218 X17.5
Note that the T parameter is the type, the P parameter is the position,  and the X parameter is the value to be stored in that position
4. Once you have set all 3 values, you should have the new PID constants set.

Using Repetier Host with my Tronxy X3A

I want to do an autotune on my extruder to get better temperature control.  To do that, I need to send an M303 code to my printer.  I hope to use Repetier host to do that.  This entry shows the process.

Setting up the Printer

I needed to set the 3D printer up properly as a printer in Repetier.

Getting the driver

I needed a USB to serial driver.  The website for a downloadable driver is found on the microSD card that came with the printer.  For my printer, the website was http://www.ftdichip.com/Drivers/VCP.htm

Then I installed the appropriate driver for my system.  Now I have a usb to serial port as my printer.

Setting the Baudrate

In order to communicate properly, the baudrate of the Repetier host needs to match that of the printer. 
Use the LCD panel to get to Configuration/General/Baudrate.  The baudrate on your printer displays.

Now go to Repetier and look at the Printer menu, Printer Settings, select the proper baud rate, and hit OK.  

Then click on the Connect button, and the printer should be connected.  Your printer should reset, and you should get a message that tells what your firmware is (in my case, Repetier_0.01).  And your printer status should go to idle.

Running an Autotune

The following command should give me an autotune:

 M303 E0 S200 C8

I need to get this command to the printer. O To do so, I use a script under the G-Code tab in Repetier-host.

Select Script  1 from the list.

Paste in the command above.

Save it with the save icon.

Go to Printer/Send Script 1.  This starts the autotune running.  On Repetier-host I see

Info: PID Autotune Start

Now I need to wait for the extruder temperature to go above and below 200 C 8 times.

Another way to send the command

An easier way to send the command to the printer is using the Print Panel.

On the print panel, there's a G-code entry box.  Paste the command above into the box, and click the Send button.  And the autotune runs just as it did above.

Tronxy X3A Bed Leveling

Before making test prints, it's necessary to level the bed.  I tried several times, and read several websites, before I finally converged on the process that worked for me.  So without further ado, here's my bed-leveling process.

Compress the bed adjusting springs

Adjust the nuts on the corners of the print bed to compress the springs as far as possible.  Be careful not to over-compress them.  You will over-compress them if the Y-axis roller screws run into the bottom side of the heat bed.  This distorts the Y-axis table and causes slop.  If you get them too tight, just loosen them a little bit.

Adjust the Z-axis limit

By default, the printer wants to start at Z=0.  It's possible to use G-code to make a printer offset (and that's what I'll do once I have the auto-level sensor), but in the meantime it's easy to adjust the Z-axis limit and the print bed to make everything work well.  Here's the procedure:
  1. Home all axes, using the buttons on the LCD panel.
  2. Look at the end of the extrusion nozzle relative to the surface of the print bed.  Is it a few mm or more above the bed?  You'll need to lower the Z-axis limit switch.  It it at or below the level of the bed?  You'll need to raise the limit switch.  Is it 1-2 mm above the bed?  Your limit switch is just right.
  3. To lower the Z-axis limit switch:
    1. Loosen the nut holding the switch in place.
    2. Slide the switch down.
    3. Use the LCD panel and buttons to lower the Z-axis. Get extruder nozzle 1-2 mm above the print bed (your eye is a sufficient measurement device).
    4. While watching the limit switch output on the display, slide the limit switch up until the display says the limit switch is closed.  Tighten the limit switch in the new position.
    5. Return to step 1 and see if the limit switch setting is correct.
  4. To raise the Z-axis limit switch:Slide the switch down.
    1. Use the LCD panel and buttons to raise the Z-axis. Get extruder nozzle 1-2 mm above the print bed (your eye is a sufficient measurement device).
    2. Loosen the limit switch.
    3. While watching the limit switch output on the display, slide the limit switch up until the display says the limit switch is closed.  Tighten the limit switch in the new position.
    4. Return to step 1 and see if the limit switch setting is correct

Level the bed

Now you need to get the bed leveled and adjusted to the proper height.  Here's how I did it:

  1. Use the LCD panel to preheat the bed and extruder.  I don't know how important this is, but some websites mention that thermal expansion can be an issue.
  2. Use the LCD panel to move the Z-axis to a position of 0.12 mm.  This corresponds to the thickness of a typical sheet of paper.
  3. Move the X and Y axes to position the extruder over one corner of the bed.
  4. Place a sheet of paper between the bed and the extruder nozzle.  Loosen the bed adjusting screw to allow the bed to rise toward the nozzle, while moving the paper back and forth.  eventually, you will feel a slight drag as the nozzle makes contact with the paper.
  5. Repeat steps 3 and 4 with each corner, and verify that the drag is the same at all locations on the bed.
Now you should be ready to print a test part.

Tronxy X3A Build Tips

Here are some tips I wish I'd had when building my printer.


Y Axis

Make sure the rollers fit tight on the Y-axis, so the table can't wobble.  The holes in the acrylic table support are large enough to provide a little adjustment room.  I made things work by slightly loosening the rollers, pinching them in with my fingers, and tightening the screw with a hex key oriented so the tightening force would push the screw towards the center of the extrusion.

X Axis

Mount the X-axis screw nut supports as far down on the Z-axis carriage as possible (the screws will be as high in the adjustment slots as possible.

Mount the X-axis extrusion as high as possible on the X-axis screw nut support.

If you don't do both of these things, you may find that the X-axis roller nuts will interfere with the Z-axis screw supports.  I put it together wrong, and had to readjust the positions to make my axis work.

Make sure the X-axis motor is mounted with the electrical connector facing down.

Z Axis Limit Switch

Mount the Z-axis limit switch on the outside of the Z-axis extrusion.  If you don't, the Z-axis won't be able to get down to the surface of the print bed.

Wiring

Use twist ties or cable ties to temporarily secure your wiring before testing the printer.  I did all my wires up in the spiral loom that was provided.  And then I found some wiring problems.  So I had to deal with the loom at this point.  Wish I had waited to put the wiring in the loom.

Tools

Some T-handle or other long-handle metric hex keys make assembly much nicer than working with just the ones provided in the kit.  And ball-end keys help work around some of the obstacles.

Small (6 mm and smaller) combination wrenches would help with assembly.  I ended up using a 4-inch adjustable wrench for lots of the assembly, but it's kind big and gets in the way. 

Tronxy X3A Initial Impressions

I just bought my first 3D printer -- A Tronxy X3A self-leveling printer -- on ebay.  I chose the printer because it was inexpensive, seemed to have good components, and was self-leveling.  This begins my 3D printing experience.

Because there's not a lot of documentation for this printer, I thought I'd start a blog as a place to share my experiences.  It will provide a place for me to keep track of important information, and maybe it will help others.

Let me begin with a list of pros and cons for my new printer.

Pros

  • Great structure.  Built with aluminum extrusions, which makes it light and rigid.
  • High build quality for parts.  Everything fit well and went together nicely.  Some of the more complex subassemblies came preassembled.
  • All-metal extruder head.
  • Sockets, rather than screw terminals, for wiring components.  Made the wiring nice and robust.
  • Smooth roller system for axes.
  • Twin-screw z-axis drive is very smooth and robust.
  • Nice filament roll support system.
  • Nice enclosure for the electronics (although I might prefer to have the electronics better integrated with the printer structure).

Cons

  • Cryptic instructions.  The printer came with a set of pictorial instructions.  They were sufficient to build the printer, but I ended up moving backwards several times through the construction because I had missed something (or else it wasn't even covered in the instructions).
  • No help once you get the printer built.  Once the printer was built, I was on my own for getting it up and running.  Fortunately, there is a robust 3D printing community, and this Tronxy is a prusa derivative, so most of the prusa i3 instructions will apply.
  • Weak after-sale support.  Whenever I asked a question of the seller on ebay, I got an offer for a partial refund, rather than the answer to the question I wanted.  I felt like I was pretty much on my own.
  • Although I bought an auto-leveling printer, the one I received didn't have the auto-level sensor. And Tronxy wouldn't send me one.  They did give me a $20 partial refund, and I used that money to buy the sensor elsewhere, so I think I will soon have autolevel.

Summary

Would I buy this printer again?  In a heartbeat.  The price is right; the parts quality appears to be excellent; the printer works.

But I wish the documentation were better.  I'll provide some notes that would have helped me had I had them.