Asked
Resolved Resolved by Athena AI!

DC Motor And Grinding Noise When PWM Is Used

or anyone else in the know. Can you help me with my problem I'm having? Please see below. I welcome any thoughts or suggestions. I'm not only asking for ideas but also writing this down to try to help myself understand what is happening amd maybe figure it out. A few odd things are happening

First, I've been using PWM to adjust the speed on a little gear motor for years without issue. My setup includes ARC sending a PWM signal to adjust the motors speed through a digital port of an EZB v4. The motor turns on through a homemade TIP transistor switch I made and will run at a speed set by the PWM signal sent. The motor, while it has always been a bit loud, it has run smoothly. Of course as the PWM was increased the motor got louder so I've been running the PWM at 20% as there was not a lot of increased speed that I could see above this setting. Also the motor ran a lot quieter in the robot then it did at 100%.

Recently, this motor started making ticking/grinding noises when the PWM is set between 10 and 80%. Any setting above or below that and the motor runs  and sounds as it usually did before these new developments.

My first thought was "Bad gear motor". However other odd things are happening to other devices. *I also have a light effect board sharing the same power feed that feeds the motor. This board will run a set light pattern for many LED lights in that part of the robot. It also lets me start up two seperate light effects to these lights by grounding two header pins on this board, one at a time. I do this using relays triggered from a script sent from ARC. ARC sends the commands through two digital ports. They are on the same EZB v4's that triggers the TIP transistor switch starting the PWM controlled motor. I've noticed that depending on the state of the relays (on or off, grounding the light effect board or not grounding) that sometimes the PWM motor will run properly and without the grinding noise at all. *Added to this, odd light effects happen to my controlled lights with the motor turned off but the lights run properly without issue with the motor running. *Another strange happening is that the relays controlling the grounding of the special light effects will trigger (without a command) when the motor starts.

I've read about PWM motor noise but people describe it as a whining or humming noise. My noise is a chatter, ticking noise. I've also read that perhaps I need to use a Logic controlled Mosfet when using PWM. I'm unsure what this all means but I'm using a TIP Transistor as a switch for the motor.  Any thoughts about these?

There are two sides to controlling this motor and light board. First is the power feed and the second is the control signals from the EZB. The power feed has both the light effect board and the motor on the same 12 volt DC circuit. The light board has a constant power feed and the motor is on the same circuit but is turned on and off by a TIP switch attached to an EZB Digital port. The Motor speed is controlled using ARC PWM settings. Then the light board grounding relays are turned on and off by two different Digital ports of the EZB.

My EZB Digital ports to control the motor and light effect relays are: *Grounding relay #1: D8 *Motor TIP transistor On/off switch: D9 *Grounding relay #2: D10

Again, everything seemed to be working as expected for a very long time then these odd things started happening. Any ideas, thoughts or insight is welcomed.


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

PRO
Canada
#1  

It sounds like you're experiencing a combination of electrical noise and potential interference issues. Here are some steps and suggestions to help diagnose and potentially resolve the problem:

1. Check Connections and Wiring

  • Loose Connections: Ensure all connections are secure. Loose connections can cause intermittent issues.
  • Shared Power Supply: Since the motor and light effect board share the same power supply, ensure the power supply can handle the combined load without voltage drops.

2. Electrical Noise and Interference

  • Decoupling Capacitors: Add decoupling capacitors (e.g., 0.1F ceramic capacitors) across the power supply lines of the motor and the light effect board to filter out noise.
  • Ferrite Beads: Use ferrite beads on the power lines to reduce high-frequency noise.
  • Shielded Cables: Use shielded cables for the PWM signal and other control lines to reduce electromagnetic interference (EMI).

3. Separate Power Supplies

  • Isolate Power Supplies: If possible, use separate power supplies for the motor and the light effect board to prevent noise from the motor affecting the light board.

4. Use a Logic-Level MOSFET

  • Replace TIP Transistor: Consider replacing the TIP transistor with a logic-level MOSFET. MOSFETs are generally more efficient and can handle higher currents with less heat dissipation.
  • Example MOSFET: IRLZ44N is a popular logic-level MOSFET that can be used for this purpose.

5. PWM Frequency

  • Adjust PWM Frequency: The default PWM frequency might be causing the motor to produce audible noise. Try adjusting the PWM frequency in ARC to see if it reduces the noise. You can do this by modifying the PWM settings in the ARC software.

6. Grounding Issues

  • Common Ground: Ensure that all components share a common ground to prevent ground loops, which can cause noise and erratic behavior.
  • Ground Loops: Check for ground loops and try to minimize them by having a single ground point.

