diff options
author | David Crocker <dcrocker@eschertech.com> | 2017-08-26 23:31:47 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2017-08-26 23:32:00 +0300 |
commit | 7df2fe5e9a3387dbe00947dffe375b6443079b94 (patch) | |
tree | f033bbcaf41220ca93775756f011128b03b87c4c | |
parent | 2e967359f0b93c31437fdc4b7e93187a4ebbf050 (diff) |
Version 1.19.1v1.19.1
M208 XY limits are now applied to SCARA printers
Minimum limits are applied to M92, M291, M203 and M566 parameters
-rw-r--r-- | Release/RADDS/Edge/RepRapFirmware-RADDS-1.19.1.bin | bin | 0 -> 274916 bytes | |||
-rw-r--r-- | src/Movement/Kinematics/ScaraKinematics.cpp | 20 | ||||
-rw-r--r-- | src/Platform.cpp | 5 | ||||
-rw-r--r-- | src/Platform.h | 10 | ||||
-rw-r--r-- | src/Version.h | 4 |
5 files changed, 19 insertions, 20 deletions
diff --git a/Release/RADDS/Edge/RepRapFirmware-RADDS-1.19.1.bin b/Release/RADDS/Edge/RepRapFirmware-RADDS-1.19.1.bin Binary files differnew file mode 100644 index 00000000..74dceff8 --- /dev/null +++ b/Release/RADDS/Edge/RepRapFirmware-RADDS-1.19.1.bin diff --git a/src/Movement/Kinematics/ScaraKinematics.cpp b/src/Movement/Kinematics/ScaraKinematics.cpp index fe956355..8fd1cad2 100644 --- a/src/Movement/Kinematics/ScaraKinematics.cpp +++ b/src/Movement/Kinematics/ScaraKinematics.cpp @@ -180,7 +180,11 @@ bool ScaraKinematics::IsReachable(float x, float y) const // TODO take account of arm angle limits bool ScaraKinematics::LimitPosition(float coords[], size_t numVisibleAxes, AxesBitmap axesHomed) const { - bool limited = false; + // First limit all axes according to M208 + const bool m208Limited = Kinematics::LimitPosition(coords, numVisibleAxes, axesHomed); + + // Now check that the XY position is within radius limits, in case the M208 limits are too generous + bool radiusLimited = false; float x = coords[X_AXIS] + xOffset; float y = coords[Y_AXIS] + yOffset; const float r2 = fsquare(x) + fsquare(y); @@ -198,29 +202,23 @@ bool ScaraKinematics::LimitPosition(float coords[], size_t numVisibleAxes, AxesB x *= minRadius/r; y *= minRadius/r; } - limited = true; + radiusLimited = true; } else if (r2 > maxRadiusSquared) { const float r = sqrtf(r2); x *= maxRadius/r; y *= maxRadius/r; - limited = true; + radiusLimited = true; } - if (limited) + if (radiusLimited) { coords[X_AXIS] = x - xOffset; coords[Y_AXIS] = y - yOffset; } - // Limit Z and any additional axes according to the M208 limits - if (LimitPositionFromAxis(coords, Z_AXIS, numVisibleAxes, axesHomed)) - { - limited = true; - } - - return limited; + return m208Limited || radiusLimited; } // Return the initial Cartesian coordinates we assume after switching to this kinematics diff --git a/src/Platform.cpp b/src/Platform.cpp index 4159e983..90126cd1 100644 --- a/src/Platform.cpp +++ b/src/Platform.cpp @@ -1948,8 +1948,9 @@ void Platform::Diagnostics(MessageType mtype) const char* const reasonText = (reason == (uint32_t)SoftwareResetReason::user) ? "User" : (reason == (uint32_t)SoftwareResetReason::NMI) ? "NMI" : (reason == (uint32_t)SoftwareResetReason::hardFault) ? "Hard fault" - : (reason == (uint32_t)SoftwareResetReason::otherFault) ? "Other fault" - : "Unknown"; + : (reason == (uint32_t)SoftwareResetReason::stuckInSpin) ? "Stuck in spin loop" + : (reason == (uint32_t)SoftwareResetReason::otherFault) ? "Other fault" + : "Unknown"; MessageF(mtype, "%s, spinning module %s, available RAM %u bytes (slot %d)\n", reasonText, moduleName[srdBuf[slot].resetReason & 0x0F], srdBuf[slot].neverUsedRam, slot); // Our format buffer is only 256 characters long, so the next 2 lines must be written separately diff --git a/src/Platform.h b/src/Platform.h index 3c3e21da..d1fa886d 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -164,9 +164,9 @@ enum class SoftwareResetReason : uint16_t erase = 0x10, // special M999 command to erase firmware and reset NMI = 0x20, hardFault = 0x30, // most exceptions get escalated to a hard fault + stuckInSpin = 0x40, // we got stuck in a Spin() function for too long otherFault = 0x70, inAuxOutput = 0x0800, // this bit is or'ed in if we were in aux output at the time - stuckInSpin = 0x1000, // we got stuck in a Spin() function for too long inLwipSpin = 0x2000, // we got stuck in a call to LWIP for too long inUsbOutput = 0x4000 // this bit is or'ed in if we were in USB output at the time }; @@ -974,7 +974,7 @@ inline float Platform::DriveStepsPerUnit(size_t drive) const inline void Platform::SetDriveStepsPerUnit(size_t drive, float value) { - driveStepsPerUnit[drive] = value; + driveStepsPerUnit[drive] = max<float>(value, 1.0); // don't allow zero or negative } inline float Platform::Acceleration(size_t drive) const @@ -989,7 +989,7 @@ inline const float* Platform::Accelerations() const inline void Platform::SetAcceleration(size_t drive, float value) { - accelerations[drive] = value; + accelerations[drive] = max<float>(value, 1.0); // don't allow zero or negative } inline float Platform::MaxFeedrate(size_t drive) const @@ -1004,7 +1004,7 @@ inline const float* Platform::MaxFeedrates() const inline void Platform::SetMaxFeedrate(size_t drive, float value) { - maxFeedrates[drive] = value; + maxFeedrates[drive] = max<float>(value, 1.0); // don't allow zero or negative } inline float Platform::ConfiguredInstantDv(size_t drive) const @@ -1014,7 +1014,7 @@ inline float Platform::ConfiguredInstantDv(size_t drive) const inline void Platform::SetInstantDv(size_t drive, float value) { - instantDvs[drive] = value; + instantDvs[drive] = max<float>(value, 1.0); // don't allow zero or negative values, they causes Move to loop indefinitely } inline void Platform::SetDirectionValue(size_t drive, bool dVal) diff --git a/src/Version.h b/src/Version.h index 30779646..638a0373 100644 --- a/src/Version.h +++ b/src/Version.h @@ -9,11 +9,11 @@ #define SRC_VERSION_H_ #ifndef VERSION -# define VERSION "1.19+3" +# define VERSION "1.19.1" #endif #ifndef DATE -# define DATE "2017-08-25" +# define DATE "2017-08-26" #endif #define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman" |