MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.23k forks source link

repeated G29 T1 (or G29 T0) gives different results... #7021

Closed lrpirlet closed 7 years ago

lrpirlet commented 7 years ago

Background

I am using the latest bugfix-1.1.x (0b6b7c9) to build my firmware for my Prusa i3 printer...

Configuration.h is the only customized file and is accessible from https://github.com/lrpirlet/Marlin/tree/lrp-2-jun-2017 under https://github.com/lrpirlet/Marlin/blob/lrp-2-jun-2017/Marlin/Configuration.h

I issue an M133 S30 to avoid "echo:busy: processing" in the middle of mu disered output... I Issue G28, G29 P0 followed by G29 P1... I issue G29 W to log the G29 characteristics... All the above without any problem...

Issue I send G29 T1 several time and got different results... or rather I DO MISS some values at DIFFERENT places in each of the outputs.

extracted from https://github.com/lrpirlet/Marlin/blob/lrp-2-jun-2017/logs/Repetier_log.txt please find here the evidence for G29 T1... G29 T0 also missbehave...

14:49:39.459 : N21 G29T1*68
14:49:39.679 : ,0.148
14:49:39.819 : 0.030,0.163,0.201,0.249,0.276,0.251,0.274,0.062,0.118
14:49:39.991 : -0.015,0.126,0.175,0.158,0.228,0.230,0.272,0.198,0.148
14:49:40.147 : -0.093,-0.031,0.144,0.213,0.223,0.263,0.268,0.232,0.116
14:49:40.303 : -0.117,-0.013,0.120,0.194,0.236,0.230,0.269,0.233,0.143
14:49:40.428 : -0.124,-0.044,0.097,0.162,0.229,0.246,0.270,0.165,0.190
14:49:40.569 : -0.086,0.063,0.141,0.208,0.226,0.255,0.272,0.214,0.214
14:49:40.709 : ,0.248,0.244,0.212
14:49:40.850 : 0.004,-0.042,0.194,0.218,0.238,0.290,0.297,0.224,0.204
14:49:40.865 : ok
14:49:51.766 : N22 G29T1*71
14:49:51.970 : 0.048,0.189,0.227,0.252,0.220,0.228,0.229,0.180,0.148
14:49:52.110 : 0.030,0.163,0.201,0.249,0.276,0.251,0.274,0.062,0.118
14:49:52.252 : -0.015,0.126,0.175,0.158,0.228,0.230,0.272,0.198,0.148
14:49:52.393 : -0.093,-0.031,0.144,0.213,0.223,0.263,0.268,0.232,0.116
14:49:52.580 : -0.117,-0.013,0.120,0.194,0.236,0.230,0.269,0.233,0.143
14:49:52.735 : ,0.246,0.270,0.165,0.190
14:49:52.876 : -0.086,0.063,0.141,0.208,0.226,0.255,0.272,0.214,0.214
14:49:53.017 : -0.067,-0.034,0.177,0.215,0.233,0.284,0.248,0.244,0.212
14:49:53.157 : 0.004,-0.042,0.194,0.218,0.238,0.290,0.297,0.224,0.204
14:49:53.173 : ok
14:49:56.896 : N23 G29T1*70
14:49:57.083 : 0.048,0.189,0.227,0.252,0.220,0.228,0.229,0.180,0.148
14:49:57.254 : 0.030,0.163,0.201,0.249,0.276,0.251,0.274,0.062,0.118
14:49:57.380 : -0.015,0.126,0.175,0.158,0.228,0.230,0.272,0.198,0.148
14:49:57.583 : -0.093,-0.031,0.144,0.213,0.223,0.263,0.268,0.232,0.116
14:49:57.723 : ,0.269,0.233,0.143
14:49:57.864 : -0.124,-0.044,0.097,0.162,0.229,0.246,0.270,0.165,0.190
14:49:58.005 : -0.086,0.063,0.141,0.208,0.226,0.255,0.272,0.214,0.214
14:49:58.145 : -0.067,-0.034,0.177,0.215,0.233,0.284,0.248,0.244,0.212
14:49:58.294 : 0.004,-0.042,0.194,0.218,0.238,0.290,0.297,0.224,0.204
14:49:58.306 : ok
14:50:06.686 : N24 G29T1*65
14:50:06.890 : 0.048,0.189,0.227,0.252,0.220,0.228,0.229,0.180,0.148
14:50:07.029 : 0.030,0.163,0.201,0.249,0.276,0.251,0.274,0.062,0.118
14:50:07.170 : -0.015,0.126,0.175,0.158,0.228,0.230,0.272,0.198,0.148
14:50:07.311 : -0.093,-0.031,0.144,0.213,0.223,0.263,0.268,0.232,0.116
14:50:07.452 : -0.117,-0.013,0.120,0.194,0.236,0.230,0.269,0.233,0.143
14:50:07.593 : -0.124,-0.044,0.097,0.162,0.229,0.246,0.270,0.165,0.190
14:50:07.733 : ,0.214,0.214
14:50:07.874 : -0.067,-0.034,0.177,0.215,0.233,0.284,0.248,0.244,0.212
14:50:08.016 : 0.004,-0.042,0.194,0.218,0.238,0.290,0.297,0.224,0.204
14:50:08.032 : ok

