Tannoo / Marlin

Optimized firmware for RepRap 3D printers based on the Arduino platform.
http://www.marlinfw.org/
GNU General Public License v3.0
1 stars 0 forks source link

UBL Menu Sytem #1

Closed Tannoo closed 7 years ago

Tannoo commented 7 years ago

@Roxy-3D, could you look this over and tell me what you think?

https://github.com/Tannoo/Marlin/tree/UBL_Menu

It is current with RCBugFix as of 4/20/17.

Tannoo commented 7 years ago

I would like to make GRID_MAX_POINTS_X adjustable. Or, at least, UBL grid points adjustable.

Roxy-3D commented 7 years ago

I don't understand the question... The GRID_MAX_POINTS_X & Y need to be known at compile time. Do you want to make those changeable at print time? That may not make sense because a lot of storage is allocated based on those numbers and that storage would still have to be allocated for the larger, worst case.

The LCD Menu changes may be very helpful. That would allow somebody to setup a mesh without a host computer!

Tannoo commented 7 years ago

Ok. Don't worry about it. Not a big deal.

I am also trying to figure out how to get the O1 output on the LCD.

Any help there?

Roxy-3D commented 7 years ago

I'm not sure what you are thinking... If you want to have the LCD Panel dump the mesh in a form it can be grabbed by the host computer, it might be reasonable to add something to ultraLCD.cpp similar to how home offsets does its work:

    void lcd_set_home_offsets() {
      // M428 Command
      enqueue_and_echo_commands_P(PSTR("M428"));
      lcd_return_to_status();
    }

Except you would be doing a PSTR("G29 O1");

Is that what you are asking???

Tannoo commented 7 years ago

No, I got that part.

I would like to have the option to view the mesh on the LCD. At least the numerical matrix. Dump to the LCD, not the serial.

I'm not sure that there is a small enough font to display a 15x15 matrix. So, it may not be possible, it's just a thought.

Tannoo commented 7 years ago

I would like to setup another map_type to output to the LCD an not the serial.

I have been fighting with all kinds of stuff to get it to work.

Maybe you can help me out with the flow of information: It looks like this to me:

ubl_g29.cpp calls ubl.display_map when 'O' is seen. That calls this: void unified_bed_leveling::display_map in ubl.cpp.

It there, in that function, that things get a little fuzzy to me.

First step I've done is to change the map_type variable to int instead of bool.

My real confusion is this:

Now, trying to figure out how to make the serial echoes into STATIC_ITEMs for the LCD without all the conflicts and non-definitions.

Do I need to make a START_SCREEN() in the ubl.cpp or somehow get the x,y numbers called from an ultralcd.cpp function?

Roxy-3D commented 7 years ago

It there, in that function, that things get a little fuzzy to me. First step I've done is to change the map_type variable to int instead of bool.

Yeah... Thinky did that. But I don't really agree a Bool is better than an integer map type. And a Bool limits you to two map types. So... I just left it for now. But for a 3rd map type, you want to change that.

The map function isn't that complicated if you realize, the bulk of it is to print the headers (and trailers) above (and below) the map. And then the other complexity is it is trying to figure out which format to print in. Really... without all that extra complexity it turns into:

   for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
      for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
        float f;
    f = z_values[i][j];
        if (isnan(f)) 
          serialprintPGM(PSTR("    .    "));
        else 
          SERIAL_PROTOCOL_F(f, 3);
     }
      MYSERIAL.write((char)'\n');
    }

Now, trying to figure out how to make the serial echoes into STATIC_ITEMs for the LCD without all the conflicts and non-definitions. Do I need to make a START_SCREEN() in the ubl.cpp or somehow get the x,y numbers called from an ultralcd.cpp function?

I can't help you much with the LCD code. That stuff is cryptic. When I have to do something in that file, I find a function or feature that behaves similarly to what I want to do and copy it. And then start making small changes to it. But one way you can see the Mesh values on the LCD is to do a G29 P4 R and it will move the nozzle to each location and display the current mesh point value. If you click the encoder wheel without turning it... You can walk through all the numbers in a given area of the mesh.

I know that isn't what you want but at least it does get you the information displayed on the LCD Panel.

Tannoo commented 7 years ago

I have a screen setup to display some info... now I just need to find and assign the info to display.

Tannoo commented 7 years ago

