Digital counter to sinewave + phase angle

Status
Not open for further replies.

Prototyp_V1.0

Advanced Member level 2
Joined
Apr 3, 2007
Messages
673
Helped
119
Reputation
238
Reaction score
83
Trophy points
1,308
Location
Norway
Activity points
5,103
Hi. I'm trying to plan a quite large DIY project. I'm aware that what I'm trying to do could possible be impossible to achieve. Well here's the plan:

I want to make a circuit having TWO sinus outputs, let's call them sin1 and sin2. sin2 shall be about 90 deg after sin1.
Finally I'll use those two voltages to have very fine control of a stepper motor.

Here's how I imagine how the circuit is put together:

1* (this is where I need help)
A regular 4-bit BCD-counter turn off and on four transistors (could be H-bridges) connected to an resistor grid. This will generate an analog output voltage. Problem here is - I don't know how to get that voltage somewhere similar to a sinus - I could need some hint here.

2*
Next step (if I succed making a R-grid that can provide almost sinus output) is to connect the BCD-counter to an adder. Output from the adder shall be connected to an identically R-grid as the counter itself. This will provide an output voltage sin2 that has a phase angle with respect of sin1, where the phase angle is decided by a static bcd-value into the adder.

3*
Aditional amplifier stage will be planned only after stage 1 and 2 is being realized. Not discussed now.
To go easy and just make an easy sinus generator is not an option, because I need to be able to stop oscillation at any time, that is f=0. That could only be done by a counter and DA converter.


I also tried to figure out if this could be achieved by using a johnson "counter" and a R-grid. I didn't manage to get anywhere near sinus.
Also I tried to set up a spreadsheet to calculate different output voltages from a R-grid and BCD-counter using different values for the resistors. I managed to get triangle wave, exponential-like output, but nowhere near sinus :x

The regular R/R2 networ only allow me to make triangle-alike output. I /could/ theoretically be able to get there using only triangle wave (two, with phase angle), but the idea about having precise control of a stepper's angle is just to forget - I think.

Thanks in advance
 

Check available step motor controllers with micro-stepping feature. They do basically, what you try to achieve.
You should consider that a main limitation for this drive method is mechanical and magnetical non-linearty of the step motor.
 

FvM said:
Check available step motor controllers with micro-stepping feature. They do basically, what you try to achieve.
I'm building from scratch if I figure out this is doable.

I do find a possible solution. I can make a ring counter where each output is connected to a transistor to a resistor in a resistor grid. Having various values for all resistors, I can have multiple "choice" voltage dividers (that resistor grid) making something that looks like sine wave.

I did a spreadsheet/graph for such a voltage grid, and I found that it takes about 11 separate voltage dividers to actually get a somewhat decent sinus output.

Another thing that take a lot of components here is that I need one simple two-input mux for every single d-flipflop to make a ring counter that is able to go backward too. Or I can us that many xor gates instead of mux, but it doesn't change the fact that complexity will be the same.

So, anybody knows if there is an even more easy way to make a ring counter being reversible?
 

I'm building from scratch
Why not! Does it also imply not to use DAC chips or any kind of programmable logic? Then you should proceed the way
you started. It's always instructive.
 

I have built (handwired) something like this. It was for making
the data streams for I & Q, for a digital RF modulator.
More general-purpose, but I tested some things with cos/sin
data streams out of it.

I used 27C512 EPROMs because they were the last obvious
generation of by-8, parallel address I could find. That in
turn demanded 5V logic. I used 74AC series parts. The counter
was more complex than might be necessary because I
needed an arbitrary count length. I did that with 4-bit
parallel-load counters and 8-bit magnitude comparators
and some loose logic.

You could use up/down counters I believe, to get the
reversable feature. But check into the possibility that you
could also reverse count by inverting address bits more
simply (or maybe reverse rotation only wants, say, Q
swapped for /Q).

I built an R-2R DAC into the thing to check the digital
"waveform" on the 'scope. Used hex inverters and discrete
10K/20K (R/2R) components summed into a 100 up, 100 ohm
down output network (50 ohm net).

Depending on the granularity you need, a Johnson counter
(or binary followed by an analog multiplexer w/ properly
weighted resistors at each step) would be much more compact
an implementation. Just not capable of arbitrary waveforms.
But still (perhaps) amenable to reverse rotation by address
inversion (XOR).
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…