PDA

View Full Version : Digital to Analog Converter



kutsi
- 10th May 2007, 15:33
Hi all,

I'm working on a project,and using 18f4550. I'm designing a circuit board and planning to control a dc-motor. I would try pwm, instead my instructor wanted me to use DAC. Can you beriefly explain me, how should I choose DAC? For example I know AD converter ın PIC is 10 bits. Is it appropriate to use a 12 bit DAC? Thanks alot.

Acetronics2
- 10th May 2007, 15:55
Hi, Kutsi

You've two ways for the DAC ...

if using 8 bits output ( for a motor it's far enough !!! ) ... then use a full port with a 1% resistors R/2R ladder to generate the voltage output ... ( a little AOP buffer will make it perfect ... )
no need a MAX 512 or else here ...

if using more bits, a LTC 1257 or 1451 from Linear will work fine, you're not to use all your DAC resolution ... and can send two "0"s as LSBs past the ADC 10 bits you've read !!!

Alain

PS: PWM freq. to use depends upon the motor technology, but there's always some switching noise you can hear in the windings ... but low speed torque obtained is better ( easier to see smoke if overloaded too !!! )

DC won't produce any noise ... but will give poor starting torque, if there's no rpm regulation implemented. a current protection is easier to add in this way ...

ErnieM
- 10th May 2007, 20:33
To start, let’s assume your A/D (10 bits) is going to read some parameter, you make a calculation based on that info, spit that number to the D/A which sets how fast the motor runs.

At first glance, you’ll need a 10 bit max D/A to run the motor because that is all the accuracy you have, the 10 bits given by your A/D. However, if your motor doesn’t run linearly (such as it needs a few volts before it even starts to turn) you may be wasting D/A range to get past the dead zone. How accurately you need control the motor is gonna decide how many bits you need (so you'll have to give us more info for an informed choice). 8 bits as a starting point for experimentation isn't a bad choice.

I’m not one to reinvent wheels; you can buy a very well designed D/A for little more then some precision resistors will cost you to build the R/2R ladder, and it will perform better to boot. I’ve used a few of Maxim’s D/A chips with an I2C serial interface (basically serial data and clock). PBP had commands to run these off 2 PIC pins.

Maxim can be a problem to get parts if the major distributors don’t have it, they tend to long lead times with high min orders. I’m sure people here will offer you way too many alternatives if you ask. ;-)

mister_e
- 10th May 2007, 20:47
Maxim are a pain in the LA LA LA LA LA sometimes... they're also trigger happy to obsolete their parts.. at least those much specifics...

But i agree, 10 bits in, 10bit (or lower) out.

kutsi
- 10th May 2007, 23:18
Thanks for the tips. I will try them,and turn back with many other questions, I guess.

Acetronics2
- 11th May 2007, 08:47
Hi, Ernie

I do not know where you buy your resistors ...

but my 1% 100 ppm ones from RAMTRONICS cost me ... 1.8 cent/ unit !!!

" Hobbyist " price ... of course.

Alain

T.Jackson
- 11th May 2007, 09:42
You need more than just the resistors. You also need a suitable OP AMP for buffering. The more you Load the ladder down, the less usable resolution you'll have. R2/R ladders are old school stuff. Better to use the dedicated chip - having this knowledge is worth more.

Acetronics2
- 11th May 2007, 10:21
having this knowledge is worth more.


And YOU have it .... Super Trent !!!

LOL

Alain

J_norrie
- 27th June 2007, 19:17
Just an additional note I used the LTC1453 DAC and it was easy to use and worked great I used it to drive an analog devices 4-20mA convertor chip.

hope this is of some use to somebody.

thanks again for all your help and patience

************************************************** **************
'
'LTC1453 DAC Setup
output portC.5 'clock pin
output portA.2 'data pin
output portA.3 'CS/Load pin low to enable clock high to load data to dac output
symbol DCK = portc.5
symbol DDA = portb.0
symbol DCS = porta.2
DAOut var word ' daoutput variable
DAspan var word ' Da span adjust variable
Volt1 var word ' Raw data variable
' ----------------------------------------------------------------------------
' Get Load Value and output to DAC 0-2.5 vdc for range of 12 bits
' ----------------------------------------------------------------------------
DAC1: low DCS
DAout = volt1*DAspan ' voltage output raw signal scaling
DAout = div32 1000

shiftout DDA,DCK,1,[DAout\12]
HIgh DCS
return