Update the filament axis resolution when E resolution is changed
The filament sensor "chunk lenght" needs to be updated every time the E axis resolution is changed in order to trigger at the same distance. Introduce a new function fsensor_set_axis_steps_per_unit() and use it consistent during init, in M92 and M350.
This commit is contained in:
parent
ce74b746f1
commit
d47363d85a
@ -6673,7 +6673,7 @@ Sigma_Exit:
|
||||
{
|
||||
if(code_seen(axis_codes[i]))
|
||||
{
|
||||
if(i == 3) { // E
|
||||
if(i == E_AXIS) { // E
|
||||
float value = code_value();
|
||||
if(value < 20.0) {
|
||||
float factor = cs.axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab.
|
||||
@ -6682,6 +6682,7 @@ Sigma_Exit:
|
||||
axis_steps_per_sqr_second[i] *= factor;
|
||||
}
|
||||
cs.axis_steps_per_unit[i] = value;
|
||||
fsensor_set_axis_steps_per_unit(value);
|
||||
}
|
||||
else {
|
||||
cs.axis_steps_per_unit[i] = code_value();
|
||||
@ -8429,7 +8430,6 @@ Sigma_Exit:
|
||||
res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only
|
||||
if (res_valid)
|
||||
{
|
||||
|
||||
st_synchronize();
|
||||
uint16_t res = tmc2130_get_res(i);
|
||||
tmc2130_set_res(i, res_new);
|
||||
@ -8446,6 +8446,8 @@ Sigma_Exit:
|
||||
cs.axis_steps_per_unit[i] /= fac;
|
||||
position[i] /= fac;
|
||||
}
|
||||
if (i == E_AXIS)
|
||||
fsensor_set_axis_steps_per_unit(cs.axis_steps_per_unit[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -149,6 +149,11 @@ void fsensor_checkpoint_print(void)
|
||||
restore_print_from_ram_and_continue(0);
|
||||
}
|
||||
|
||||
void fsensor_set_axis_steps_per_unit(float u)
|
||||
{
|
||||
fsensor_chunk_len = (int16_t)(FSENSOR_CHUNK_LEN * u);
|
||||
}
|
||||
|
||||
void fsensor_init(void)
|
||||
{
|
||||
#ifdef PAT9125
|
||||
@ -161,7 +166,7 @@ void fsensor_init(void)
|
||||
#ifdef PAT9125
|
||||
uint8_t oq_meassure_enabled = eeprom_read_byte((uint8_t*)EEPROM_FSENS_OQ_MEASS_ENABLED);
|
||||
fsensor_oq_meassure_enabled = (oq_meassure_enabled == 1)?true:false;
|
||||
fsensor_chunk_len = (int16_t)(FSENSOR_CHUNK_LEN * cs.axis_steps_per_unit[E_AXIS]);
|
||||
fsensor_set_axis_steps_per_unit(cs.axis_steps_per_unit[E_AXIS]);
|
||||
|
||||
if (!pat9125)
|
||||
{
|
||||
|
@ -29,6 +29,9 @@ extern void fsensor_checkpoint_print(void);
|
||||
//! initialize
|
||||
extern void fsensor_init(void);
|
||||
|
||||
//! update axis resolution
|
||||
extern void fsensor_set_axis_steps_per_unit(float u);
|
||||
|
||||
//! @name enable/disable
|
||||
//! @{
|
||||
extern bool fsensor_enable(bool bUpdateEEPROM=true);
|
||||
|
Loading…
Reference in New Issue
Block a user