Questions

Does anyone else see that behavior???

Since the difference between the 3 commands G29 T1 is just a different time, could we see some interrupt misshandling... I am completely at lost, and would appreciate some help...

Last but not least,

Thanks in advance.

Roxy-3D commented 7 years ago

@lrpirlet I don't know what a M133 command is. But the G29 W in the second link says you have a 9 x 9 mesh. I looked at the various G29 T commands you gave it. I do not think the mesh data is changing. I think data is getting lost as it is being transmitted to Repetier Host.

Probably, we should be using map type 0 to debug this for several reasons. First, that outputs more characters and does it with less delays between the title or header characters. And secondly, that is more human readable so it will be easier to see if data got lost.

I use PronterFace and do not see a problem. There are a couple of things we can try to get the map to print out better and not lose data. First you can try changing in Configuration_adv.h to have

#define TX_BUFFER_SIZE 32

because that will cause

  void unified_bed_leveling::display_map(const int map_type) {
...
        #if TX_BUFFER_SIZE > 0
          MYSERIAL.flushTX();
        #endif
        safe_delay(15);

Waiting for the RS232 Transmit Buffer to flush will probably slow things down enough you don't lose data.

The other thing you can do is change that safe_delay(15) to safe_delay(50) in the display_map() function to slow the map generation down enough you don't lose data.

And I hesitate to ask this... Because it is a total pain in the @$$. But you could try installing PronterFace and use that. Like I say... I use PronterFace and do not see the problem.

We can also try lowering the baud rate in Configuration.h but that would be a very last ditch thing to do.

/**
 * This setting determines the communication speed of the printer.
 *
 * 250000 works in most cases, but you might try a lower speed if
 * you commonly experience drop-outs during host printing.
 *
 * :[2400, 9600, 19200, 38400, 57600, 115200, 250000]
 */
#define BAUDRATE 57600

Please let me know what you see as you change things. OK?

lrpirlet commented 7 years ago

Hi @Roxy-3D, thanks a lot... Your point of view triggered another approach...

I used the Arduino imbedded tool called serial monitor (well in french, that tool is named "moniteur série")...

I get good data, see bellow... (Accessorily, M133 S sets the time interval for the keep alive message, setting 30 seconds does clean up the output from the many echo:busy: processing issued every 2 seconds by default... Note that Repetier timeout is 40 seconds so 30 second is quite enough to keep Repetier happy...)

So what is different between passive Arduino serial monitor and Repetier?

The baud rate I use is 115200, the serial monitor seems slower than that (I can see the line progressing) meaning that there is some sort of hand checking possible between the printer and the host... Next action will be to read the Repetier doc and play with the safe_delay in Marlin...

I doubt that Marlin is buggy, I think it may be over-optimized for Repetier...

There is no echo in the Arduino serial monitor, find the command I typed in front of the result...

I'll keep reporting when more results available... again, thanks.

G28

echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
X:0.00 Y:0.00 Z:7.79 E:0.00 Count X:0 Y:0 Z:31160
ok

M113 S30

ok

G28

X:0.00 Y:0.00 Z:7.79 E:0.00 Count X:0 Y:0 Z:31160
ok

G29 W

Unified Bed Leveling System v1.01 inactive.
No Mesh Loaded.
UBL object count: 1
planner.z_fade_height : 10.0000
zprobe_zoffset: -4.7899999
UBL_MESH_MIN_X  (0 + 1)=1
UBL_MESH_MIN_Y  (0 + 1)=1
UBL_MESH_MAX_X  (180 - (1))=179
UBL_MESH_MAX_Y  (180 - (1))=179
GRID_MAX_POINTS_X  9
GRID_MAX_POINTS_Y  9
MESH_X_DIST  22.25
MESH_Y_DIST  22.25
X-Axis Mesh Points at: 1.000  23.250  45.500  67.750  90.000  112.250  134.500  156.750  179.000  
Y-Axis Mesh Points at: 1.000  23.250  45.500  67.750  90.000  112.250  134.500  156.750  179.000  
Kill pin on :41  state:1

ubl_state_at_invocation :0

ubl_state_recursion_chk :0

Meshes go from 0x0248 to 0x0F7F
sizeof(ubl) :  1

z_value[][] size: 324

EEPROM free for UBL: 0x0D37
EEPROM can hold 10 meshes.

Unified Bed Leveling sanity checks passed.
ok

G29 P1

Default storage slot 0 selected.
Mesh invalidated. Probing mesh.
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
ok

G29 T0

Bed Topography Report:

(0,8)                                                           (8,8)
(1,179)                                                        (179,179)
  0.025    0.161    0.188    0.229    0.219    0.223    0.213    0.179    0.168  

 -0.014    0.126    0.166    0.236    0.256    0.208    0.281    0.119    0.069  

 -0.059    0.097    0.132    0.093    0.157    0.218    0.251    0.210    0.058  

 -0.106   -0.046    0.111    0.154    0.196    0.195    0.229    0.194   -0.012  

 -0.089   -0.042    0.078    0.145    0.209    0.229    0.252    0.214    0.147  

 -0.098    0.027    0.077    0.175    0.210    0.228    0.242    0.223    0.160  

 -0.110   -0.025    0.057    0.173    0.190    0.244    0.243    0.148    0.172  

 -0.036    0.003    0.159    0.204    0.207    0.260    0.268    0.183    0.183  

[ 0.007]  -0.011    0.167    0.220    0.224    0.255    0.257    0.184    0.174  
(1,1)                                                            (179,1)
(0,0)                                                             (8,0)
ok

G29 T1

0.025,0.161,0.188,0.229,0.219,0.223,0.213,0.179,0.168
-0.014,0.126,0.166,0.236,0.256,0.208,0.281,0.119,0.069
-0.059,0.097,0.132,0.093,0.157,0.218,0.251,0.210,0.058
-0.106,-0.046,0.111,0.154,0.196,0.195,0.229,0.194,-0.012
-0.089,-0.042,0.078,0.145,0.209,0.229,0.252,0.214,0.147
-0.098,0.027,0.077,0.175,0.210,0.228,0.242,0.223,0.160
-0.110,-0.025,0.057,0.173,0.190,0.244,0.243,0.148,0.172
-0.036,0.003,0.159,0.204,0.207,0.260,0.268,0.183,0.183
0.007,-0.011,0.167,0.220,0.224,0.255,0.257,0.184,0.174
ok
Roxy-3D commented 7 years ago

Good! You can get a nice looking Topology Map now! Now you can see what things look like. Your bed is very good! But there is a slight 'fold' in it at the center (X-Axis). Front to back is about as good as you can hope for. UBL can easily handle those flaws!

You don't need to do this... But you can mess with #define PROPORTIONAL_FONT_RATIO 1.5 in Configuration_adv.h to push those columns titles over.

Have you done G26 so you know which mesh points still need tweaking?

Here is a cool picture of your bed's topology. This was generated with your G29 T1 data:

image

lrpirlet commented 7 years ago

@Roxy-3D Ok, I think I understand what is going on... I have autotemp enabled Looking at the Repetier log shows that Marlin sends a temperature report every second... this DOES interfere with the output of the command G29 T

@repetier I have no idea if what I see is intended or not. I have at the very begin (during what I call the initial setup) a M155 S1 command so marlin generates a temp report every seconds... that is NOT coherent with the printer parameter where a temperature report should be queried every 3 seconds ( or M105 should be issued every 3 seconds)

Confirmation I did issue M155 S5... I could get a clean G29 T0 about every time, but NOT ALWAYS...

MY interpretation It seems that G29 T0 is preventing M105 command to be executed... so without autotemps we serialize the commands output... NOW, IF autotemp report is enabled, then chances are that we get temp report in the middle of a long output such as the G29 T output...

Proposed resolution Would it be difficult to suspend AUTOTEMP while long output are generated?? Sorry, my skills with C and/or C++ are such that I may come (or not) with an implementation in about 2-3 months...

repetier commented 7 years ago

Yes, 1s temperature report was intendet. 3s is more because it adds extra traffic on sending commands and with autotemp there is no interrupt of normal command flow any more.

From host side it should be no problem to suspend report - it just gets no updates to show but that was the same before as G29 would have blocked M105 the same way.

I guess you just cache the autotemp flag, disable it and at the end of G29 set it back to cached value.

lrpirlet commented 7 years ago

@Roxy-3D Thanks for the topology map... I have not tried G26 yet but will soon after I re-calibrate speed, acceleration and jerk...

@repetier Ok, thanks, this would NOT have been MY choice...

I use my 3D printer to print N-scale object (N-scale is 1:160), so I need high accuracy in both the cartesian axis and the extruder axis... That implies, for me, using both mesh levelling (UBL is great) AND LIN-Advance... The 8 bit controller is limit in terms of speed...

To increase the traffic, without GUI control, is IMHO, a step backward... I guess I need to edit my startup script to include a M155 S3... or market around to find a program that gives me control AND do not make things under my feet with a GUI that is only a gimmick (that is how I feel)...

AGAIN, please no offences, I just am somewhat frustrated because I feel I do not have full control over the host software... On the other hand, I like the repetier host I chose because of the integration of the slicers programs...

I carefully reduce as much as I can the interrupts in the controller by reducing event output occurrences (M113 S30 is an example)... I find this AUTOTEMP replying 30 characters every second or 90 characters every 3 seconds instead of sending about 7 characters( M105*) plus 30 characters answer... that makes 90 VS 37 interrupts for absolutely no REAL benefit (ever see PHYSICAL temp of the printer changing significantly in ONE second?)

BTW, thanks a lot for pointing out that SENDING M105 is what synchronize the commands... I guess my proposed solution now become to queue an equivalent of M105 at every AUTOTEMP time... (ok, I still need to read and understand the code to verify if that approach makes sense...)

lrpirlet commented 7 years ago

@Roxy-3D Ok, please find here a picture of what is going on... I have AUTOTEMP enabled (configuration_adv.h)...

So Marlin outputs a temperature report every M155 ... Please note that this is TOTALY ASYNCHRONEOUS to the command flow... ANY command sending several lines of console output run the risk to be CORRUPTED by this... The implementation of AUTOTEMP is at least incomplete...

In my case, Repetier default activates a temperature report every seconds... So any console output taking more than one second will see an imbedded temp report at least once and sometime twice... see below the log. Note that this is NOT TIED with Repetier...

I have examined the code... It would be extremely costly in term of resource to submit a M105 command at every M155 ... I guess the only acceptable solution would be to have an interlock over the console resource... I imagine that implemented with a bool over any console output that needs be protected

...
# define lock-console false // in some .h file
...
// Then in the code
...
lock-console true;
// console print to be protected such as G29 T0 
lock-console false;
...
  inline void auto_report_temperatures() {
    if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) {
      next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval;
      if !lock-console {
        print_heaterstates();
        SERIAL_EOL();
      }
    }
  }

