Electronics > Projects, Designs, and Technical Stuff

Radio Direction Finding

<< < (17/39) > >>

PA3BNX:
Hello Everybody,

Recent programming done.

I did made an OneFix option in the NewMymapping145.exe
(SoundDoppler133aAll.zip)
Soon on the sites of PI4WAG and PA8W

So I can see Two last Arrows and all the fixes (where all the in memory bearings do cross)
or Just One Last Arrow and OneFix (as a Yellow Dot in center with a square around it)
where the most fixes are.
The map is divided in 10 by 10 squares.


Yes I see the TDOA PE5EDW
You also must use 4 antenna's hi just like the doppler.

Everybody is free to generate a file like Packet.txt and put that in the
same map where MyMapping.exe resides.
IF all okay it certainly wil plot on the UIV32 maps.

The packet.txt must contain something like:
(APRS101.PDF)

PA3BNX>APDF01:;BNX.DF912*162814/5157.80N/00534.23E\000/000/224/847 %DF224°/7 1458950 kHz

And it shows on the map.

You can also insert a GPS $GPRMC <cr>s tring with %333/9<cr>mixed
in MyMapping and it plots.

If you have APRSIS32.exe installed you can also plot on APRSIS32 Maps with the TDOA

Just press ctrl-p en you can copy and paste a file like packet.txt  in it and it displays in APRSIS32
Also you can manual plot bearings as objects on APRSIS32.exe



SoundDoppler.exe can send through TCPIP the packet.txt automaticly to an APRSIS32 TEXT port
So it wil plot automaticly on APRIS32 maps and all other vieuwers with APRSIS32 if you have Inet connectivity.

Some of the code from DrawOneFix in MyMapping.exe

This shows the Yellow dot and Square box and amounth of fixes in that square box.
All the fixes are in arrFixedPixel already in pixel coordinates of the map.


 

--- Code: ---

