PDA

View Full Version : Analog Output Controller



Ironman
01-27-2009, 11:46 AM
Hey guys,

I'm on the Cornell Minesweeper team (http://minesweeper.engineering.cornell.edu/) and we are looking for microcontroller to control our motor drivers.

we need 3 digital outs , 2 digital ins and 1 analog output per motor. We'd like to have this all on one board.

any suggestions would be awesome.

however the analog output is key. If the board doesn't have it, it's of zero use to us.

Thanks
Ironman

jes1510
01-27-2009, 11:58 AM
I assume you mean an PWM output for the analog out. How much memory do you need? Speed? What language do you want to use?

The Arduino may fit the bill. It's programmable in C, has 4 hardware PWM, 6 A/D, and a crapload of digital pins.

Ironman
01-27-2009, 02:25 PM
no, i mean analog out, as in I need an analog signal

not square waves.

lnxfergy
01-27-2009, 02:31 PM
no, i mean analog out, as in I need an analog signal

not square waves.

PWM, when fast enough, looks and acts like analog. Put a capacitor on it if you need more smoothing.

-Fergs

jes1510
01-27-2009, 02:32 PM
Are you talking about a variable DC voltage? Sine generator? Triangle waves? Modulated RF?

Why do need such a thing and why will PWM not work?

Ironman
01-27-2009, 11:19 PM
we have a motor driver that has an analog input to control the speed. it says that it can be controlled via a potentiometer that changes between 0-5v.

we want a microcontroller that can replace the potentiometer.

not certain if the fast PWM values would work or not.

thanks for the ideas thus far.

Adrenalynn
01-28-2009, 12:58 AM
Honestly, I looked around for awhile and decided it was too much of a PITA for analog out to a big commercial motor controller that Ooops sent me. One of the issues I had was that everything was at 36v DC which just isn't going to go direct, so it has to be scaled in and out. What'd I do? I just put a micro servo on a potentiometer. Ya know what? It works darned well. Very smooth, very accurate.

For better accuracy and speed, you could even go with a tiny stepper motor, but that's additional complication, and I don't know that it's all that necessary.

Make fun of the "hillbilly engineering" if you must - but it's easy, fast, and works perfectly well. And it's ~$5 to replace the servo or $0.75 to replace the pot. At that kind of cost it's not like "oops! damn! I just killed my expensive MCU/board..."

metaform3d
01-28-2009, 03:07 AM
Make fun of the "hillbilly engineering" if you must - but it's easy, fast, and works perfectly well. And it's ~$5 to replace the servo or $0.75 to replace the pot. At that kind of cost it's not like "oops! damn! I just killed my expensive MCU/board..."F'ing-A. I suppose some kind of super-genius could get directly from A to C, but for my money if I know how to get from A to B and from B to C a little more legwork never hurt me.

Unless I had a weight budget of course. Then I'd be screwed.

Adrenalynn
01-28-2009, 12:43 PM
Actually, you wouldn't be screwed in a tight weight budget. You could just get a little more creative and pick up one of those cheapie little RC helicopters on sale for $7, a surface-mount pot for $0.85, turn the light on your 10 power magnifier, get out the tweezers and the hemostats, and epoxy one of the microscopic servos to the microscopic pot and you'd be in for some tiny fraction of an ounce of weight. The wire you solder on it would probably weigh more.

We as hobbyists can't manufacture stuff like that, but we sure as heck can "repurpose" it. I love repurposing stuff. Whenever I'm working on a project you'll find me flitting around Howes (Home Depot/Lowes - pronounced "Hoes" ;), picking up stuff in plumbing, then over to cabinetry to grab some drawer slides or screen-door guides, then ... Then I'm off to Toys R Us to rip apart some unsuspecting little toy, then over to the craft store, then ... If you capitalize on the amazing mad manufacturing sk1llz of some of this pre-made stuff, it's stunning what you can find ...

Oh - and that brings me to a practical point:

Most easily sourced pots have a large rotation range. My solution for mating them to a 100deg pot is to get a larger pot. If the original pot was a 10k, I'll get a 50k and just use 10k out of one end. The controller doesn't know the difference... Controllers have very low resolution anyway. Try finding one that has even 8 bits of [I]usable step. Most are practically 4-6bits because they smooth the input. In a human-interfaced pot-driven controller, there's a lot of dead-band because humans are noisy. That's less desirable to imitate in an MCU, so if you can steal the middle out of a pot you eliminate most of the dead-band with the "more accurate" MCU.

