Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Electronic Potentiometer

  1. Oct 21, 2016 #1
    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 gonna 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.
     
  2. jcsd
  3. Oct 21, 2016 #2

    berkeman

    User Avatar

    Staff: Mentor

    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?
     
  4. Oct 21, 2016 #3
    Well not exactly sure about the interface, but I am wanting to use the Arduino for that application if it helps.
     
  5. Oct 21, 2016 #4

    berkeman

    User Avatar

    Staff: Mentor

    What interfaces does the Arduino uC offer?
     
  6. Oct 21, 2016 #5

    berkeman

    User Avatar

    Staff: Mentor

  7. Oct 21, 2016 #6

    Averagesupernova

    User Avatar
    Gold Member

    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.
     
  8. Oct 21, 2016 #7
    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.

    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.
     
  9. Oct 21, 2016 #8

    berkeman

    User Avatar

    Staff: Mentor

    The MOSI and MISO pins are used for SPI communication (along with some Chip Select signals).
    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.
     
  10. Oct 21, 2016 #9
    Well, seeing as that is the easiest option, guess I'll go with that, thank you very much.
     
  11. Oct 22, 2016 #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.
     
  12. Oct 24, 2016 #11

    Baluncore

    User Avatar
    Science Advisor

    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
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Electronic Potentiometer
Loading...