Public Sub DrawOneFix()
        ''ToDo
        ''Not ready yet
        ''03-04-2013
        ''06-04-2013
        ''08-04-2013
        ''09-04-2013
        ''Only Call this sub after Sub CalcFixes
        ''Something Like DDF007 R&S
        ''Divide map in 10 by 10 also 100 squares
        ''Check Each fix to see if it's on the map
        ''Then count how many fixes are in each square
        ''Then draw one dot at the center of the square where the most fixes are

        ''Const integer
        Const t As Integer = 10  ''X and Y division squares
        ''Integer
        Dim arrSquare((t * t) - 1) As Integer ''This array has 100 elements
        Dim c As Integer
        Dim c1 As Integer
        Dim x As Integer
        Dim v As Integer
        Dim yRow As Integer
        Dim xRow As Integer
        Dim m As Integer
        ''Float
        Dim Xpixel As Single
        Dim Ypixel As Single
        Dim xs As Single
        Dim ys As Single

        ''String
        Dim myval As String

        ''Divide map in 10 x 10 squares

        ''Example squares of map
        ''Use this one
        ''00 01 02 03 04 05 06 07 08 09 -xRows
        ''10 11 12 13 14 15 16 17 18 19
        ''20 21 22 23 24 25 26 27 28 29
        ''30 31 32 33 34 35 36 37 38 39
        ''40 41 42 43 44 45 46 47 48 49
        ''50 51 52 53 54 55 56 57 58 59
        ''60 61 62 63 64 65 66 67 68 69
        ''70 71 72 73 74 75 76 77 78 79
        ''80 81 82 83 84 85 86 87 88 89
        ''90 91 92 93 94 95 96 97 98 99
        '-yRows

        ''Count the dots in a squares
        ''Format arrFixedPixel X and Y fix

        xs = CSng(Pict1Width / t)
        ys = CSng(Pict1Height / t)

        For x = 0 To MaxFixes
            If CheckFixOnMap(arrFixedPixel(x, 0), arrFixedPixel(x, 1)) Then ''No fix on map
                ''Do not round but take integer values
                ''Find yRow 
                yRow = CInt((CSng(arrFixedPixel(x, 1)) / ys) + 0.5) ''Value between 0 and 10
                yRow = yRow - 1
                If yRow < 0 Then yRow = 0 ''Value between 0 and 9
                ''Find xrow
                xRow = CInt((CSng(arrFixedPixel(x, 0)) / xs) + 0.5) ''Value between 0 and 10
                xRow = xRow - 1
                If xRow < 0 Then xRow = 0 ''Value between 0 and 9

                ''Create the index here  0 > 99
                c = (yRow * t) + xRow
                If c <= UBound(arrSquare) Then
                    ''Count here
                    arrSquare(c) += 1
                Else
                    Debug.Print("Sub DrawOneFix error=" & xRow & "*" & yRow & " = " & c)
                End If
            End If
        Next x

        ''Find the index count square with most fixes
        ''What if there is 2 or more the maximums ?

        c = 0 ''Must reset c here because it's used
        For x = LBound(arrSquare) To UBound(arrSquare)
            If arrSquare(x) > c Then
                c = x  ''Index number where max value is
                v = arrSquare(x) ''Max value
            End If
        Next x

        ''Nothing found No fixes on map
        If c = 0 Then Exit Sub

        ''Backup Index for drawing amount off fixes in rectangle x
        c1 = c

        ''Search for more then 1 maximum
        ''Dot is color coral if more then 2 and > 2 color dark red the same maximums.
        For x = LBound(arrSquare) To UBound(arrSquare) Step 1
            If v > 0 Then
                If v = arrSquare(x) Then
                    m += 1
                End If
            End If
        Next x

        ''c is the index number of arrSquare
        ''Extract xRow and yRow from c

        myval = c.ToString

        If myval.Length < 3 Then
            myval = "0" & myval
        End If

        yRow = CInt(Val((myval.Substring(0, myval.Length - 1))))
        xRow = CInt(Val((myval.Substring(myval.Length - 1, 1))))

        ''Because it goes from 0 to 9
        ''Make it go from 1 to 10
        xRow += 1
        yRow += 1

        ''Take center x and y coordinate of c
        ''ReCalc xRow and yRow in pixels
        Xpixel = CSng((xRow * xs) - (0.5 * xs))
        Ypixel = CSng((yRow * ys) - (0.5 * ys))

        ''Plot the OneFix dot
        ''Size of circle
        v = 6
        c = 2 * v
        ''Object
        Dim grp As Graphics
        Dim p As Pen
        Dim newfont As Font

        With My.Forms.Form1
            grp = .PictureBox1.CreateGraphics
            p = New Pen(Color.Black, 2)
            'Debug.Print("Sub DrawOneFix")
            'Debug.Print("c=" & arrSquare(c1) & " Field(0>99)=" & c1)
            'Debug.Print("m=" & m)
            Select Case m
                Case 0, 1
                    grp.FillEllipse(Brushes.Yellow, Xpixel - v, Ypixel - v, c, c)
                Case 2
                    grp.FillEllipse(Brushes.Coral, Xpixel - v, Ypixel - v, c, c)
                Case Else
                    grp.FillEllipse(Brushes.DarkRed, Xpixel - v, Ypixel - v, c, c)
            End Select
            v = v + 1
            c = 2 * v
            grp.DrawEllipse(p, Xpixel - v, Ypixel - v, c, c)
            ''Draw a rectangle around the dot
            v = CInt(0.5 * xs)
            c = CInt(0.5 * ys)
            p = New Pen(Color.Black, 1)
            grp.DrawRectangle(p, Xpixel - v, Ypixel - c, xs, ys)
            newfont = New Font("sans MS", 8, FontStyle.Bold)
            grp.DrawString(arrSquare(c1).ToString & " x", newfont, Brushes.Black, Xpixel - v, Ypixel - c)
        End With

        p.Dispose()
        newfont.Dispose()
        grp.Dispose()

    End Sub




--- End code ---

Have fun experimenting.

PA3BNX:
Hello EveryBody,

I am working on a new function
MaxTopDetector in SoundDoppler.exe

That should it make possible to
use 4 Yagi's or other directivity antenna's

And detect in mode AM or tapping from AGC from a reciever
and get the direction from it.

With almost exact the same supersimplesounddoppler hardware.

Just replace the monopole Antenna's for 4 small yagi's pointing in 4 directions

Some code in visual basic for this kind of detector




--- Code: ---
Public Function MaxTopDetector() As String
''ToDo
''18-04-2013
''19-04-2013
''22-04-2013
''Amplitude peiler
''Find maximum amplitude in SCF
''Try to extract max adjacent max amplitude width
''Average x1 and x2 and recalc to degrees
''Also try to calculate the Q ?

