Searching \ for '[PIC] Gen 3 sinewaves with 120 degree difference' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/math/index.htm?key=sine
Search entire site for: 'Gen 3 sinewaves with 120 degree difference'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Gen 3 sinewaves with 120 degree difference'
2010\11\04@065612 by Peter Nielsen

flavicon
face
Can anyone please advise the most efficient way to program a PIC to output three simultaneous 8Hz sinewave outputs with a 0, 120, 240 degree phase relationship? The object is to apply the waves to coils to produce a circularly polarized field. I understand the PWM outputs will need to be filtered to derive the SW's.

Any pointers in this direction would be sincerely appreciated. Or, if someone can program this with their existing expertise, I would consider paying for the service.

Peter Nielsen

2010\11\04@073443 by Michael Watterson

face picon face
 On 04/11/2010 10:52, Peter Nielsen wrote:
> Can anyone please advise the most efficient way to program a PIC to output
> three simultaneous 8Hz sinewave outputs with a 0, 120, 240 degree phase
> relationship? The object is to apply the waves to coils to produce a
> circularly polarized field. I understand the PWM outputs will need to be
> filtered to derive the SW's.
>
> Any pointers in this direction would be sincerely appreciated. Or, if
> someone can program this with their existing expertise, I would consider
> paying for the service.
>
> Peter Nielsen
>
I think maybe you mean a rotating magnetic field

Circular polarisation of EM field can be achieved with a splitter and extra cable length to an aerial at right angles.

Anyway.. normally you use a look up table of 1/4 of a sinewave...

8Hz is very slow.... you can use the values to change
*  PWM registers. Limited number of coil drives.
*  DAC made  via 8 resistors on  multiple 8 bit latch, use other pins to address latches
*  I2C DAC
*  Even PWM by SW using single timer interrupt. Best scheme as the frequency is low 8Hz and the only limit on coils is number of output pins. Not any harder. Iv'e done play back of 8KHz sample rate wave files on a pin this way..

For 8Hz I would have a single timer interrupt fast enouogh,  and use lookup table below (make a bigger one for more resolution, using Words),
increment a software counter for each pin. Initalise offsets of phase by initial count values. Use lookup table to decide on/off period counter preset and set or reset pin at zero count.
So each pin that drives a coil has 2 x 16 bit software counters, one for current position on 8Hz cycle (increments at 8Hz x resolution of lookup *4 as table is 1/4 of a cycle)  and one  for the one/off period.

Much detail left out and all off the top of my head so may have errors



JAL example using fixed point arithmetic (16 bit and 32 integers)

These pieces of code where used to generate a run time scaleable analogue clock on an Graphics panel
tested on 16F877, 16F877A, 18F4550

-- fixed point math is 8 bits for decimal in this library.
--    approx two decimal paces, the part after "point" is 0 to 255
--    sword fixed point numbers are thus -127.00 to +127.00 approx
--    if you want bigger numbers replace all swords by sdwords and
--         sdwords by sbyte*8 if the compiler can do the math still.

-- sin values scaled to (256 * 1.0) -1 for values above Zero
-- (i.e. add one to lookup if using table directly for other than Zeroth Element)
-- apart from zero, all values are 1 less than actual
-- to allow storage in 1 byte each
const byte SINLOOKUP[] = {0, 3, 8, 12, 17, 21, 26, 30, 35, 39, 43, 48, 52, 57,
    61, 65, 70, 74, 78, 82, 87, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127,
    131, 135, 138, 142, 146, 149, 153, 157, 160, 164, 167, 170, 174, 177, 180,
    183, 186, 189, 192, 195, 198, 201, 203, 206, 209, 211, 214, 216, 218, 221,
    223, 225, 227, 229, 231, 233, 235, 236, 238, 240, 241, 242, 244, 245, 246,
    247, 248, 249, 250, 251, 252, 253, 253, 254, 254, 254, 255, 255, 255, 255 }
