cvra / motor-control-board

DC Motor Controller with CAN Interface. CC-BY 4.0
Other
12 stars 6 forks source link

Higher PWM frequency limit #3

Open antoinealb opened 9 years ago

antoinealb commented 9 years ago

The current max PWM frequency is about 2.5 kHz, due to a problem in the current measurement circuit. Having a limit > 20kHz would be nice for noise purposes.

Stapelzeiger commented 9 years ago

should be fixed now

antoinealb commented 9 years ago

Could you explain the problem quickly ?

Stapelzeiger commented 9 years ago

Previously the current sense resistor was connected to one of the mosfet half bridge outputs in series with the dc motor. This caused a problem when this half bridge was active, doing PWM since the common mode voltage of the sense resistor switches between zero and 15V. The amplifier we are using has a good common voltage rejection, but only statically. For a step in common mode voltage, the output makes a pulse of about 10us length. (see Datasheet page 6, figure 3-6) For 25kHz (period of 40us) PWM this disturbance is significant. This is why current sense only worked for low (around 2kHz) frequencies. Now the sense resistor is in series with the supply (on the high side) and is therefore not exposed to common voltage steps. Using this configuration we'll need to compensate for the fact that during PWM off time, the measured current is zero even though the current in the motor stays (almost) constant.

SyrianSpock commented 9 years ago

There are 3 ways of measuring current in the motor:

Both last solutions increase ground resistance, but this is negligible since our shunt is 10mOhm. They also don't allow to measure the current continuously since you can't monitor the current that flows from the diode to the motor so you need to compensate for that in the software.

I think the solution proposed is the best that can be done to ensure that the fewest changes to the design so we don't need to spend a lot of time reviewing and we can keep the stencil.