What would be the risk???

To be honest, if that takes too much time or if it needs a more complex solution, I may revert and switch off the feature AUTOTEMP... I really fear intermittent, hard to trace failures...

The log from repetier

09:11:59.890 : start
09:11:59.890 : echo: External Reset
09:11:59.890 : Marlin bugfix-1.1.x
09:11:59.890 : echo: Last Updated: 2017-05-04 12:00 | Author: LRP
09:11:59.906 : Compiled: Jun 10 2017
09:11:59.906 : echo: Free Memory: 2765  PlannerBufferBytes: 1232
09:11:59.921 : echo:V38 stored settings retrieved (453 bytes; crc -15873)
09:11:59.921 : Unified Bed Leveling System v1.01 inactive.
09:11:59.968 : Unified Bed Leveling initialized.
09:11:59.968 : UBL System reset()
09:11:59.968 : echo:  G21    ; Units in mm
09:11:59.968 : echo:  M149 C ; Units in Celsius
09:11:59.984 : echo:Filament settings: Disabled
09:11:59.984 : echo:  M200 D3.00
09:11:59.984 : echo:  M200 D0
09:11:59.984 : echo:Steps per unit:
09:11:59.984 : echo:  M92 X80.00 Y80.00 Z4000.00 E402.00
09:12:00.000 : echo:Maximum feedrates (units/s):
09:12:00.000 : echo:  M203 X300.00 Y300.00 Z3.00 E25.00
09:12:00.000 : echo:Maximum Acceleration (units/s2):
09:12:00.000 : echo:  M201 X1000 Y1000 Z50 E5000
09:12:00.015 : echo:Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
09:12:00.015 : echo:  M204 P1500.00 R2000.00 T1500.00
09:12:00.015 : echo:Advanced: S<min_feedrate> T<min_travel_feedrate> B<min_segment_time_ms> X<max_xy_jerk> Z<max_z_jerk> E<max_e_jerk>
09:12:00.031 : echo:  M205 S0.00 T0.00 B20000 X20.00 Y20.00 Z0.40 E5.00
09:12:00.031 : echo:Home offset:
09:12:00.031 : echo:  M206 X0.00 Y0.00 Z0.00
09:12:00.031 : N1 M110*34
09:12:00.031 : N2 M115*36
09:12:00.031 : N3 M105*36
09:12:00.031 : N4 M114*35
09:12:00.031 : N5 M111 S6*98
09:12:00.031 : echo:Unified Bed Leveling:
09:12:00.031 : echo:  M420 S0 Z10.00
09:12:00.031 : Unified Bed Leveling System v1.01 inactive.
09:12:00.093 : Active Mesh Slot: -1
09:12:00.093 : z_offset: 0.000000
09:12:00.093 : EEPROM can hold 10 meshes.
09:12:00.093 : echo:Material heatup parameters:
09:12:00.093 : echo:  M145 S0 H180 B70 F0
09:12:00.093 : M145 S1 H240 B110 F0
09:12:00.109 : echo:PID settings:
09:12:00.109 : echo:  M301 P21.90 I1.43 D83.96
09:12:00.109 : echo:Z-Probe Offset (mm):
09:12:00.109 : echo:  M851 Z-4.79
09:12:05.534 : echo:SD init fail
09:12:05.534 : ok
09:12:05.534 : N6 T0*60
09:12:05.566 : FIRMWARE_NAME:Marlin bugfix-1.1.x (Github) SOURCE_CODE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Pi3 3D LabteK EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff
09:12:05.566 : Cap:EEPROM:1
09:12:05.566 : Cap:AUTOREPORT_TEMP:1
09:12:05.566 : Cap:PROGRESS:0
09:12:05.566 : Cap:AUTOLEVEL:1
09:12:05.566 : Cap:Z_PROBE:1
09:12:05.566 : Cap:LEVELING_DATA:1
09:12:05.581 : Cap:SOFTWARE_POWER:0
09:12:05.581 : Cap:TOGGLE_LIGHTS:0
09:12:05.581 : Cap:CASE_LIGHT_BRIGHTNESS:0
09:12:05.581 : Cap:EMERGENCY_PARSER:0
09:12:05.581 : ok
09:12:05.581 : N7 M20*22
09:12:05.597 : ok T:21.99 /0 B:20.00 /0 @:0 B@:0
09:12:05.597 : N8 M80*19
09:12:05.628 : X:0.00 Y:0.00 Z:0.00 E:0.00 Count X:0 Y:0 Z:0
09:12:05.628 : ok
09:12:05.628 : N9 M105*46
09:12:05.644 : echo:DEBUG:INFO,ERRORS
09:12:05.644 : ok
09:12:05.644 : echo:Active Extruder: 0
09:12:05.644 : N10 M220 S100*80
09:12:05.644 : ok
09:12:05.644 : Begin file list
09:12:05.644 : End file list
09:12:05.644 : ok
09:12:05.644 : ok
09:12:05.644 : N11 M221 S100*80
09:12:05.644 : ok T:21.99 /0 B:20.00 /0 @:0 B@:0
09:12:05.644 : ok
09:12:05.644 : N12 M111 S6*84
09:12:05.644 : ok
09:12:05.644 : N13 T0*8

