Slanted printing right before it gives this error is a damaged or dirty encoder strip and or bad encoder sensor. Clean the encoder strip with alcohol and if that doesn't fix the issue, I would replace the strip and be ready to replace the sensor if needed.