James Kuszmaul | d12497a | 2024-01-14 18:00:34 -0800 | [diff] [blame^] | 1 | namespace frc971.zeroing; |
| 2 | |
| 3 | table HallEffectZeroingConstants { |
| 4 | // The absolute position of the lower edge of the hall effect sensor. |
| 5 | lower_hall_position:double (id: 0); |
| 6 | // The absolute position of the upper edge of the hall effect sensor. |
| 7 | upper_hall_position:double (id: 1); |
| 8 | // The difference in scaled units between two hall effect edges. This is the |
| 9 | // number of units/cycle. |
| 10 | index_difference:double (id: 2); |
| 11 | // Number of cycles we need to see the hall effect high. |
| 12 | hall_trigger_zeroing_length:uint64 (id: 3); |
| 13 | // Direction the system must be moving in order to zero. True is positive, |
| 14 | // False is negative direction. |
| 15 | zeroing_move_direction:bool (id: 4); |
| 16 | } |
| 17 | |
| 18 | table PotAndIndexPulseZeroingConstants { |
| 19 | // The number of samples in the moving average filter. |
| 20 | average_filter_size:uint64 (id: 0); |
| 21 | // The difference in scaled units between two index pulses. |
| 22 | index_difference:double (id: 1); |
| 23 | // The absolute position in scaled units of one of the index pulses. |
| 24 | measured_index_position:double (id: 2); |
| 25 | // Value between 0 and .5 which determines a fraction of the index_diff |
| 26 | // you want to use. |
| 27 | allowable_encoder_error:double (id: 3); |
| 28 | } |
| 29 | |
| 30 | table EncoderPlusIndexZeroingConstants { |
| 31 | // The amount of index pulses in the joint's range of motion. |
| 32 | index_pulse_count:int (id: 0); |
| 33 | // The difference in scaled units between two index pulses. |
| 34 | index_difference:double (id: 1); |
| 35 | // The absolute position in scaled units of one of the index pulses. |
| 36 | measured_index_position:double (id: 2); |
| 37 | // The index pulse that is known, going from lowest in the range of motion to |
| 38 | // highest (Starting at 0). |
| 39 | known_index_pulse:int (id: 3); |
| 40 | // Value between 0 and 0.5 which determines a fraction of the index_diff |
| 41 | // you want to use. If an index pulse deviates by more than this amount from |
| 42 | // where we expect to see one then we flag an error. |
| 43 | allowable_encoder_error:double (id: 4); |
| 44 | } |
| 45 | |
| 46 | table PotAndAbsoluteEncoderZeroingConstants { |
| 47 | // The number of samples in the moving average filter. |
| 48 | average_filter_size:uint64 (id: 0); |
| 49 | // The distance that the absolute encoder needs to complete a full rotation. |
| 50 | one_revolution_distance:double (id: 1); |
| 51 | // Measured absolute position of the encoder when at zero. |
| 52 | measured_absolute_position:double (id: 2); |
| 53 | |
| 54 | // Treshold for deciding if we are moving. moving_buffer_size samples need to |
| 55 | // be within this distance of each other before we use the middle one to zero. |
| 56 | zeroing_threshold:double (id: 3); |
| 57 | // Buffer size for deciding if we are moving. |
| 58 | moving_buffer_size:uint64 (id: 4); |
| 59 | |
| 60 | // Value between 0 and 1 indicating what fraction of one_revolution_distance |
| 61 | // it is acceptable for the offset to move. |
| 62 | allowable_encoder_error:double (id: 5); |
| 63 | } |
| 64 | |
| 65 | table RelativeEncoderZeroingConstants {} |
| 66 | |
| 67 | table ContinuousAbsoluteEncoderZeroingConstants { |
| 68 | // The number of samples in the moving average filter. |
| 69 | average_filter_size:uint64 (id: 0); |
| 70 | // The distance that the absolute encoder needs to complete a full rotation. |
| 71 | // It is presumed that this will always be 2 * pi for any subsystem using this |
| 72 | // class, unless you have a continuous system that for some reason doesn't |
| 73 | // have a logical period of 1 revolution in radians. |
| 74 | one_revolution_distance:double (id: 1); |
| 75 | // Measured absolute position of the encoder when at zero. |
| 76 | measured_absolute_position:double (id: 2); |
| 77 | |
| 78 | // Threshold for deciding if we are moving. moving_buffer_size samples need to |
| 79 | // be within this distance of each other before we use the middle one to zero. |
| 80 | zeroing_threshold:double (id: 3); |
| 81 | // Buffer size for deciding if we are moving. |
| 82 | moving_buffer_size:uint64 (id: 4); |
| 83 | |
| 84 | // Value between 0 and 1 indicating what fraction of a revolution |
| 85 | // it is acceptable for the offset to move. |
| 86 | allowable_encoder_error:double (id: 5); |
| 87 | } |
| 88 | |
| 89 | table AbsoluteEncoderZeroingConstants { |
| 90 | // The number of samples in the moving average filter. |
| 91 | average_filter_size:uint64 (id: 0); |
| 92 | // The distance that the absolute encoder needs to complete a full rotation. |
| 93 | one_revolution_distance:double (id: 1); |
| 94 | // Measured absolute position of the encoder when at zero. |
| 95 | measured_absolute_position:double (id: 2); |
| 96 | // Position of the middle of the range of motion in output coordinates. |
| 97 | middle_position:double (id: 3); |
| 98 | |
| 99 | // Threshold for deciding if we are moving. moving_buffer_size samples need to |
| 100 | // be within this distance of each other before we use the middle one to zero. |
| 101 | zeroing_threshold:double (id: 4); |
| 102 | // Buffer size for deciding if we are moving. |
| 103 | moving_buffer_size:uint64 (id: 5); |
| 104 | |
| 105 | // Value between 0 and 1 indicating what fraction of one_revolution_distance |
| 106 | // it is acceptable for the offset to move. |
| 107 | allowable_encoder_error:double (id: 6); |
| 108 | } |
| 109 | |
| 110 | table AbsoluteAndAbsoluteEncoderZeroingConstants { |
| 111 | // The number of samples in the moving average filter. |
| 112 | average_filter_size:uint64 (id: 0); |
| 113 | // The distance that the absolute encoder needs to complete a full rotation. |
| 114 | one_revolution_distance:double (id: 1); |
| 115 | // Measured absolute position of the encoder when at zero. |
| 116 | measured_absolute_position:double (id: 2); |
| 117 | |
| 118 | // The distance that the single turn absolute encoder needs to complete a full |
| 119 | // rotation. |
| 120 | single_turn_one_revolution_distance:double (id: 3); |
| 121 | // Measured absolute position of the single turn encoder when at zero. |
| 122 | single_turn_measured_absolute_position:double (id: 4); |
| 123 | // Position of the middle of the range of motion in output coordinates. |
| 124 | single_turn_middle_position:double (id: 5); |
| 125 | |
| 126 | // Threshold for deciding if we are moving. moving_buffer_size samples need to |
| 127 | // be within this distance of each other before we use the middle one to zero. |
| 128 | zeroing_threshold:double (id: 6); |
| 129 | // Buffer size for deciding if we are moving. |
| 130 | moving_buffer_size:uint64 (id: 7); |
| 131 | |
| 132 | // Value between 0 and 1 indicating what fraction of one_revolution_distance |
| 133 | // it is acceptable for the offset to move. |
| 134 | allowable_encoder_error:double (id: 8); |
| 135 | } |