I believe the magic happens here:

    const float current_xi = ubl.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0),
                current_yi = ubl.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);

    for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
      for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
        const bool is_current = i == current_xi && j == current_yi;

        // is the nozzle here? then mark the number
        if (map_type == 0) SERIAL_CHAR(is_current ? '[' : ' ');

        const float f = z_values[i][j];
        if (isnan(f)) {
          serialprintPGM((map_type == 0) ? PSTR("   .  ") : PSTR("NAN"));
        }
        else {
          // if we don't do this, the columns won't line up nicely
          if ((map_type == 0) && f >= 0.0) SERIAL_CHAR(' ');
          SERIAL_PROTOCOL_F(f, 3);
          idle();
        }
        if ((map_type >= 1) && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR(',');

        #if TX_BUFFER_SIZE > 0
          MYSERIAL.flushTX();
        #endif
        if (map_type == 0) {
          SERIAL_CHAR(is_current ? ']' : ' ');
          SERIAL_CHAR(' ');
        }
      }
      SERIAL_EOL;
      if (j && (map_type == 0)) { // we want the (0,0) up tight against the block of numbers
        SERIAL_CHAR(' ');
        SERIAL_EOL;
      }
    }
Tannoo commented 7 years ago

I didn't see your reply when I posted the last two...

Thanks for your help. I will hammer my head on the keyboard until something works. lol

Roxy-3D commented 7 years ago

Yes... That block of code I Cut & Pasted into the above text is the 'magic' to send the Mesh Map to the host device. Instead of using serial and MYSERIAL routines, you would be calling LCD functions to get things displayed.

for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
      for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
        float f;
    f = z_values[i][j];
        if (isnan(f)) 
          serialprintPGM(PSTR("    .    "));
        else 
          SERIAL_PROTOCOL_F(f, 3);
     }
      MYSERIAL.write((char)'\n');
    }
Tannoo commented 7 years ago

Yeah.. I'm working on that.

PITA, it is.

Tannoo commented 7 years ago

I give up, my head is bleeding.

Tannoo commented 7 years ago

I just can't get declarations to jive.

I tried to make it work from ultralcd.cpp.... nope... can't get the f to carry over. Something about cannot float an int. lol

I cannot get it to work in ubl.cpp... nope. That's not happening either. Can't seem to draw a screen from there.

Roxy-3D commented 7 years ago

To convert an integer to float... You just cast it with a ((float) i) assuming i is an int.

Somebody else over at the RepRap forum wanted to make changes to the LCD Panel menu code. I told them this is a very difficult piece of code to be trying to modify if you are not fluent in C.

http://forums.reprap.org/read.php?415,763824

Actually.... I could have said that better. The LCD Panel code is very difficult to modify EVEN IF you are fluent in C. It is a very cryptic piece of code.

Tannoo commented 7 years ago

Yeah. I don't want to convert anything as that would mean losing the resolution of the z corrections of the matrix displayed on the LCD.

Question: What is the \ used for in C/C++/Arduino?

  #define START_SCREEN() \
    START_SCREEN_OR_MENU(LCD_HEIGHT - (TALL_FONT_CORRECTION)); \
    encoderTopLine = encoderLine; \
    bool _skipStatic = false; \
    SCREEN_OR_MENU_LOOP()
Roxy-3D commented 7 years ago

It is a pre-processor directive. It says that the stuff on the next line is still part of the current macro definition. The START_SCREEN() macro includes everything on the next 4 lines.

Tannoo commented 7 years ago

Okay, this compiles... but, doesn't do what's expected. My guess is memory corruption. Wrong locations somewhere.

The screen doesn't show, but servos are wigging out and after a few seconds, Marlin resets.

This is executed from ultralcd.cpp:

    void _lcd_ubl_output_lcd_map() {
      START_SCREEN();
        STATIC_ITEM(MSG_UBL_LEVEL_BED, false, false);

        float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];

        const float current_xi = ubl.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0),
                    current_yi = ubl.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);

        for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
          for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
            const bool is_current = i == current_xi && j == current_yi;

            const float f = z_values[i][j];
            if (isnan(f)) {
              STATIC_ITEM("NAN", false, false);
            }
            else {
              // if we don't do this, the columns won't line up nicely
              STATIC_ITEM("", f, false, false);
              idle();
            }
            if (i < GRID_MAX_POINTS_X - 1) STATIC_ITEM(",", false, false);

            safe_delay(15);
          }
          SERIAL_EOL;
        }
      END_SCREEN();
    }

