Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -rc9b434898a8bbe9143b243627ea081e5e0f7a861 -r8ac6dbd310f7408760e5cad232b1e9834882f739 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision c9b434898a8bbe9143b243627ea081e5e0f7a861) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 8ac6dbd310f7408760e5cad232b1e9834882f739) @@ -863,7 +863,7 @@ if ( commandedPositionEnum == VALVE_POSITION_B_OPEN ) { // Enable current relaxation - setFPGAValveSetPoint( valve, currentPosition, TRUE ); + setFPGAValveSetPoint( valve, targetPosition, TRUE ); } // Go back to Idle state @@ -1290,22 +1290,22 @@ // Subtract the defined number of steps for the next transition if ( commandedPositionEnum == VALVE_POSITION_B_OPEN ) { - valvesStatus[ valve ].targetPositionInCounts = getValvePositionCounts( valve ) + nextStep; + valvesStatus[ valve ].targetPositionInCounts = currentPosition + nextStep; } if ( commandedPositionEnum == VALVE_POSITION_C_CLOSE ) { - valvesStatus[ valve ].targetPositionInCounts = getValvePositionCounts( valve ) - nextStep; + valvesStatus[ valve ].targetPositionInCounts = currentPosition - nextStep; } break; case VALVE_POSITION_B_OPEN: // If the valve is currently in position B, subtract the defined number of steps for the next transition - valvesStatus[ valve ].targetPositionInCounts = getValvePositionCounts( valve ) - nextStep; + valvesStatus[ valve ].targetPositionInCounts = currentPosition - nextStep; break; case VALVE_POSITION_C_CLOSE: // If the valve is currently in position C, add the defined number of steps for the next transition - valvesStatus[ valve ].targetPositionInCounts = getValvePositionCounts( valve ) + nextStep; + valvesStatus[ valve ].targetPositionInCounts = currentPosition + nextStep; break; default: