First, check the Whirlpool Duet Washer Job Aid for the meaning of the error codes, which you should include in your question.
That said, it might due to shaking from being out of balance. "The unbalance detection routine occurs.. while basket spin is accelerating from 40 to 400 rpm... If the Motor Control Unit senses an unbalanced condition, the drive motor is stopped."
A few likely causes of excessive shaking:
- There are two suspension springs. If one breaks, the drum tilts to one side and drops lower.
- There are four shock absorbers. Over time, they can deteriorate, causing excessive shaking.
- The drum bearing can be loose.
The first two can be easily fixed with comparatively inexpensive parts, using the Job Aid and readily-found online videos. Use caution, particularly with electrical safety and with spring replacement. This is not a good DIY project for a beginning learner.
However, replacing the drum and/or bearing are not a DIY project, nor is it inexpensive. For a 10 year-old washer, it's likely not worthwhile.