-- 0 to 90 degrees in 1 degree steps

-- 8bit resolution sin function R x Sin (angle) in degrees -32767 to +32767
-- result can be same magnitude and opposite sign

-- use to generate audio waves by changing angle at a fixed speed.
-- if using all 360 degrees in one degree steps, then frequency is step rate / 360
-- at nyquist frequency you only need 0 and 180 degrees, i.e. 1/2 sample rate.
-- if sample rate is 48kHz then for 12kHz you have only 4 samples, i.e. 90 degree steps
-- at 1.2kHz thus you use 9 degree steps.
-- 1 degree steps is thus  133.33  Hz if step speed is 48KHz
-- PWM can be loaded via this lookup
-- use 128 and add 127 to answer for 8 bit PWM
-- use 512 and add 511 to answer for 10bit PWM
-- if summing two frequencies, peak value is twice, so add as swords < 16383 and
-- divide sum by 2!
-- Author: Michael Watterson

-- works with fixed point numbers 256 = 1.0
function rSin8( sword in radius, sword in angle ) return sword is
var sword yPos
    --make sure works for ANY angle ...
    While (angle < 0)   loop
        angle = angle + 360
    end Loop
    While (angle >= 360)   loop
        angle = angle - 360
    end Loop
    Case angle of
    0:  yPos = 0
    90: yPos = radius
    180: yPos =0
    270: yPos = -radius
    otherwise
        block
            -- add or subtract one as lookups above zero have -1 so 256x 1.0
            -- fits in one byte
            If (angle > 0) & (angle < 90) Then
                yPos = sword(SINLOOKUP[angle]) + 1
             elsif (angle > 90) & (angle < 180) Then
                angle = angle - 90
                yPos = sword(SINLOOKUP[(90 - angle)]) + 1
            elsif (angle > 180) & (angle < 270) Then
                angle = angle - 180
                yPos = -sword(SINLOOKUP[angle]) - 1
            elsif (angle > 270) & (angle < 360) Then
                angle = angle - 270
                yPos = -sword(SINLOOKUP[(90 - angle)]) - 1
            End If
            yPos = yPos * radius / 256
        end block
    End case
    return (yPos)
end function

-- Author: Michael Watterson
function rCos8( sword in radius, sword in angle ) return sword is
var sword xPos
    --make sure works for ANY angle ...
    While (angle < 0)   loop
        angle = angle + 360
    end Loop
    While (angle >= 360)   loop
        angle = angle - 360
    end Loop
    Case angle of
    0:  xPos = radius
    90: xPos = 0
    180: xPos = -radius
    270: xPos = 0
    otherwise
        block
            -- add or subtract one as lookups above zero have -1 so 256x 1.0
            -- fits in one byte
            If (angle > 0) & (angle < 90) Then
                xPos = sword(SINLOOKUP[(90 - angle)]) + 1
             elsif (angle > 90) & (angle < 180) Then
                angle = angle - 90
                xPos = -sword(SINLOOKUP[angle]) - 1
            elsif (angle > 180) & (angle < 270) Then
                angle = angle - 180
                xPos = -sword(SINLOOKUP[(90 - angle)]) - 1
            elsif (angle > 270) & (angle < 360) Then
                angle = angle - 270
                xPos = sword(SINLOOKUP[angle]) + 1
            End If
            xPos = xPos * radius / 256
        end block
    End case
    return (xPos)
end function