[Google Spellcheck doesn't like the word "repurpose". I think that says a lot. Whether it says it about me or Google is a project for the curious reader... :D]

Ironman
01-28-2009, 02:34 PM
a good solution, but not professional enough for our 30grand robot.

instead i believe we'll be going with this.
http://sine.ni.com/nips/cds/view/p/lang/en/nid/14604

although writing the code for your solution might actually be easier than interfacing with this device.

Adrenalynn
01-28-2009, 02:46 PM
That looks like a pretty good solution in the ~$300 range. I agree it would be a bit more of a challenge to code to, but it sounds like you guys will be up to the task. :) Thanks for sharing it! Please keep us updated on your progress!

lnxfergy
01-28-2009, 03:02 PM
That looks like a pretty good solution in the ~$300 range. I agree it would be a bit more of a challenge to code to, but it sounds like you guys will be up to the task. :) Thanks for sharing it! Please keep us updated on your progress!

Aren't you gonna need LabView software with that though, which is $999 to $2599 depending on configuration.

And correct me if I'm just being dense on this, but the analog is spec'd as 12-bit 150 S/s -- um 150 Samples per second?!? An AVR mega @ 16MHz, deriving 12-bit resolution from its 16-bit counter, could do 4kS/s... 150 sounds REALLY slow...

-Fergs

Adrenalynn
01-28-2009, 03:55 PM
Nod. But a university team is going to have LabView by default. It's a SchoolThang. :) They've pretty well saturated the educational system world-wide with LabView, IMHO.

150S/s is pretty slow but it's probably more than adequate for speed control, right? Do you really need to change speed more than 150x/sec?

Doing HV/high current analog output from an Arduino is going to be challenging in circuit design - unless there's some easy method I'm missing [entirely possible. My strengths are more digital electronics rather than analog electronics]

lnxfergy
01-28-2009, 04:48 PM
Nod. But a university team is going to have LabView by default. It's a SchoolThang. :) They've pretty well saturated the educational system world-wide with LabView, IMHO.

150S/s is pretty slow but it's probably more than adequate for speed control, right? Do you really need to change speed more than 150x/sec?

Doing HV/high current analog output from an Arduino is going to be challenging in circuit design - unless there's some easy method I'm missing [entirely possible. My strengths are more digital electronics rather than analog electronics]

The analog out on that device is only spec'd for 0-5V, 5-10mA though... so, same problem (In fact, that's probably a lower current than an AVR).

-Fergs

Adrenalynn
01-28-2009, 04:53 PM
Actually, that's a good point. I didn't pay enough attention to it 'cause I had thought that Ironman would. Maybe that's not a requirement with their controller and I'm just transplanting my own crosses to bear onto them. ;)

robologist
01-28-2009, 10:16 PM
Another possible is the Tini2138 or Pluga2138 ARM micros from New MIcros (http://newmicros.com/). Both have a single 10 bit DAC pin, though they are only 0 to 3.3 volts. Based on the NXP (Philips) LPC2138 micro.

jes1510
01-28-2009, 10:25 PM
I have no idea how much current you need to carry but would a digital pot work?

[Edit] If you need more current then a digital pot setup to control the gain of a common op-amp should work fine.

Ironman
02-07-2009, 03:40 PM
what do you mean by a digital pot? something that you could feed a PWM signal into and out comes an analog signal?

ultimately our goal was to design as little electronics as possible, because we have so much work to do.

that may have been a terrible call, because now that i'm looking at trying to interface with this NI thing...

they have a base software for it, but it's only in an .rpm and i need a .deb, so i'm going to have to convert it, and then idk what this base software looks like, if it's labview well then we're going to have a fun time finding a copy of it.

i'm really hoping for a C package.

it doesn't need to be high current, it's replacing the manual pot that is on the motor driver of squeaky.

jes1510
02-07-2009, 08:59 PM
I mean a digital potentiometer. They are serial driven (serial, I2C, etc) and have "taps" throughout the pot. For instance, a 10K pot with 1024 taps would have 1024 taps at around 9 ohms.

Put a regular pot on on the controller and measure the current going through the pot to find out if it's a viable solution since a digital pot is a low current device.

http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2556350&keywords=digital%20potentiometer