PWM smoothing
« on: July 21, 2014, 10:01:06 AM »
hey all

I already start a tread for the automated motor fader i try to instal in my desk, but maybe the specific question I have right now is better posted here

System drive the motor with a PWM (PIC18F output) and H-bridge (L293D)
I want to smooth this PWM, to have more silent systeme, mechanical noise and also electronic noise leaking to my audio part of the fader
something like a variable DC relative to the PWM duty cycle

my question is simple, can I add an active LPF/integrator stage between PIC output and H-bridge?
Can I add resistive load to a PIC output?

best

Zam




Rochey

Re: PWM smoothing
« Reply #1 on: July 21, 2014, 10:19:12 AM »
no, it needs to be after the driver,

otherwise, you'll be driving the driver with analog signals, causing partial on/off and potentially causing cross conduction (shorting)
Expat Audio Home: http://www.expataudio.com

Re: PWM smoothing
« Reply #2 on: July 21, 2014, 12:30:08 PM »
tks Rochey i'm expecting you :)

You point me weeks ago to the uCApps system, and it's a really good advise, but I'm totally noob for all the soft side and digital component coming with, like PIC etc...
This system work fine, with HUI/MCU :)
But i'm not 100% happy with the driver side, for sure work fine with DAW remote system only, but as I have also audio in my fader, i need to improve noise

So the problem is the L293 input not the PIC output right ?

Now the following question is, can I have a resistive load at the L293 output ? and what kind of filter (active or not) can I hook between H-bridge out and motor, not to many current for AOP there ?

Or I can try the schematic suggested by a group member here http://groupdiy.com/index.php?topic=56212.msg723383#msg723383
can I hook this (Usoll) at the PIC output (and remove the L293D) ? this signal come from the processor board. analog mux/demux --> flip/flop--> intel MCU

Initially my question is about this schematic (but without the H-bridge on the right) hooked on my actual NG_MF board

--------

another noise problem (at audio side) is the 1K trig signal from the touch sensor, it's about 10dB over my noise floor with only one fader. But I will come back later for this one ....

best

Zam


Rochey

Re: PWM smoothing
« Reply #3 on: July 21, 2014, 12:40:13 PM »
do you mean that noise is coupling from the motor control into the audio band?

do you know what switcing frequency your controller is switching at?

You may need an LC filter (inductor and capacitor) at the output of the H driver.
Expat Audio Home: http://www.expataudio.com

Re: PWM smoothing
« Reply #4 on: July 21, 2014, 02:19:32 PM »
yes

I have 3 noises

1-mechanical/acoustic noise from motor and PWM (i can't imagine working in my room with 16 or 24 motofader like this...)
I improve this by hooking a 1000uF caps at the motor pin, but not a final solution as it is a polarized one
fader move smoother (keeping the fast move when needed) but target is less accurate.

2- coupling noise from motor into audio band (solution 1 improve this also)

3- 1kHz sensor trig, I have no idea for this one right now, it's a floating cable, i have to try a shielded cable, but if leaking is at the fader PCB and resistive track print i can do nothing.
1ms pulse is a bad choice (my opinion), i don't know if it's possible to change this a the soft/MIOS side, to something over 20khz, for the moment i have no answer from TK

about the frequency switching, for what I can tell, the board is fitted with 10MHz clock for the PIC,
For the PWM we have user parameter setting in the MF_NG tools, from 0.00ms to 12.75ms in 0.05ms steps
I have good result in fader speed/move and target reaching between 1 and 3 ms, voltage motor set to 7v at this point.
The best compromise I find for now.
I can also set the max and min duty for both up and down move.

do you have any starting point for the LC value, is that we call a snubber ?

I also have to say i "want" to smooth the PWM for noise, but also for better move of the fader, when I plug my motor to a 4.5V pure DC battery, it's fast, smooth and quiets at the same time.
Pure variable DC seem the solution, but maybe I dream white a PIC, PWM, and Hbridge.

best

Zam
« Last Edit: July 21, 2014, 02:47:35 PM by zamproject »

culteousness1

Re: PWM smoothing
« Reply #5 on: September 19, 2014, 11:16:11 AM »
Hi Zam,

what's the PWM's frequency, by the way? I may got an idea...

Best,
Carsten
"What's all this analog stuff anyhow?" - Bob Pease
"My favorite programming language is ... solder." - Bob Pease

joaquins

Re: PWM smoothing
« Reply #6 on: September 19, 2014, 02:35:41 PM »
Maybe too complicated but an option, take your PWM output and smooth it right away, then with a 555 or something like that you can make a PWM freq at 100kHz, controlled by your original PWM signal as analog, so now your high current is on higher freq. I assume you have protection diodes as recommended for this application, L293 doesn't have them inside.

The leaking of the driver noise into the audio could be bad PCB implementation, use different ground for digital and analog signals, they don't need to met each other on the fader PCB. For the cap in parallel, changing the freq will allow you to use smaller caps to get equivalent filtering. About the acoustical noise, you can get it better using acoustical damping, first in the mounting of the motor, then some acoustical insulation may help as well, inside a heavy box will be better than outside while prototyping. I would maybe damp the surface where the whole thing is mounted so your front panel (if it's thin) doesn't act as a speaker diaphragm.

Even if you change the freq to be outside the audio band, you may not listen to it directly anymore but may still be there, so I'd look for PCB implementation so you don't have your signal integrity compromised.

JS

If I don't know how it works, I prefer don't turn it on.

Re: PWM smoothing
« Reply #7 on: September 20, 2014, 10:35:32 AM »
what's the PWM's frequency, by the way? I may got an idea...

hello Carsten
As I say previously,  I can adjust from 0.05ms to 12.75ms so F is from 20K to 78Hz, not audio friendly at all

Maybe too complicated but an option, take your PWM output and smooth it right away, then with a 555 or something like that you can make a PWM freq at 100kHz, controlled by your original PWM signal as analog, so now your high current is on higher freq. I assume you have protection diodes as recommended for this application, L293 doesn't have them inside.

The leaking of the driver noise into the audio could be bad PCB implementation, use different ground for digital and analog signals, they don't need to met each other on the fader PCB. For the cap in parallel, changing the freq will allow you to use smaller caps to get equivalent filtering. About the acoustical noise, you can get it better using acoustical damping, first in the mounting of the motor, then some acoustical insulation may help as well, inside a heavy box will be better than outside while prototyping. I would maybe damp the surface where the whole thing is mounted so your front panel (if it's thin) doesn't act as a speaker diaphragm.

Even if you change the freq to be outside the audio band, you may not listen to it directly anymore but may still be there, so I'd look for PCB implementation so you don't have your signal integrity compromised.

JS

hello Joaquins

I use the L293D, diode inside.
At this time the only "board" that share audio and digital is the fader inside PCB with servo, touch and audio track

I'm in standby on this at the moment lot of work at the studio, and I decide after all test performed this summer that PWM and H bridge is not the solution for what i need... next step is an analog PI controller proto, i keep the MIOS system, so powerfull, the idea is to replace the PIC/H-bridge motor driver module by a DAC module, then I go to my analog motor driver.

Tks  for all suggestions !

best

Zam