The coeff_frac_bits and scale_frac_bits can be automatically
calculated, so there's no need for the callers to specify this
information.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Have the callers convert convert the trigger_value from a float to an
integer (if necessary). This is in preparation for implementing
rounding in to_fixed_32().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add new add_lowpass(), add_highpass(), add_notch(), and
setup_initial_state() methods to DigitalFilter. Use these instead of
creating the filters from the constructor.
Also remove the unused filtfilt() method.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new create_probe_result() helper function that can generate a
ProbeResult using a toolhead position and a set of probe offsets.
Use this helper in other modules.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rework the trigger_analog code to support different "trigger"
conditions. This merges in features of ldc1612.c into
trigger_analog.c, such as error code reporting in the MCU. This is in
preparation for using trigger_analog with ldc1612.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't require callers of MCU_trigger_analog to create the
mcu.TriggerDispatch() instance - instead, create it within the
MCU_trigger_analog() class.
Also, make it easier to use MCU_trigger_analog without an
MCU_SosFilter - the MCU_trigger_analog can automatically create an
empty filter if needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename sos_filter.py to trigger_analog.py and copy MCU_trigger_analog
class from load_cell_probe.py to this new file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support offsetting and scaling the initial raw value prior to
processing in the sos_filter.
Remove that support from trigger_analog.c .
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the SosFilter class to MCU_SosFilter. Automatically reload the
filter coefficients on a reset_filter() call, so there is no need to
support loading of the filter at init time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the mcu based load_cell_probe code to trigger_analog. This is
a rename of the C code files, struct names, and command names. There
is no change in behavior (other than naming) with this change.
This is in preparation for using the load_cell_probe functionality
with other sensors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Make it possible for the probe's get_offsets() code to depend on the
parameters of the probe request. This is in preparation for eddy
"tap" support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change the low-level probe code to return ProbeResult tuples from
probe_session.pull_probed_results(). Also update callers to use the
calculated bed_xyz values found in the tuple instead of calculating
them from the probe's xyz offsets.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Initial setup of Load Cell Probing. This implementation supports triggering from the Load Cell Probe on the MCU. It also supports, optiopnal, filtering of the force signal by sos filter to eliminate drift caused by bowden tubes or other mechanical causes.
Signed-off-by: Gareth Farrington <gareth@waves.ky>