To Shop Home

Serial DAC Project

I have VFD's driving the spindle motors for my Bridgeport and a couple of lathes. Other than some torque issues at low speed, they work pretty well. In addition to driving spindles, I found small VFD's on eBay cheap enough to use as three-phase converters for coolant pumps. They are proving to be quite handy. This page will contain the information I gather for developing an adapter between EMC and VFD's, or more generally, a DC analog adapter

My VFD's are set up to be controlled by a 0 to 10 Volt analog signal for speed and sinking Forward or Reverse to a Control Common terminal for rotation direction. An overview of my plan so far is shown below.

The DAC is a Linear Technologies LTC1257 12 bit unipolar converter. It has just the features I need, which helps to make it easier to implement than more complex DAC's. The software interface with EMC is an HAL component. It has an input pin for the value to convert to a binary bit stream output pin, plus output pins for Clock and Load*.

Timing Notes
serial_dac.comp HAL component file

I have a nearly working version of the software in the files above. There are a few issues that remain.

I made a mess of compiling the HAL component by using under-bars in my file and pin names. I removed the under-bars until I got the compile working. Ideally, I should review the documentation to get a better handle on the under-bar and dash issues. I will most likely get to it later than sooner.

I get "unrecognized type" errors when I try to use u32 in standard_pinout_dac.ini. I changed all u32's to s32's which stopped the type errors.

In order to output 12 bits, I needed to test for "cycle >= 12" in the serialdac.comp file. Since cycle is supposed to start at zero, I was expecting to test for "cycle >= 11".

The last issue that has cropped up so far, is that only the lower eight bits are getting through to the output. The most significant bit (MSB, bit 11) gets sent first, with the least significant bit (LSB, bit 0) sent last. The first four bits always come out as zero.

The Halscope screen shot below shows the last two issues.

Since 4095 is the highest value for datain, the dacbit trace above should be true all the way across. Counting the dacclock rising edges between dacload* falling edges, indicates twelve bits. This is what I want, but it seems to me, that I had to cheat to get it.

In addition to the above issues, I'll be working on ordering parts, breadboarding a prototype and laying out pc boards.

To Shop Home

Pages Created by Kirk Wallace

Copyright © 2006-7 WALLACE COMPANY
Rev. Date: 2007/12/22 18:44 PST KW