Final Report of Antenna Project

Embed Size (px)

Citation preview

  • 8/9/2019 Final Report of Antenna Project

    1/40

    Satellite Tracking and 6.1 mDish Antenna Control System

    ECE 4007 Senior Design Project Final ReportSection L04, SatTrack Team

    Project Adisor Dr! "illiam #$nt

    Dann% D$ong, P&$c #$n%&'an$el 'ende(, Sa&and )oori(ade&

    Rodrigo *$interos

    S$+mitted'a% 7, 0-0

  • 8/9/2019 Final Report of Antenna Project

    2/40

    Table of Contents

    Project .erie/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Preliminar% Assessment!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1E2 '3 Encoders !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!5aria+le Fre6$enc% Dries 5FD8s9 and 'otors !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Control So:t/are and #ard/are !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;

    'otor Control S%stem!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!40

  • 8/9/2019 Final Report of Antenna Project

    3/40

    Project Overview

    T&e o+jectie o: t&is project /as to +$ild an a$tomated satellite@celestial o+ject tracking s%stem $sing

    t&e e?isting ;!- m para+olic re:lector antenna +% designing and implementing a control s%stem /it& t&e ne/

    and e?isting &ard/are!

     Preliminary Assessment 

    T&e e?isting control s%stem o: t&e antenna is s&o/ in Fig$re -!

    Figure 1. Existing system.

    T&e antenna and its control s%stem &ad not +een $sed and maintained since 00 t&ere:ore, t&e :irst

    step o: t&e project /as to determine /&ic& components o: t&e s%stem s&o/n in Fig$re - /ere :$nctional!

     BEI M-25 Encoders

    T&e e?isting encoders /ere t/o -;3+it optical a+sol$te encoder made +% 1E2 part n$m+er 'D3

    F4#SS;;)3D-733S3C-43T39 one mo$nted on t&e a(im$t& a?is and one on t&e eleation a?is /it& no

    enclos$re! D$e to t&e lack o: doc$mentation :rom t&e st$dent gro$p t&at &ad installed t&ese encoders in 00-,

    t&e pint3o$t con:ig$ration o: t&ese encoders /ere $nkno/n! A:ter man% $ns$ccess:$l online searc& attempts

    :or t&e datas&eet o: t&e '3 1E2 encoders, an application engineer named 'ark Bigerl at 1E2 /as

    contacted! 2t /as :o$nd o$t t&at t&e '3 model &ad +een o+solete :or more t&an a decade and t&ere /ere no

    digital doc$mentation aaila+le :or t&em! .ne /eek :ollo/ing o$r :irst contact /it& 'ark Bigerl, &e sent t&e

    scanned datas&eet o: t&e '3 and a doc$mentation containing t&e pin3o$t con:ig$ration and t&e data

     protocol! T&ese doc$ments are aaila+le in Appendi? !

  • 8/9/2019 Final Report of Antenna Project

    4/40

    T&e data protocol o: t&e e?isting model 1E2 '3 is di::erential Serial S%nc&rono$s 2nter:ace SS29

    and t&e +a$d rate is selected +% gro$nding one o: t&e :o$r preset clock pins! To test t&e encoders, t&e 400 #(

     +a$d rate /as selected and t&e set3$p o: Fig$re /as $sed to monitor t&e o$tp$t data!

    Figre !! 1E23' Test Set3$p!

    Pin A o: t&e encoders is t&e positie data signal o: t&e di::erential SS2 and pins 5 and T are 5cc and

    =nd pins respectiel%! T&e e?pected oscilloscope capt$res /ere repetition o: serial +inar% /ords - start

     +it, < data +its, - stop +it9 as indicated +% t&e 1E2 doc$mentation! T&e s&a:ts o: t&e encoders /ere t$rned

    appro?imatel% 4 degrees and a screen capt$re o: t&e oscilloscope displa% /as taken and saed to a S1

    memor% stick! T&e screen capt$res :or eac& encoder /ere t&en compared side +% side to determine i: t&e +inar% data c&anges are proportional to ang$lar displacement o: t&e s&a:t! T&e screen capt$res o: t&e

    eleation encoder are s&o/n in Fig$re !

  • 8/9/2019 Final Report of Antenna Project

    5/40

     Figre ". Data signal screens&ots o: t&e eleation encoder/it& its s&a:t positioned at < di::erent angles!

    T&e res$lts :or t&e a(im$t& encoder s&o/ed t&at at all t&e o$tp$t data stream is constant at angle

    /&ic& lead to t&e concl$sion t&at it /as d%s:$nctional! T&e eleation encoder o$tp$t data stream did c&ange

    /it& t&e angle o: t&e s&a:t and :$rt&er anal%sis o: t&e serial o$tp$t +inar% /ords s&o/ed t&at t&e angle data

    c&anges are proportional to t&e ang$lar displacement o: t&e s&a:t! 2t /as concl$ded t&at t&e eleation encoder

    /as :$nctional

    Variable Frequency Drives (VFDs! and Motors

    T&e po/er inp$ts R,S, and T9 o: t&e t/o e?isting 5FD8s /ere connected to t&e main 3p&ase po/er

    lines o: t&e control panel t&ro$g& :$ses and t&eir o$tp$ts , 5, and "9! T&e control 2@. &ad t&e /irings o:

    t&e preio$s s%stem /&ic& /as connected to t&e rela%s o: t&e proto+oard, +$t it /as no longer connected and

    no /iring diagram o: it /as aaila+le! sing t&e datas&eet o: t&e 5FDs, t&e test circ$it s&o/n in Fig$re 4

    /as $sed to test t&e motors and t&e 5FD8s!

  • 8/9/2019 Final Report of Antenna Project

    6/40

    Figre #. Circ$it $sed to test t&e motors and motor dries!

    T&e eleation 5FD /orked as e?pected and it ran t&e eleation motor +ot& in C" and CC"

    direction and controlled t&e speed as t&e resistance o: t&e potentiometer c&anged! T&e same set$p /as $sed

    :or t&e a(im$t& 5FD +$t it did not :$nction! T&e reset ro$tine as e?plained in t&e datas&eet /as per:ormed on

     +ot& 5FD8s +$t t&e res$lts remained t&e same! Also t&e seen3segment screen o: t&e a(im$t& 5FD onl%

    s&o/ed t&e middle das& lines! 1e:ore it /as concl$ded t&at t&e a(im$t& 5FD /as d%s:$nctional not t&e

    motor, t&e 5FD8s /ere s/apped and t&e same test /as per:ormed +$t t&e s$spected 5FD did not r$n t&e

    eleation motor eit&er! T&e :inal concl$sion /as t&at +ot& motors and t&e eleation 5FD /ere :$nctional +$t

    t&e a(im$t& 5FD /as de:ectie!

    "ontrol #o$t%are and &ard%are

    T&e e?isting 5is$al 1asic3+ased control so:t/are named 'oon Track /as designed in ->>> in

    conj$nction /it& a series o: transistor drien rela%s on a proto+oard to control t&e 5FD8s! 1ot& encoders /ere

    directl% connected ia t/o separate RS3 ports to a Penti$m 2 PC t&at also &osted t&e control so:t/are and

    controlled t&e 5FD8s t&ro$g& a DA* card and t&e rela%s on t&e proto+oard!

    A:ter :inding t&e details o: t&e :$nctionalit% o: t&e 'oon Track so:t/are +% reading t&e report o: t&e

    st$dent gro$p t&at &ad modi:ied t&e so:t/are :or a di::erent project in 00 and &aing &ad a de:ectie 5FD

    and encoder, it /as decided not to $se t&e 'oon Track so:t/are and t&e Penti$m 2 PC! 2n making t&is

    decision, ot&er :actors s$c& as &aing &ad t&e goal o: designing a general p$rpose tracking s%stem and t&e

  • 8/9/2019 Final Report of Antenna Project

    7/40

    need :or designing a ne/ so:t/are compati+le /it& t&e replacements o: t&e de:ectie components did

    contri+$te as /ell!

    $otor Control System

    Fig$re s&o/s t&e +lock diagram o: t&e motor control s%stem /&ic& +$ilt aro$nd t&e Po/er Fle? 4

    motor dries! T&e motor dries /ere speci:ied to take digital signals :rom t&e microcontroller $nit t&ro$g&t&e rela% +oard, send signals to stop@start t&e motors, and receie commands :rom t/o sa:et% component

    limit s/itc&es and emergenc% stop!

    Figure 5. Block diagram of the motor control system.

    VFDs #ettin' and #eed "ontrol 

    T&e Po/er Fle? 4 motor dries /ere c&osen to /ork /it& t&e e?isting motors and to replace t&e t/o

     +roken motors dries t&e% are 3p&ase, AC dries, /it& a 0053405 inp$t@o$tp$t rating! T&ese aria+le

    :re6$enc% AC dries 5FDs9 allo/ a $ser to control t&e motors speeds man$all% +% c&anging a rotar%

     potentiometer on t&e 5FD or +% inp$t signals :rom o$tside so$rces! T&e potentiometer on t&e 5FDs allo/s a

    $ser to adj$st t&e speed o: t&e motors directl% t&ro$g& t&e 5FD! T&e internal circ$itr% o: t&e 5FDs allo/s a

    microcontroller $nit to ena+le preset speeds /it& digital inp$t signals t&o$g& t&e rela% +oard! For eac& 5FD,

    t&e microcontroller $nit /ill assign :ie inp$t signal to :ie rela%s! T&ese :ie inp$t signals are Stop, Start,

    Direction, Speed -, and Speed 0! Fo$r di::erent preset :re6$encies@speeds can +e c&anged :rom t&e t/o inp$t

    speed signals! Preset :re6$encies are set in t&e Adanced Program =ro$p :rom A0703A07! To control t&e

    motor dries t&ro$g& t&e 5FDs $sing e?ternal inp$t signals, all o: t&e :ollo/ing parameters m$st +e

     programmed into t&e 5FDs 3"ire setting in t&e starting so$rce P0;9, so$rce SRC9 $nder Dip S/itc&,

    Coast to Stop $nder stop mode P079, and Preset Fre6 in speed re:erence P0

  • 8/9/2019 Final Report of Antenna Project

    8/40

    )*e +elay Board 

    T&e 5FD8s are con:ig$red :or so$rce mode /&ic& $ses its o/n 45DC internal oltage :or control

    signals! Controlling t&e 5FD8s +% t&e 'C co$ld not &ae +een done directl% +eca$se t&e 'C o$tp$t

    oltage leel is 5DC and it is not s$::icient to control t&e 5FD8s in Sink mode! T&ere:ore, a rela% +oard

    /as designed and assem+led /it& terminal +locks to receie inp$t signals :rom t&e 'C and control t&e

    5FD +% s/itc&ing t&e logic control circ$it o: t&e 5FD8s!T&e inp$t c$rrent dra/ o: t&e rela%s alone are -7mA! 2n order not to oerload t&e o$tp$ts o: t&e

    'C, t&e rela%s are drien /it& a general p$rpose )P) transistor +iased to operate as a solid state s/itc&! A

    diode is reersed +iased in parallel /it& eac& rela%8s inp$t terminals in order to eliminate reerse c$rrent

    :lo/s o: t&e solenoids o: t&e rela%s to t&e transistors8 collectors! A signal indicator LED circ$it is placed .n

    t&e +ase o: eac& transistor! T&e circ$it diagram o: a single rela% drier circ$it is s&o/n in Fig$re ;! T&e

    circ$it o: Fig$re ; red$ced t&e inp$t c$rrent dra/ to appro?imatel% mA!

    Figre 6. Po/er ampli:ier circ$it to drie t&e rela%s

  • 8/9/2019 Final Report of Antenna Project

    9/40

    Sa%ety &ards

    "&en considering t&e design o: an% s%stem, it is important to eliminate as man% &a(ards as possi+le

    and +% doing so red$cing t&e need :or an% sa:et% meas$res! Protectie g$ards are re6$ired to ens$re t&e

    s%stems :$nctionalit% and t&e $sers sa:et%! T&e =2Trac motion control $nit implements t/o t%pes o: sa:et%

    g$ards t&e limit s/itc&es, and t&e E3Stop +$tton!

     ,imit #%itc*es

    T&is sa:et% g$ard preents t&e control $nit and t&e motors :rom displacing t&e antenna :art&er a/a%

    :rom its sa:e3range a(im$t& displacement! T&e limit s/itc&es are located at t&e +ottom o: t&e antenna, +elo/

    t&e antennas pole! Fig$re 7 s&o/s a pict$re o: t&is sa:et% s%stem! 2n t&e pict$re, t&e green s6$ares indicate

    t&e location o: t&e metal plates t&at sere as t&e limit points :or t&e antennas a(im$t& displacement! T&e red

    s6$are indicates t&e location o: t&e limit sensor t&at detects /&et&er t&e antennas a(im$t& displacement istoo :ar to t&e le:t or to t&e rig&t!

    Figre '. Pict$re o: t&e LimitS/itc& Sa:et% S%stem!

    .nce t&e limit sensor detects t&at t&e antennas displacement is too :ar to eit&er direction, it sends a

    signal to t&e rela% +oard to c$t t&e po/er to t&e motors! T&e rela% circ$it opens t&e s/itc&es to t&e t&ree

     p&ase oltage lines :eeding t&e control $nit! T&$s, t&e control $nit s&$ts do/n t&e motors! T&e control $nit

    m$st t&en order t&e motion s%stem to moe t&e antenna in t&e opposite direction! Fig$re < s&o/s a sc&ematic

    diagram o: t&e limit s/itc&es connected to t&e rela% +oard and t&e t&ree3p&ase oltage lines :eeding t&e

    control $nit!

  • 8/9/2019 Final Report of Antenna Project

    10/40

    Figre (. Sc&ematic Diagram o: t&e Limit S/itc& Sa:et%S%stem!

     E-#to Button

    T&e E3Stop sa:et% g$ard seres as a mec&anical means to stop t&e control $nit and t&e motors! T&is

    g$ard is implemented to stop t&e s%stem in case o: $n3:oreseen incidents t&at ma% p$t in risk t&e $sers sa:et%

    or t&e s%stems :$nctionalit%! T&e emergenc% stop, E3Stop, +$tton is easil% accessi+le, recogni(a+le and

    /orks relia+le and sa:el%! 2t is located on t&e $pper corner o: t&e control $nits rig&t side! Fig$re > s&o/s t&e

    E3Stop +$tton and its position relatiel% to t&e control $nit, /&ic& is indicated +% t&e red s6$are in t&e pict$re

    on t&e rig&t!

    a9 +9

    Figre ). Pict$re o: t&e E3Stop +$tton a9 P&%sical location in control $nits +o?! +9 Relatie position o: +$tton /&en o+sering t&e control $nit!

  • 8/9/2019 Final Report of Antenna Project

    11/40

    Fig$re -0 s&o/s a sc&ematic diagram o: t&e E3Stop sa:et% g$ard s%stem! T&e sc&ematic s&o/s t&e E3

    Stop +$tton, and t&e connection +et/een t&e 3p&ase oltage lines, t&e 5aria+le :re6$enc% Drie 5FD9

    $nits, and t&e motors!

    E3Stop +$tton  G /ires9

    Figre 1*. Sc&ematic diagram o: t&e E3Stop +$tton sa:et% g$ard!

    T&e E3Stop +$tton acts as a mec&anical oltage s/itc& :or t&e motion control $nit in case an $n3

    :oreseen incident occ$rs and t&e motion s%stem m$st +e immediatel% stopped! .nce t&e E3Stop +$tton is

     pressed, it /ill open t&e 3p&ase oltage lines s/itc&! T&$s t&e motors /ill &ae no po/er to operate t&e

    motion s%stem /ill +e stopped!

    +ardware Control S,system

  • 8/9/2019 Final Report of Antenna Project

    12/40

     Bac'round

    T&e &ard/are control s$+s%stem is +ased aro$nd t&e Ard$ino 'ega microcontroller $nit 'C9! T&e

    'C /as designed to resole t&e encoders, o+tain commands :rom t&e PC, and send control signals to t&e

    motor dries! T&e :$nctional +lock diagram o: t&e &ard/are control s$+s%stem is s&o/n +elo/ in Fig$re --!

    Figre 11. 1lock diagram o: t&e &ard/are control s$+s%stem!

    .t&er possi+le candidates :or t&e control $nit /ere t&e P2C< and t&e P2C-7H;0 microcontrollers!

    T&e Ard$ino /as c&osen oer t&e P2C microcontrollers d$e to t&e price o: t&e deelopment

     +oards@programmers and t&e time re6$ired to implement an em+edded s%stem! T&e Ard$ino is a lo/ cost

    complete deelopment +oard, programmed in a lang$age +ased on t&e C programming lang$age,

     programma+le t&ro$g& standard S1 ports, /it& a large li+rar% o: pre3/ritten code aaila+le on t&e internet!

    T&e Ard$ino 'ega /as c&osen oer ot&er Ard$ino ariants e!g!, D$emilanoe, 'ini, )ano, Pro9 +eca$se it

    is t&e onl% Ard$ino +oard /it& a s$::icient amo$nt o: 2@. pins :or t&e entire control $nit! T&e 2@. pins are

    a+le to /rite 5 digital signals, /&ic& are $sed to control t&e motor dries, and t&e% can also read 5 digitalsignals, /&ic& can +e o+tained or conerted :rom ind$str% standard encoder o$tp$ts! Complete Ard$ino

    speci:ications are aaila+le on t&e Ard$ino /e+site IJ. 

    As o: Han$ar% 0-0, 1E2 ' series -; +it optical a+sol$te rotar% encoders /ere installed on t&e

    a(im$t& and eleation a?es o: t&e antenna! T&ese encoders operated at an internal +a$d rate o: 400 to

    --00 +a$d set +% s&orting pins on t&e connector9 IAppendi? Pg J and o$tp$t -; +it +inar% data t&ro$g&

    SS2 protocol! "&en terminated properl% $sing an SS2 receier 2C, t&e o$tp$t o: t&e encoder looks like t&e

    /ae:orm s&o/n in Fig$re -!

  • 8/9/2019 Final Report of Antenna Project

    13/40

    Figre 1!. Encoder data o$tp$t!

    T&e digital data can +e e?tracted :rom t&e /ae:orm in Fig$re < +% :ollo/ing t&e 1E2 data protocol

    IAppendi? Pg 4J! T&e 1E2 data protocol sends t&e +inar% data in

  • 8/9/2019 Final Report of Antenna Project

    14/40

    ran on an internal +a$d rate and o$tp$t +inar% data, t&e S2CB encoders m$st +e e?ternall% clocked /it& a

     p$lse train to o+tain t&e data! A diagram o: t&e p$lse train is s&o/n in Fig$re - IAppendi? " Pg ->J!

    Figre 1". Clock signal :or S2CB encoders!

    From Fig$re -, t&e encoders +egin data transmission a:ter an initial lo/ p$lse, and c&ange to t&e

    ne?t data +it on eer% s$+se6$ent rising edge! Timing o: t&e clocking signal is cr$cial :or acc$rate data

    transmission a more detailed ie/ o: t&e clocking signal is s&o/n in Fig$re -4 IAppeni? N Pg J!

    Figre 1#. 'ore detailed ie/ o: S2CB re6$ired clock signal!

     

    From Fig$re -4, :o$r 49 timing aria+les are o: interest T, t, tm, and Tp! Since t&ere is a dela% time,

    t, /&en t&e data +it +ecomes sta+le, t&e control $nit is programmed to read on t&e :alling edge o: a p$lse

     period to ens$re t&at t&e data +it is sta+le! To ens$re clock p$lse trains are distinctl% separated, Tp is set to at

    least t/o clock signal periods OT9 t&is time is increased d$e to intermediate processes o: t&e control $nit

     program! Alt&o$g& not mentioned in an% S2CB Stegmann doc$mentation, t&e mono:lop time, tm, sets t&e

    minim$m clock :re6$enc% or ma?im$m T9 :or relia+le data trans:er IAppendi? AA Pg-4J! Fig$re - s&o/s

    an e?ample c%cles o: t&e inp$t clock signal to t&e S2CB encoder and positional data o$tp$t signal!

  • 8/9/2019 Final Report of Antenna Project

    15/40

    Figre 1-. T/o c%cles o: S2CB clock, and data!

    T&e S2CB encoders o$tp$t data as gra% code! T&is data :ormat is pre:erred oer t&e +inar% data

    :ormat :or encoders, gra% code onl% c&anges one -9 +it per step t&$s t&e ma?im$m error in data

    transmission is one -9 +it! To get an% n$merical data :rom t&e encoder, it m$st +e conerted to +inar% :rom

    gra% code t&is can +e done $sing t&e rec$rsie :$nction s&o/n in E6$ation -!

    n−m=n−m−-⊕Gnm E6$ation -!

    2n E6$ation -, n is e?ponent o: t&e most signi:icant +it in +inar% code corresponding to t&e n$m+er o: gra%

    code +its min$s one, m is a ector :rom 0 to n, = is t&e corresponding gra% code +it, and ⊕ corresponds to

    an .R e?cl$sie .R9 :$nction! T&is is easil% implemented in t&e C3programming lang$age $sing t&e code

    s&o/n in Fig$re -;!

    795 uint16_t gray2bin(uint16_t num) {796 uint16_t temp = num ^ (num>>8);797 temp ^= (temp>>4);798 temp ^= (temp>>2);799 temp ^= (temp>>1);800 return temp;801 }

    Figre 16. F$nction to conert :rom -; +it gra% code to +inar%!

  • 8/9/2019 Final Report of Antenna Project

    16/40

    T&e S2CB encoders re6$ire a di::erential clock signal and o$tp$t a di::erential data signal IAppendi?

    " Pg -

  • 8/9/2019 Final Report of Antenna Project

    17/40

    Figre 1'. T&e Ard$ino 'ega and Et&ernet S&ield set$p $ses a9 S1:or programming, +9 a !-mm center3positie pl$g :or e?ternal po/er,c9 aCat3 ca+le :or Et&ernet connection, and d9 j$mper /ires :or an

    Et&ernet S&ield &ack!

     

  • 8/9/2019 Final Report of Antenna Project

    18/40

    Ta,le 1 Et&ernet S&ield To Ard$ino 'ega Pino$ts

    Et&ernet S&ield Pin Ard$ino 'egaPin

     )otes

    Analog Pin 0 Analog Pin 0

    Analog Pin - Analog Pin -

    Analog Pin Analog Pin

    Analog Pin Analog Pin

    Analog Pin 4 Analog Pin 4

    Analog Pin Analog Pin

    Digital Pin 0 Digital Pin 0

    Digital Pin - Digital Pin -

    Digital Pin Digital Pin

    Digital Pin Digital Pin

    Digital Pin 4 Digital Pin 4

    Digital Pin Digital Pin

    Digital Pin ; Digital Pin ;

    Digital Pin 7 Digital Pin 7

    Digital Pin < Digital Pin <

    Digital Pin > Digital Pin >

    Digital Pin -0 Digital Pin SS signal +end Et&ernet S&ield pin to aoid contact /it& Ard$ino 'ega Digital Pin -0

    Digital Pin -- Digital Pin - '.S2 signal +end Et&ernet S&ield pin to aoid contact /it& Ard$ino 'ega Digital Pin--

    Digital Pin - Digital Pin 0 '2S. signal +end Et&ernet S&ield pin to aoid contact /it& Ard$ino 'ega Digital Pin-

    Digital Pin - Digital Pin SCB signal +end Et&ernet S&ield pin to aoid contact /it& Ard$ino 'ega Digital Pin

    -

    T&e Ard$ino SP2 SCB, '2S., '.S2, and SS signals &ae +een relocated :rom pins -, -, --, and

    -0 on t&e Ard$ino D$emilanoe to pins , 0, -, and on t&e Ard$ino 'ega respectiel% I-J! T&e &ack

    allo/s Ard$inos Et&ernet li+rar% :$nctions to +e called /&ic& can +e $sed to esta+lis& connection, transmit,

    and receie data ia Et&ernet IJ!

     

    T&e 'C@PC comm$nication is esta+lis&ed and maintained as per Fig$re -

  • 8/9/2019 Final Report of Antenna Project

    19/40

    Figre 1(. 'C@PC comm$nication s$+ro$tine! 

    T&e +ackend so:t/are on t&e PC $tili(es a string protocol prod$ced +% t&e Pickle P%t&on mod$le,

    descri+ed +elo/! T&e PC, or serer, transmits t&e target, a(im$t& coordinate, and eleation coordinate to t&e

    'C, or client, :ollo/ing t&e :ormat +elo/

    S target/n I aziumthcoordinate/n I elevationcoordinate/n 

    T&e 'C decodes t&e command +% t&e &eaders SQ and 2Q and t&e ne/3line delimiter @n!Q T&e

    target is t&e name o: t&e target transmitted as a string! T&e a(im$t& and eleation coordinates are transmitted

    as :ie digit integers t&e :irst t&ree integers correspond to t&e &$ndreds, tens, and ones digits, and t&e last

    t/o integers correspond to t&e tent&s and &$ndredt&s digits! T&e connection and trans:er /as tested +%

    o$tp$tting t&e receied data to t&e serial port and LCD!

    T&e 'C $pdates t&e PC o: its c$rrent stat$s t&ro$g& anot&er Pickle string protocol, /&ose :ormat is

    s&o/n +elo/

    I status\n I el_cw\n I error\n I el_ccw\n I elevationangle\n I az_ccw\n I

    azimuthangle\n I az_cw\n

    Eac& o: t&e aria+les stat$s, elc/, elcc/, eleationangle, a(c/, a(cc/, a(im$t&angle9 is

    transmitted as a +inar% n$m+er! T&e aria+les elc/, elcc/, a(c/, a(cc/ are +inar% - or 0 to denote

    /&et&er t&e limit s/itc& :or t&e a(im$t& or eleation clock/ise or co$nter3clock/ise directions &ae +een

    triggered! T&e a(im$t& and eleation are transmitted +ack to t&e PC :ollo/ing t&e same protocol :or

    receiing t&e coordinates t&e :irst t&ree integers correspond to t&e &$ndreds, tens, and ones digits, and t&e

    last t/o integers correspond to t&e tent&s and &$ndredt&s digits! T&e stat$s is a 3+it +inar% code /&ic& gies

    t&e c$rrent stat$s o: t&e 'C t&is code is descri+ed in Ta+le !

  • 8/9/2019 Final Report of Antenna Project

    20/40

     

    Ta,le ! 31it 1inar% Stat$s Code

    Decimal 1inar% 19 Stat$s

    0 00 DoneQ

    - 0- "orkingQ

    -0 ErrorQ

    T&e 'C onl% sends data to t&e PC /&en t&e stat$s o: t&e 'C or t&e position o: t&e antenna

    c&anges! T&e complete set$p +et/een t&e 'C and t&e PC is s&o/n +elo/ in Fig$re ->!

    Figre 1). T&is is a diagram o: t&e interconnections +et/een t&e PC and 'C ia an Et&ernet &$+ allinterconnections are Cat3 ca+les! T&e comp$ter acts as t&e serer and t&e 'C acts as a client!

    T&e Et&ernet &$+ is $sed to allo/ t&e connection +et/een t&e Et&ernet compati+le PC and 'C! An

    alternatie /o$ld +e to $se an Et&ernet crossoer ca+le to directl% connect t&e PC to t&e 'C &o/eer, t&e

    &$+ and reg$lar Cat3 ca+le sol$tion /as c&osen +eca$se t&e PC onl% &as one natie Et&ernet port /&ic& is

    $sed to connect to t&e internet!

    2n t&e c$rrent program, t&e so:t/are +ackend serer comm$nicates $sing t&e :ollo/ing 2P address and

     port ->!-;

  • 8/9/2019 Final Report of Antenna Project

    21/40

  • 8/9/2019 Final Report of Antenna Project

    22/40

    T&e terminal +locks allo/ 6$ick e?ternal connections o: po/er and signals to t&e rela% +oard! T&e

    sc&ematic o: all connections to t&e C terminal +lock is aaila+le in Appendi? I*J!

    T&e Ard$ino da$g&ter+oard proides t&e j$mper /ires :or t&e Et&ernet s&ield to /ork /it& t&e

    Ard$ino 'ega! 2t also &as connections to t&e :emale 43pin +ar connector $sed :or t&e LCD! T&is +oard is

    $sed mainl% :or aest&etic reasons and to keep t&e C internals more compact and neat! A sc&ematic o: t&e

    da$g&ter+oard is aaila+le in Appendi? IRJ!T&e LCD da$g&ter+oard is a small $niersal proto+oard attac&ed to t&e top o: t&e Et&ernet S&ield!

    T&is +oard &as a -0 kK potentiometer /&ic& adj$sts t&e LCD contrast ratio! A sc&ematic o: t&is +oard is

    aaila+le in Appendi? I.J!

    T&e LCD connection :rom t&e Ard$ino to t&e LCD drier occ$rs in a m$ltistage connection! First t&e

     pins :rom t&e Ard$ino are :ed to t&e Ard$ino da$g&ter+oard connected to a 43pin :emale +ar connector! T&e

    male +ar connector is connected to a 43pin ri++on ca+le! 43pin ri++on ca+les /ere not readil% aaila+le so

    one pin /as remoed :rom a 3pin ri++on ca+le! T&e ot&er end o: t&e ri++on ca+le is a standard D1 male

    connector /it& onl% a 43pin ri++on ca+le, t&e :irst pin on t&e D1 connector is omitted! T&e male

    connector connects to a D1 :emale connector /&ic& makes t&e :inal interconnections /it& t&e LCD drier!

    T&e LCD is t&en mo$nted on t&e coer o: t&e C :or isi+ilit%! A pino$t c&art descri+ing all interconnects

    and a :$nction description o: eac& pin is Aaila+le in appendi? ISJ!

    T&e encoders, /&ic& comm$nicate t&ro$g& t&e SS2 line drier, attac& to t&e C t&ro$g& standard

    D1> connectors! T&e pino$ts o: t&ese c$stom connectors is aaila+le in Appendi? ITJ!

     #ystem "alibration

    1e:ore t&e 'C o$tp$ts an% acc$rate ang$lar positions relatie to Eart&, t&e s%stem m$st +e

    cali+rated! T&e +asic steps :or cali+ration are descri+ed +elo/

    • T$rn on t&e 3p&ase po/er circ$it +reaker in t&e control +o?!• Allo/ time :or t&e 'C to +oot $p it is :inis&ed /&en te?t on t&e LCD is isi+le!• Po/er t&e encoders +% toggling t&e E)CP"RQ s/itc& on t&e side o: t&e C!• Disconnect all %ello/ /ires t&ese connect t&e 'C to t&e rela% +oard9 :rom t&e T1!• "it& a j$mper /ire, connect 5 to t&e a(im$t& and eleation start rela%s to t$rn on t&e 5FDs

    • 'an$all% moe antenna to le:tmost A(im$t&9 and +ottom Eleation9 positions $ntil t&e% are er%close to triggering t&e le:tmost and +ottom limit s/itc&es! T&is is done +% connecting 5 to one or +ot& o: t&e speed rela%s t&is /ill ar% t&e motor speed as preio$sl% descri+ed9

    • At t&is point, connect 5 to t&e a(im$t& and eleation stop rela%s to t$rn o:: t&e 5FDs• Reset +ot& encoders +% $sing t&e reset +$ttons on t&e C t&is sets t&e gra% code to (ero at t&ese

     positions9• Repeat step !• 'an$all% moe t&e antenna to t&e rig&tmost A(im$t&9 and top Eleation9 positions $ntil t&e% are

    er% close to triggering t&e rig&tmost and top limit s/itc&es!• Repeat step 7!

  • 8/9/2019 Final Report of Antenna Project

    23/40

  • 8/9/2019 Final Report of Antenna Project

    24/40

  • 8/9/2019 Final Report of Antenna Project

    25/40

    2: at an% point t&e antenna control operation +ecomes $nsta+le or co$ld endanger near+%

    &ard/are@personnel, po/er to t&e s%stem can +e 6$ickl% s&$t o:: +% engaging t&e emergenc% stop, as

     preio$sl% descri+ed! An alternatie to t&is is to t$rn o:: t&e 3p&ase po/er circ$it +reaker! )ote t&at +ot& o:

    t&ese actions, /&ile t&e motors9 are still moing, co$ld potentiall% damage t&e 5FDs, control $nit, or

    encoders!

     no%n Bu's and Fi.es

    2: t&e s%stem &as not $ndergone t&e complete cali+ration proced$re /it& t&e A'C satellite, +$t t&e

    encoders &ae +een reset at t&e le:tmost and +ottom limit s/itc&es, t&e ang$lar position o: t&e a(im$t& ma%

    toggle +et/een t/o al$es as s&o/n on t&e LCD! T&is is onl% an iss$e $nder t&e :ollo/ing conditions

    -! 1ot& encoders are connected to t&e C!! A(im$t& angle is X -!00V!

    ! Eleation angle is X -!00V!

    "&en onl% one o: t&e encoders eit&er a(im$t& or eleation9 is connected to t&e C, t&e angle /ill

    displa% properl% :or t&e /&ole ang$lar range 0!00V G >!>>V! #o/eer /&en +ot& encoders are connected

    and t&e ot&er t/o re6$irements are met, t&e a(im$t& position /ill toggle +et/een t/o al$es! T&e iss$e &as

     +een narro/ed do/n to t&e clock signal driing t&e encoders! "&en all t&ree conditions are met, t&e clock

    signal /ill make one p$lse o: t&e p$lse train ro$g&l% t/ice as large eer% ot&er c%cle, ca$sing an error in data

    transmission and toggling t&e data +et/een t/o al$es! "it& t&e so:t/are limits set +% cali+rating aria+les

    ANC"L2'2T and ELC"L2'2T9, t&is toggling /ill make also toggle t&e 5FDs on and o:: i: t&e $ser

    /ants t&e antenna to moe!

    As a :$ll cali+ration proced$re &as not %et +een set, a temporar% :i? &as +een implemented! T&e

    so:t/are limit :or t&e a(im$t& angle is slig&tl% greater t&an -!00V a+o$t -!-V9! Since t&e antenna can no/

    no longer moe +elo/ -!-V a(im$t&, t&e t&ree conditions /ill neer +e satis:ied and t&e toggling iss$e no

    longer occ$rs! For a long term :i? cali+ration mode /o$ld reset t&e encoder ang$lar position relatie to Eart&

    rat&er t&an (ero, and t&is s&o$ld :i? t&e iss$e completel%!

    Anot&er iss$e onl% occ$rs /&en t&e code :or remote mode is ena+led! "it& t&at ersion o: t&e code,

    t&ere is no sa:eg$arding meas$re to ens$ring t&at all rela%s are set properl% and t&at t&e motor is completel%

    stopped! T&e code to :i? t&is is s&o/n in Fig$re 0 +elo/!

  • 8/9/2019 Final Report of Antenna Project

    26/40

    213 if(reet!e"ay == true) {214 reet!e"ay = #a"e;215 etup!e"ay();216 }

    Figre !*. nc&anged :lag code!

     

    2n Fig$re 0, resetRela%s is a 1oolean :lag t&at is onl% tr$e /&en t&e maintenance@remote mode

    selector s/itc& is toggled, and set$pRela%s9 is a :$nction t&at ens$res t&e motors and rela%s are set to

    initiali(ed states! 'an% ariants o: t&is code &ae +een implemented &o/eer, t&e :lag resetRela%s neer

    toggles to :alse, and set$pRela%s /ill contin$e to r$n eer% c%cle! T&is means t&at i: one o: t&e maintenance

    mode moement s/itc&es is engaged, t&e C /ill contin$e to toggle t&e 5FDs +et/een moing :rom t&e

    s/itc&9 and stopped :rom t&e :$nction set$pRela%s99!

    2: remote mode is to /ork relia+l%, a ne/ :lag@:$nction needs to +e designed to reset t&e rela%s to

    initiali(ed states /&eneer t&e mode is s/itc&ed :rom maintenance to remote and ice ersa!

    "ode Flo%

    Eer% c%cle, t&e 'C r$ns some initiali(ations and t&en t&e +$lk o: t&e code is r$n as a state mac&ine

    as s&o/n in Fig$re -!

  • 8/9/2019 Final Report of Antenna Project

    27/40

     Figre !1. 'C code :lo/!

    T&e initiali(ation step onl% occ$rs once /&en t&e 'C +oots $p a:ter receiing main po/er! 2n t&is

    state, t&e 'C initiali(es t&e target to 2)2T2AL2NEDQ, t&e a(im$t& and eleation angles to 0, and r$ns t&e

    :$nctions set$pPins9, set$pSerial9, set$pEt&ernet9, set$pLCD9, set$p5FD9, set$pClock9, and

    set$pRela%9 /&ic& are all aaila+le in Appendi? I22J! Finall%, t&e program c&ecks i: maintenance mode is

    engaged and sets $p t&e interr$pt :or t&e maintenance@remote toggle s/itc&!

    T&e set$p :$nctions are descri+ed +elo/ in Ta+le

  • 8/9/2019 Final Report of Antenna Project

    28/40

    Ta,le " Set$p F$nctions

    /ame Fnction Descri0tion

    set$pPins Sets pins as 2)PT or .TPT

    set$pSerial Sets t&e +a$d rate :or t&e serial monitor onl% $sea+le /&en connected iaS19

    set$pEt&ernet .$tp$ts Et&ernet connection in:ormation to t&e serial monitor and esta+lis&esan initial connection /it& t&e serer

    set$pLCD Prints persistent te?t to t&e LCD

    set$p5FD Ens$res t&e motor is stopped at t$rn on

    set$pClock 2nitiali(es encoder clocking signals &ig& +e:ore :irst p$lse train

    set$pRela% 2nitiali(es all rela%s to open e?cept :or stop

    A:ter t&e initiali(ation loop t&e program enters t&e main loop /&ic& /ill contin$e $ntil po/er is

    disconnected to t&e 'C! T&e program +egins +% resoling t&e encoders, conerting t&e gra% al$es to

     +inar%, conerting t&e +inar% n$m+er to split decimal :ormat, and t&en printing t&e al$es to t&e LCD $sing

    t&e printLCD9 :$nction aaila+le in Appendi? I22J! T&e printLCD9 :$nction also prints o$t /&et&er or not an

    Et&ernet connection /as made and t&e c$rrent target! For t&e :irst c%cle, t&e target /ill displa%

    'A2)TE)A)CEQ i: in maintenance mode, or 2)22TAL2NEDQ i: in remote mode +eca$se no target &as

     +een ac6$ired %et!

    Ass$ming maintenance mode, t&e :$nction /ill t&en enter t&e 'A2)TC.))ECT state! 2n t&is state,

    t&e program /ill attempt to make one Et&ernet connection and t&en moe into t&e 'A2)TE)A)CE state!

    T&is state is onl% r$n once /&eneer t&e mode is s/itc&ed to maintenance mode!

    2n 'A2)TE)A)CE mode, r$ns t&ro$g& an entire s$+ro$tine to read t&e maintenance mode s/itc&es

    and control t&e rela%s@5FDs accordingl%! First t&e program adds a 0 ms dela% t&is is to ens$re t&at all 1HTs

    and rela%s on t&e rela% +oard &ae &ad eno$g& time to reac& stead% state +e:ore c&anges are made! T&e

     program t&en reads +ot& s/itc&es :or t&e a(im$t& onl% one can +e actie at a time +eca$se it is p&%sicall%

    impossi+le to t&ro/ t&e s/itc& to le:t and rig&t sim$ltaneo$sl%! 2: one direction is triggered, t&e program t&en

    c&ecks t&e so:t/are set limit s/itc& :or t&at direction onl% in t&is /a%, i: t&e le:t limit s/itc& is triggered

    t&en t&e motor is stopped and error :lags are set$p :or t&e Et&ernet data string, +$t t&e antenna can still moe

    to t&e rig&t, and ice ersa! 2: t&e so:t/are limit s/itc& &as not +een &it, t&en t&e program ens$res t&at t&e

    stop signal to t&e 5FD is t$rned o::, sends t&e appropriate direction signal, sets t&e error :lags to .B, and

     +egins ramping to t&e ma?im$m speed programmed into t&e 5FD! T&is t&o$g&t process is repeated :or +ot&

    a(im$t& direction s/itc&es and +ot& eleation direction s/itc&es!

    Finall%, i: t&ere is a PC Et&ernet connection t&en t&e 'C transmits its stat$s to t&e PC! T&e loop

    t&en contin$es skipping t&e 'A2)TC.))ECT step!

  • 8/9/2019 Final Report of Antenna Project

    29/40

    Alt&o$g& t&e remote mode &as not +een tested or implemented, t&e code is aaila+le and +elieed to

    /ork gien a :e/ minor de+$gging c&anges! 2: ena+led, t&e program /ill r$n t&e :ollo/ing states "A2T,

    TRA)SLATE, START, '.5E, C#ECB, ST.PAN, ST.PEL, E)D!

    2n t&e "A2T state, t&e 'C c&ecks :or an aaila+le Et&ernet connection to t&e so:t/are +ackend! 2:

    t&e connection is made, t&en t&e 'C receies a command :rom t&e PC :ollo/ing t&e Pickle receie :ormat

    descri+ed a+oe! T&e 'C /ill t&en conert t&e coordinates receied :rom t&e PC into +inar% :ormat! 2:t&ere is a di::erence +et/een t&e target coordinates and c$rrent position o: t&e antenna, t&e state /ill c&ange

    to TRA)SLATE! 2: t&e PC sends t&e string )o TargetQ :ormatted e?actl% as s&o/n, t&en t&e program /ill

    remain in t&e "A2T state! T&is is implemented +eca$se /&en t&e PC no longer &as a target to send, t&e target

    name /ill +e )o TargetQ, and t&e coordinates /ill +e (ero! T&is /ill +e calc$lated as an ang$lar di::erence

     +et/een t&e target coordinates and t&e c$rrent position, and t&e program /o$ld tr% to contin$e /it& t&e state

    mac&ine! T&is :inal c&eck ens$res t&at a:ter a target &as +een reac&ed and no ot&er target is c&osen, t&e

    antenna /ill remain in t&e same position!

    Since t&e p&%sical limit s/itc&es are not /ired to t&e 'C, t&e TRA)SLATE state determines i: a

    target coordinate sent +% t&e PC /o$ld trip a limit s/itc& and sets t&e error :lags accordingl%! 2: an% o: t&e

    :lags s&o$ld c&ange, t&e program reerts to t&e "A2T state ot&er/ise t&e program contin$es to t&e START

    state! 2n eit&er case, t&e 'C o$tp$ts t&e c$rrent stat$s o: an% error :lags to t&e PC t&ro$g& t&e Pickle send

    :ormat descri+ed a+oe!

    T&e START state t$rns o:: t&e stop signal and t$rns on t&e start signal :or t&e 5FDs according to

    /&ic& direction t&e antenna needs to moe! T&ere is anot&er 0 ms dead time dela% +et/een t&e c&anging o:

    t&ese signals to ens$re t&at t&e start and stop signals are not actie at t&e same time! T&e state mac&ine is

    c&anged to t&e '.5E state!

    2n t&e '.5E state, t&e program determines /&ic& direction t&e 5FDs need to +e set to reac& t&e

    target coordinates! T&is is done /it& a simple e6$alit% statement +et/een t&e target coordinate and t&e

    c$rrent antenna position! Depending on &o/ :ar a/a% t&e antenna is :rom t&e target, t&e antenna ma% moe

    at one o: :o$r speeds set +% ??Speed09, ??Speed-9, ??Speed9, ??Speed9, /&ere ??Q corresponds to

    a(Q :or a(im$t& or elQ :or eleation! T&e speed is c&osen depending on t&e ang$lar di::erence +et/een t&e

    target and t&e c$rrent position as s&o/n in Ta+le 4, and t&e act$al speed in terms o: motor #( is determined

     +% t&e 5FD programming!

    Ta,le # Speed Settings

    Di::erence +et/een target and c$rrent positions Speed F$nction

    Y Z -0 Speed9

    -0[ \ Y Z [ Speed9

    [ \ Y Z [ Speed-9

    Y ] [ Speed09

  • 8/9/2019 Final Report of Antenna Project

    30/40

    1% setting t&e direction and speed aria+les, t&e signals are sent to t&e rela% +oard /&ic& /ill control

    t&e 5FDs accordingl%! T&e state mac&ine c&anges states to t&e C#ECB state!

    2n t&e C#ECB state, t&e program recalc$lates t&e ang$lar di::erence +et/een t&e target coordinates

    and t&e c$rrent position! 2: +ot& coordinates are reac&ed, t&e state c&anges to E)D! 2: onl% t&e a(im$t&

    coordinate &as +een reac&ed, t&e state c&anges to ST.PAN similarl%, i: t&e eleation coordinate &as +een

    reac&, +$t t&e a(im$t& &as not, t&e state c&anges to ST.PEL! 2: neit&er coordinate &as +een reac&ed t&en t&e program loops +ack to t&e '.5E state! 2n all cases, t&e 'C $pdates t&e antenna program stat$s to t&e PC

    ia Et&ernet!

    2n eit&er ST.PAN or ST.PEL states, a 0 ms dela% is applied and a stop signal is send to t&e

    corresponding 5FD t&ro$g& t&e rela% +oard! T&e program /ill no/ loop +ack to t&e '.5E state &o/eer,

    no/ t&at one partic$lar 5FD &as +een stopped, an% inadertent c&anges to t&e speed or direction o: t&at

    motor drie /ill not a::ect t&e position +eca$se it is stopped!

    2n t&e E)D state, t&e antenna &as reac&ed its target coordinate in +ot& a(im$t& and eleation! T&e

     program again ens$res t&at t&e motor dries are stopped! T&e program stat$s :lag is set to DoneQ as

    descri+ed +% Ta+le 4, and t&e 'C stat$s is sent to t&e PC ia Et&ernet! T&e state /ill c&ange +ack to t&e

    "A2T state and /ait :or a ne/ target!

    2t is important to note t&at i: at an% point t&e mode is s/itc&ed +et/een maintenance and remote

    mode, t&e program /ill reset to eit&er 'A2)TC.))ECT or "A2T states respectiel% een i: in t&e middle

    o: a moement command! 2t is important to read t&e kno/n +$gs section to ens$re t&at appropriate :i?es are

    made +e:ore ass$ming completel% sa:e operation!

    2n t&eor% t&e remote mode code /orks &o/eer, d$e to a lack o: time t&is code remains $ntested! 2n

    its c$rrent state, onl% a :e/ minor +$gs ma% e?ist and co$ld +e :i?ed /it& anot&er :e/ /eeks o: testing!

    ackend So%tware

    0vervie%

    A c$stom so:t/are program /as /ritten in P%t&on I4J to :acilitate t&e comm$nication +et/een t&e

    client so:t/are and t&e antenna controller! T&e +ackend receies commands :rom t&e client, processes t&e

    command and $pdates t&e antenna as necessar%! T&e +ackend s%stem also $pdates t&e client /it& t&e

    antenna8s c$rrent stat$s! Along /it& :acilitating comm$nication +et/een t&e t/o ends o: t&e s%stem t&e

     +ackend m$st also manage t&e targets, incl$ding nig&tl% $pdates o: a local catalog o: Eart& or+iting o+jects!

    Fig$re s&o/s a +lock diagram o: t&e main components o: t&e +ackend s%stem!

  • 8/9/2019 Final Report of Antenna Project

    31/40

    Figre !!. 1ackend so:t/are proiding a link +et/een major

    components!

    ),E 

    Descri0tion

    T&e T/o Line Element set TLE9 I7J is a set o: or+ital elements t&at descri+e t&e position and

    elocit% o: Eart& or+iting o+jects, standardi(ed +% ).RAD! ).RAD is a +i3national nited States and

    Canadian organi(ation c&arged /it& t&e missions o: aerospace /arning and aerospace control :or )ort&

    America IJ! .nl% t&e S=P4@< or SDP4@< prediction models can +e $sed

    I>J!

  • 8/9/2019 Final Report of Antenna Project

    32/40

    T&e title line is onl% meant :or &$man reada+ilit% and consists o: t&e name o: t&e or+iting o+ject! T&e

    second and t&ird lines contain t&e or+ital elements along /it& an $ni6$e id :or t&e o+ject! Fig$re lists an

    e?ample TLE, t&e 2nternational Space Station, /&ile a +reakdo/n o: eac& line are seen in Ta+les , ;, and 7!

    2SS NARA9

    - 44 >

  • 8/9/2019 Final Report of Antenna Project

    33/40

    Ta,le ' 1reakdo/n o: Contents o: Line

    Field Colmns Content 23am0le

    - 0-30- Line n$m+er

    0307 Satellite n$m+er 44

    0>3-; 2nclination IDegreesJ -!;4-;

    4 -Ta,le ( Data+ase Sc&ema

    5nteger Primary ey Datetime Test Te3t Te3t

    $id lastpdate Line 0 Line - Line

    Python

    "&en c&oosing a programming lang$age to /rite t&e s%stem in C, CU, and P%t&on /ere

    considered! C and CU /ere not c&osen +eca$se o: t&e steep learning c$re a non programmer /o$ld &ae

  • 8/9/2019 Final Report of Antenna Project

    34/40

    to end$re in order to c$stomi(e t&e so:t/are :or an% speci:ic needs! P%t&on /as c&osen :or t&e :ollo/ing

    reasons!

    • Fast protot%ping• .+ject oriented• Reada+ilit% and sel: doc$menting• ^1atteries incl$ded^, t&e standard li+rar%•  P%Ep&em mod$le

    Fast Prototy0ing

    P%t&on allo/s a programmer to easil% re:ine t&e so:t/are as t&e so:t/are eoles, allo/ing t&e

     programmer to easil% tr% ne/ t&ings, or a di::erent met&od to implement an action! Rapid protot%ping is

    especiall% eas% to do in P%t&on +eca$se it is an interpreted and d%namic lang$age, t&ere is no compiler

    re6$iring to kno/ t&e datat%pes o: aria+les, :$nction arg$ments, or :$nction ret$rns! 1eca$se P%t&on is a

    d%namic lang$age t&ere is no need to proide a seperate oerloaded :$nction :or eac& o: t&e possi+le

    di::erent :$nction arg$ments to t&e P%t&on programmer i: it looks, smells, and :eels like an int t&en it m$st

     +e an int!

    O,ject Oriented

    2n P%t&on eer%t&ing is an o+ject, incl$ding aria+les, classes, een :$nctions, and literals! Treating

    eer%t&ing as an o+ject allo/s 6$icker design o: so:t/are +% not &aing to di::erentiate +et/een o+jects and

    reg$lar aria+les, and +% allo/ing o+ject oriented design principles can +e applied an%/&ere in t&e program!

    T&e :ollo/ing code snippet demonstrates P%t&ons treatment o: o+jects!

    csv = ','.join("ello !orld".slit(##

    A:ter e?ec$tion t&e al$e o: csv is "ello,!orld"!

    T&e o+ject oriented nat$re o: P%t&on allo/s t&e +ackend so:t/are to +e /ritten so t&at di::erent

    connection met&ods can +e $sed, s$c& as RS3, TCP@2P, or S1! Ass$ming t&e di::erent connections

    implement t&e necessar% :$nctions and data attri+$tes, t&e so:t/are /ill +e a+le to $se t&e connection /it&o$t

    an% modi:ication to t&e core! T&is is also $sed /&en calc$lating t&e position o: t&e t&e 4 di::erent targets!

    Fig$re 4 s&o/s t&e :$nctions $sed comp$te t&e position o: di::erent targets, t&e ^)o Target^, and a TLE

     +ased target!

  • 8/9/2019 Final Report of Antenna Project

    35/40

    70   def get_angles(self, radians=None):71 """Return the home position"""72 return (0, 0)

    23 def get_angles(self, radians=None):2!0 """al#ulate the lo#ation of this target as seen $%2!1 the o$ser&er'antenna2!2

    2!3 Return a tuple of the angles in degrees $% default2!!2! """2!*2!7 selfo$ser&erdate = ephemno+()2! selfsat#ompute(selfo$ser&er)2! if radians is None:20 selfa-imuth = selfsata-21 selfele&ation = selfsatalt22 else:23 selfa-imuth = rad_2_deg(selfsata-)2! selfele&ation = rad_2_deg(selfsatalt)22* return (selfa-imuth, selfele&ation)

    Figre !#. F$nctions :or calc$lating t&e position o: t&e targets, ^)o Target^ top9, and a TLE +ased +ottom9 s&o/n! Re:er to Appendi? ## :or t&e :$ll so$rce code!

    7eada,ility and Sel% Docmentation

    2t /as $nderstood t&at it /o$ld +e $nlikel% t&at t&e s%stem /o$ld +e completed in one semester o:

    /ork, and t&at in order to eer &ae a complete s%stem t&e code m$st not +e re3/ritten +% eer% team! 2n

    order to allo/ ot&er teams to e?tend t&e c$rrent code t&e% m$st +e a+le to easil% read and $nderstand it!P%t&on8s inentor =$ido an Ross$m states ^code is read m$c& more o:ten t&an it is /ritten^ in t&e o::icial

    st%le g$ide :or P%t&on code I-0J! Anot&er :eat$re t&at improes P%t&on reada+ilit% is t&e treatment o: /&ite

    space as important! Code +locks are descri+ed +% t&e indentation leel, making related statements e?plicitl%

    o+io$s! Re:er +ack to Fig$re 4 :or an e?ample o: P%t&on code!

    P%t&on also &as +$ilt3in s$pport :or accessing t&e doc$mentation o: a class, :$nction, or mod$le, kno/n as

    docstrings! P%t&on docstrings are enclosed /it&in a matc&ing pair o: ^^^ triple do$+le 6$otes9 and occ$r as

    t&e :irst statement a:ter t&e declaration o: a class, :$nction, or mod$le! Re:er to t&e one line docstring on line

    n$m+er 7- and t&e m$lti3line docstring on lines 4034 in Fig$re 4! T&e docstrings are $se:$l /&ile

     protot%ping code in t&e P%t&on interpreter, and can +e accessed +% t%ping &elp:$nction9!

    atteries inclded

    P%t&on8s standard li+rar% coers a /ide range o: :$nctions incl$ding a +$ilt in S*Lite data+ase

    engine, ra/ net/ork sockets, t&reading, and TCP@DP serers! T&e standard li+rar% /as $sed to implement

  • 8/9/2019 Final Report of Antenna Project

    36/40

    t&e antenna@client TCP serers in di::erent t&reads, comm$nication +et/een t&e serers and t&eir clients, and

    to access t&e TLE data+ase! Fig$re lists a part o: t&e TCP serer class t&at in&erits :rom t&e TCP serer

    class in order to listen :or connections :rom t&e antenna!

    1 class .ntenna(/o#et/er&erhreading/er&er):

    20 """lient ' #ommuni#ation ser&er21

    22 his #lass +ill set up and maintain #onne#tions to the antenna, +hile

    23 also ser&ing as an o$4e#t interfa#e to the antenna for the outside+orld2!

    2 """

    Figre !-. TCP serer class listening :or antenna connections! For :$ll so$rce code seeAppendi? IEEJ!

    Py20hem

    P%Ep&em is $sed :or all t&e astronomical calc$lations and is a P%t&on /rapper :or t&e Ep&em C

    li+rar%! P%Ep&em /orks +% comp$ting t&e a+sol$te position o: target in t&e sk% and conerting t&e rig&ts

    ascension and declination similar to latit$de and longit$de e6$ialent9 to a(im$t& and eleation +ased $pon

    t&e o+serer8s location, it is also $sed to determine t&e ne?t time t&e target is aaila+le /it&in t&e antenna8s

    look angle! P%Ep&em &as +$ilt in kno/ledge o: t&e major +odies, s$c& as t&e s$n, planets and moons, and

     proides ro$tines to load $ser ac6$ired or+ital elements in ).RAD TLE or ep&em data+ase :ormat! For

    o+jects t&at cannot +e :o$nd in eit&er :ormat, t&e o+ject can +e created and it8s elements set indiid$all%!P%Ep&em and Ep&em /ere tested :or acc$rac% +% comparing t&e res$lts o: di::erent satellite positions

    against res$lts o+tain :rom )ASA8s Sk%"atc& jaa applet, and /as proen to +e acc$rate!

     Bacend In Detail

    T&e +ackend so:t/are is composed o: TCP@2P serers r$nning in di::erent t&reads, and t&e main

    t&read o: e?ec$tion t&at &andles t&e comm$nication +et/een t&e client and antenna! T&e main loop is /ritten

    to +e o+liio$s to t&e connection protocols or t&e $nderl%ing met&od to calc$late t&e target position! T&is:acilitates possi+le control o: m$ltiple antennas, connected to m$ltiple clients, tracking targets o: di::erent

    t%pes! Fig$re ; s&o/s a more detailed ersion o: t&e +lock diagram o: t&e +ackend s%stem!

  • 8/9/2019 Final Report of Antenna Project

    37/40

    Figre !6. Detailed +lock diagram o: +ackend s%stem!

     

    T&e clients connect ia TCP@2P to t&e TCP serer marked 8Client T&read8 in Fig$re , t&e

    client so:t/are can t&en send commands to t&e antenna +% sending a pickled ersion o: a P%t&on data t%pe

    called a dictionar%, /&ic& is an $nordered mapping +et/een ke%Wal$e pairs! Pickling is a P%t&on term :or

    trans:orming almost an% o+ject &ierarc&% into a +%te stream or string, /&ic& can t&en +e saed to a :ile or

    sent oer net/ork connections! Pickling o+jects circ$ments &aing to de:ine a c$stom protocol to delimit

    t&e transmitted data! T&e antennas connect in a similar :as&ion! Fig$re 7 s&o/s a P%t&on dictionar% and later

    t&e pickled ersion o: t&e dictionar%!

    $$$ imort c%ic&le as ic&le$$$ command = 'target')**++, 'jocode'-012

    $$$ ic&le.dums(command#"(d3\nS'jocode'\n)\nI+45-6\nsS'target'\n7\nI)**++\ns."$$$ ic&le.loads(ic&le.dums(command##'jocode' +45-6, 'target' )**++2

    Figre !'. P%t&on code snippet demonstrating 8pickling8, and 8$npickling8 a dictionar%!

    T&e main loop t&read :or/ards t&e target position to t&e antenna, and t&en :or/ards t&e antenna stat$s

    to t&e client! Fig$re < is a :lo/ c&art o: t&e main loop!

  • 8/9/2019 Final Report of Antenna Project

    38/40

     

    Figre !(. Flo/ c&art o: t&e main loop e?ec$tion pat&!

    T&e main loop /aits :or a connection :rom t&e client or t&e antenna! 2: t&e antenna is connected /&ilet&ere is no client connected t&e +ackend /ill send a target named 8)o Target8, and tell it to moe to its &ome

     position! 2: t&e client connects /&ile t&ere is no antenna connected t&e +ackend s%stem /ill $pdate t&e client

    /it& an antenna stat$s o: 8)ot Connected8! .nce +ot& t&e antenna and clients are connected t&e +ackend /ill

    monitor t&e client :or an% ne/ commands, t&e onl% ne/ command implemented is a c&ange o: target, i: t&ere

    is a ne/ target it /ill $pdate t&e antenna accordingl%! 2: t&ere are no ne/ commands and t&e antenna &as

    :inis&ed moing to t&e last sent position t&e +ackend /ill calc$late t&e ne/ position and send t&e command

    to t&e antenna!

    T&e cli ent command is a dictionar%!

    89::0;

  • 8/9/2019 Final Report of Antenna Project

    39/40

     

    S0S = 'status'S0>S?"done"@, 'connected' Aalse,

    'az_cw'Aalse, 'az_ccw'Aalse,

    'el_cw'Aalse, 'el_ccw'Aalse,

    'error'Aalse, 'az'-.-, 'el' -.-2

    Re:er to Appendi? IFFJ :or t&e meaning o: t&e al$es o: eac& :ield!

    8ser 5nter%aces

    T/o $ser inter:aces /ere started to connect to t&e +ackend s%stem! T&ere is a P%t&on +ased =2 $sing t&e

    P%=TB toolkit, and a command line inter:ace! See Appendi? I==J :or t&e =2 code, and Appendi? I##J :or

    t&e CL2 code!

  • 8/9/2019 Final Report of Antenna Project

    40/40

    7e%erences

    -! Et&ernet S&ield #ack 3 &ttp@@mc$kits!com@00>@04@0;@ard$ino3et&ernet3s&ield3mega3&ack@

    ! Ard$ino Et&ernet Code 3 &ttp@@///!ard$ino!cc@en@Re:erence@Et&ernet

    ! Ard$ino 'ega 1oard Sc&ematic 3 &ttp@@ard$ino!cc@en@'ain@Ard$ino1oard'ega

    4! LCD 2n:ormation 3 &ttp@@///!spark:$n!com@commerce@prod$ctin:o!p&pprod$ctsidW7-0! P%t&on 3 &ttp@@///!p%t&on!org

    ;! P%Ep&em 3 &ttp@@///!r&odesmill!org@p%ep&em@

    7! TLE 3 &ttp@@celestrak!com@).RAD@doc$mentation@tle3:mt!asp

    >! S=P4@