The serial output shows something that I didn't expect:

save_ubl_active_state_and_disabled() called multiple times in a row.
restore_ubl_active_state_and_leave() called too many times.
echo:Bed Leveling Off
ok
Tannoo commented 7 years ago

I expected the z_value to be displayed on one line, and each one to display in the same spot for now.

I am trying to get something to start working...after that... formatting.

If I have to ditch displaying the map on the LCD, I can. I just think that it's doable.

Roxy-3D commented 7 years ago

The

save_ubl_active_state_and_disabled() called multiple times in a row.
restore_ubl_active_state_and_leave() called too many times.
echo:Bed Leveling Off
ok

message is strange. That isn't even in that code. That is some extra code to make sure recursion isn't happening and some how that code is tripping it.

Let me think about this and see if something suddenly makes sense to me.

Tannoo commented 7 years ago

I do believe the START_MENU / END_MENU is called several times before it stops. IDK why, but that's what I've seen. I will put a delay in there to see if that helps.

Tannoo commented 7 years ago

To no repeat a function, I found that I can call that one:

    void _lcd_ubl_output_map_numbers() {
      ubl.display_map(map_type);
    }

I am not trying to get numbers from it. So far, I get no numbers... just random stepper moves. lol .. Not exactly what I'm looking for.

Tannoo commented 7 years ago

Kill screen shows in less than 1 sec. Here's the serial output:

Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.1520.256Error:KILL caused by too much inactive time - current command: 
Error:Printer halted. kill() called!
Tannoo commented 7 years ago

Here's the relevant functions in ultralcd.cpp:

    void _lcd_ubl_output_map_numbers() {
      ubl.display_map(map_type);
    }

    /**
     * UBL Output LCD map
     */
    void _lcd_ubl_output_lcd_map() {
      START_SCREEN();
      STATIC_ITEM(MSG_UBL_LEVEL_BED, false, false);
      _lcd_ubl_output_map_numbers();
      STATIC_ITEM("", lcd_output_f, false, false);
      END_SCREEN();
    }
Tannoo commented 7 years ago

If I add a delay inside the SCREEN calls, I get X, Y, AND Z movements and then Marlin resets.

    void _lcd_ubl_output_map_numbers() {
      ubl.display_map(map_type);
    }

    /**
     * UBL Output LCD map
     */
    void _lcd_ubl_output_lcd_map() {
      START_SCREEN();
      STATIC_ITEM(MSG_UBL_LEVEL_BED, false, false);
      _lcd_ubl_output_map_numbers();
      STATIC_ITEM("", lcd_output_f, false, false);
      safe_delay(200);
      END_SCREEN();
    }

Here's the serial up to the reset:

Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152start
echo:Marlin 1.1.0-RCBugFix

So, this time, I don't know what reset it or why.

Tannoo commented 7 years ago

Is there a way to call a function only once and null after that?

Tannoo commented 7 years ago

I'm sorry, I am thinking out loud. I created a UBL_MAP_CALL_ONCE flag to hopefully do just that.

Tannoo commented 7 years ago

lol.... I changed the code to this:

    void _lcd_ubl_output_map_numbers() {
      ubl.display_map(map_type);
      UBL_MAP_CALL_ONCE = false;
    }

    /**
     * UBL Output LCD map
     */
    void _lcd_ubl_output_lcd_map() {
      START_SCREEN();
      STATIC_ITEM(MSG_UBL_LEVEL_BED, false, false);
      if (UBL_MAP_CALL_ONCE == true) _lcd_ubl_output_map_numbers();
      STATIC_ITEM("", lcd_output_f, false, false);
      END_SCREEN();
    }

No Screen change, but I get this on the monitor:

Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.152
Bed Topography Report for LCD:

0.1520.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
0.2560.3120.3020.2620.1550.008-0.2320.2000.200
0.1430.2320.2900.2760.2240.1610.027-0.1990.2000.200
0.0860.2350.2480.2470.2140.1730.047-0.1550.2000.200
0.0590.1710.2100.2090.1890.1560.080-0.1040.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.2000.2000.2000.2000.2000.2000.2000.2000.200
0.2000.1320.1290.1170.1030.0610.019-0.079-0.3030.200
0.2000.2050.2530.2180.2350.1820.135-0.029-0.2620.200
0.2000.1900.2420.2890.2650.2240.136-0.018-0.2680.200
0.2000.1720.2610.3030.3000.2410.1620.005-0.2550.200
Error:MAXTEMP triggered, system stopped! Heater_ID: 0
Error:Printer halted. kill() called!