-- use to rotate angle of a line by calculating endpoints
-- use to generate quadrature waves by changing angle at a fixed speed.
-- if using all 360 degrees in one degree steps, then frequency is step rate / 360
-- Author: Michael Watterson
procedure PolarToCartesian(sword in radius, sword in angle, sword out xPos, sword out yPos) is
    --make sure works for ANY angle ...
    While (angle < 0)   loop
        angle = angle + 360
    end Loop
    While (angle >= 360)   loop
        angle = angle - 360
    end Loop
    Case angle of
    0:
         block
         xPos = radius
         yPos = 0
         end block
    90:
       Block
        xPos = 0
        yPos = radius
        end block
    180:
        block
        xPos = -radius
        yPos = 0
        end block
    270:
         block
         xPos = 0
         yPos = -radius
         end block
    otherwise
        block
             -- add or subtract one as lookups above zero have -1 so 256 x 1.0
            -- fits in one byte
           If (angle > 0) & (angle < 90) Then
                yPos = sword(SINLOOKUP[angle]) + 1
                xPos = sword(SINLOOKUP[(90 - angle)]) + 1
            elsif (angle > 90) & (angle < 180) Then
                angle = angle - 90
                xPos = -sword(SINLOOKUP[angle]) - 1
                yPos = sword(SINLOOKUP[(90 - angle)]) + 1
            elsif (angle > 180) & (angle < 270) Then
                angle = angle - 180
                xPos = -sword(SINLOOKUP[(90 - angle)]) - 1
                yPos = -sword(SINLOOKUP[angle]) - 1
            elsif (angle > 270) & (angle < 360) Then
                angle = angle - 270
                xPos = sword(SINLOOKUP[angle]) + 1
                yPos = -sword(SINLOOKUP[(90 - angle)]) - 1
            End If
            xPos = xPos * radius / 256
            yPos = yPos * radius / 256
        end block
    End case
End procedure

2010\11\04@074530 by ivp

face picon face
> Can anyone please advise the most efficient way to program a PIC
> to output three simultaneous 8Hz sinewave outputs with a 0, 120,
> 240 degree phase

Peter,

some dsPIC33F have a stereo 16-bit audio DAC. Two of these PICs
will provide three good quality waveforms that can be amplified (eg
off-the-shelf audio amps) to drive the coils. I have a variable AC PSU
project pencilled out using this method, but not done much programming
on it as yet. The s/w should be fairly straight-forward though. It would
be as simple as loading the DAC with data from a table under timer
control, with pot variability

Joe

*
*
**********
Quality PIC programmers
http://www.embedinc.com/products/index.ht

2010\11\04@081006 by Olin Lathrop

face picon face
Peter Nielsen wrote:
> Can anyone please advise the most efficient way to program a PIC to
> output three simultaneous 8Hz sinewave outputs with a 0, 120, 240
> degree phase relationship? The object is to apply the waves to coils
> to produce a circularly polarized field. I understand the PWM outputs
> will need to be filtered to derive the SW's.

You didn't say what kind of harmonic content you can tolerate.  However, 8Hz
is so slow that many many PWM periods can easily be used per 125ms output
cycle.  This allows for easily removing the PWM frequency down to irrelevant
levels for most any purpose.

The basic strategy is pretty simple.  Chose a PIC with at least 3 hardware
PWM outputs.  A low end 30F or 24F would be fine, depending on whether you
have a 5V or 3.3V supply.  Run the PWMs together at a fixed frequency, like
16KHz, for example.  That makes the PWM frequency 2000x higher than the
desired output frequency, making it easy to filter out with a few passive
parts.  At 16MHz instruction rate you get 1 part in 1000 resolution on each
PWM pulse, which is again well more than needed to get harmonic content down
to likely irrelevant levels.  That's not even maxxing out the PIC, so more
resolution could be had if needed and you're willing to spend the power to
run the PIC faster.

There will be a interrupt each PWM pulse.  The processor will maintain 3
separate angles, each 1/3 circle apart.  A sine lookup is done on each, and
the resulting value appropriately scaled and written to the PWM hardware to
take effect next pulse.  With the example numbers above, you get 1000
instructions per interrupt.  This is way more than necessary to do the sine
lookups, advance the angles (with 16 fraction bits), and do the appropriate
scaling to the PWM values.

> Any pointers in this direction would be sincerely appreciated. Or, if
> someone can program this with their existing expertise, I would
> consider paying for the service.

We can definitely do this.  Give me a call if you want to kick this around.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\11\04@081228 by Spehro Pefhany

