From d530fb9d3c3084ba21a72d1746a091a28d4b469a Mon Sep 17 00:00:00 2001 From: kf Date: Mon, 23 Mar 2026 17:47:34 +0900 Subject: [PATCH 1/5] refactor: add descriptors --- src/Config.zig | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Config.zig b/src/Config.zig index 891a64f..621d976 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -521,6 +521,12 @@ pub const Info = struct { } = .{}, mechanical_angle_offset: Type = "f32", + __mechanical_angle_offset: Meta = .{ + .description = + \\Offset between the mechanical position reference and the electrical + \\phase angle. + , + }, axis: struct { length: Type = "f32", @@ -578,38 +584,45 @@ pub const Info = struct { }, max_current: Type = "f32", __max_current: Meta = .{ + .description = "Maximum motor coil current.", .unit_short = "A", .unit_long = "Ampere", }, continuous_current: Type = "f32", __continuous_current: Meta = .{ + .description = "Maximum continuous motor coil current.", .unit_short = "A", .unit_long = "Ampere", }, rs: Type = "f32", __rs: Meta = .{ + .description = "Linear Motor Resistance", .unit_short = "Ω", .unit_long = "Ohm (Line to Neutral)", }, ls: Type = "f32", __ls: Meta = .{ + .description = "Linear motor Inductance", .unit_short = "H", .unit_long = "Henry (Line to Neutral)", }, center: struct { kf: Type = "f32", __kf: Meta = .{ + .description = "Force Constant", .unit_short = "N/A_rms", }, } = .{}, between: struct { kf: Type = "f32", __kf: Meta = .{ + .description = "Force Constant", .unit_short = "N/A_rms", }, } = .{}, kbm: Type = "f32", __kbm: Meta = .{ + .description = "Back EMF Constant", .unit_short = "V/(m/s)", }, } = .{}, @@ -617,11 +630,16 @@ pub const Info = struct { sensor: struct { default_magnet_length: Type = "f32", __default_magnet_length: Meta = .{ + .description = "Default Carrier magnet length", .unit_short = "m", .unit_long = "Meter", }, ignore_distance: Type = "f32", __ignore_distance: Meta = .{ + .description = + \\Dead-Zone boundaries around permanent magnet boundaries where + \\sensor data is ignored + , .unit_short = "m", .unit_long = "Meter", }, @@ -629,6 +647,10 @@ pub const Info = struct { zero_position: Type = "f32", __zero_position: Meta = .{ + .description = + \\Distance from the start of the Line to the center of the first motor + \\coil. + , .unit_short = "m", .unit_long = "Meter", }, From 74a38b808434ed0bf453c0e2af51ab3d7458ccc7 Mon Sep 17 00:00:00 2001 From: kf Date: Tue, 24 Mar 2026 10:07:33 +0900 Subject: [PATCH 2/5] refactor: change descriptors for rs and ls --- src/Config.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Config.zig b/src/Config.zig index 621d976..149937f 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -596,13 +596,13 @@ pub const Info = struct { }, rs: Type = "f32", __rs: Meta = .{ - .description = "Linear Motor Resistance", + .description = "Stator Resistance", .unit_short = "Ω", .unit_long = "Ohm (Line to Neutral)", }, ls: Type = "f32", __ls: Meta = .{ - .description = "Linear motor Inductance", + .description = "Stator Inductance", .unit_short = "H", .unit_long = "Henry (Line to Neutral)", }, From 47dfdcaaa0e81b499fc6551da127fa56046cf6a2 Mon Sep 17 00:00:00 2001 From: kf Date: Tue, 24 Mar 2026 10:10:53 +0900 Subject: [PATCH 3/5] refactor: add Hall sensor descriptors --- src/Config.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Config.zig b/src/Config.zig index 149937f..749eb02 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -523,7 +523,7 @@ pub const Info = struct { mechanical_angle_offset: Type = "f32", __mechanical_angle_offset: Meta = .{ .description = - \\Offset between the mechanical position reference and the electrical + \\Offset between the mechanical position reference and the electrical \\phase angle. , }, @@ -659,11 +659,17 @@ pub const Info = struct { magnet_length: struct { backward: Type = "f32", __backward: Meta = .{ + .description = + \\Magnet length based on sensor readings in backward direction. + , .unit_short = "m", .unit_long = "Meter", }, forward: Type = "f32", __forward: Meta = .{ + .description = + \\Magnet length based on sensor readings in forward direction. + , .unit_short = "m", .unit_long = "Meter", }, From c69c5120f544000b74793fec54f0a0e81949f9d9 Mon Sep 17 00:00:00 2001 From: kf Date: Tue, 24 Mar 2026 10:28:22 +0900 Subject: [PATCH 4/5] refactor: change wording --- src/Config.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Config.zig b/src/Config.zig index 749eb02..40b31f8 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -648,8 +648,8 @@ pub const Info = struct { zero_position: Type = "f32", __zero_position: Meta = .{ .description = - \\Distance from the start of the Line to the center of the first motor - \\coil. + \\Distance from the start of the Line to the center of the first linear + \\motor. , .unit_short = "m", .unit_long = "Meter", From 517f602988a8aba26b93c45cfefd14449050b58d Mon Sep 17 00:00:00 2001 From: kf Date: Tue, 24 Mar 2026 16:32:50 +0900 Subject: [PATCH 5/5] refactor: review changes --- src/Config.zig | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Config.zig b/src/Config.zig index 40b31f8..0c3b840 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -523,8 +523,8 @@ pub const Info = struct { mechanical_angle_offset: Type = "f32", __mechanical_angle_offset: Meta = .{ .description = - \\Offset between the mechanical position reference and the electrical - \\phase angle. + \\Normalized angle offset between the magnet movement direction and + \\the sensor installation position. , }, @@ -596,15 +596,15 @@ pub const Info = struct { }, rs: Type = "f32", __rs: Meta = .{ - .description = "Stator Resistance", + .description = "Stator Resistance (line to neutral)", .unit_short = "Ω", - .unit_long = "Ohm (Line to Neutral)", + .unit_long = "Ohm", }, ls: Type = "f32", __ls: Meta = .{ - .description = "Stator Inductance", + .description = "Stator Inductance (line to neutral)", .unit_short = "H", - .unit_long = "Henry (Line to Neutral)", + .unit_long = "Henry", }, center: struct { kf: Type = "f32", @@ -637,8 +637,8 @@ pub const Info = struct { ignore_distance: Type = "f32", __ignore_distance: Meta = .{ .description = - \\Dead-Zone boundaries around permanent magnet boundaries where - \\sensor data is ignored + \\Distance a magnet needs to travel over the sensor before the + \\read data is valid to use. , .unit_short = "m", .unit_long = "Meter", @@ -648,8 +648,8 @@ pub const Info = struct { zero_position: Type = "f32", __zero_position: Meta = .{ .description = - \\Distance from the start of the Line to the center of the first linear - \\motor. + \\Distance the magnet must travel over the sensor from the backward position + \\of Axis 1 until its center aligns with the center of the Axis 1 motor. , .unit_short = "m", .unit_long = "Meter",