Skip to content

Commit da87aeb

Browse files
committed
UNTESTED: Hangprinter: Allow Hangprinter to be configured with 9 anchors
1 parent 3ce726d commit da87aeb

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/Movement/Kinematics/HangprinterKinematics.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
constexpr size_t DefaultNumAnchors = 4;
2121
// Default anchor coordinates
2222
// These are only placeholders. Each machine must have these values calibrated in order to work correctly.
23-
constexpr float DefaultAnchors[8][3] = {{ 0.0, -2000.0, -100.0},
23+
constexpr float DefaultAnchors[9][3] = {{ 0.0, -2000.0, -100.0},
2424
{ 2000.0, 1000.0, -100.0},
2525
{-2000.0, 1000.0, -100.0},
2626
{ 0.0, 0.0, 3000.0},
2727
{ 0.0, 0.0, 0.0},
2828
{ 0.0, 0.0, 0.0},
2929
{ 0.0, 0.0, 0.0},
30+
{ 0.0, 0.0, 0.0},
3031
{ 0.0, 0.0, 0.0}};
3132
constexpr float DefaultPrintRadius = 1500.0;
3233

@@ -86,13 +87,13 @@ void HangprinterKinematics::Init() noexcept
8687
* In practice you might want to compensate a bit more or a bit less */
8788
constexpr float DefaultSpoolBuildupFactor = 0.007;
8889
/* Measure and set spool radii with M669 to achieve better accuracy */
89-
constexpr float DefaultSpoolRadii[HANGPRINTER_MAX_AXES] = { 75.0, 75.0, 75.0, 75.0, 75.0, 75.0, 75.0, 75.0}; // HP4 default
90+
constexpr float DefaultSpoolRadii[HANGPRINTER_MAX_AXES] = { 75.0, 75.0, 75.0, 75.0, 75.0, 75.0, 75.0, 75.0, 75.0}; // HP4 default
9091
/* If axis runs lines back through pulley system, set mechanical advantage accordingly with M669 */
91-
constexpr uint32_t DefaultMechanicalAdvantage[HANGPRINTER_MAX_AXES] = { 2, 2, 2, 2, 2, 2, 2, 4}; // HP4 default
92-
constexpr uint32_t DefaultLinesPerSpool[HANGPRINTER_MAX_AXES] = { 1, 1, 1, 1, 1, 1, 1, 1}; // HP4 default
93-
constexpr uint32_t DefaultMotorGearTeeth[HANGPRINTER_MAX_AXES] = { 20, 20, 20, 20, 20, 20, 20, 20}; // HP4 default
94-
constexpr uint32_t DefaultSpoolGearTeeth[HANGPRINTER_MAX_AXES] = { 255, 255, 255, 255, 255, 255, 255, 255}; // HP4 default
95-
constexpr uint32_t DefaultFullStepsPerMotorRev[HANGPRINTER_MAX_AXES] = { 25, 25, 25, 25, 25, 25, 25, 25};
92+
constexpr uint32_t DefaultMechanicalAdvantage[HANGPRINTER_MAX_AXES] = { 2, 2, 2, 2, 2, 2, 2, 2, 4}; // HP4 default
93+
constexpr uint32_t DefaultLinesPerSpool[HANGPRINTER_MAX_AXES] = { 1, 1, 1, 1, 1, 1, 1, 1, 1}; // HP4 default
94+
constexpr uint32_t DefaultMotorGearTeeth[HANGPRINTER_MAX_AXES] = { 20, 20, 20, 20, 20, 20, 20, 20, 20}; // HP4 default
95+
constexpr uint32_t DefaultSpoolGearTeeth[HANGPRINTER_MAX_AXES] = { 255, 255, 255, 255, 255, 255, 255, 255, 255}; // HP4 default
96+
constexpr uint32_t DefaultFullStepsPerMotorRev[HANGPRINTER_MAX_AXES] = { 25, 25, 25, 25, 25, 25, 25, 25, 25};
9697
ARRAY_INIT(anchors, DefaultAnchors);
9798
numAnchors = DefaultNumAnchors;
9899
printRadius = DefaultPrintRadius;
@@ -677,8 +678,8 @@ void HangprinterKinematics::PrintParameters(const StringRef& reply) const noexce
677678
HangprinterKinematics::ODriveAnswer HangprinterKinematics::GetODrive3EncoderEstimate(DriverId const driver, bool const makeReference, const StringRef& reply, bool const subtractReference) THROWS(GCodeException)
678679
{
679680
const uint8_t cmd = CANSimple::MSG_GET_ENCODER_ESTIMATES;
680-
static CanAddress seenDrives[HANGPRINTER_MAX_AXES] = { 0, 0, 0, 0, 0, 0, 0, 0 };
681-
static float referencePositions[HANGPRINTER_MAX_AXES] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
681+
static CanAddress seenDrives[HANGPRINTER_MAX_AXES] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
682+
static float referencePositions[HANGPRINTER_MAX_AXES] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
682683
static size_t numSeenDrives = 0;
683684
size_t thisDriveIdx = 0;
684685

src/Movement/Kinematics/HangprinterKinematics.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class HangprinterKinematics : public RoundBedKinematics
5252

5353
private:
5454
// Basic facts about movement system
55-
const char* ANCHOR_CHARS = "ABCDEFHI"; // Skip the G, since it is reserved in G-code
56-
static constexpr size_t HANGPRINTER_MAX_AXES = 8;
55+
const char* ANCHOR_CHARS = "ABCDEFHIJ"; // Skip the G, since it is reserved in G-code
56+
static constexpr size_t HANGPRINTER_MAX_AXES = 9;
5757
static constexpr size_t A_AXIS = 0;
5858
static constexpr size_t B_AXIS = 1;
5959
static constexpr size_t C_AXIS = 2;

0 commit comments

Comments
 (0)