*09:12:05.644 : N14 M155 S185** This sets AUTOTEMP report every 1 second

09:12:05.659 : echo:DEBUG:INFO,ERRORS
09:12:05.659 : ok
09:12:05.659 : echo:Active Extruder: 0
09:12:05.659 : ok
09:12:05.659 : ok
09:12:06.662 : T:21.91 /0 B:20.00 /0 @:0 B@:0
09:12:07.662 : T:21.87 /0 B:19.88 /0 @:0 B@:0
09:12:08.662 : T:21.87 /0 B:20.00 /0 @:0 B@:0
09:12:09.663 : T:21.87 /0 B:19.84 /0 @:0 B@:0
09:12:10.664 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:11.664 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:12.664 : T:21.91 /0 B:19.88 /0 @:0 B@:0
09:12:13.665 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:14.666 : T:21.91 /0 B:19.96 /0 @:0 B@:0
09:12:15.667 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:16.668 : T:21.91 /0 B:19.88 /0 @:0 B@:0
09:12:17.669 : T:21.91 /0 B:19.96 /0 @:0 B@:0
09:12:18.669 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:19.671 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:20.671 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:21.672 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:22.672 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:23.675 : T:21.91 /0 B:19.92 /0 @:0 B@:0
09:12:24.675 : T:21.91 /0 B:20.00 /0 @:0 B@:0
09:12:25.676 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:26.675 : T:21.91 /0 B:19.92 /0 @:0 B@:0
09:12:27.677 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:28.678 : T:21.87 /0 B:20.00 /0 @:0 B@:0
09:12:29.679 : T:21.87 /0 B:19.88 /0 @:0 B@:0
09:12:30.681 : T:21.91 /0 B:19.88 /0 @:0 B@:0
09:12:31.681 : T:21.91 /0 B:19.92 /0 @:0 B@:0
09:12:32.682 : T:21.91 /0 B:19.96 /0 @:0 B@:0
09:12:33.681 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:34.684 : T:21.91 /0 B:19.96 /0 @:0 B@:0
09:12:35.683 : T:21.87 /0 B:20.00 /0 @:0 B@:0
09:12:36.683 : T:21.91 /0 B:19.96 /0 @:0 B@:0
09:12:37.685 : T:21.87 /0 B:20.00 /0 @:0 B@:0
09:12:38.684 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:39.687 : T:21.95 /0 B:19.84 /0 @:0 B@:0
09:12:40.695 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:41.327 : N15 G29T0*66
09:12:41.327 : echo:Home XYZ first
09:12:41.343 : Bed Topography Report:
09:12:41.358 : (0,8)                                                           (8,8)
09:12:41.390 : (1,179)                                                        (179,179)
09:12:41.593 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:12:41.593 : 
09:12:41.699 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000 T:21.87 /0 B:20.00 /0 @:0 B@:0
09:12:41.736 : 0.000    0.000
09:12:41.736 : 
09:12:41.876 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:12:41.876 : 
09:12:42.017 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:12:42.017 : 
09:12:42.173 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:12:42.173 : 
09:12:42.313 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:12:42.313 : 
09:12:42.453 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:12:42.453 : 
09:12:42.594 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:12:42.594 : 
09:12:42.711 : [ 0.000]   0.000    0.000    0.000 T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:42.798 : 0.000    0.000    0.000    0.000    0.000
09:12:42.829 : (1,1)                                                            (179,1)
09:12:42.845 : (0,0)                                                             (8,0)
09:12:42.861 : ok
09:12:43.711 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:44.714 : T:21.87 /0 B:19.88 /0 @:0 B@:0
09:12:45.706 : T:21.87 /0 B:20.00 /0 @:0 B@:0
09:12:46.707 : T:21.87 /0 B:20.00 /0 @:0 B@:0
09:12:47.722 : T:21.91 /0 B:19.88 /0 @:0 B@:0
09:12:48.724 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:49.710 : T:21.87 /0 B:19.88 /0 @:0 B@:0
09:12:50.727 : T:21.91 /0 B:20.00 /0 @:0 B@:0
09:12:51.726 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:52.726 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:12:53.713 : T:21.95 /0 B:19.96 /0 @:0 B@:0
09:12:54.728 : T:21.87 /0 B:19.88 /0 @:0 B@:0
09:12:55.715 : T:21.91 /0 B:19.96 /0 @:0 B@:0
09:12:56.715 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:57.731 : T:21.87 /0 B:19.88 /0 @:0 B@:0
09:12:58.731 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:12:59.716 : T:21.87 /0 B:19.88 /0 @:0 B@:0
09:13:00.734 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:13:01.720 : T:21.91 /0 B:19.92 /0 @:0 B@:0
09:13:02.720 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:13:03.720 : T:21.95 /0 B:19.92 /0 @:0 B@:0
09:13:04.723 : T:21.87 /0 B:19.92 /0 @:0 B@:0