Very interesting. The LCD actually timed out and was at the info screen before it killed it. I'm just not sure why the heater is involved yet. OH! the last time must have set the temps somehow, because everything is very hot!

Tannoo commented 7 years ago

Yes, it's turning on all the analog outputs. The hotend, the bed, and the fan. But with arbitrary values. Something is getting stepped on.

Tannoo commented 7 years ago

Hotend was set to 744, the bed to 1260, and the fan to 12%. Very odd.

Roxy-3D commented 7 years ago

Two comments... You have to call idle() very often or the Kill message will happen. That is to protect the printer in case the firmware goes crazy and doesn't keep managing the heaters.

The hotend going 744 degrees sounds like you have some data corruption happening. A bad pointer or something is stepping on things. It might be best to find the data corruption problem first, because it maybe the rest of your code is working right but you can't tell that with the corruption happening.

On Thu, Apr 27, 2017 at 10:35 AM, Tannoo notifications@github.com wrote:

Hotend was set to 744, the bed to 1260, and the fan to 12%. Very odd.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Tannoo/Marlin/issues/1#issuecomment-297751241, or mute the thread https://github.com/notifications/unsubscribe-auth/AIA9YqlozC7AGAw1ntcVZi09Vs_zaQqkks5r0LW-gaJpZM4NCrYm .

Tannoo commented 7 years ago

Yes, I believe that. I'm trying to find out where. ubl.display_map(map_type); is getting called too many times in a row. The idle() call is in the ubl.display_map function.

I'm not sure where the data corruption is. I ran into that once with char XXX [15] declarations and got that sorted. But, this time, there is a float that's new. In ubl.cpp: float lcd_output_f; and if (map_type == 2) lcd_output_f = f;

In ultralcd.cpp: extern float lcd_output_f; and STATIC_ITEM("", lcd_output_f, false, false);

Tannoo commented 7 years ago

I will remove that float and see if the corruption and stuff stops.

Tannoo commented 7 years ago

That made no difference... hmm. Well, there was a time that it didn't, now it does.

Tannoo commented 7 years ago

I've tried so many different ways to get the f data to ultralcd.cpp and nothing gives me a number. Latest iteration crashes with Marlin resetting or kill called. It's random.

So, I've given up for now.

Tannoo commented 7 years ago

Well, I tried another approach before I giving up.

...and it's back to weird corruptions again.

I am declaring in ultralcd.cpp, extern const float f because of const float f in ubl.cpp.

Then, currently trying to display that as STRINGIFY(f).

I am lost as to why corruption is happening. But, I'll put it to rest for another while.

Roxy-3D commented 7 years ago

I am lost as to why corruption is happening. But, I'll put it to rest for another while.

I know why it is happening... It took 4 of us and a hardware debugger to figure it out. This thread goes into all the gory details. https://github.com/MarlinFirmware/Marlin/issues/6405#issuecomment-297429048

I'm sorry. I thought you were working off of the most current code base. If I had realized that wasn't the case, I would spoke up much earlier.

Any way.... If you move your changes to the current code base, the data corruption should be gone.

Roxy-3D commented 7 years ago

I was just thinking... Would it make sense to leave the map display alone for now? And instead add a UBL menu to the LCD Panel code. Maybe an Activate, Deactivate, P0, P1 P3, P4, Save and Load option? Then people would not need to have a host computer plugged into the printer. Somebody was just asking for that.

First, those would be a lot simpler and more straight forward to add to the LCD code. That would help you do the more difficult Map Display. But the other thing is I finally have some time to think about things. There is probably a good way to use the limited display space to show the map. Maybe we have a little postage stamp size icon with a dot on it representing which number (or group of numbers) is being displayed. And the dot moves around based on how the encoder wheel is turned?

Tannoo commented 7 years ago

This thread goes into all the gory details. MarlinFirmware#6405 (comment)

Yes, I've seen that.

I thought you were working off of the most current code base.

I am.

If you move your changes to the current code base, the data corruption should be gone.

