From aec742ece4589aa857926c16649a3be358a57c44 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 21 Aug 2021 22:05:53 -0400 Subject: angle: Initial support for angle sensor calibration Signed-off-by: Kevin O'Connor --- docs/API_Server.md | 3 ++- docs/Config_Reference.md | 7 +++++++ docs/G-Codes.md | 21 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/API_Server.md b/docs/API_Server.md index 8c3e966e..95f8a8d9 100644 --- a/docs/API_Server.md +++ b/docs/API_Server.md @@ -354,7 +354,8 @@ A request may look like: and might return: `{"id": 123,"result":{"header":["time","angle"]}}` and might later produce asynchronous messages such as: -`{"params":{"errors":0,"data":[[1290.951905,-5063],[1290.952321,-5065]]}}` +`{"params":{"position_offset":3.151562,"errors":0, +"data":[[1290.951905,-5063],[1290.952321,-5065]]}}` The "header" field in the initial query response is used to describe the fields found in later "data" responses. diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index 0add9aed..7fca3797 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -4007,6 +4007,7 @@ Magnetic hall angle sensor support for reading stepper motor angle shaft measurements using a1333, as5047d, or tle5012b SPI chips. The measurements are available via the [API Server](API_Server.md) and [motion analysis tool](Debugging.md#motion-analysis-and-data-logging). +See the [G-Code reference](G-Codes.md#angle) for available commands. ``` [angle my_angle_sensor] @@ -4017,6 +4018,12 @@ sensor_type: #sample_period: 0.000400 # The query period (in seconds) to use during measurements. The # default is 0.000400 (which is 2500 samples per second). +#stepper: +# The name of the stepper that the angle sensor is attached to (eg, +# "stepper_x"). Setting this value enables an angle calibration +# tool. To use this feature, the Python "numpy" package must be +# installed. The default is to not enable angle calibration for the +# angle sensor. cs_pin: # The SPI enable pin for the sensor. This parameter must be provided. #spi_speed: diff --git a/docs/G-Codes.md b/docs/G-Codes.md index 34234bfa..131ee6e8 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -106,6 +106,27 @@ VAL=`: Writes raw "value" into a register "register". Both "value" and "register" can be a decimal or a hexadecimal integer. Use with care, and refer to ADXL345 data sheet for the reference. +### [angle] + +The following commands are available when an +[angle config section](Config_Reference.md#angle) is enabled. + +#### ANGLE_CALIBRATE +`ANGLE_CALIBRATE CHIP=`: Perform angle calibration on the +given sensor (there must be an `[angle chip_name]` config section that +has specified a `stepper` parameter). IMPORTANT - this tool will +command the stepper motor to move without checking the normal +kinematic boundary limits. Ideally the motor should be disconnected +from any printer carriage before performing calibration. If the +stepper can not be disconnected from the printer, make sure the +carriage is near the center of its rail before starting calibration. +(The stepper motor may move forwards or backwards two full rotations +during this test.) After completing this test use the `SAVE_CONFIG` +command to save the calibration data to the config file. In order to +use this tool the Python "numpy" package must be installed (see the +[measuring resonance document](Measuring_Resonances.md#software-installation) +for more information). + ### [bed_mesh] The following commands are available when the -- cgit v1.2.3-70-g09d2