*09:13:05.145 : N16 M155 S385** This sets AUTOTEMP report every 3 seconds

09:13:05.145 : ok
09:13:08.147 : T:21.91 /0 B:19.92 /0 @:0 B@:0
09:13:11.149 : T:21.87 /0 B:19.88 /0 @:0 B@:0
09:13:13.084 : N17 G29T0*64
09:13:13.087 : echo:Home XYZ first
09:13:13.100 : Bed Topography Report:
09:13:13.118 : (0,8)                                                           (8,8)
09:13:13.150 : (1,179)                                                        (179,179)
09:13:13.353 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:13.353 : 
09:13:13.493 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:13.493 : 
09:13:13.633 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:13.633 : 
09:13:13.774 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:13.774 : 
09:13:13.977 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:13.977 : 
09:13:14.132 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:14.132 : 
09:13:14.151 : 0.000    0.000    0.000 T:21.91 /0 B:19.88 /0 @:0 B@:0
09:13:14.276 : 0.000    0.000    0.000    0.000    0.000    0.000
09:13:14.276 : 
09:13:14.417 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:14.417 : 
09:13:14.557 : [ 0.000]   0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:14.573 : (1,1)                                                            (179,1)
09:13:14.612 : (0,0)                                                             (8,0)
09:13:14.624 : ok
09:13:17.168 : T:21.95 /0 B:19.88 /0 @:0 B@:0
09:13:20.156 : T:21.91 /0 B:20.00 /0 @:0 B@:0
09:13:23.174 : T:21.91 /0 B:19.92 /0 @:0 B@:0
09:13:26.175 : T:21.87 /0 B:19.96 /0 @:0 B@:0
09:13:26.722 : N18 G29T0*79
09:13:26.722 : echo:Home XYZ first
09:13:26.740 : Bed Topography Report:
09:13:26.764 : (0,8)                                                           (8,8)
09:13:26.784 : (1,179)                                                        (179,179)
09:13:26.987 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:26.987 : 
09:13:27.128 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:27.128 : 
09:13:27.333 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:27.333 : 
09:13:27.473 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:27.473 : 
09:13:27.614 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:27.614 : 
09:13:27.769 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:27.769 : 
09:13:27.910 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:27.910 : 
09:13:28.050 : 0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:28.050 : 
09:13:28.191 : [ 0.000]   0.000    0.000    0.000    0.000    0.000    0.000    0.000    0.000
09:13:28.222 : (1,1)                                                            (179,1)
09:13:28.238 : (0,0)                                                             (8,0)
09:13:28.254 : ok
09:13:29.177 : T:21.95 /0 B:19.96 /0 @:0 B@:0
09:13:32.179 : T:21.87 /0 B:19.92 /0 @:0 B@:0
09:13:35.182 : T:21.95 /0 B:19.92 /0 @:0 B@:0
lrpirlet commented 7 years ago

