Real-time filament diameter measurement and control

This feature allows the printer to read the filament diameter
automatically and adjust the printer in real time.  Added code to read
an analog voltage that represents a filament diameter measurement.  This
measurement is delayed in a ring buffer to compensate for sensors that
are a distance away from the extruder.  The measurement is used to
adjust the volumetric_multiplier for the extruder.  Some additional g
codes (M404, M405, M406, M407) are used to set parameters and turn
on/off the control. g code M221 is updated.  Pins for RAMPS1.4, RAMBO,
and Printrboard are identified for analog input.  The configuration file
is updated with relevant user parameters.
This commit is contained in:
Filip Mulier
2014-08-06 19:30:57 -05:00
parent 1d0fe035f3
commit 85649a4549
7 changed files with 289 additions and 7 deletions

View File

@ -229,6 +229,16 @@ extern int EtoPPressure;
extern unsigned char fanSpeedSoftPwm;
#endif
#ifdef FILAMENT_SENSOR
extern volatile float filament_width_nominal; //holds the theoretical filament diameter ie., 3.00 or 1.75
extern volatile bool filament_sensor; //indicates that filament sensor readings should control extrusion
extern float filament_width_meas; //holds the filament diameter as accurately measured
extern signed char measurement_delay[]; //ring buffer to delay measurement
extern int delay_index1, delay_index2; //index into ring buffer
extern float delay_dist; //delay distance counter
extern int meas_delay_cm; //delay distance
#endif
#ifdef FWRETRACT
extern bool autoretract_enabled;
extern bool retracted[EXTRUDERS];