This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
reprapfirmware-dc42/DeltaParameters.h
David Crocker 6525a46a52 Version 1.09m
New features
============
The PWM frequency for the heated bed and for any heater used as a
chamber heater is now 10Hz for bettercompatibility with DC-AC SSRs.

The PWM frequency for fans is now configurable using the F paramete ron
the M106 command. The default is 500Hz, which gives esonable control of
fans not designed for PWM. Increase it to 25000Hz when using 4-wire PWM
fans.

When a Duet 0.8.5 board is configured or detected, the fan control is
now automatically inverted. If you previously used M106 P0 I1 in
config.g to invert it, you will need to remove that.

M579 (scale Cartesian axes) is now implemented (thanks chrishamm).

M114, M119 and M573 commands can now be executed concurrently with other
commands.

When DDA debugging is enabled, the debug output now includes all active
extruders instead of just the first two.

M408 S0 now includes the fan speeds (for PanelDue).

M119 now reports the Z probe as well as the endstop switch states.

A tool can now be defined even if a tool with the same tool number
exists already. The existing tool will be shut down and deleted.

The bed heater can now be disabled using M140 S-1 (thanks chrishamm).

The chamber heater (if present) and the endstop switch states are now
reported to the web interface (thanks chrishamm).

Increased defauklt Z prove dive height to 5mm.

Increased default PID Ki to 0.2

Bug fixes
=========
On a CoreXY machine, XY speeds were too low by a factor of sqrt(2).

On a delta machine, after running auto calibration the Z=0 height could
be slightly inaccurate, depending on the difference between the X and Z
endstop corrections

When using a non-intelligent modulated Z probe on a Duet 0.8.5, the
modulation pin number was incorrect.

The M27 (Report SD card print status) response was inverted compared to
what it should be. When in Marlin mode it now includes the "byte n/m"
field that some versions of Pronterface expect.

Cold extrusion prevention did not work - an error message was generated,
but the extruder was driven anyway.

M999 PERASE is now more reliable (thanks chrishamm).

M23, M30 and M32 commands did not work when the filename parameter
passed included an absolute path.

//A T command inside a macro file did not execute the tool change macros
files.

A memory leak occurred when a tool was deleted.

All moves are now completed before switching to CoreXY mode.

Polling requests from PanelDue were not relied to when a macro was being
executed

M667 with no parameters returned an incorrect string
2015-12-06 22:12:31 +00:00

74 lines
3.3 KiB
C++

/*
* DeltaParameters.h
*
* Created on: 20 Apr 2015
* Author: David
*/
#ifndef DELTAPARAMETERS_H_
#define DELTAPARAMETERS_H_
// Class to hold the parameter for a delta machine.
class DeltaParameters
{
public:
DeltaParameters() { Init(); }
bool IsDeltaMode() const { return deltaMode; }
float GetDiagonal() const { return diagonal; }
float GetRadius() const { return radius; }
float GetPrintRadius() const { return printRadius; }
float GetXCorrection() const { return xCorrection; }
float GetYCorrection() const { return yCorrection; }
float GetZCorrection() const { return zCorrection; }
float GetTowerX(size_t axis) const { return towerX[axis]; }
float GetTowerY(size_t axis) const { return towerY[axis]; }
float GetEndstopAdjustment(size_t axis) const { return endstopAdjustments[axis]; }
float GetHomedCarriageHeight(size_t axis) const { return homedCarriageHeight + endstopAdjustments[axis]; }
float GetPrintRadiusSquared() const { return printRadiusSquared; }
void Init();
void SetDiagonal(float d) { diagonal = d; Recalc(); }
void SetRadius(float r) { radius = r; Recalc(); }
void SetEndstopAdjustment(size_t axis, float x) { endstopAdjustments[axis] = x; Recalc(); }
void SetPrintRadius(float r) { printRadius = r; printRadiusSquared = r * r; }
float GetHomedHeight() const { return homedHeight; }
void SetHomedHeight(float h) { homedHeight = h; Recalc(); }
void SetXCorrection(float angle) { xCorrection = angle; Recalc(); }
void SetYCorrection(float angle) { yCorrection = angle; Recalc(); }
void SetZCorrection(float angle) { zCorrection = angle; Recalc(); }
float Transform(const float machinePos[AXES], size_t axis) const; // Calculate the motor position for a single tower from a Cartesian coordinate
void InverseTransform(float Ha, float Hb, float Hc, float machinePos[AXES]) const; // Calculate the Cartesian position from the motor positions
float ComputeDerivative(unsigned int deriv, float ha, float hb, float hc); // Compute the derivative of height with respect to a parameter at a set of motor endpoints
void Adjust(size_t numFactors, const float v[]); // Perform 3-, 4-, 6- or 7-factor adjustment
void PrintParameters(StringRef& reply) const; // Print all the parameters for debugging
private:
void Recalc();
void NormaliseEndstopAdjustments(); // Make the average of the endstop adjustments zero
const float degreesToRadians = PI/180.0;
const float radiansToDegrees = 180.0/PI;
// Core parameters
float diagonal; // The diagonal rod length, all 3 are assumed to be the same length
float radius; // The nominal delta radius, before any fine tuning of tower positions
float xCorrection, yCorrection, zCorrection; // Tower position corrections
float endstopAdjustments[AXES]; // How much above or below the ideal position each endstop is
float printRadius;
float homedHeight;
// Derived values
bool deltaMode; // True if this is a delta printer
float towerX[AXES]; // The X coordinate of each tower
float towerY[AXES]; // The Y coordinate of each tower
float printRadiusSquared;
float homedCarriageHeight;
float Xbc, Xca, Xab, Ybc, Yca, Yab;
float coreFa, coreFb, coreFc;
float Q, Q2, D2;
};
#endif /* DELTAPARAMETERS_H_ */