Fixed error with z-homing in previous release

Fixed a random hang after z-homing in the previous release. Also make Z
probe temperature coefficient default to zero always, and Z probe
calibration temperature default to current bed temperature always.
This commit is contained in:
David Crocker 2014-02-25 00:32:04 +00:00
parent 92c17dede2
commit 2b7b9fc505
6 changed files with 11 additions and 9 deletions

View file

@ -24,7 +24,7 @@ Licence: GPL
#define CONFIGURATION_H
#define NAME "RepRapFirmware"
#define VERSION "0.57o-dc42"
#define VERSION "0.57p-dc42"
#define DATE "2014-02-24"
#define LAST_AUTHOR "dc42"

View file

@ -923,7 +923,7 @@ bool GCodes::SetPrintZProbe(GCodeBuffer* gb, char* reply)
{
params.calibTemperature = gb->GetFValue();
}
else if (!PrintingAFile())
else
{
// Use the current bed temperature as the calibration temperature if no value was provided
params.calibTemperature = platform->GetTemperature(0);
@ -932,6 +932,10 @@ bool GCodes::SetPrintZProbe(GCodeBuffer* gb, char* reply)
{
params.temperatureCoefficient = gb->GetFValue();
}
else
{
params.temperatureCoefficient = 0.0;
}
platform->SetZProbeParameters(params);
}
else

2
Move.h
View file

@ -564,7 +564,7 @@ inline void Move::HitLowStop(int8_t drive, LookAhead* la, DDA* hitDDA)
{
// Executing G30, so set the current Z height to the value at which the end stop is triggered
// Transform it first so that the height is correct in user coordinates
float xyzPoint[3];
float xyzPoint[DRIVES + 1];
LiveCoordinates(xyzPoint);
xyzPoint[Z_AXIS] = lastZHit = platform->ZProbeStopHeight();
Transform(xyzPoint);

View file

@ -86,8 +86,8 @@ void Platform::Init()
nvData.gateWay = GATE_WAY;
nvData.zProbeType = 0; // Default is to use the switch
nvData.irZProbeParameters.Init(false);
nvData.ultrasonicZProbeParameters.Init(true);
nvData.irZProbeParameters.Init();
nvData.ultrasonicZProbeParameters.Init();
nvData.magic = FlashData::magicValue;
}

View file

@ -420,14 +420,12 @@ struct ZProbeParameters
float calibTemperature; // the temperature at which we did the calibration
float temperatureCoefficient; // the variation of height with bed temperature
void Init(bool isUltrasonic)
void Init()
{
adcValue = Z_PROBE_AD_VALUE;
height = Z_PROBE_STOP_HEIGHT;
calibTemperature = 20.0;
temperatureCoefficient = (isUltrasonic)
? 0.007575 // speed of sound correction assuming half wavelength between sensor and bed
: 0.0; // no default temperature correction for IR sensor
temperatureCoefficient = 0.0; // no default temperature correction
}
float GetStopHeight(float temperature) const