Newbie question about controlling motors..

I have only recently started learning electronics and Arduino. I’ve been doing some experimenting with a DC Motor and an L298N motor driver. So far I’ve been able to control the speed (rpm) of the motor through PWM control…

I’m wondering if there’s a way to control the torque of the motor e.g.: increasing the torque without changing the RPM, increasing the RPM without increasing the torque, etc… I’ve been searching the internet for quite some time and I still haven’t found a solution to this… Hopefully someone here can help me with this! :slight_smile:

pixiecompact:
I'm wondering if there's a way to control the torque of the motor e.g.: increasing the torque without changing the RPM, increasing the RPM without increasing the torque, etc.

You can't change the torque without the RPM changing unless there is a greater load on the motor to match the greater torque.

You can create a program that will allow a motor to maintain a set speed even when the load changes (within the limits of the capability of the motor and its power supply), and the set speed can be changed at will.

It is much easier to help if you tell us about the project you want to create.

...R

If you want to control torque, you have to control (or measure) current through the motor,
as torque in a DC motor depends on current (or more often current depends on the torque
if the motor is naively driven).

If you have current sensing you can create a feedback loop to adjust PWM to hold torque
to a preset value (using a PID loop, typically).

If you have a constant current driver then you can directly set torque without needed
a control loop as the driver already is doing that for you.

If you have current sensing you can implement over-torque tripping, a useful thing
to have if you motor drives something that crashes into an end-stop

If you control the torque you cannot also control the RPM, that is then determined
by the load's response to the torque.

Typical current control feedback loops are run at high frequencies, 10kHz or more,
since in practice such a loop is often an inner control loop inside a velocity or position
feedback loop who's output is a torque value. Inner loops need to run faster than
the loops that control them (I think that's generally true).

Pixie, do you drive a car? The accelerator pedal is a torque control. Push the pedal further and you get more torque.

What happens next? The car accelerates. The speed changes. So no, in general you cannot control torque without affecting speed.