Actually, I stopped trying to display data from ubl.cpp. I copied the relevant stuff over to ultralcd.cpp in the function to display the map. I stopped having corruption issues, but it's not displaying any numbers.

Would it make sense to leave the map display alone for now? And instead add a UBL menu to the LCD Panel code. Maybe an Activate, Deactivate, P0, P1 P3, P4, Save and Load option? Then people would not need to have a host computer plugged into the printer. Somebody was just asking for that.

I was thinking that also. I have everything else working... maybe more than you are asking for. lol

Here's the breakdown of the UBL menu I have now:

    /**
     * UBL submenu
     * 
     * Prepare
     *  Unified Bed Leveling
     *    Activate UBL
     *    Deativate UBL
     *    1 - Build Mesh
     *      Build PLA Mesh
     *      Build ABS Mesh
     *      Build Custom Mesh
     *        Hotend Temp:
     *        Bed Temp:
     *        Build Custom Mesh
     *      Build Cold Mesh
     *      Continue Bed Mesh
     *    2 - Fill-in NANs
     *      Smart Fill-in
     *      Fill-in Mesh
     *    3 - Validate Mesh
     *      PLA Mesh Validation
     *      ABS Mesh Validation
     *      Custom Mesh Validation
     *        Hotend Temp:
     *        Bed Temp:
     *        Validate Mesh
     *    4 - Edit Mesh
     *      Edit PLA Mesh
     *      Edit ABS Mesh
     *      Edit Custom Mesh
     *        Hotend Temp:
     *        Bed Temp:
     *        Edit Mesh
     *    Mesh Leveling
     *      Mesh Leveling
     *      Grid Mesh Leveling
     *        Side points:
     *        Level Mesh
     *    Mesh Storage
     *      Memory Slot:
     *      Load Bed Mesh
     *      Save Bed Mesh
     *    Output Map
     *      Map Type:
     *      Output Bed Mesh Host / Output Bed Mesh Excel
     *    Output UBL Info
     */

That's how I'm keeping mine for now.

Do you want only what you stated?

Roxy-3D commented 7 years ago

Your full menu list is great! I only gave the smaller list because even that is a fair amount of work. But that would be the minimal amount needed to have a 'Full System'. Why would a user want to have a PLA mesh and an ABL mesh? Any mesh should be able to allow any type of filament to be used with it.

I thought you were working off of the most current code base.

I am.

OK. But when I go to the code in this branch and look at gcode_G29() it doesn't have the attribute(optimization(O0)) or what ever the correct syntax is. That is why I thought you did not have the most current. No reason to fight problems that have already been found!

Tannoo commented 7 years ago

Well, I haven't updated this branch in a week or so. But, my local working copy on my printer is the latest as of yesterday.

Tannoo commented 7 years ago

I can update it.

Tannoo commented 7 years ago

It is now updated with RCBugFix as of now.

It will take me a few more mins to get the latest menu code I have on to it.

Tannoo commented 7 years ago

Ok. It's updated now to what I have on my printer.

FYI: There are other things I have like: DHT sensor addition RGB lighting control menu. Leveling system in use listed on the Printer Info screen. Initialize Memory (M502 > M500 > M501") on the Control menu.

Tannoo commented 7 years ago

They are all on my current_running branch.

Tannoo commented 7 years ago

Tell me what you want changed, I will.

Tannoo commented 7 years ago

Or...you should be able to submit PRs here.

Roxy-3D commented 7 years ago

What is your thinking on why there should be a PLA Mesh and an ABS Mesh? I just dial my mesh in very accurately, and I use it for either type of material.

Also... Another suggestion. A command like G29 J4 would be useful on your menu. (To tilt the mesh based on the glass positioning.) But it takes a lot of extra logic to make the LCD Menu allow you to pick the number. It might be good to have an include file or a set of #define's where the user could pick a number. You would be able to enque a G29 J command. But it would be a lot simpler if the user had to pick a number to go with that ahead of time. Or maybe... That is exactly what you do. You allow them to enque a G29 J but the command defaults to the specified G29 J default (which I believe is 3).

Tannoo commented 7 years ago

Well, on mine, the bed changes shape when it's heated to 110C vs 50C

Tannoo commented 7 years ago

Do you set your mesh up at ABS temps? I can't do that yet due to PLA is all I have atm. So, I have to set it up at PLA temps.