Calibrating E-Steps + Using the Serial Command Interface (Tina2/Tina2S)

Moderator: CrazyIvan

Post Reply
User avatar
CrazyIvan
Posts: 354
Joined: Mon Jul 10, 2023 10:25 am

Calibrating E-Steps + Using the Serial Command Interface (Tina2/Tina2S)

Post by CrazyIvan »

"E-Steps" is an abbreviation of "Set E Axis Steps-Per-Unit", meaning how many increments of the extruder stepper motor are required to move the filament feed by 1mm. The E-step calibration is fundamental to ensuring the amount of filament required (as calculated by the slicer) is extruded accurately.

Abstract

At the factory default setting, the author's Tina2 and Tina2S under-extrude by 4 to 6%. That means 4-6% less filament is deposited than the slicer has calculated. The consequence is voids: the voids relieve extrusion pressure so printed lines don't fuse with each other as well as they could – so prints are weaker, particularly between layers and especially for bed adhesion. Overall finished dimensions may be affected (slightly) by smaller than expected line widths.

With properly calibrated E-Steps, the printer performs the way the slicer expects. Any adjustments required beyond that can be made in the slicer, using "flow" settings.


Check Calibration

To check the E-step calibration on Tina2/2S:
  1. On the Control menu, select "Restore Defaults". This is to ensure any modified settings are returned to standard. It will bring up the installation menu, but apart from selecting your desired UI language the rest can be ignored (it only invites you to load some filament and then run a print from TF card).
  2. If filament is loaded, "unload" or "auto-retract" it (Prepare menu).
  3. Unclip the Bowden tube at the motor end and feed a length of filament into it (you'll only need a foot of it at most). Manually position the filament so it is level with the top of the tube fitting.
  4. Steps 4 & 5 are easiest done using the calibration file (see below). However, to do it manually: On the Control menu, select "Temperature" and set the nozzle temperature to 200. The extruder motion is locked out unless the hot-end is hot, so that filament movement is not attempted when it might not move because of being solidified.
  5. With the nozzle at target temperature, on the Prepare menu select "Move axis" and then "Extruder". Select "Move 10mm" and increment the value shown by 100. The filament will slowly drive out of the fitting. Wait for it to stop moving.
  6. Measure the length of filament above the tube fitting.
Alternative to manually performing steps 4 & 5 above, copy the following code into a file "E-Steps Test.gcode", and run it as if a print file (this overrides the cold nozzle extruder lockout instead of heating the nozzle):

Code: Select all

;MachineType:ENTINA TINA2S
; NB: Tina2 doesn't care about the above

M302 P1 ; Override cold nozzle lockout
M82 ; Extruder in absolute mode
G92 E0 ; Reset extruder position
G1 E100 ; Feed filament 100mm nominal
M302 P0 ; Reinstate cold nozzle lockout
Any text on a line after a ";" is comment, except some lines starting with ";" are directives. The Tina2S requires the ";MachineType:ENTINA TINA2S" line to recognise a print file as valid, but the Tina2 doesn't care so the above file will work on both.

In my case, with the factory default settings, the fed length was 94mm not the nominal 100mm (96mm for the Tina2). I don't know why that should be so much in error, but I admit under-extrusion is less of a problem than over-extrusion. Nonetheless, the printer calibration really ought to be correct, with any adjustments made in the slicer settings for "flow".

Option 1: Compensating in the Slicer

If you don't want to fiddle with the printer settings, an E-steps calibration error can be compensated for in the slicer. For Cura, the "flow" and "initial layer flow" can be adjusted as follows:
  1. Check the default value, in my case it is "95%" (meaning the slicer G-code output already under-extrudes by 5% less than the theoretical amount required to fill the volume).
  2. Using my values as an example, calculate 95 x 100 / 94 = 101, and insert that as "flow" and "initial layer flow".
Now, any model you slice will have had the E-steps calibration trimmed in the G-code.

This must not be applied simultaneously with Options 2 or 3.

Option 2: Calibrating the Printer

By hand-crafting a bit of G-code, the E-steps calibration can be corrected on the printer. I had to use the serial command interface (see next post) to find out how to do this, but having "taken one for the team"(™) you can just put a file on the SD (TF) card and run it.

The factory E-steps setting is "90.00", and it's a fair guess every Tina2/2S is the same. Yours might not be, and I've covered that in the instructions - it should be ball-park though.
  1. Calculate the new E-steps value required as follows, using the length measured in the test in place of my "94":
    • E-steps = 90 x 100 / 94 = 95.74 (to two decimal places)
  2. Use a text editor to create a file "Calibration.gcode", copy & paste the following into it, and replace my "95.74" value with the value from your calculation:

    Code: Select all

    ;MachineType:ENTINA TINA2S
    
    M92 E95.74 ; Set E-steps (default = 90.00)
    M500 ; save to EEPROM
    
    Save the file.
  3. Copy the file to your SD card. Plug the SD into your printer and "print" it.
  4. Repeat the E-step calibration test above. The fed length should be exactly 100mm. If so, you're done.
  5. If it's not, that could be because your printer default was not "90.00". Measure the new length. Substitute it for "X" in the following calculation, where "Y" is the E-steps value you tried first:
    • E-steps = Y x 100 / X (to two decimal places)
  6. Edit the file so the "M92" command includes the new E-steps value.
  7. Copy the edited file to the SD card and "print" it. Repeat the calibration test if you want, but you should be done.
As previously noted, the file is suitable for both Tina2 and Tina2S. The "M92" G-code command sets steps-per-unit on all the axes, we're just using it for the E (extruder) "axis". "M500" saves the settings to non-volatile memory, otherwise the printer would forget the setting if power-cycled or reset with the button. The Factory Reset operation from the menus (or as an M502 G-code instruction) returns E-steps to the factory default of 90.00.

Option 3: Adding the Calibration at the Start of Every G-Code File

The "M92 E##.##" G-code line could be added to the Machine Setting Start G-Code in Cura, instead of (or as well as) calibrating the printer. That would send the E-steps calibration to the printer in the preamble of every sliced print file, instead of relying on calibration stored in the printer, and it doesn't matter that the G-code repeats the calibration.

This is less appropriate if you have more than one Tina2S (or more than one Tina2), if they require different calibrations, but you could create a new printer definition for each printer – just make sure to duplicate the whole configuration except with the different M92 details, and hard-code the ;MachineType directive instead of allowing Cura to set it from the variable.

Which Option Is Best?

That depends. I prefer the idea of calibrating the printer (Option 2), but any time a Factory Reset operation occurs, the user will have to remember to run the calibration file again.

Do all Tina2/2S's require the same calibration value? I don't know, but mine are both the same. If they all perform the same, why is the factory default E-steps calibrated incorrectly? Does the calibration vary over time, eg with wear? Please report your calibration values.

If they are not all the same, then adding calibration to the G-code preamble (Option 3) will mean a sliced file for one Tina2/2S may not be suitable for a different (or somebody else's) Tina2/2S. However, if that is not a concern, perhaps using Option 3 as well as Option 2 is a useful safety net.

Option 1 precludes either of the others, but I consider Option 1 to be a last resort – ie in emergency, or only for those too timid to go for Options 2 or 3.
 

POSTREACT(ions) SUMMARY


User avatar
CrazyIvan
Posts: 354
Joined: Mon Jul 10, 2023 10:25 am

Re: Serial Comms

Post by CrazyIvan »

Anyone wanting to play with the printer's serial command interface might find this blog useful. The status reports which the printer provides over the interface give far more information than is available on the LCD. The serial command interface is actually USB, but it works like a USB to serial port dongle and behaves as a traditional com port so far as the OS is concerned (when a CH340 driver is installed – do that first).

In order to find out the default E-steps value (and therefore a starting ball-park figure), I had no alternative than to use the serial command interface to interrogate the machine's settings. Being the first time I've done this, a fairly simple thing became frustrating due to a combination of software not running properly on the particular versions of operating systems and hardware I had available.

Initially, running PuTTY (a teletype/VDU console emulator, able to communicate with a remote computer using a variety of protocols including Telnet and serial coms) under pre-SP1 Win7 on a netbook (for convenience) had me fishing in the dark. I couldn't hit on a combination of serial port parameters (baud rate etc) which produced anything intelligible. It later turned out that PuTTY wasn't working properly, which was misleading.

There's a useful piece of software called "Greg's SD Print Tool" which can scan for a plugged-in printer and auto-detect the port parameters (to some extent – see below), and provides a GUI for sending commands and receiving responses, but it wouldn't work on the netbook, wouldn't work in Wine, and when I tried it on a proper Win7 machine the auto-detection had a bug and I still had to guess, although I need not have worried because the default was correct (and the bug has been fixed now).

Please note that, at least at present, Greg's Tool does not include Tina2 baud rate capability, but will work with Tina2S. There is no need to scan for baud rate, the default baud rate is correct for Tina2S.

Having used Greg's Tool to confirm the serial interface parameters, I fell back to using a simple serial TTY program. However, although PuTTY Portable worked fine for Tina2, I could not make it work on the Tina2S – a mystery which will remain a mystery unless and until I receive fresh information. Weird. The only idea I have is if it doesn't support 115,200 baud properly. (As I was pioneering this on my 2S first, and before I tried Greg's Tool, this is what had me pulling my hair out!)

For Windows: "termite" is much simpler than PuTTY.. Settings get saved in a .ini file, so it is eminently "portable". Identify the right com port using "mode" at the Windows shell command prompt. However, Termite does not support 1,000,000 baud, so is no good for Tina2... but (as noted above) PuTTY doesn't work with the Tina2S! So it's Termite for the Tina2S and PuTTY for the Tina2 (I've linked to the portable version).

For Linux: "moserial". The serial port will be something like /dev/ttyUSB0, identifiable at a command prompt by "dmesg | grep ttyUSB". Fortunately this works with both Tina2 and Tina2S.

If a TTY complains it can't connect to the (PC's) serial port, but you're sure you've identified the serial port correctly, try running the TTY as Admin (Windows) or root (Linux – sudo).

The serial port parameters for Tina2S are 115200,8N1 (115,200 baud, 8 data no parity 1 stop). For the Tina2, I was about to give up when I finally hit on 1000000,8N1 as a last ditch effort!!

Note that Marlin (the firmware running the Tina2/2S) only sends LF at the end of lines (not CR+LF), so output will be better formatted if you set the TTY to add a CR for every LF, and Marlin does not echo back input text so you will probably want to force local echo in the PuTTY terminal settings (this does not apply to Termite/moserial, which use separate panes for incoming and outgoing traffic). Be sure not to echo Marlin output back to Marlin – you'll end up with a continuous loop of 'command not recognised' being output, then input and output again...!

Also, the Tina2/2S is case sensitive, and all G-code commands must use capitals. Greg's Tool automatically converts lower case input to caps.

Opening the port, the printer should respond to the open connection by announcing itself with a settings report and then outputting the system temperatures every few seconds – which interrupts the other more interesting status responses you'll be demanding. Kill the temperature reports by injecting the command "M155 S0".

M503 gets a run-down of the current system settings. For a complete guide to G-code, see https://marlinfw.org/meta/gcode/

The screen-shot below shows a Tina2 session just started in moserial, with the printer announcing itself and sending system status. Termite is very similar.
calibrating2.jpg
calibrating2.jpg (244.1 KiB) Viewed 16 times
Fixed by admin.


I could have programmed the E-steps calibration over the command interface, but there is the possibility of having to repeat the same operation from time to time. I decided having it in a calibration G-code file meant it is instantly available without messing around with a cable and moving a PC to the printer (or the printer to a PC), and I might add other tweaks to the same file (teaser: using centred XY axis origins to expand the build volume available in Cura).
 

POSTREACT(ions) SUMMARY


Post Reply