picon face
At 06:52 AM 04/11/2010, you wrote:
>Can anyone please advise the most efficient way to program a PIC to output
>three simultaneous 8Hz sinewave outputs with a 0, 120, 240 degree phase
>relationship? The object is to apply the waves to coils to produce a
>circularly polarized field. I understand the PWM outputs will need to be
>filtered to derive the SW's.
>
>Any pointers in this direction would be sincerely appreciated. Or, if
>someone can program this with their existing expertise, I would consider
>paying for the service.
>
>Peter Nielsen

If the stock 10 bit PWM output is good enough for you, you can use
any motor control oriented PIC. Depending on how accurate the 8Hz
has to be, you can use a counter or a phase accumulator approach, and
then look up the relevant sine wave value from a smallish table.
The same table can be used for all three, and as someone said, you
only need to store the first pi/2 of the sine wave. Obviously,
you step backward in time during even quarters of the sine wave, and
forward during the first and third.

You may not even need filtering if the inductance of the coils is
high enough relative to the PWM frequency.

We've done extremely pure sine wave generation using trig functions
implemented in an FPGA to synthesize the sine wave to enough bits to
choke a horse, and then state-of-the art DACs to turn it into analog
signals (oh, and a supervisory micro such as a PIC or an ARM), but I
doubt you need that.

>Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

2010\11\04@081742 by Olin Lathrop

face picon face
Michael Watterson wrote:
> So each pin that drives a coil has 2 x 16 bit software counters, one
> for current position on 8Hz cycle

16 bits is not likely enough given the slow output frequency and therefore
the small angle step each PWM pulse.  My first knee jerk reaction is to use
another word for the fraction.  That will provide much more frequency
resolution, although the OP didn't say what the frequency accuracy had to
be.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\11\04@082130 by andries.tip

flavicon
face
Peter,

Could you give us a bit more detail on your design, like
- Does the PIC have to deal with other things apart from the sine waves ?
- How accurate do the sine waves need to be (PWM frequencies, resolution) ?
- Must it be a small device ?
- Price ?

Cheers,
-Andries


{Original Message removed}

2010\11\04@131049 by Dwayne Reid

flavicon
face
At 04:52 AM 11/4/2010, Peter Nielsen wrote:
>Can anyone please advise the most efficient way to program a PIC to output
>three simultaneous 8Hz sinewave outputs with a 0, 120, 240 degree phase
>relationship? The object is to apply the waves to coils to produce a
>circularly polarized field. I understand the PWM outputs will need to be
>filtered to derive the SW's.

I did a project similar to that back in '99 - it provided 2 sets of 3-phase outputs where the phase angle difference between each set of outputs was adjustable.  This was used to test 3-phase power-factor measurement equipment where one set of outputs represented voltage, the other set represented current.

It used a 16C74 running at 20 MHz driving 6- 12 bit serial DACs with some of the tightest assembler code I've ever written.  The version I wrote was adjustable from 40 to about 67 Hz output with the phase angle difference between the two sets of 3-phase outputs adjustable from 0 to 360 degrees in 1.5 degree increments (240 steps).  The DACs were fed from lookup tables that had 240 + 8 entries for 90 degrees of sine-wave.  The extra table entries were used to allow counter wrap without problems.

The outputs of the DACs needed only minimal filtering - I think that I used a simple 2-pole low-pass filter on one of the op-amp stages that was used to scale the output of the DAC.

We built only a few of those units but as far as I know, they are still being used.  I also see another software version in that project's directory that does 0.25 degree phase shift changes but I don't know if that was ever shipped to the customer (their spec was 1.5 degree increments).

Today, given your project specs, I'd probably do something similar.  12-bit or 16-bit serial DACs are cheap and your desired output frequency is nice and low - you've got lots of time to read lookup tables and spit serial data out to the DACs.

The real advantage of using DACs over PWM is that much less filtering is required to get clean sine-wave outputs.