7. Check for Faulty Components

  • Motor: Test the motor independently to ensure it is not faulty.
  • Relays: Ensure the relays are functioning correctly and not causing interference.

8. Software Configuration

  • Filters: Use the Filters robot skill to smooth out the PWM signal. This can help reduce noise and erratic behavior.
  • PWM Slider: Ensure the PWM Slider is configured correctly and not causing abrupt changes in the PWM signal.

Example Code for Using Filters

Here’s an example of how you can use the Filters robot skill to smooth the PWM signal:

// Initialize the filter with ID "motorFilter" and a dampen size of 4
MeanFilterInit("motorFilter", 4);

// Function to set PWM with filtering
function setFilteredPWM(port, value) {
    // Add the value to the filter and get the filtered value
    var filteredValue = MeanFilterAdd("motorFilter", value);
    // Set the PWM value to the filtered value
    PWM.set(port, filteredValue);
}

// Example usage
setFilteredPWM(D9, 50); // Set PWM to 50% with filtering

Additional Resources

Conclusion

By addressing potential electrical noise, ensuring proper grounding, and using appropriate components like logic-level MOSFETs, you can mitigate the issues you're experiencing. Additionally, using filters in your ARC project can help smooth out the PWM signal and reduce erratic behavior. If you continue to experience issues, consider isolating components and testing them individually to identify the root cause.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#2  

@Athena thanks for this info. I'm not aware of a Filters robot skill. Can you direct me as to where to find it or information about it?

PRO
Canada
#3  

I apologize for the confusion; there isn't a specific "Filters" robot skill in Synthiam ARC. However, you can implement filtering techniques directly in your scripts to smooth out the PWM signal.

Here’s how you can implement a simple moving average filter in JavaScript to smooth the PWM signal:

Implementing a Moving Average Filter

  1. Initialize the Filter: Create an array to store the last few PWM values and a function to calculate the average.

  2. Update the PWM Value: Each time you set a new PWM value, add it to the array, remove the oldest value if necessary, and calculate the average.

Example Code

Here’s an example of how you can implement this in JavaScript within ARC:

// Initialize the filter array and size
var pwmValues = [];
var filterSize = 5; // Adjust the size as needed

// Function to calculate the average of the array
function calculateAverage(values) {
    var sum = 0;
    for (var i = 0; i < values.length; i++) {
        sum += values[i];
    }
    return sum / values.length;
}

// Function to set filtered PWM
function setFilteredPWM(port, value) {
    // Add the new value to the array
    pwmValues.push(value);

    // Remove the oldest value if the array exceeds the filter size
    if (pwmValues.length > filterSize) {
        pwmValues.shift();
    }

    // Calculate the average value
    var averageValue = calculateAverage(pwmValues);

    // Set the PWM to the average value
    PWM.set(port, averageValue);
}

// Example usage
setFilteredPWM(D9, 50); // Set PWM to 50% with filtering

Steps to Use the Code

  1. Add the Script:

    • Open your ARC project.
    • Add a new JavaScript script.
    • Copy and paste the above code into the script editor.
  2. Modify the Script:

    • Adjust the filterSize variable to change the smoothing effect.
    • Use the setFilteredPWM function to set the PWM value with filtering.

Additional Resources

By implementing this filtering technique, you can smooth out the PWM signal and potentially reduce the noise and erratic behavior you're experiencing with your motor. If you have any further questions or need additional assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#4  

I'm posting to close this thread as resolved. After working on and off on this issue for the past week (mostly testing to learn) I think I have it fixed. Turns out there was a nasty ground loop or something to do with the DC voltage neutrals causing the problems. I had two AC to DC power supplies in my robot. The DC neutrals of each power supplies were not tied together thus making them isolated to each other. The motor and light controller board were on a different power supply from the EZB controlling them. Once I tied the DC neutrals of each power supply together the problems went away. All lights can now be controlled as designed and the PWM controlled motor runs quiet at all speeds.

I then went one step further and removed the second power supply and rerouted all power to the one main power supply. Since the main power supply could handle the extra load (which is actually only 1 amp peek) I didn't see the advantage of having two power supplies and complicating things. KISS id guess (Keep It Simple Stupid). LOL.;)

So all seems good now. Thanks.

#5  

Good job Dave, We all want to use the Kiss system early on but sometimes it takes the hard knocks of experience to make it all so obvious after the fact. The kicker is the answer probably came to you when you set it aside and let your brain unconsciously think about it.