# I always thought...

• posted

grml: ~ # wcalc Enter an expression to evaluate, q to quit, or ? for help:

-> atan 1 = 45

-> tan 1 = 0.0174551

-> tan 45 =

0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999994

-> tan -45.0000 =

-0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999994

-> tan 45.0001 = 1

(Thinking about the software for fluxgate compass).

• posted

0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999994

-0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999994

Hey, my vintage-1972 HP35 calculator does better than that.

ftp://jjlarkin.lmi.net/Auto.jpg

Thinking of making a fluxgate?

John

• posted

0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999994

-0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999994

What happens if you turn off arbitrary precision and just do it as a regular 64 or 128 bit float?

• posted

On a sunny day (Wed, 18 May 2011 07:00:06 -0700) it happened John Larkin wrote in :

0.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

-0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

Yes good old reliable stuff :-)

I have already made the fluxgate, wound the coils, and made a small 2 transistor multivibrator that drives it into saturation. If I play around with a magnet in the vicinity I can see the spikes induced in the pic-up coil change. Just letting some thoughts run through my head how to do this with ONE PIC only =drive a LCD compass display from the pulses. Is not so easy, the pulses are small, very short, too short for the ADC in the PIC I think, there is all sorts of drift. Else I would need opamps and CMOS switches too... but that is too easy :-) Maybe the PIC hardware comparators could be used in some way...

It is just a sideline project that I play with every now and then.

• posted

On a sunny day (Wed, 18 May 2011 10:09:37 -0400) it happened Bitrex wrote in :

0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

-0.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

grml: ~ # wcalc -P6 Enter an expression to evaluate, q to quit, or ? for help:

-> tan 45 = 1.00000

-> atan 1 = 45.000000

-> OK, much better:-)

• posted

[snip]

I'm not familiar with that wcalc. Mine's a part of geda and its completely different. Yours doesn't appear to be particularly well written. Some sort of formatting/rounding would be nice (with a user defineable number of significant digits).

But for a fluxgate compass, 45.0001 degrees will get you to the same place

45 degrees will. I'd worry more about the discontinuities at values like +90 and +270 degrees to make sure your boat doesn't head in completely the wrong direction. There are dragons at the edges of the world, you know.
```--
Paul Hovnanian     mailto:Paul@Hovnanian.com
------------------------------------------------------------------```
• posted

On a sunny day (Wed, 18 May 2011 08:30:24 -0700) it happened "Paul Hovnanian P.E." wrote in :

Yes, them dragons can be problematic.

• posted

Buy the Honeywell product and get the benefit of my marvy chip design ;-) ...Jim Thompson

```--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |```
• posted

0.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

-0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

transistor multivibrator that

the pic-up coil change.

=drive

PIC I think,

How does one make a fluxgate compass? You'd need at least two (orthogonal) flux gates, but they would have to measure field linearly, or some way that can be linearized, so you can do the trig.

I suppose I could look it up... but what kind of newsgroup would we have if everybody looked things up?

John

• posted

On a sunny day (Wed, 18 May 2011 12:11:44 -0700) it happened John Larkin wrote in :

The idea is that if you send a ring core into saturation with an AC waveform, then if you put a coil around it on the OUTSIDE the signals cancel. In the presence of an external magnetic field one side of the ring saturates earlier than the other, and this causes a small signal to be induced in the external coil. If you use 2 external coils at 90 degrees angles, then the direction of the magnetic field is atan (volts1 / volts2).

So, in ASCII .|| . . || ( .)--- drive coil (into saturation) . || . =======|| ======== U2 angle = atan (U1 / U2) . || . ^ pick up coil 1 . || . ||

• posted

Nice explanation Jan -- thanks!

I take it you're building one of these, PIC microcontroller included?

---Joel

• posted

Does yours calculate tan(y/x) on the chip and put out degrees? It sounds like Jan has the X and Y values and is trying to use wcalc to do the math.

```--
Paul Hovnanian     mailto:Paul@Hovnanian.com
------------------------------------------------------------------```
• posted

On a sunny day (Wed, 18 May 2011 13:54:41 -0700) it happened "Joel Koltner" wrote in :

Well, I am in the evaluation phase, that does mean that his morning I worked out a way to do it with ONE PIC and maybe 2 capacitors (both decoupling) only :-) But as with all ideas, I will need to test a few things to see if it really works.

• posted

Assuming you want something that will run at sensible speed on a PIC then 16bit scaled integer versions of rational aproximations are probably more appropriate than a flawed multiple precision package.

eg.

Sin(x) x(60-7x²)/(60+3x²) x - x³/3! + x^5/5! - ... Cos(x) (12-5x²)/(12+x²) 1 - x²/2! + x^4/4! - ... Tan(x) x(15-x²)/(15-6x²) x + x³/3 + 2x^5/15 + ... Arctan(x) x(15+4x²)/(15+9x²) x - x³/3 + x^5/5 - ...

Be careful how you use them the expressions are valid only for |x|

• posted

On a sunny day (Thu, 19 May 2011 10:26:53 +0100) it happened Martin Brown wrote in :

Yes that could work. Math on a PIC 18Fxxx is not that hard, I did a scope with FFT:

I used a lookup table for sine (add a bit for cos). source is there too.

In the case of the compass the speed is not cricial, how fast can you spin like a pirouette?

Not even the speed between processing the oputpout of one coil and the other needs to be high, for the same reason.

• posted

My chip only does the analog functions, providing the driving current pulses; plus lots of fancy auto-zeroing and gain stabilization. (It was three-axis BTW.) Analog was then processed by a uP. ...Jim Thompson

```--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |```
• posted

On a sunny day (Wed, 18 May 2011 12:11:44 -0700) it happened John Larkin wrote in :

PS, here are some scope pictures, I have put these on the local server, for some reason only telco KPN knows they still have this IP address live (it should have been disconnected yesterday): ftp://86.81.55.74/pub/fluxgate/

If it no longer works I will move it to panteltje.com.

• posted

s

sterday):

Thanks, I was going to ask if you were winding your own coils. I assume you know you can buy the whole head with some internal electronics for ~\$50. FGM-2 from Speake & Co.

But undoubtedly more fun to make your own.

George H.

• posted

On a sunny day (Thu, 19 May 2011 09:26:12 -0700 (PDT)) it happened George Herold wrote in :

Yes you can buy anything. And maybe you will learn from it where north and south is, but not much more. This is indeed more fun, and some challenge to designg the best and simplest electronics, write some software for it etc.

I was just reading about a 3 axis magnetometer in a NASA spacecraft:

Would not be impossible to make a 3 axis one, I have a lot of these small cores :-) Now a space-taxi is needed. :-)

• posted

cores :-)

A friend used a sweet *little* 3-axis one made by a bloke in the UK, in an auto-piloted model helicopter he built about a decade ago. A single core, with 7 windings; one to saturate it and 3 pairs for the 3 axes. I considered trying to build one myself.

What type of core material is most suitable for this? Presumably one that's easy to saturate, to reduce the power demand...

These days you'd use one of the Honeywell sensors though, surely?

Clifford Heath.

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.