Feasibility - Four Wheel Robot Travel Straight with Steppers and Encoders

Hello,

So I currently built a four wheel robot (front two free spinning, back two driven by steppers) and despite my assumptions that the precision of stepper motors would lead it to maintain a straight path, it fails to do so consistently.

I have two high resolution encoders that I was hoping could provide feedback and thus yield continuous straight line motion, however I noticed most examples of encoder feedback (PID) loops are being used with DC motors.

Is it possible to achieve this result with steppers + encoders? Thanks !

You need to find out why it is not going in a straight line. If the wheels are slipping then an encoder will not help. If you are missing steps then an encoder will tell you this but it means you are trying to drive it too fast anyway.