Controlling a servo-motor with different voltages for PWM and power supply

Thread Starter

Pabert

Joined Mar 8, 2020
20
Hello,

I have a quick question. I can't find the answer on internet.
I want to controll 4 SG90 Servo-motors (Here is the datasheet). My problem is that I will have PWM signals coming from a STM32 microcontrollers (so these PWM will be 3.3V) but the motors will have arround 5V or a bit more as power supply (anyway, more than 3.3V).
Is it possible to make them work with PWM voltages lower than their power supply ? Or do I have to find a way to "increase" the voltages of the PWM (and if so, how can I do this ? maybe with a pull-up resistor but I don't know the "risks" for the integrity of the signals) ?

Thanks in advance for your answers !
 

jpanhalt

Joined Jan 18, 2008
11,087
Since the signal is unidirectional, you can do it without active elements:
1583860352609.png

Although, for 4 servos, I would probably use the single chip solution. There are several out there.
 

Thread Starter

Pabert

Joined Mar 8, 2020
20
Thanks, I'll take a look at this one.
An other question comes to my mind using this kind of IC. I may plan to use a battery to power up the motors (the same battery than the one I talked about here : https://forum.allaboutcircuits.com/threads/battery-level-indicator-with-lm3914-need-help.167752/) but if I do so, the power supply voltage of the motors will not be constant (and I won't be able to use a voltage level translator as it seems to output a constant voltage, correct me if I'm wrong).
Is there a way to get a constant voltage to power up the motors (with 5V for example) from this battery, allowing me to use a voltage level translator for the PWM ?

Thanks again for your help.
 

jpanhalt

Joined Jan 18, 2008
11,087
Generally drone motors are controlled with PWM, not by setting a fixed voltage. The basic reasons are efficiency and high currents involved. Voltage is monitored to determine when to signal low battery and to cut-off, if programmed.

Logic and to a lesser extent servos do have voltage control. Many people underestimate the current servos can draw. In general, a switching regulator is used because the current can be quite high in some flight conditions of fixed wing drones. (NB: Any aircraft that can be remotely controlled is now called a "drone." Weight can be a factor in determining what license, if any is needed.)
 

Thread Starter

Pabert

Joined Mar 8, 2020
20
Yes but if I power up the motors with a battery, the battery voltage will vary, and thus I need the PWM voltage to vary according to it. Is there a way to have the same PWM voltage than the battery one even with variations or should I use a regulator between the battery and the motors + voltage level translator to have a constant 5V (or arround) for motors' power supply and PWM and if so, which one ?
 

jpanhalt

Joined Jan 18, 2008
11,087
Yes but if I power up the motors with a battery, the battery voltage will vary, and thus I need the PWM voltage to vary according to it. Is there a way to have the same PWM voltage than the battery one even with variations or should I use a regulator between the battery and the motors + voltage level translator to have a constant 5V (or arround) for motors' power supply and PWM and if so, which one ?
PWM is usually current mode. You are flying the drone, and are or should be able to react to changes in altitude, power, wind, temperature, etc. (i.e., flight conditions).
 

Thread Starter

Pabert

Joined Mar 8, 2020
20
Hello,

Sorry for the delay. I chose to use a STM8 instead of a STM32, allowing me to have a 5V PWM without having to use a voltage level translator.
Is it possible to find an IC (like a buck-boost) that would be able to output a constant 5V voltage with 2A (or even more) from a 4 cells NiMH battery to power up the motors and the STM8 ?
 
Last edited:

jpanhalt

Joined Jan 18, 2008
11,087
Lots of options. Check SparkFun and Adafruit for pre-built units at reasonable cost. I have used the ON Semi NCP1402. Minimal components. It seems to be a popular type of chip. In other words, equivalents made by other manufacturers.

Here's what I built for 5V:

1584554197144.png
 

Thread Starter

Pabert

Joined Mar 8, 2020
20
I see, but I would prefer an IC and not a pre-built unit. My goal is to have only one PCB board in the future, if possible of course.
I found this part : https://www.monolithicpower.com/en/...n/switching-regulators/buck-boost/mp8862.html but I don't understand the datasheet. I can't find whether it is able to output 5V from a varying 3.6-6V or not, because all the informations given by the datasheet are for a 12V input...

This part is from this list : https://www.monolithicpower.com/products/dc-dc-power-conversion/switching-regulators/buck-boost.html
 

jpanhalt

Joined Jan 18, 2008
11,087
It will be hard to find a boost IC complete with internal inductor. The NCP1402 is available separately. The IC's you link to all require external components and more that the NCP1402 (and similar) require.
 

jpanhalt

Joined Jan 18, 2008
11,087
My comment related specifically to this sentence:
I see, but I would prefer an IC and not a pre-built unit.
I interpreted that to mean you were looking for an IC that did the whole thing. I think it is very unlikely you will find such an IC; although, some packaged circuits ("power bricks") are quite small.

No doubt you are aware there is a huge number of IC's designed for building boost converters. Go to your favorite vendor and find something that meets your needs. You have yet to say how much current you need. In the fixed wing models I mentioned with up to 4-m wings and at least 6 servos for control surfaces, 6 A was pretty much a minimum. Your model will be considerably different.
 
Top