[SOLVED] BrickPi Motors are not moving with speed < ~75 and are noisy


#1

Hi,
I just got an old BrickPi. Set up everything on my RPi and started coding. EDIT: It’s an BrickPi+

Now the BrickPi motors are not moving with a speed < 75 but make a high-pitched noise.
Also the motors are louder than when they are used with a NXT.

A friend of mine said it could be due to the PWM Frequency used by the BrickPi, is that correct?

Is there some way to make the motors move, even at low speed?

Thanks in advance!


#2

Hi @fabian.geiselhart,


A very important aspect is whether you’re using a BrickPi+ or a BrickPi3:

  • The BrickPi+ has a harder time keeping the motors work, especially when the batteries are rather low.

  • The BrickPi3 holds the speed better than the BrickPi+ across a whole range of voltages.

Because of this, the platform you’re using is really important.


On the other hand, it seems that older motors have this noise issue - so it’s by design.
You shouldn’t worry about it.


Thank you!


#3

The BrickPi+ uses a power scale of 0-255, so 75 is only about 30%. If your batteries are only at e.g. 7.2v (nominal voltage for 6 AA rechargeable cells), that’s an average of only abou 2.1 volts. This seems reasonable. BrickPi3 uses a power scale of 0-100 (percentage).

The BrickPi+ uses a low PWM frequency (490Hz if I remember correctly); certainly within hearing range (which is why you can hear them hum). BrickPi3 uses a PWM frequency of 20kHz, which is more like the NXT or EV3 (you can’t hear the PWM hum).


#4

@RobertLucian @Matt

I’m powering the motors over a 9V 4A power adapter, so there should be enough voltage. AND the motors really sound fine when being used with a NXT, so I don’t think it’s due to the motors.

Is there a way to patch the firmware to use the frequency of a BrickPi3? From what I understand the BrickPi is basically two Arduinos and H-Bridges ontop of the Raspberry Pi, so this should be possible. Otherwise I think I’ll just write my own firmware (since I use no sensors this shouldn’t be that complicated), is there a guide on BrickPi hacking or do I have to figure everything out myself (speaking of, is this about the BrickPi+ or the BrickPi3)?


#5

I’m powering the motors over a 9V 4A power adapter, so there should be enough voltage. AND the motors really sound fine when being used with a NXT, so I don’t think it’s due to the motors.

Is there a way to patch the firmware to use the frequency of a BrickPi3? From what I understand the BrickPi is basically two Arduinos and H-Bridges ontop of the Raspberry Pi, so this should be possible. Otherwise I think I’ll just write my own firmware (since I use no sensors this shouldn’t be that complicated), is there a guide on BrickPi hacking or do I have to figure everything out myself (speaking of, is this about the BrickPi+ or the BrickPi3)?

actually each single EV3 motor draws 600mA at free-wheel and up to 2A each under heavy load and especially when stalling. So given you are running 4 motors simultaneously under load, then up to 8A may be possible and your 4A power supply might become overloaded.Admittedly, for just 1 motor at 75/255 pwm that should be no issue IMO .
OTOH, the noise thing can be unpleasant even if it’s not supposed to cause severe issues. But IIRC, the BrickPi+ is controlled via UART by the Pi, not sure about pwm generation source though.
(hell, this editor is really annoying…)


#6

Under most circumstances a 9V 4A power supply should be adequate.

The PWM frequency is the same as Arduino, since the BrickPi+ is basically two arduinos with supporting circuits (for power, motors, sensors, etc.).

You’re welcome to write your own firmware, but other than the schematics, there isn’t much documentation for hacking the BrickPi+.

That schematic you linked to is for the BrickPi+. For reference/comparison, the BrickPi3 schematic can be found here.

The motors will run fine with a low PWM frequency (i.e. 490Hz); you’ll just be able to hear the PWM hum.


#7

the pwm base frequency for Arduino pwm pins is actually ~31kHz-62kHz (depending on pin numbers) which is always ultrasonic:

  • Base frequencies:
  •  o The base frequency for pins 3, 9, 10, and 11 is 31250 Hz.
    
  •  o The base frequency for pins 5 and 6 is 62500 Hz.
    

(ref.: https://playground.arduino.cc/Code/PwmFrequency)


#8

The PWM base frequencies are indeed about 31kHz and 62kHz, but the default divisors set the PWM frequencies to 490.2 and 976.5625. The clocks are used by more than just PWM, so things like millis, delay, servo, tone, etc. might stop working as expected if you change the divisors. See here for more details.


#9

I’m just writing my own firmware and changing the pwm solved the problem. I changed the frequency and now the motors sound better and I’m able to run them with a speed of 20 in idle. (Although senors don’t work anymore, but I don’t need them…)


#10