Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -ra0b8983fa00aa8e2e8ec74744978cffaa4011dcd -rdcc1278c9008ca5169a5d7b7f11e50e471af16b6 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision a0b8983fa00aa8e2e8ec74744978cffaa4011dcd) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision dcc1278c9008ca5169a5d7b7f11e50e471af16b6) @@ -43,7 +43,7 @@ #define VALVE_FORCE_HOME TRUE ///< Force valve to home even if already homed. #define ZERO_ENC_DEBOUNCE_THRESHOLD_CNT 5 ///< Valves zero encoder debounce threshold count. #define ZERO_ENC_DEBOUNCE_TIMEOUT_MS ( 0.25 * MS_PER_SECOND ) ///< Valves zero encoder debounce timeout in milliseconds. -#define VALVE_OFFEST_FROM_EDG_CNT 320 ///< Valves offset from the edge. +#define VALVE_OFFEST_FROM_EDG_CNT 296 ///< Valves offset from the edge. #define POS_C_FROM_ZERO_CNT VALVE_OFFEST_FROM_EDG_CNT ///< Position C from zero position in counts. #define POS_D_PARTIAL_CLOSE_FROM_ZERO_CNT ( POS_C_FROM_ZERO_CNT + 32 ) ///< Position D partial close from zero position in counts. @@ -716,14 +716,8 @@ *************************************************************************/ static S16 convertCountToDivision8( S16 count ) { - S16 convCount = 0; + S16 convCount = ( count >> 3 ) << 3; - // If position A was calculated to not be a division of 8 it is rounded down to be a division of 8 - if ( ( count % ROTARY_VALVE_MICROSTEP_FRACTION ) < 4 ) - { - convCount = ( count >> 3 ) << 3; - } - return convCount; }