''Not ready yet

''Const Float
Const threshold As Single = 0.3 ''Percentage

''Integer
Dim x As Integer
Dim x1 As Integer
Dim x2 As Integer

Dim max As Long
Dim min As Long
Dim smax As Long

Dim Max1 As Long
Dim Min1 As Long

''String
Dim arrmax As String
Dim myval As String

''Remember
''UboundArrSwitchCap1 Used size
''UboundArrSwitchCap Real size

''Find Max and Min
For x = 0 To UboundArrSwitchCap1
      Select Case arrSwitchCap(x)
          Case Is > max
           max = arrSwitchCap(x)
          Case Is < min
           min = arrSwitchCap(x)
      End Select
Next x

''Could be a spike but not likely because of SCF
If max > Math.Abs(min) Then
  smax = 1
 ElseIf Math.Abs(min) > max Then
  smax = 2
 Else
  MaxTopDetector = strcEmpty
  Debug.Print "Whoops bad directive antenna's or NoSignal"
  Exit Function
End If

Max1 = max - (threshold * max)
Min1 = min - (threshold * min)

''Fill threshold level adjacent values arrays
For x = 0 To UboundArrSwitchCap
   Select Case arrSwitchCap(x)
    Case max, Is > Max1
      arrmax = arrmax & "1"
    Case min, Is < Min1
      arrmax = arrmax & "2"
    Case Else
      arrmax = arrmax & "0"
    End Select
Next x

''Search for max value adjacent in arrmax

Select Case smax
 Case 1 ''Pos
       
   For x = Len(arrmax) To 1 Step -1
     myval = String(x, "1")
     x1 = InStr(1, arrmax, myval)
     If x1 > 0 Then
          ''ArrSwitchCap filter is zero based
          ''The arrmax is 1 based
          x1 = x1 - 1
          x2 = x1 + Len(myval)
        Exit For
     End If
   Next x
   
   Call CalcAdjacentTopMax(arrmax, smax, x1, x2)
 
 Case 2 ''Neg
     
   For x = Len(arrmax) To 1 Step -1
     myval = String(x, "2")
     x1 = InStr(1, arrmax, myval)
     If x1 > 0 Then
        ''ArrSwitchCap filter is zero based
        ''The arrMax is 1 based
        x1 = x1 - 1
        x2 = x1 + Len(myval)
       Exit For
     End If
   Next x
   
   Call CalcAdjacentTopMax(arrmax, smax, x1, x2)

End Select

''Average maximum
x = Round((x1 + x2) * 0.5)

''It can be negative if changed by CalcAdjacentTopMax
''If negative add x
If x < 0 Then
 x = UboundArrSwitchCap + x
End If

''Calc degrees
MaxTopDetector = Conv3(Str$(x) * ZeroCrossFactor)

End Function

Public Sub CalcAdjacentTopMax(ByVal arrmax As String, ByVal smax As String, ByRef x1 As Integer, ByRef x2 As Integer)
''ToDo
''21-04-2013
''22-04-2013
''Calc MaxTop if it is around 0 degrees
''Only Called from Sub MaxTopDetector

''Integer
Dim x As Integer
Dim x12 As Integer
Dim x22 As Integer
Dim h As Integer

''String
Dim arrmax1 As String
Dim myval As String

''Nothing ToDo
If Left$(arrmax, 1) <> smax And Right$(arrmax, 1) <> smax Then Exit Sub

''Pre add last elements from string arrMax
h = Len(arrmax) \ 4
arrmax1 = Right$(arrmax, h) & Left$(arrmax, h)

For x = Len(arrmax1) To 1 Step -1
   myval = String(x, smax)
   x12 = InStr(1, arrmax1, myval)
   If x12 > 0 Then
      ''ArrSwitchCap filter is zero based
      ''The arrmax is 1 based
       x12 = x12 - 1
       x22 = x12 + Len(myval)
       Exit For
   End If
Next x

''Change x1 and x2
If (x2 - x1) < (x22 - x12) Then
  x1 = x12 - h
  x2 = x22 - h
End If


End Sub


--- End code ---

I hope to release the next version of sounddoppler134All.zip soon on our web sites.

