What is a suitable frequency for 15V/3A DC motor? Is there any effect on the motor when the frequency is changing? I am confused with this until now and the Internet shows a lot of theory that confuses me.
There are three main issues with the PWM frequency for driving a motor:
- It must be fast enough so that the motor "sees" the average value and not the individual pulses. Motors have physical rotors that spin, the inertia of which will low pass filter the PWM. Usually 100 Hz or at most a few 100 Hz is good enough. Consider that many motors work fine when driven from a single phase of 50 or 60 Hz power.
- It must be slow enough so that switching losses are a small fraction of the overall power. Transistors don't go instantly between on and off state where the power dissipation is zero (for a ideal switch). In between the dissipation in the transistor will be signigicant. This can be a problem due to the wasted power, but usually the problem of getting rid of the waste heat arises before that. For example, at 500 mW you can let a TO-220 package cool itself in free air. At 2 W you have to do the math and consider cooling carefully.
- Depending on the application and the environment this motor will be installed in, you may need to consider whining. Even though 500 Hz may be plenty fast enough for the motor to average out, and 2 ms is a nice and slow switching time compared to the time of the transition region, it may cause audible whining. This can be quite irritating to humans, and is difficult to predict for any one motor. The magnetic fields caused by the coils will change with the current, which changes at the switching frequency. The force on individual wires of a winding is proportional to this magnetic field. Individual wires can vibrate much faster than the rotor as a whole can react. These winding and possibly other parts of the motor cause audible sound when vibrating. The sound is also proof of motion, which can eventually wear out insulation and the like.
There is no way to know how audible a motor will be at a particular frequency without trying it. A lot of motor drivers switch at just above the human hearing limit for this reason. For example, 24 kHz is a common switching frequency, especially for off the shelf motor controllers that aren't matched to a particular motor and application.
The frequency choice depends on the application requirements and the exact details of the motor. If you're only looking for someone to give you a number then picking a frequency just above the audible range is probably going to work. That said, let's try and understand some aspects of the theory.
Like any other repetitive signal we can look at the PWM as a sum of sine waves with different frequencies/phases. This paper gives the spectral analysis of a PWM signal. The tl;dr intuitive version of this is that there is a DC component (which varies linearly between your max and min voltage given 100% or 0% duty cycle respectively), the next component is at the PWM (aka fundamental) frequency (and is the largest) and then you have components at harmonics (multiples) of this PWM frequency with ever decreasing amplitude.
If we look at the motor as a device that converts current to torque and has a fixed resistance (so voltage to torque) and has a flat frequency response to an infinite frequency we would see an ever increasing velocity and ripples on that velocity at the various PWM frequencies. This is a first order approximation of what's going on and it will apply at very low velocities/frequencies/torque.
Let's talk a little bit about the size of those ripples in velocity and the relationship to frequency. Since you are applying
voltage==current==torque==angular acceleration*m in our little model here, the velocity is the integral of your signal (the area under the curve). We'll try and remember some of our math and the integral of
- 1/a * cos(ax) . The important takeaway here is that the velocity amplitude will decrease as the frequency (a) increases (a is 1 means 1 rad/s). If you're looking at the position you need to integrate again and so that will become even smaller (
1/a^2) as the frequencies increase.
So to summarize, a higher frequency will result in reduced velocity and position ripple of the load for purely mechanical reasons. Increasing the mass (moment of inertia) will also reduce the ripple (linearly). When your motor is running in air those mechanical ripples can result in a sound wave just like a speaker.
There are two big areas this model doesn't account for. One is back EMF, so as the motor runs faster your torque will effectively decrease. This is the primary reason why your load won't accelerate to an infinite velocity.
The second area is the electrical behaviour of the motor. (Oops, this is EE stack exchange). We can talk about the drivers and transistor switching behaviour but the main factor (given reasonably low frequencies) is usually the inductance and resistance of the motor coil. Those cause the motor to look like a low-pass filter with the exact frequency response dependent upon the motor's parameters. As derived here the time constant (time it takes the current to ramp up to maximum current) is the motor coil inductance divided by its resistance (
L/R). What that means is that higher frequencies are attenuated more than lower frequencies which is pretty convenient since we're really mostly interested in the DC component of the PWM. High performance motors are going to have a very wide frequency response (and may be driven with PWMs in the 100's of KHz) while lower performance motors will have a much lower cut-off frequency. When you are aiming for very high control bandwidth (e.g. in closed loop/servo applications) you want the highest possible PWM frequency since that will impact your current loop bandwidth.
Another note is that the various electrical components themselves will often vibrate at the drive frequency for various reasons (e.g. the coils have a force acting on them as well) so often the audible buzz comes from those rather than the load (which is often too damped/massive to make a lot of noise - unless you're driving a speaker!!!).
You can always dive deeper and model the physics more accurately but I think the above captures a reasonable first approximation that can be used to make an informed decision. In some systems you will definitely need to have a better understanding of the motor physics, the drive transfer function, transistor switching, friction, the load's stiffness/frequency response, feedback etc...