For a work school project of mine, I am trying to make a self-balancing robot. I am using these Pololu DC motors and my 4s Lithium Ion battery pack outputs 15.7V at a rated 2Ah. Currently I am using the L298N Motor Driver and a PWM signal from an Arduino Due to control the geared motors. I understand that effective voltage corresponds to RPM and effective current corresponds to motor torque. My teacher would strongly prefer I switch to a current-controlled driver instead so that I can vary motor torque as apposed to RPM. How do I go around doing this? What motor drivers vary current and keep voltage at a steady 12V?? I also need the driver to be bidirectional. Will this driver sold on Pololu work??
Basically you need a DC motor PWM control, as you already found out, you control the motor voltage. Then you do need to measure the current and control the current by controlling the voltage. For this purpose a PI controller in your MCU shall be used.