@thinkyhead Could I have your advise too... Git blame reports you to be the submitter, gitk report you are the author...

Thanks in advance.

lrpirlet commented 7 years ago

@thinkyhead @Roxy-3D @repetier

I have solved that bad console output using the following workaround that prevent AUTOTEMP output for a while... M155 S15 G29 T0 M155 S3 (that is MY setup, repetier host sends M155 S1...)

I have also proven that a lock mechanism does work, but I have NOT been able to complete ALL the modifications in the Marlin code (I am so slow that I will spend more time to keep current than to make progress).

I really think that some console print serialization mechanism could be invented. Various solutions could be used:

Now I really wonder why we need a multi characters protocol to synchronize Marlin and the host... I know that GCODE protocol impose the 'ok'... Probably because a human should be able to read what is going on and eventually react...

I guess we could propose an alternate protocol that would be a ONE CHARACTER ASCII instead of a multi characters set that could be intermixed because asynchronously produced. This control character could be periodically repeated till the condition goes away.

ref: https://en.wikipedia.org/wiki/ASCII

Of course this implies to engage meeting with the host software authors. Besides, I have not the skill (or speed) to write it. Please do consider this protocol proposal as a request for improvement....

Roxy-3D commented 7 years ago

I believe we need a much more robust protocol for 3D Printing. It needs better error detection and synchronization. For starters... I want at least a 16-bit CRC to help validate the contents of the command line that has been sent.

