hardware/gantry_tuning.h

Gantry capability probe + persistent motion profile.

This is the software half of the “tuning mode” plan (docs/gantry-tuning-docs/PLAN.md). It is deliberately hardware-free and stateless so the parsing/serialization logic is unit-testable without a serial port:

Phase 0 GrblCapabilities + parseCapabilities() — what firmware/driver is on the other end of the wire ($I / $$ read-back). Phase 1 MotionProfile — the Kirin-side source of truth for feedrate + GRBL motion settings, saved/loaded so a tuned profile survives restarts.

The serial round-trips that produce the inputs to these functions live on Gantry::GrblController (gantry_controller.h).

namespace Gantry
struct GrblCapabilities
#include <gantry_tuning.h>

Public Functions

inline bool hasSetting(int n) const
double setting(int n, double fallback = 0.0) const
std::string summary() const

Public Members

bool responded = false
std::string firmwareName
std::string version
bool isGrblHAL = false
bool tmcDetected = false
std::vector<std::string> buildOptions
std::map<int, double> settings
struct MotionProfile
#include <gantry_tuning.h>

Public Functions

std::vector<std::string> toGrblCommands() const
std::string serialize() const
bool save(const std::string &path) const

Public Members

double feedRate = 1000.0
double maxRateX = 0.0
double maxRateY = 0.0
double accelX = 0.0
double accelY = 0.0
double junctionDeviation = -1.0
double runCurrentMaX = 0.0
double runCurrentMaY = 0.0
double holdCurrentPct = 0.0
bool stealthChop = false

Public Static Functions

static MotionProfile deserialize(const std::string &text)
static bool load(const std::string &path, MotionProfile &out)