dwayne

-- Dwayne Reid   <.....dwaynerKILLspamspam@spam@planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax
http://www.trinity-electronics.com
Custom Electronics Design and Manufacturing

2010\11\04@131617 by Veronica Merryfield

picon face
Does it have to be a pic?

The spec so far indicates a fixed frequency 3 phase output with no other functionality required. This could be achieved fairly simply with 3 op-amps, 3 resistors and 3 capacitors. Sine purity would not be an issue, no filtering would be required and it would be significantly cheaper on engineering.



On 2010-11-04, at 3:52 AM, Peter Nielsen wrote:

{Quote hidden}

> -

2010\11\04@133639 by Bob Blick

face
flavicon
face

On Thu, 04 Nov 2010 21:52:52 +1100, "Peter Nielsen" said:
> Can anyone please advise the most efficient way to program a PIC to
> output
> three simultaneous 8Hz sinewave outputs with a 0, 120, 240 degree phase
> relationship? The object is to apply the waves to coils to produce a
> circularly polarized field. I understand the PWM outputs will need to be
> filtered to derive the SW's.
>
> Any pointers in this direction would be sincerely appreciated. Or, if
> someone can program this with their existing expertise, I would consider
> paying for the service.

Hi Peter,

If you do DDS(direct digital synthesis) then you will be able to vary
the frequency without hassle if you ever need it.

There are lots of ways to do the analog output. At the low speeds you
are concerned with, you could even use software PWM.

Or you could use a PIC that had three PWM channels.

Or use three outboard DACs. That would be cleaner.

There are also lots of dedicated DDS chips that have the DACs in them
already, and you could use a PIC to control them. Analog Devices makes
lots of them, many are as cheap as a DAC.

Cheerful regards,

Bob

-- http://www.fastmail.fm - Access your email from home and the web

2010\11\04@144331 by Olin Lathrop

face picon face
Dwayne Reid wrote:
> Today, given your project specs, I'd probably do something
> similar.  12-bit or 16-bit serial DACs are cheap and your desired
> output frequency is nice and low - you've got lots of time to read
> lookup tables and spit serial data out to the DACs.
>
> The real advantage of using DACs over PWM is that much less filtering
> is required to get clean sine-wave outputs.

True, but at this PWM to output frequency ratio the filtering is trivial.
PWM has advatages over DACs too.  These include nice linearity,
monotonicity, and no external parts.

If the PWM frequency is 16KHz and the sine output 8Hz, then two filter poles
at 32Hz will attenuate the PWM frequency to 4ppm of its original, or about
108dB.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\11\04@145519 by Olin Lathrop

face picon face
Bob Blick wrote:
> There are lots of ways to do the analog output. At the low speeds you
> are concerned with, you could even use software PWM.
>
> Or you could use a PIC that had three PWM channels.
>
> Or use three outboard DACs. That would be cleaner.

"Cleaner" is debatable, but so far we're mostly talking about producing the
analog signals.  Then what?

It sounded like the OP wanted to set up a rotating magnetic field using 3
coils, with possibly 3 or 6 poles.  We should look at the whole system.  If
that is really the spec, then 3 analog sine signals isn't a convenient
intermediate unless these are very small coils that can be driven almost
directly by opamps.

If more power than what a opamp can put out is needed, then it makes more
sense to drive the coils directly using PWM.  There never needs to be a
analog voltage signal representing the three sines.  The sine signals only
exist in the average currents thru the coils.  The coils could be wired
together in a delta configuration, and 3 half bridges used with each of the
6 switches driven directly by the motor control PWM outputs of a 16 bit PIC..

It would be useful for the OP to clarify what he's really trying to do.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\11\04@152523 by Michael Watterson

face picon face
 On 04/11/2010 18:44, Olin Lathrop wrote:
> Dwayne Reid wrote:
>> Today, given your project specs, I'd probably do something
>> similar.  12-bit or 16-bit serial DACs are cheap and your desired
>> output frequency is nice and low - you've got lots of time to read
>> lookup tables and spit serial data out to the DACs.
>>
>> The real advantage of using DACs over PWM is that much less filtering
>> is required to get clean sine-wave outputs.
> True, but at this PWM to output frequency ratio the filtering is trivial.
> PWM has advatages over DACs too.  These include nice linearity,
> monotonicity, and no external parts.
>
> If the PWM frequency is 16KHz and the sine output 8Hz, then two filter poles
> at 32Hz will attenuate the PWM frequency to 4ppm of its original, or about
> 108dB.
>
And you can easily have 8 pins with different phase 16KHz is achievable.

You maybe won't get 108dB with real life layout.
It depends how "big" the coils are and application, who knows maybe 12dB is plenty filter

2010\11\04@153413 by Marcel Duchamp

picon face
I've done this with a PIC10F device driving leds.  As most others have noted, the best method depends on:
a) allowable harmonic content
b) stability
c) flexibility in case of needing to make changes
d) other system issues that will determine if a PIC10F is a good choice or if a dsPic is better.  Or as Veronica mentioned, an analog approach, possibly driven with a crystal oscillator for accuracy.

On 11/4/2010 3:52 AM, Peter Nielsen wrote:
{Quote hidden}

>

2010\11\05@002329 by Peter Nielsen

flavicon
face
Thanks to everyone for their helpful input. I understand a few more details are called for.

The circuit described in my OP is intended to run on 4 x "AAA" cells. It's function is to produce a low intensity, rotational magnetic field via a circular array of 6 reed relay coils (500-1K Ohms). Two coils would be energized at a time (opposite positions) so a 120 degree phase difference is required between each of the three sinewaves. Required output to each coil is less than 50ma.

Passively filtering PWM outputs is acceptable since only a approximate sinewaves are required. IOW I don't want a discontinuous stepping motor type effect. Cost and parts count to be minimal, eg. PIC, LPF passives and 3 op amps. Frequency is fixed at around 8Hz and must be stable to 0.1 Hz.

Given this additional information, requested by a few correspondents, any further suggestions would be much appreciated. For example, which PIC to use, how many LUT's are actually required, and advice regarding the code. If I feel the programming is beyond my own current level of expertise, I may approach those members who have expressed interest in doing the work for a fee.

Peter Nielsen

2010\11\05@043613 by Michael Watterson

face picon face
 On 05/11/2010 04:17, Peter Nielsen wrote:
{Quote hidden}

You only need one lookup table, for 90 degrees. No matter how many phases. no matter frequency, no matter how many different frequencies. no matter if 3 pins used or 6 pins (separate drive for each coil if all are common, no HW inversion needed)

2010\11\05@110526 by Bob Ammerman

flavicon
face
> You only need one lookup table, for 90 degrees. No matter how many
> phases. no matter frequency, no matter how many different frequencies.
> no matter if 3 pins used or 6 pins (separate drive for each coil if all
> are common, no HW inversion needed)

However, you may find your code somewhat simpler if you use a full 360 table, and make its length a power of two. You'll probably have plenty of program space to do that.

FWIW: I would probably tackle this problem with a 18F PIC using software PWM.

-- Bob Ammerman

2010\11\05@123158 by Olin Lathrop

face picon face
Bob Ammerman wrote:
> However, you may find your code somewhat simpler if you use a full 360
> table, and make its length a power of two. You'll probably have
> plenty of program space to do that.

Perhaps, but the mechanics of reusing a 1/4 wave table are really quite
simple.  If you express angles so that a full circle is a power of 2, then
the high bit tells you whether to flip the sign of the result, and the next
lower bit whether to complement the remaining low bits before the table
lookup.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\11\07@094827 by Steve Smith

