Go Down

Topic: [SOLVED] Obtaining Magnetic Declination (Read 3 times) previous topic - next topic

PeterH


I have been working on a mobile project that needs to know the direction of true north.

The project I am interested in is a vehicle mounted solar tracker that will be used in Europe and northern Africa to keep our leisure batteries topped up.


I don't understand why you're trying to deal with magnetic declination and so on. It seems that the objective is to predict the position of the sun so you can point a solar collector at it. To do that you need to know the lat/log, time and direction of North. But just how accurately do you need to know which way is North? Or put another way, just how directional is your solar collector? If it's a flat PV panel, it's not very directional at all. Surely, a GPS position and time fix plus a bog standard uncorrected magnetic compass is going to get you better accuracy than you need. If you don't think it is, then what sort of accuracy are you aiming for, and why?

I only provide help via the forum - please do not contact me for private consultancy.

Bob101

#16
Oct 22, 2012, 12:19 am Last Edit: Oct 22, 2012, 12:21 am by Bob101 Reason: 1
Well 2-5 days passed quickly  :P... ok, ok, I'm ahead of schedule here. I grabbed a copy of the library and made some tiny changes (so I didn't have the baggage of AP).

Specifically I changed AP_Declination.h
Code: [Select]
#ifndef AP_Declination_h
#define AP_Declination_h
#include <Arduino.h> // added this
#include <avr/pgmspace.h>
#include <math.h>


AP_Declination.cpp
Code: [Select]
//#include <FastSerial.h> // removed this
//#include <AP_Common.h> // removed this
#include <Arduino.h> // added this
#include <AP_Declination.h>
#include <avr/pgmspace.h>
#include <math.h>


Then I changed prinf to print in AP_Declination_test and removed "FastSerialPort(Serial, 0);". All compiles well and runs flawlessly in my Arduino Mega. Passed all of their self-tests and for the few points I tried was within 1 degree of magnetic-declination.com. Yay!



me again!

+12 degrees in Northern Finland
Botswana -11 degrees

trouble is magnetic substrata can have a massive local effect

I recall seeing aeronautical isocline charts for Scandinavia with loops and whorls like a fingerprint


Super job! Thanks for finding outliers for me to check. Just compared them against the library and it agrees with magnetic-declination.com to within a degree for all the places I checked. Happy  :).


I don't understand why you're trying to deal with magnetic declination and so on. It seems that the objective is to predict the position of the sun so you can point a solar collector at it. To do that you need to know the lat/log, time and direction of North. But just how accurately do you need to know which way is North? Or put another way, just how directional is your solar collector? If it's a flat PV panel, it's not very directional at all. Surely, a GPS position and time fix plus a bog standard uncorrected magnetic compass is going to get you better accuracy than you need. If you don't think it is, then what sort of accuracy are you aiming for, and why?


You are right that a PV panel isn't that directional at all. The energy collected will probably fall off roughly as the cosine of the angle between the panel normal and the direction of the sun. I suppose 10 degrees off (due to declination) wouldn't be the end of the project and it would be very reasonable to just neglect it.

I am a bit of a perfectionist, however, and I am hoping some of what I learn/cobble together can be used in other projects such as heliostats where precision could be more important. I have been working with Gabriel over at cerebralmeltdown.com and he has managed to create a library that can track the sun with better than degree accuracy at a rate of one calculation per second. I have built/adapted a machine that can move a panel to better than 1 degree of accuracy. It seemed natural to me to just try to maintain this accuracy provided it didn't take up all my time. I wondered how easy it would be and thanks to this thread I think I'm there now in just 1 day! Yay!

Bob101

Output from AP_Declination_Test is attached.

If anybody smarter than me wants to check specific values against NOAA or their favourite calculator please let me know if the test was successful!

Thanks guys/girls!

Go Up