The Shop > Electronics & IC Programing
HELP: +/- Variable Voltage from uC
sparky961:
For the record, this is what I came up with today (attached). It seems to work well and I'm well on the way to implementing a PID control loop. You might see a project that uses these in the near future.
Thanks for all of the advice and suggestions. If anyone has a simpler idea that uses less components, speak up. :)
srm_92000:
Hi there,
From what you've done already you probably know this, but I just thought I'd say in case it had slipped by.
The thing is that you say you are using a PWM output which is not a 0 to 5v signal it is a 0 or 5v signal with the duty cycle of on-off changing, so the output would be a -10 to +10 PWM following(or maybe inverted) the input unless the incoming PWM is greatly smoothed and filtered to provide an average voltage output.
Hope this makes sense,
sparky961:
Thanks for pointing out this very important fact, Steve. Yes, I am indeed using an RC filter on the amplifier's input. I tried first to see how well it would work without the filter, but the motor was not running smoothly.
I've been working with microcontrollers for almost 15 years now, and on this project I'm trying out one of the Arduino compatible boards. From what I can see so far, "Arduino" could be replaced with "Microcontrollers for Dummies" because it greatly simplifies and glazes over some of the more difficult parts of microcontroller development.
Not that I'm complaining. It enabled me to get up and running very quickly with minimal screwing around with initialization and figuring out which bits I needed to tweak this way and that. While I was collecting information for this, I saw a posting online where someone said they were _surprised_ to learn that analogWrite() didn't actually output an analog signal, rather a square wave (aka PWM). Though I think it's good that more people are making things using microcontrollers, I'm afraid that there's going to be a lot of mistakes made because of false assumptions due to a lack of knowledge.
It's sort of like programming for a PC these days. Even I don't care much what's going on behind the scenes, though I do understand a lot of what goes on behind the scenes.
Thanks for putting up with my rant. :)
-Sparky
srm_92000:
Ah - good stuff,
I thought you might already have got this sorted.
I'm still stuck using pic's - too set in my ways on the wrong side of 50 so I just keep on using what I'm used to.
I quite fancy buying a raspberry pi though just to play with. I've got no idea what to use it for though so I can't justify the cost (not the thing itself, just all the add ons I know I'll need once I get one :thumbup:
Navigation
[0] Message Index
[*] Previous page
Go to full version