Today 22-04-2013
I did fix some bugs in the above
Subroutines.
Code above also fixed

They seem to work okay now.

Today 23-04-2013
Uploaded a picture of extreme situation with 4 Uni directional antennas
I hope MaxTopDector can handle them all.

I am also improving the SinCos detector
So after some test the new version SoundDoppler134All.zip wil be on our sites.

PA3BNX:
Hello everybody,

The new version is on our sites SoundDoppler134aAll.zip

I have fixed some issues with the SinCosDetector.

It now runs excelent even without the lowpasfilters.
It's even better then the ZerocrossDetector.

I also improved the software squelch routines.

The New SinCosDetector


--- Code: ---

Public Function SinCosDetector() As String
''ToDo
''22-04-2013
''25-04-2013
''Runs excellent

''Integer
Dim x As Integer
Dim Y As Integer
 
''Float
Dim Degrees As Double
Dim SinSum As Double
Dim CosSum As Double
Dim z As Double

''UboundArrSwitchCap Real Size
''UboundArrSwitchCap1 Used Elements

Y =  UboundArrSwitchCap + 1

For x = 0 To UboundArrSwitchCap
 z = twopi * (x / Y)
 SinSum = SinSum + (arrSwitchCap(x) * Math.Sin(z))
 CosSum = CosSum + (arrSwitchCap(x) * Math.Cos(z))
Next x

''Now check kwadrant ambiguity
''Nothing there
If SinSum = 0 And CosSum = 0 Then
 SinCosDetector = strcEmpty
 Exit Function
End If


If CosSum = 0 Then
 z = 1000000 ''Must be large ''No division by zero
  Else
 z = SinSum / CosSum
End If

''Debug.Print SinSum, CosSum, Round(Degrees)

If SinSum = 0 Then SinSum = 0.0000001
''Now SinSum <> 0 and CosSum <> 0

''Sin = y axis
''Cos = x axis
''Atn(y/x) * rad1

''Atn gives from -90 to + 90 degrees * pi/180 (Rad1)
Degrees = Math.Atn(z) * rad1

''Find the right degrees

         If SinSum < 0 And CosSum > 0 Then
            ''0 to 90       = -90 to 0
            ''Debug.Print "1 " & Degrees & strcDegrees
            Degrees = 90 - Math.Abs(Degrees)
            GoTo under
        End If

        If SinSum > 0 And CosSum > 0 Then
            '' 90 to 180    = 0 to 90
            ''Debug.Print "2 " & Degrees & strcDegrees
            Degrees = 90 + Degrees
            GoTo under
        End If

        If SinSum < 0 And CosSum < 0 Then
            ''270 > 360    90 to 0
            ''Debug.Print "3 " & Degrees & strcDegrees
            Degrees = 270 + Degrees
            GoTo under
        End If

        If SinSum > 0 And CosSum < 0 Then
            ''180 to 270    = -90 to 0
            ''Debug.Print "4 " & Degrees & strcDegrees
            Degrees = 270 + Degrees
            GoTo under
        End If

        Debug.Print "Sub SinCosError " & Time$

under:


''It may not be larger then 360 or lower then 0 degrees
Select Case Degrees
 Case Is >= 360
  Degrees = Degrees - 360
 Case Is < 0
  Degrees = 360 - Degrees
End Select

SinCosDetector = Conv3(Str$(Math.Round(Degrees)))

End Function


--- End code ---

This detector gives good results
It's like a correlator

It also can be used for an Amplitude Direction Finder

like having 4 yagi's pointing to 4 directions NSEW

Just set the reciever to AM detection


Picture contains a SuperSimpleSoundDoppler softswitcher
ala PA8W generator.

Happy FoxHunting Testing etc.

PA3BNX:
Hello Every Body,

I have a new version SoundDoppler135All.zip with
a possibilty of 4 calibration tables and improved squelch detection
and the sincos detector has now also correlation methode.
It runs very good now

Further are we designing and building a new mobile antenny array

With a flat plate antenna

You must have a reciever with mode AM to use it.

Take a look at this patent.


PA3BNX:
Hello Everybody,

Working on the new am plate antenna for my software

I show you some antenna types that can be used for
automatic radio direction finding that can he made
for radio amateur applications

Further a suggestion how to make the plate am direction finder
working with my software.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod