Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- HABalloon
- Messages
Search
Re: Code Question
David, Thank you for a very detailed explanation!? I have printed this out and stuck it in the notes portion of the project folder.? This is all new to me. I have printed Eduardo's code out and have been sorting through it.? Teaching myself code the hard way, I guess. I'm going to work through some examples and see if I can make sense of this.? If I remember correctly, the GPS chip Eduardo is using returns coordinate values in ddmm.sssss, but some of the examples I've seen have the GPS coordinates written down as 34.944586 latitude and -89.991557 as an example. The different format may be throwing me off. Paul On Wed, Feb 26, 2020 at 8:45 AM <david.sprague@...> wrote: A bit more clarification on the values of the divisors: |
Re: Code Question
A bit more clarification on the values of the divisors:
The top level grid squares are 20 degrees longitude by 10 degrees latitude, so ? the 2000000 used as divisor in the MH[0] calculation is equivalent to dividing by 20 degrees in the scaled ? representation,and ? the 1000000 divisor is equivalent to dividing by 10 degrees for MH[1], The next level finer grid is composed of squares that are 2 deg longitude by 1 deg latitude ? a 200000 divisor is equivalent to dividing by 2 degrees for MH[2], and ? a 100000 divisor is equivalent to dividing by 1 degree for MH[3] The next finer squares for the third subdivision are 5 minutes longitude by 2.5 degrees latitude ? 8333 is equivalent to dividing by 0.08333 degrees or 5 minutes for MH[4] ? 4167 is approximately equivalent to dividing by 0.04666 degrees or 12.5 minutes for MH[5] ? (although I think it would be more accurate and correct to use 4167) and finally, the next and finest grid is composed of squares that are 30 seconds longitude by 15 seconds latitude, so ? 833 is equivalent to dividing by 0.00833 degrees or 30 seconds, and ? 416 (which should perhaps be 417) is equivalent to dividing by .00416 degrees or 15 seconds |
Re: Code Question
I don't know if there's a particular part you're hung up on or not but here goes:
The basic idea is that they're converting lat/lon to grid and subgrid coordinates using integer arithmetic rather than using decimal numbers since the floating point representation used for decimal numbers can introduce seemingly small rounding errors that can turn into larger errors for these kinds of operations.? Additionally, integer math is significantly faster on some micro-controller processors. The capital L at the end of the first two lines of code converts those numbers to long integers which are 32 bits and can therefore represent positive integers up to 2,147,484,647 which is therefore able to hold the largest integer value we'll need which is 36,000,000 and represents 360 degrees.? This results in the variables lon and lat being represented as Long integers (32 bits). In the first two lines: ? lon = (gps.location.lng() * 100000) + 18000000L;
? lat = (gps.location.lat() * 100000) + ?9000000L; is taking a longitude as a decimal number from -180.000000 to +180.000000 (or something very close to that) and turning it into a positive integer by scaling it up, by multiplying by 100000, and then adding 18000000.? So now the range of longitudes goes from 000000000 to 36000000. (Multiplying by 100000 is equivalent to shifting the decimal point five positions to the right and so it "preserves" the first five values to the right of the decimal point, in the original number, in the scaled integer representation.) It then does a similar calculation for latitude which starts out with a range of -90.00000 to +90.00000 and transforms it to a range of 0000000 to +18000000 Next what it's going to do is divide those scaled positive integer lat/lon in order to generate the codes for the grid/subgrids. The first step is to calculate the first two values of the locator code by dividing the longitude into 20 degree sections and the latitude into 10 degree sections.? In our scaled representation, 20 degrees is represented as 2000000 and 10 degrees is represented as 1000000.? The longitude values get mapped to character (letter) values from 'A' to 'R' (the first 18 letters of the alphabet).? Since longitude is represented as a range of 0 to 36000000, if we divide that by 2000000, that's equivalent to dividing 360 by 20 = 18.? So you are getting 18 possible values based on which 20 degree section of longitude you location is in. In case you don't know, the "+=" operation in C means "take the value on the right and add it to the value on the left and store the result back in the variable on the left.? So in the line: MH[0] += ?lon / 2000000; It's going to look up the zeroth entry in the MH array, which is an ascii number representing the letter 'A' and add to it a value from 0 to 17 based one which section of longitude falls into.? The result will be that MH[0] will hold an ASCII code for a single latter in the range from 'A' to 'R' depending on the longitude value of the location. The does the a similar operation in the next line of code:? ? MH[1] += ?lat / 1000000;
This will divide the latitude value that ranges from 0 to 18000000 and divides it by 1000000 which will give us a number ranging from 0 to 17.? It will take that value and add it to the ascii code for 'A' to get an ascii coded letter ranging from 'A' to 'R'.? This code will tell you which section of 10 degrees of latitude you're located in. So that takes care of the first two characters of the WSPR grid code which indicate which "rectangle" of 20 deg longitude by 10 deg latitude you're located in. The next step is to do a similar calculation for the first level sub grid in both longitude and latitude. ? MH[2] += (lon % 2000000) / 200000;
? MH[3] += (lat % 1000000) / 100000;
The % operator divides the first value by the second value but instead of giving you the quotient, it gives you the remainder.? You can think of this as taking the result of? the first longitude calculation (lon / 2000000) and subtracting that result from the longitude and they dividing that remainder by 2 degrees (represented in this scaled representation as 200000) to divide it into 10 equal sections of 2 degrees each.? A similar operation is done on the latitude value, dividing it into 10 equal sections of 1 degree each.? The 10 x 10 subgrid we fall into is represented by a pair of ASCII codes ranging from '0' to '9' (zero to nine). The next two lines: ? MH[4] += ((lon % 200000) / 8333);
? MH[5] += ((lat % 100000) / 4166);
take the remainder after we've divided into the first and second subdivision and converts that to a value from 0 - 23 that is added to the ASCII code resulting in letters in each of the two positions ranging from 'A' to 'X'. The final two lines does yet another 10 x 10 subdivision resulting in the ASCII codes from '0' to '9' for longitude and latitude. I hope that helps.? You might want to first implement it using excel or google sheets to see how it's doing the scaled math operations.? The MOD function (short for Modulo) in Excel and google sheets does the equivalent of the % operator in C, it calculates the remainder? of a division. Dave ? |
Code Question
I am hoping somebody could explain this piece of code to me. ?I'm just stumped! I understand the basics of converting GPS coordinates to WSPR grid squares, and I can do it by hand with paper, pencil, and calculator. I'm just not connecting the dots on how the program is handling it.
Thank you! Paul ______________________________________________________________________________________________________________________________________________________________________________________________ void loc8calc() // Calculates full locator from GPS
{
?
? lon = (gps.location.lng() * 100000) + 18000000L;
? lat = (gps.location.lat() * 100000) + ?9000000L;
?
? char MH[8] = {'A', 'A', '0', '0', 'A', 'A', '0', '0'}; // Full locator characters
?
? MH[0] += ?lon / 2000000;
? MH[1] += ?lat / 1000000;
? MH[2] += (lon % 2000000) / 200000;
? MH[3] += (lat % 1000000) / 100000;
? MH[4] += ((lon % 200000) / 8333);
? MH[5] += ((lat % 100000) / 4166);
? MH[6] += ((lon % 200000) % 8333) / 833;
? MH[7] += ((lat % 100000) % 4166) / 416; |
Re: ICT WSPR Tracker BOM?
I have built a some smd Steve Weber ATS radios by hand. I made a "doofus"? hihi from a piece of coat hanger wire. It has some fishing weights in the middle and a sharpened end that you use to hold the part in place. The other handy tool is a toothpick with some beeswax on the tip. Its great for holding tiny parts. You also need very fine solder and a very sharp pointed soldering tip.
I now use a converted toaster oven with a controller I built with a kit from Sparkfun (several years ago..it has a serial connector). You always have to do some touch up but it generally works well. I'd like to see that K1FM board converted to parts on one side and no 402. I'm not sure how well my oven would work on upside down boards. Oh..and a ginormous magnifying visor Good luck 73 Jim VE3PRO |
Re: ICT WSPR Tracker BOM?
That's what the "safety squint" and the Great Outdoors are for :-)
toggle quoted message
Show quoted text
John K5MO On 1/31/2020 1:58 PM, B C wrote:
those are some teenie tiny little parts..how do you plan to solder them?? At one time I thought about using a toaster oven, but was warned that fumes from the solder paste are toxic and possibly explosive.? hi hi.. I have 3 un assembled stella boards here waiting for parts and when I look at the size of those pads I just sigh... |
Re: ICT WSPR Tracker BOM?
The resonator should be bigger. Or the PCB footprint smaller. I came up with the BOM, see below: Resistors R1 4k7 0402 R2 4k7 0402 R3 DNP 0402 R4 4k3 0402 R5 100k or 110k 0402 R6 10k 0402 Capacitors C1 4.7uF 0603 C2 1uF 0603 C3 100nF 0402 C4 1uF 0603 C5 DNP 0402 C6 100nF 0402 C7 100nF 0402 Oscillators Q1 27MHz TCXO TXETBLSANF-27.000000 RES 4MHz Resonator with included loading caps ECS-SR1-4.00-B-TR Note: I used a different Murata Resonator but now it is no longer available. Actives GPS Ublox Max M8C MCU Atmega 328P Transmitter Si5351A High side switch MIC94092 Reset monitor MIC2775 On Sat, Feb 1, 2020 at 12:07 AM Big Dave <rockfordtractor@...> wrote: Good light, good magnification, and no coffee! |
Re: ICT WSPR Tracker BOM?
those are some teenie tiny little parts..how do you plan to solder them?? At one time I thought about using a toaster oven, but was warned that fumes from the solder paste are toxic and possibly explosive.? hi hi.. I have 3 un assembled stella boards here waiting for parts and when I look at the size of those pads I just sigh... Brian K9WIS ----------------------------------------- From: "Big Dave"To: [email protected] Cc: Sent: Thursday January 30 2020 8:56:35AM Subject: Re: [HABalloon] ICT WSPR Tracker BOM? |
Re: ICT WSPR Tracker BOM?
Thanks for this thread, I working the same path, and this helps a lot ! On Tue, Jan 14, 2020 at 9:25 AM JanV <jan.vadilijev@...> wrote:
|
Re: ICT WSPR Tracker BOM?
开云体育W dniu 14-01-2020 o?03:32, Big Dave
pisze:
OH I guess I should add: Is there a particular version of the GPS to use? The schematic specs, max6 and the PDF mentions Max8. Max 8 comes in a bunch of different versions. -- SQ9GOL Peter Greetings from Poland website: '73 |
Re: ICT WSPR Tracker BOM?
Any suggestions for Solar cells? On Tue, Jan 14, 2020 at 8:10 AM <yo9ict@...> wrote: My flights used: |
to navigate to use esc to dismiss