The F1 error code indicates a water level pressure transducer signal that is out of range. Here is a link for a previous answer regarding troubleshooting and repair for the F1 error code:
Why does my Whirlpool washer model WTW6500SW1 display the fault code F1?
The F51 error code indicates that the control board is not detecting the proper signal from the RPS (Rotor Position Sensor that monitors rpm's of the motor) sensor. This could be caused by an improper water fill level, an item stuck between the stainless steel spin basket and the plastic outer tub, an item under the washer that is interfering with motor spin, a failed RPS sensor, a wiring harness problem or a failed machine control board. Replacing the control board for the F1 problem described above may resolve the F51 error code problem at the same time.
I provided extensive technical troubleshooting information in the images below that a technician would use to diagnose and repair the F51 error code. If you have advanced technical skills and can use this information, you may be able to repair the washer yourself. This information is intended for technicians. Follow electrical safety guidelines when using this information. Be sure that you
unplug the washer
to disconnect electrical power before accessing internal components. Do not attempt any procedure that you are not completely confident that you can safely execute.
If you need more help, resubmit your question with additional details.
If you decide that you need a technician to service this washer, I recommend that you call the Whirlpool Customer Experience Center at 1-800-253-1301.