4 Commits

Author SHA1 Message Date
Kevin O'Connor
106d1d2a2a docs: Note the release of v0.9.1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-28 10:55:21 -04:00
Kevin O'Connor
ed5ce9cb37 linux: Fix spi handling with more than one spi device
Reported by @opensource-alt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-25 10:14:15 -04:00
Kevin O'Connor
c2c79ff98d bltouch: Fix bug causing incorrect position when "stow_on_each_sample=False"
It is only valid to call raise_probe() when the toolhead is not
moving.  Make sure to call sync_print_time() from multi_probe_end() to
ensure that.  This fixes a bug that could cause the Z axis steppers to
lose their position when "stow_on_each_sample=False".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-24 00:22:58 -04:00
Kevin O'Connor
1b6b7fc58c kin_extruder: Fix numerical stability when using pressure advance
Avoid using the absolute E position when calculating pressure advance
as that position can grow arbitrarily large, which can result in
"numerical stability" problems.  That instability could eventually
lead to internal errors during step compression.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-23 22:59:20 -04:00
4 changed files with 18 additions and 7 deletions

View File

@@ -35,6 +35,11 @@ Available on 20201020. Major changes in this release:
graph_temp_sensor, whconsole
* Several bug fixes and code cleanups.
Klipper 0.9.1
--------------
Available on 20201028. Release containing only bug fixes.
Klipper 0.8.0
=============

View File

@@ -52,7 +52,8 @@ extruder_integrate_time(double base, double start_v, double half_accel
// Calculate the definitive integral of extruder for a given move
static double
pa_move_integrate(struct move *m, double start, double end, double time_offset)
pa_move_integrate(struct move *m, double base, double start, double end,
double time_offset)
{
if (start < 0.)
start = 0.;
@@ -60,7 +61,7 @@ pa_move_integrate(struct move *m, double start, double end, double time_offset)
end = m->move_t;
// Calculate base position and velocity with pressure advance
double pressure_advance = m->axes_r.y;
double base = m->start_pos.x + pressure_advance * m->start_v;
base += pressure_advance * m->start_v;
double start_v = m->start_v + pressure_advance * 2. * m->half_accel;
// Calculate definitive integral
double ha = m->half_accel;
@@ -75,20 +76,23 @@ pa_range_integrate(struct move *m, double move_time, double hst)
{
// Calculate integral for the current move
double res = 0., start = move_time - hst, end = move_time + hst;
res += pa_move_integrate(m, start, move_time, start);
res -= pa_move_integrate(m, move_time, end, end);
double start_base = m->start_pos.x;
res += pa_move_integrate(m, 0., start, move_time, start);
res -= pa_move_integrate(m, 0., move_time, end, end);
// Integrate over previous moves
struct move *prev = m;
while (unlikely(start < 0.)) {
prev = list_prev_entry(prev, node);
start += prev->move_t;
res += pa_move_integrate(prev, start, prev->move_t, start);
double base = prev->start_pos.x - start_base;
res += pa_move_integrate(prev, base, start, prev->move_t, start);
}
// Integrate over future moves
while (unlikely(end > m->move_t)) {
end -= m->move_t;
m = list_next_entry(m, node);
res -= pa_move_integrate(m, 0., end, end);
double base = m->start_pos.x - start_base;
res -= pa_move_integrate(m, base, 0., end, end);
}
return res;
}
@@ -109,7 +113,7 @@ extruder_calc_position(struct stepper_kinematics *sk, struct move *m
return m->start_pos.x + move_get_distance(m, move_time);
// Apply pressure advance and average over smooth_time
double area = pa_range_integrate(m, move_time, hst);
return area * es->inv_half_smooth_time2;
return m->start_pos.x + area * es->inv_half_smooth_time2;
}
void __visible

View File

@@ -173,6 +173,7 @@ class BLTouchEndstopWrapper:
def multi_probe_end(self):
if self.stow_on_each_sample:
return
self.sync_print_time()
self.raise_probe()
self.sync_print_time()
self.multi = 'OFF'

View File

@@ -57,6 +57,7 @@ spi_open(uint32_t bus, uint32_t dev)
devices[devices_count].bus = bus;
devices[devices_count].dev = dev;
devices[devices_count].fd = fd;
devices_count++;
return fd;
}