# What is the exact formula relating a DC motor's input voltage and torque produced?

I'm trying to control a 12V geared DC motor with encoder through an Arduino by an L298D driver for my self balnace bot.

Based on the angles from the attached gyro sensor and encoder, it calculates the correcting torque by an LQR controller.

I need to produce this calculated torque by PWM of Arduino through the motor driver.

$$T=K_t\cdot i$$

Torque is proportional to the current, the torque constant $$\K_t [Nm/A]\$$ specifies the relation .

There is no direct formula for the voltage relation.

simulate this circuit – Schematic created using CircuitLab

Voltage to current relation, with inductivity neglected

$$V_a = R_a\cdot i_a+\Omega\cdot K_v$$

Voltage to current relation, with inductivity into account $$V_a = R_a\cdot i_a + L_a\dfrac{di_a}{dt} + \Omega\cdot K_v$$

You have also a transfer function, if it can help : https://electronics.stackexchange.com/a/262069/82111

• is there a relation between i (armature current)and Vin? – user160452 Feb 5 at 12:22
• habr.com/en/post/220989 – user160452 Feb 5 at 12:23
• im sorry to inform the above answers didnt help my case as i need to apply a specific voltage at motor terminal to get intended torque output. Can i assume a linear approx b/w Vin and o/P Torque? Because i need to code it in arduino – user160452 Feb 5 at 13:41
• Torque of a DC motor is not linearly related to voltage, but average current. So control the current linearly by varying the PWM duty cycle percentage. i.e. when pivoting "backwards", increase PWM and when forwards - decrease PWM. Note this is a four-quadrant problem - the L298D needs to +/- PWM in both forwards and reverse. The goal is, each PWM being 0 to achieve balance. – rdtsc Feb 5 at 14:02
• @user160452 NO, there is no relation between input voltage and torque. There is a relation between input voltage, motor speed and torque. If you assume a constant speed, maybe full speed, maybe stall, then you could write down a voltage/torque relation, but it would break as soon as the speed varied. – Neil_UK Feb 5 at 14:03