flavicon
face
This is fairly standard practice in motor drives UPS ect. The easy way is to
use a look up table for one quadrant of a sine wave and then cycle through
it using an up / down counter and reversal for the other half of the cycle.
That's the sine wave.
Do the same on another pin from the same table but 120 degs later. Use an
operational amplifier and subtract one from the other.
Hey presto 3 sine waves at 120 degs offset.

Use excel to generate a 6 bit table of values and bit 7 then becomes the +/-
going switch.

I did it in ASM a long time ago I will have a look for it...
Steve.
{Original Message removed}

2010\11\19@152820 by Andries Tip

flavicon
face
Dear Peter,

You could use a 18Fxxxx............ but why not use a 10F222 instead  ?

Please see:

 http://www.piclist.com/Techref/member/AT-planet-T9/threephasebitbang.htm

Kind regards,
-Andries


Op 4-11-2010 11:52, Peter Nielsen schreef:
{Quote hidden}

>

2010\11\20@063825 by RussellMc

face picon face
> The circuit described in my OP is intended to run on 4 x "AAA" cells. It's
> function is to produce a low intensity, rotational magnetic field via a
> circular array of 6 reed relay coils (500-1K Ohms). Two coils would be
> energized at a time (opposite positions) so a 120 degree phase difference
> is required between each of the three sinewaves. Required output to each
> coil is less than 50ma.

I read that as saying that the coils are activated or deactivated -
that you are activating reed relays when a sine wave signal reaches a
certain amplitude and deactivating it at some other level. (Possibly
the same level but falling amplitude)..

But, if I understand it correctly, NO external sine wave is required -
it need exist only conceptually in the mind of the machine with reeds
being on/off activated as required at the correct times as the
internal software vector rotates.

If my understanding is correct then the hardware design is super
simplified. NO visible sine waves, DACS, ADC's PWM, filters etc.  Just
connections to reed coils.

Am I misunderstanding this?


           Russell

{Quote hidden}

>

2010\11\20@082626 by Olin Lathrop

face picon face
RussellMc wrote:
> If my understanding is correct then the hardware design is super
> simplified. NO visible sine waves, DACS, ADC's PWM, filters etc.  Just
> connections to reed coils.
>
> Am I misunderstanding this?

It's hard to say.  I thought he was using the reed relays just for the coils
to produce the magnetic field, which is there for some other purpose.  But
your interpretation could possibly be correct too, which of course greatly
simplifies the problem as you said.

The OP really needs to clarify, and learn to describe things better.

If the relays are used just to produce a magnetic field, it might illuminate
things to explain why using such components not designed for that.  Why not
ordinary coils intended to produce a magnetic field?  This could be as
simple as magnet wire wound around nails or bolts with a drill.

You also might be able to wrap the coils around the whole thing that is
supposed to experience the rotating magnetic field.  I once had to write the
firmware to drive a unmodified magnetic compass in a flight simulator to any
arbitrary heading.  The compass was in a small enclosing box.  We could fit
two coils that sortof wrapped around the compass inside the box.  Of course
these couldn't be visible from outside, so they couldn't pass directly over
the compass.  They also couldn't cross at right angles as would have been
best due to physical constraints inside the box.  However, the two magnetic
vectors were different enough from each other that we got it working quite
nicely with a calibration lookup table in the firmware.  The earth's
magnetic field didn't matter since our magnetic field was many times
stronger, and what offset the earth did cause was accounted for in the
calibration along with correcting for the inconvenient geometry of the
coils.  These flight simulators were installed in fixed places and weren't
going to be moved after installation, so calibrating each unit upon
installation worked well enough.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\11\20@150149 by Peter Nielsen

flavicon
face
I would like to publicly thank Andries Tip for undertaking to write a program in response to my original post on the above subject. Before inquiring on Piclist, I searched the net for a ready solution to no avail. This surprised me, since three phase sine generation is a recurring need, and the PIC seems ideally suited. If you haven't done so already, you can see it on Andries' personal page.

Peter Nielse

More... (looser matching)
- Last day of these posts
- In 2010 , 2011 only
- Today
- New search...