Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Code weirdness in G80 #2579

Closed
leptun opened this issue Apr 5, 2020 · 5 comments · Fixed by #4332
Closed

[QUESTION] Code weirdness in G80 #2579

leptun opened this issue Apr 5, 2020 · 5 comments · Fixed by #4332
Labels
Milestone

Comments

@leptun
Copy link
Collaborator

leptun commented Apr 5, 2020

		if (degHotend(active_extruder) > EXTRUDE_MINTEMP && temp_cal_active == true && calibration_status_pinda() == true && target_temperature_bed >= 50) {
			current_position[E_AXIS] += default_retraction;
			plan_buffer_line_curposXYZE(400, active_extruder);
		}

This snippet of code at the end of G80 makes no sense. Why only unretract when Temperature calibration is used?

@leptun leptun added the question label Apr 5, 2020
@Panayiotis-git
Copy link
Contributor

Panayiotis-git commented Apr 5, 2020

At the beginning of the G80 command there is the following code:

#ifndef PINDA_THERMISTOR
		if (run == false && temp_cal_active == true && calibration_status_pinda() == true && target_temperature_bed >= 50)
		{
			temp_compensation_start();
			run = true;
			repeatcommand_front(); // repeat G80 with all its parameters
			enquecommand_front_P((PSTR("G28 W0")));
			break;
		}
        run = false;
#endif //PINDA_THERMISTOR

The temp_compensation_start() function, does a retraction:

	if (degHotend(active_extruder) > EXTRUDE_MINTEMP) {
		current_position[E_AXIS] -= default_retraction;
	}
	plan_buffer_line_curposXYZE(400, active_extruder);

I think that the unretract should be enclosed in a:
#ifndef PINDA_THERMISTOR

@leptun
Copy link
Collaborator Author

leptun commented Apr 6, 2020

Thanks, that makes a lot more sense.
Now that I think about it, why don’t we always retract during MBL? It just seems logical doing so.

@vintagepc
Copy link
Contributor

On the topic of hidden gems, I found this lurking in lcd.cpp:

#ifdef VT100
 uint8_t lcd_escape[8];
#endif

What is a VT100,you ask? 🤣
https://en.wikipedia.org/wiki/VT100

@leptun
Copy link
Collaborator Author

leptun commented Apr 6, 2020

@vintagepc it’s not hidden code, it is my code :).
The vt100 codes are escape sequence of characters that trigger a certain terminal command. In our case, we had home and set cursor that were useful for the lcd.
These were quite wasteful, so I changed the code to not use them anymore. I commented out the code so that I could save close to 1KB of flash

Edit: fix misinformation

@vintagepc
Copy link
Contributor

Interesting - either way it gave me a good laugh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants