Index: firmware/App/Drivers/PinchValve.c =================================================================== diff -u -r17261d704df24e2cbb33f544af053d67262a9e28 -rcb993d86277143601d484b8b4d1229605e4b7395 --- firmware/App/Drivers/PinchValve.c (.../PinchValve.c) (revision 17261d704df24e2cbb33f544af053d67262a9e28) +++ firmware/App/Drivers/PinchValve.c (.../PinchValve.c) (revision cb993d86277143601d484b8b4d1229605e4b7395) @@ -31,7 +31,7 @@ #define PINCH_VALVE_COMMAND_TIMEOUT_MS 1000 ///< Maximum FPGA command execution time in milliseconds. #define PINCH_VALVE_MOTION_TIMEOUT_MS 10000 ///< Maximum allowed valve motion time in milliseconds -#define PINCH_VALVE_HOME_OFFSET 1300 ///< Offset (in encoder counts) from end of travel edge to set position B and C. +#define PINCH_VALVE_HOME_OFFSET 20 ///< Offset (in encoder counts) from end of travel edge to set position B and C. #define PINCH_VALVE_FPGA_CMD_START_BIT_MASK 0x01 ///< FPGA command register bit 0 used to start a command transaction #define PINCH_VALVE_FPGA_CMD_WRITE_ONLY_BIT_MASK 0x02 ///< FPGA command register bit 1 indicating a write only command. @@ -71,7 +71,7 @@ static const S32 H1_HOMING_VELOCITY_SECOND = 3342; ///< Second H1 homing movement velocity ( Forward Direction ) static const S32 H19_HOMING_VELOCITY_FIRST = 3342; ///< First H19 homing movement velocity ( Forward Direction ) static const S32 H19_HOMING_VELOCITY_SECOND = -3342; ///< Second H19 homing movement velocity ( Reverse Direction ) -static const S32 POSITION_VELOCITY = 50000; ///< Velocity used for normal stored position movement +static const S32 POSITION_VELOCITY = 100000; ///< Velocity used for normal stored position movement #define PINCH_VALVE_EVENT_MOTION_COMPLETE_MASK 0x0001 ///< Event Status bit 0: motion complete. #define PINCH_VALVE_EVENT_MOTION_ERROR_MASK 0x0010 ///< Event Status bit 4: motion error. @@ -135,8 +135,7 @@ typedef enum pinchValvePositionCommandIndexes { PINCH_VALVE_POSITION_CMD_RESET_EVENT_STATUS = 0, ///< Pinch valve position command reset event status - PINCH_VALVE_HOME_CMD_SET_VELOCITY, ///< Pinch valve position command set velocity - PINCH_VALVE_HOME_CMD_UPDATE, + PINCH_VALVE_POSITION_CMD_SET_VELOCITY, ///< Pinch valve position command set velocity PINCH_VALVE_POSITION_CMD_SET_POSITION, ///< Pinch valve position command set position PINCH_VALVE_POSITION_CMD_UPDATE, ///< Pinch valve position command update PINCH_VALVE_POSITION_CMD_GET_ACTIVITY_STATUS, ///< Pinch valve position command get activity status @@ -198,8 +197,7 @@ static PINCH_VALVE_COMMAND_T positionCommands[ NUM_OF_PINCH_VALVE_POSITION_COMMANDS ] = { { PINCH_VALVE_PMD_CMD_RESET_EVENT_STATUS, PINCH_VALVE_RESET_EVENT_STATUS_VALUE, 0, 0, 1, 0, TRUE }, // Clears event bits before position movement - { PINCH_VALVE_PMD_CMD_SET_VELOCITY, 0, 0, 0, 2, 0, TRUE }, // Sets the velocity used to move to positions - { PINCH_VALVE_PMD_CMD_UPDATE, 0, 0, 0, 0, 0, TRUE }, // Starts movement to the calculated position A. + { PINCH_VALVE_PMD_CMD_SET_VELOCITY, 0, 0, 0, 2, 0, TRUE }, // Sets position movement velocity { PINCH_VALVE_PMD_CMD_SET_POSITION, 0, 0, 0, 2, 0, TRUE }, // Writes the requested target encoder position { PINCH_VALVE_PMD_CMD_UPDATE, 0, 0, 0, 0, 0, TRUE }, // Starts movement to the requested position { PINCH_VALVE_PMD_CMD_GET_ACTIVITY_STATUS, 0, 0, 0, 0, 1, FALSE }, // Reads activity status after movement starts @@ -293,6 +291,7 @@ setSigned32CommandWords( &h19HomingCommands[ PINCH_VALVE_HOME_CMD_SET_VELOCITY_FIRST ], H19_HOMING_VELOCITY_FIRST ); setSigned32CommandWords( &h19HomingCommands[ PINCH_VALVE_HOME_CMD_SET_VELOCITY_SECOND ], H19_HOMING_VELOCITY_SECOND ); setSigned32CommandWords( &h19HomingCommands[ PINCH_VALVE_HOME_CMD_SET_VELOCITY_THIRD ], POSITION_VELOCITY ); + setSigned32CommandWords(&positionCommands[ PINCH_VALVE_POSITION_CMD_SET_VELOCITY ], POSITION_VELOCITY ); for ( valve = FIRST_VALVE; valve < NUM_OF_VALVES; valve++ ) {