I am currently working on a project that will allow me to simulate two independent Pot outputs with a single pot input. In practice this is rather easy however I have run into a snag where the servo motor that these pot's control behaves erratically. After some reading it seem's as though I need to filter the PWM output with an RC filter to produce a clean analog wave. The pot's are 0-5v out. I'm using an UNO
The problems I'm running into are such
I have the basic theory of the circuit down but my understanding stops there. From what I gather, the cap essentially act's as a buffer to the incoming signal and produces a solid analog signal. however what's interesting is that it seems as though I am "misusing" the circuit in the sense that technically a low pass filter is for use to filter out higher frequency's and the result that I am after is a bi product of the cut off point being reached and surpassed. Sound right?
While I loosely understand the equation to find the cut off point, the correlation between what this means to my sine wave, and what my values should be escape me. In other words while I know how to find the cutoff point, I am not sure what it should be. I have briefly looked into bode plots, however they are a bit complex for my skill level and I wouldn't trust them if I couldn't back it up with a scope anyway.
With scopes in mind, is there any other way to determine what kind of noise (not sure if I used that term correctly) I'm dealing with? or better yet how do I know I've got it right. I would prefer not use my servo as a giant fuse.
simulate two independent Pot outputs with a single pot input.
can you explain what you mean by this. Makes no sense to me.
Keith is correct that the signal going to a servo needs to have a specific pulse
waveform, and this is not available with the normal PWM outputs.
sounds like what you want to do is the following,
pot -> low-pass filter -> Arduino analog channel -> servo signal -> Servo
The low-pass filter is knocking the noise off of the pot voltage, but essentially allowing
the DC component through. Since you cannot move a pot wiper very fast, you can use
a low value for cutoff frequency, like maybe 2-Hz or so, and the noise should be very
small. A simple RC low-pass filter is shown here,
Try R=4.7K and C=16 uF from the following formula,
I know my terminology would get me in trouble, I was trying to be as specfic as possible.
I have a single sweep pot that has two 0-5v outputs. The pot is just a signal input to the module that control's the servo. The module is seeing the PWM and is causing the servo to act sporadically.
Dan,
Thanks for formula, however it seems that your under the impression that I'm trying to filter the signal in. This isn't the case, I am attempting to filter the signal out from the arduino. I think it's best to just disregard the servo all together. Simply put I need to generate two analog, noise free, 0-5v signal's that can be controlled by a pot running into the Arduino.
On a side note, I did purchase a 2 channel dig pot that would most likely work fine with out a low pass filter. (I have a clean reference voltage to work with) However I would like to try and pull this off just with the Arduino.
I have a single sweep pot that has two 0-5v outputs. The pot is just a signal input to the module that control's the servo. The module is seeing the PWM and is causing the servo to act sporadically.
This still makes no sense. Can you post a schematic or link to the module. If the following is what you
want, then just move the low-pass filter to the other side,
I have a single sweep pot that has two 0-5v outputs. The pot is just a signal input to the module that control's the servo. The module is seeing the PWM and is causing the servo to act sporadically.
This still makes no sense. Can you post a schematic or link to the module.
I agree about not sounding very logical. The pot is just sampling a percentage of the +5vdc wired to it so any 'noise' on it is the result of bad Vcc power or the lack of good cap bypass practice. First step I would take is put a good 0-scope on the pot's wiper signal and see what the signal looks like.
I think what he's trying to do is use the PWM ["analog out"] of the Arduino to replace the pot,
but doesn't have the PWM filtered properly, so the analog level is noisy and the servo jitters.
oric_dan(333):
I think what he's trying to do is use the PWM ["analog out"] of the Arduino to replace the pot,
but doesn't have the PWM filtered properly, so the analog level is noisy and the servo jitters.
Maybe.
And then what? Wiring the 'filtered pwm' back into an analog input pin? Well with no schematic drawing posted nor sketch code who the heck knows what he is trying to accomplish and the method being tried, certainly not me.
See this link, last calculator on bottom of page,
Try some different values of r/c to get what you want, you'll need to lookup the frequency you are pwming at(depends on pin)
just remember there's a tradeoff between ripple and response time,