apelly commented 7 years ago

Crazy talk! The USB and serial protocols already have error handling built in.

@lrpirlet is actually asking for a separate console and terminal. All that is showing up here is conflicting display data. This is the nature of the environment.

There is a clue earlier in the issue:

I doubt that Marlin is buggy, I think it may be over-optimized for Repetier...

I'm as busy as usual, but Marlin must have one routine to output data to the console. The solution is to send it complete lines where interruption is undesirable. Then it is up to the host to handle unwanted messages (lines) during data collection, say, by disabling or filtering them.

WRT keep alive messages; why are they being sent during a busy output time? They are not needed then?

Roxy-3D commented 7 years ago

Crazy talk! The USB and serial protocols already have error handling built in.

Yes. But it is possible to lose characters. They may not be getting lost on the fake serial port implemented on USB. But I assure you... characters can get lost.

davidelang commented 7 years ago

The USB protocol has error handling built in, but does the serial protocol? most arduino boards don't have RTS/CTS hooked up.

The default settings for the arduino serial library only has a 64 byte buffer, if you have a high speed computer and/or the arduino gets busy (sending pulses to motors for example :-) it is possible to overrun this buffer.

We are fighting this problem with the Maslog CNC router project.

Roxy-3D commented 7 years ago

I believe what you say is true. But I've seen a lot of characters get lost when Marlin is transmitting to the host. (The opposite direction!) I had to insert a lot of safe_delay()'s so the host's don't lose characters.

