Open AndreySamokhin opened 3 weeks ago
I had an issue with homing because of variables declared like so:
float parkingposx[2],
parkinggrabdistance;
while this snippet doesnt really have to do with homing it is just an example.
for instance:
- uint32_t max_acceleration_mm_per_s2[DISTINCT_AXES],
- min_segment_time_us;
+ uint32_t max_acceleration_mm_per_s2[DISTINCT_AXES],
+ uint32_t min_segment_time_us;
there are a few files which should have this explicitly defined otherwise it can cause issues.
Why do you think this results in different code. Because it doesn't.
@plampix because when I had changed this code, it resulted in erratic behavior when homing.
even if you ask ChatGPT what issues may happen if you group them when declaring:
This difference would cause issues if you tried to compile the first code snippet,
as you cannot declare the same variable name with different data types in the same scope.
The compiler would throw an error.
When you declare them in the same line,
they are both allocated memory in the same block of memory.
well maybe the compiler may not always throw an error, but certainly there was an when flashing the firmware.
my guess it probably has something to do with in settings.cpp
@classicrocker883, you could have mentioned the Dangerous behavior when homing issue in your first message.
Your explanation sounds unrealistic. As @plampix pointed out, comma-separated declarations are valid in C/C++. The actual problem with the code you modified is different: you changed the order of variables in the planner_settings_t
structure, which really matters.
Next time, please do not refer to ChatGPT as a reliable source without double-checking its answers or at least carefully read it responses, as what it said ("... you cannot declare the same variable name with different data types...") is inconsistent with your explanation.
it wasnt the "order of variables" in the struct that mattered. feedrate_t
is literally the same as float
. declaring the variable inline as a different type was the cause.
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
The board reboots while homing the Z-axis.
The issue occurs inside the
do_homing_move()
function with theplanner.synchronize();
being the last executed line. Further investigation showed that thePlanner::busy()
function never returns0
because thePlanner::has_blocks_queued()
function consistently returns1
.The minimum required changes of default configuration files:
configuration.zip
Bug Timeline
New bug.
Expected behavior
When homing with the Z endstop disconnected, the expected behavior is to receive the
Printer halted. kill() called!
error. This is achievable if the configuration specifies the A4988 driver for the I axis rather than TB6560.Actual behavior
The board reboots a few seconds after initiating the homing routine along the Z-axis.
Steps to Reproduce
The bug can be reproduced using only motherboard without connecting any sensors, motors, etc.
M119
command to confirm that the Z-axis endstop is not triggered.G28 Z
command.Version of Marlin Firmware
bugfix-2.1.x (d2bda12); 2.1.2.4
Printer model
DIY
Electronics
Board - MKS GEN L V1.0 (ATmega2560); X, Y and Z drivers - A4988; I driver - TB6560
LCD/Controller
LCD is not used.
Other add-ons
No response
Bed Leveling
None
Your Slicer
None
Host Software
None
Don't forget to include
Configuration.h
andConfiguration_adv.h
.Additional information & file uploads
No response