Skip to content

Commit

Permalink
DigitCompensation
Browse files Browse the repository at this point in the history
see changelog.txt
  • Loading branch information
Nibbels committed May 17, 2017
1 parent 1080138 commit e4fba6b
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Repetier/Commands.cpp
Expand Up @@ -369,9 +369,7 @@ void Commands::printTemperatures(bool showRaw)
Com::printF(Com::tF);
Com::printF(Com::tColon,(int)readStrainGauge( ACTIVE_STRAIN_GAUGE ));
#endif //FEATURE_PRINT_PRESSURE

Com::println();

} // printTemperatures


Expand Down
7 changes: 6 additions & 1 deletion Repetier/Configuration.h
Expand Up @@ -105,11 +105,16 @@ IMPORTANT: With mode <>0 some changes in Configuration.h are not set any more, a
#define FEATURE_PRINT_PRESSURE 1

#if FEATURE_SENSIBLE_PRESSURE
#define SENSIBLE_PRESSURE_DIGIT_CHECKS 10 // MAximal auf 127 stellen, denn das wir mit char verglichen!!
#define SENSIBLE_PRESSURE_DIGIT_CHECKS 10 // MAximal auf 127 stellen, denn das wird mit char verglichen!!
//nachfolgend soll im grunde ausschließlich die wärmeausdehnung in einem perfekt kalibrierten system (HBS,mhier) kompensiert werden:
#define SENSIBLE_PRESSURE_MAX_OFFSET 180
#endif // FEATURE_SENSIBLE_PRESSURE

#define FEATURE_SENSIBLE_COMPENSATION 1
#if FEATURE_SENSIBLE_COMPENSATION

#endif // FEATURE_SENSIBLE_COMPENSATION

#endif // FEATURE_HEAT_BED_Z_COMPENSATION && FEATURE_EMERGENCY_PAUSE

/** \brief Allows to change the amount of Z-Offset which is changed by a push of the Z-Up or Z-Down button ONLY within the Mod Menu Page 2 */
Expand Down
4 changes: 2 additions & 2 deletions Repetier/Constants.h
Expand Up @@ -20,8 +20,8 @@
#define CONSTANTS_H


#define REPETIER_VERSION "RF.01.37k4.TDMod"
#define UI_PRINTER_COMPANY "Nibbels DualTD"
#define REPETIER_VERSION "RF.01.37l.Mod"
#define UI_PRINTER_COMPANY "TipDown+DigitComp"
#define UI_VERSION_STRING "V " REPETIER_VERSION


Expand Down
32 changes: 31 additions & 1 deletion Repetier/RF.cpp
Expand Up @@ -207,6 +207,12 @@ short g_nSensibleLastPressure = 0;
char g_nSensiblePressure1stMarke = 0; //sagt, ob regelung aktiv oder inaktiv, wegen Z-Limits
#endif // FEATURE_SENSIBLE_PRESSURE

#if FEATURE_SENSIBLE_COMPENSATION
long g_nSensibleCompensationSum = 0;
char g_nSensibleCompensationChecks = 0;
float g_nSensibleCompensationDigits = 0;
#endif // FEATURE_SENSIBLE_COMPENSATION

#if FEATURE_EMERGENCY_STOP_ALL
unsigned long g_uLastZPressureTime_IgnoreUntil = 0;
unsigned long g_uLastZPressureTime = 0;
Expand Down Expand Up @@ -3288,6 +3294,17 @@ void doHeatBedZCompensation( void )
nNeededZCompensation = g_staticZSteps;
}

long nNeededDigitCompensationSteps = 0;
#if FEATURE_SENSIBLE_COMPENSATION
//Etwa 5500 digits verursachen 0.055 mm tiefere nozzle: ca. 0.00001 = 1/100.000 mm pro digit.
//0.00001 ist vermutlich konservativ bis ok.
//Je höher die Kraft nach unten, desto mehr muss das Bett ausweichen: Z nach oben/+.

//VORSICHT: Die Messzellen könnten falsch verbaut sein, darum Digits immer positiv nutzen. Negative Digits würden sowieso in die falsche Richtung tunen. Ein kleiner Versatz der Nullposition wäre beim Druck egal.
nNeededDigitCompensationSteps = (long)(abs(g_nSensibleCompensationDigits) * (float)Printer::axisStepsPerMM[Z_AXIS] * 0.00001f);
#endif // FEATURE_SENSIBLE_COMPENSATION


#if DEBUG_HEAT_BED_Z_COMPENSATION
long nZDelta = Printer::compensatedPositionTargetStepsZ - nNeededZCompensation;

Expand All @@ -3310,7 +3327,7 @@ void doHeatBedZCompensation( void )
#endif // DEBUG_HEAT_BED_Z_COMPENSATION

HAL::forbidInterrupts();
Printer::compensatedPositionTargetStepsZ = nNeededZCompensation;
Printer::compensatedPositionTargetStepsZ = nNeededZCompensation + nNeededDigitCompensationSteps;
HAL::allowInterrupts();

return;
Expand Down Expand Up @@ -6533,6 +6550,19 @@ void loopRF( void )
}
#endif // FEATURE_SENSIBLE_PRESSURE

/* brief: This is for correcting sinking hotends at high digit values because of DMS-Sensor by Nibbels */
#if FEATURE_SENSIBLE_COMPENSATION
if(Printer::doHeatBedZCompensation){
g_nSensibleCompensationSum += pressure;
g_nSensibleCompensationChecks += 1;
if( g_nSensibleCompensationChecks >= 4 ){
g_nSensibleCompensationDigits = (float)(g_nSensibleCompensationSum / g_nSensibleCompensationChecks);
g_nSensibleCompensationSum *= 0.75;
g_nSensibleCompensationChecks *= 0.75;
}
}
#endif // FEATURE_SENSIBLE_COMPENSATION


if( g_nPressureChecks == EMERGENCY_PAUSE_CHECKS )
{
Expand Down
6 changes: 6 additions & 0 deletions Repetier/RF.h
Expand Up @@ -657,6 +657,12 @@ extern short g_nSensibleLastPressure;
extern char g_nSensiblePressure1stMarke; //sagt, ob regelung aktiv oder inaktiv, wegen Z-Limits
#endif // FEATURE_SENSIBLE_PRESSURE

#if FEATURE_SENSIBLE_COMPENSATION
extern long g_nSensibleCompensationSum;
extern char g_nSensibleCompensationChecks;
extern float g_nSensibleCompensationDigits;
#endif // FEATURE_SENSIBLE_COMPENSATION

#if FEATURE_FIND_Z_ORIGIN
extern volatile char g_nFindZOriginStatus;
extern long g_nZOriginPosition[3];
Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
@@ -1,3 +1,9 @@
V RF.01.37l.TDMod (2017-05-17)
- Testversion for automatic digit-compensation. The more force on the extruder, the more it will decrease in Z. This ist approx. 0.01mm / 1000 digits.
As we know the force on the extruder and the rate of decrease we compensate it within z-compensation.
See http://www.rf1000.de/viewtopic.php?f=72&t=1853 :D
Maybe this is bogus -> if not it will increase the quality of thin layer prints or small nozzle prints. It might even increase the digits-stability

V RF.01.37k4.TDMod (2017-05-16)
- fixed missing translations
- removed drive-free - i really dont want and need that!
Expand Down

0 comments on commit e4fba6b

Please sign in to comment.