https://github.com/MarlinFirmware/Marlin/blob/bugfix-1.1.x/Marlin/ubl.cpp#L157-L165

davidelang commented 7 years ago

again we get to the small buffer and lack of RTS/CTS. If there is other stuff on the USB bus, the USB/serial on the arduino isn't going to be able to send the data as fast as the arduino tries, and so some data will be lost.

This should be far less common than problems in the other direction. But if you are using a Pi where the network is on USB, you can easily run into this sort of problem.

lrpirlet commented 7 years ago

@davidelang @Roxy-3D

Well, XON/XOFF is nothing but a software equivalent of RTS/CTS to synchronize the data flow over a serial line... This is a very old and known terminal protocol implemented in ASCII.

BUT to use it implies to have BOTH SIDES to comply... in other terms it means defining a protocol (that goes a little beyond just the data flow control... We also need that the bot can tell the host: I wait for data or user intervention needed or I am busy working on a long command or etc...)

That is exactly what I propose, using the MINIMUM resource (one character signal rather than multi-characters messages)... So that also we can free the CPU for more important tasks such as LIN-ADVANCE...

jbrazio commented 7 years ago

ATmega family does not support hardware flow control, we would require to build a custom implementation using two additional pins for it. It's doable but this will only add more strain into the uC.

davidelang commented 7 years ago

a protocol that changes all existing software seems like a really bad idea.

Roxy-3D commented 7 years ago

a protocol that changes all existing software seems like a really bad idea.

You can relax... It would be a negotiated mode. Unless both sides supported it, it wouldn't happen. And unless we can get consensus about exactly what should be done and the benefit... The code will never get written.

davidelang commented 7 years ago

On Fri, 7 Jul 2017, Roxy-3D wrote:

a protocol that changes all existing software seems like a really bad idea.

Relax... It would be a negotiated mode. Unless both sides supported it, it wouldn't happen.

Ok, I have no problem with that. I've just seen too many projects break lots of external stuff because the developer(s) decided to 'improve' the protocol and ignored backwards compatibility.

lrpirlet commented 7 years ago

@roxy-3D I never updated that entry (forgot about it...). I did run G26 P B105 H215 F2.79 L0.2 N0.4 and got this nice result..

I have NO problem, I just want to take this opportunity to underline your nice work... Thanks.

20170716_223136_dxo_hd

Roxy-3D commented 7 years ago

Wow! That is a nice Mesh Validation Pattern! I can't even see where it started the print. I need to bookmark that picture for when people ask "What is the mesh validation pattern supposed to look like?"

PS. Nozzle size is now controlled with the S parameter. But the default is .4mm so you did get the same setup as you wanted.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.