Can a MOSFET be used to replace a mechanical potentiometer in a PWM circuit?

In summary: If the uC is not going to drive the PWMs directly, you could use a DAC to make the threashold voltage instead, and set that via the uC. What interfaces does your uC have for communicating with several DACs (one per motor)? I2C? SPI? Parallel?I2C is possible, but might not be the best way to go. SPI might be a better choice as it is a serial interface and can handle more than one chip. Parallel would be a last resort.
  • #1
DarkBabylon
72
10
Hello, I've been wanted to make a PWM module for a DC motor for a micro controller powered quadcopter.
Now it might be easier to just punch the code for PWM, however I would like a voltage of more than 5 volts on the motor. That wouldn't be a problem to adjust the components and source.

The problem is that currently I am building the circuit in a simulator, and got stuck at a problem. The purpose of a PWM is to adjust it on the fly (literally) for a variable RPM and the circuit is currently built with a mechanical potentiometer. What I would like is to use transistors as they can act like a variable resistor, however I can't seem to think of a solution that doesn't involve op-amps and think there might be a more efficient solution. [Edit: I think maybe a MOSFET, but don't exactly know how they work.]

Here is a link to the circuit in question.
The 25 ohm resistor is the motor (don't know an equivalent circuit for a motor, so I just put a linear one, and going to test it later), using a darlington pair and a 555 timer.
The idea is to replace the potentiometer that controls the PWM, with a component or components to act like the potentiometer currently connected.
 
Engineering news on Phys.org
  • #2
DarkBabylon said:
Hello, I've been wanted to make a PWM module for a DC motor for a micro controller powered quadcopter.
Now it might be easier to just punch the code for PWM, however I would like a voltage of more than 5 volts on the motor. That wouldn't be a problem to adjust the components and source.

The problem is that currently I am building the circuit in a simulator, and got stuck at a problem. The purpose of a PWM is to adjust it on the fly (literally) for a variable RPM and the circuit is currently built with a mechanical potentiometer. What I would like is to use transistors as they can act like a variable resistor, however I can't seem to think of a solution that doesn't involve op-amps and think there might be a more efficient solution. [Edit: I think maybe a MOSFET, but don't exactly know how they work.]

Here is a link to the circuit in question.
The 25 ohm resistor is the motor (don't know an equivalent circuit for a motor, so I just put a linear one, and going to test it later), using a darlington pair and a 555 timer.
The idea is to replace the potentiometer that controls the PWM, with a component or components to act like the potentiometer currently connected.
If the uC is not going to drive the PWMs directly, you could use a DAC to make the threashold voltage instead, and set that via the uC. What interfaces does your uC have for communicating with several DACs (one per motor)? I2C? SPI? Parallel?
 
  • #3
Well not exactly sure about the interface, but I am wanting to use the Arduino for that application if it helps.
 
  • #4
DarkBabylon said:
Well not exactly sure about the interface, but I am wanting to use the Arduino for that application if it helps.
What interfaces does the Arduino uC offer?
 
  • #6
Some Microchip devices, maybe most of them for all I know, offer an output that is PWM. I have never used it in a finished application but have fiddled with it during design. If you are willing to use a PIC processor from MicroChip this would solve some of your problems. Certainly reduce the parts count.
 
  • Like
Likes berkeman
  • #7
berkeman said:
Looks like it at least has SPI (not sure how many chip enables it can offer, though)...

https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
I can't really speak in the language you are using. What I can say is that the Arduino (Uno, which I intend to use) is able to give a binary signal in the 14 pins it provides, and 8-bit PWM signals on 6 pins out of the 14. There is an ICSP interface which I have yet to learn about. Guessing that the ICSP is the serial interface you are referring.
TX and RX serial pins, 5 analog inputs with an additional reference pin and power pins.
The 14 digital I/O pins are effectively on and off switches, with only 6 having a PWM control.

Averagesupernova said:
Some Microchip devices, maybe most of them for all I know, offer an output that is PWM. I have never used it in a finished application but have fiddled with it during design. If you are willing to use a PIC processor from MicroChip this would solve some of your problems. Certainly reduce the parts count.
While the Arduino is able to provide the PWM signals in a good set of intervals, it is only able to provide a peak of 5 volts, and would like to use higher voltage motors, as they provide a bit more power than the 3.7-5 volt ones.
 
  • #8
DarkBabylon said:
I can't really speak in the language you are using. What I can say is that the Arduino (Uno, which I intend to use) is able to give a binary signal in the 14 pins it provides, and 8-bit PWM signals on 6 pins out of the 14. There is an ICSP interface which I have yet to learn about. Guessing that the ICSP is the serial interface you are referring.
The MOSI and MISO pins are used for SPI communication (along with some Chip Select signals).
DarkBabylon said:
While the Arduino is able to provide the PWM signals in a good set of intervals, it is only able to provide a peak of 5 volts, and would like to use higher voltage motors, as they provide a bit more power than the 3.7-5 volt ones.
You are not going to drive motors directly with the uC outputs. You will need buffer amps of some sort between the Arduino uC and the motors no matter what. So your best option is to use the built-in PWM generators, and add buffer amps outside to the motors. That will give you the fastest and most accurate control of the PWM drives to the motors.
 
  • #9
berkeman said:
You are not going to drive motors directly with the uC outputs. You will need buffer amps of some sort between the Arduino uC and the motors no matter what. So your best option is to use the built-in PWM generators, and add buffer amps outside to the motors. That will give you the fastest and most accurate control of the PWM drives to the motors.
Well, seeing as that is the easiest option, guess I'll go with that, thank you very much.
 
  • Like
Likes berkeman
  • #10
Microcontrollers typically provide a PWM module just for that purpose. I assume this is for a brushed DC motor. Brushless motors can be driven using an MCU and most ESCs use that method, but coding is pretty involved especially for BEMF sensing in lieu of mechanical rotor position sensing. For that you need a fairly fast MCU. There are brushless motor drivers that can do most of the heavy lifting for you such as the TI DRV8305, but typically brushless ESCs use a fully MCU based solution.

For a brushed DC motor you will need to use a MOSFET to provide the PWM drive. If you use an H bridge (four MOSFETs in a ladder) you can even reverse the motors if you want. In some cases you can drive the MOSFET gate directly off the MCU's output pin assuming low frequency and low MOSFET gate charge. If you have a need for a larger transistor having higher gate charge running at higher frequencies or if you need level shifting you would have to use a MOSFET gate driver which is a widely available component.
 
  • Like
Likes DarkBabylon
  • #11
You might consider a very small and light-weight “arduino trinket” that costs less than $10 and can generate a couple of PWM outputs.
With a Mosfet driver for your motor it will make a complete controller re-programmable in C via a USB connector.
It also has I2C data, SPI data input and A-D converters.
https://learn.adafruit.com/introducing-trinket/pinouts
 

1. What is an electronic potentiometer?

An electronic potentiometer is an electrical component that is used to measure and adjust the voltage or current in a circuit. It is also known as a digital potentiometer or digitally controlled potentiometer.

2. How does an electronic potentiometer work?

An electronic potentiometer works by using a series of resistors, switches, and digital signals to adjust the resistance in a circuit. The resistance is controlled by a microcontroller, which can be programmed to change the resistance in precise increments.

3. What are the advantages of using an electronic potentiometer?

One of the main advantages of using an electronic potentiometer is its precise and accurate control over resistance. It also allows for remote or automated control, making it useful in a variety of applications. Additionally, electronic potentiometers are more durable and have a longer lifespan compared to traditional potentiometers.

4. What are some common uses for electronic potentiometers?

Electronic potentiometers are commonly used in audio equipment, such as volume and tone controls. They are also used in instrumentation, robotics, and industrial control systems. They are also commonly used in research and development settings for testing and calibration purposes.

5. How do I choose the right electronic potentiometer for my project?

When choosing an electronic potentiometer, it is important to consider factors such as the required resistance range, power handling capacity, and accuracy. Also, consider the type of control interface (digital or analog) and the number of channels needed. It is best to consult with a supplier or do thorough research to ensure the electronic potentiometer meets the specific requirements of your project.

Similar threads

Replies
2
Views
803
  • Electrical Engineering
Replies
1
Views
809
  • Electrical Engineering
Replies
3
Views
1K
  • Electrical Engineering
Replies
3
Views
1K
  • Electrical Engineering
Replies
14
Views
6K
  • Electrical Engineering
Replies
9
Views
3K
  • Electrical Engineering
Replies
10
Views
845
  • Electrical Engineering
Replies
6
Views
2K
  • Electrical Engineering
Replies
11
Views
100K
Replies
68
Views
3K
Back
Top