AUGUST 30, 2013 01:00 PM Assembly. Wheel. Satellite communication. Encryption. Challenge 10 Lunaro Sterlings.
Encryption Challenge. Prize = 10 Lunaro Sterlings:
decipher the message (click to get exact ciphertext):
=65000000a000000000000000ed45a19834912670eeaace8cc71a0da73a27aa9cff844d1fdc177c1794a5a3913f4757bcfb55a2a4f
dda15ca0d0c3a811f3bb68233100d3f6f1f6bda9cdcf60cada1b2f776bf74a4ac66631efe07ff2be56771d058fd9d439517c773adbf7180a3ad0835f1=
Clue:
- source code, and executable provided,
- key (used for encryption),
- original video (used for key generation) inside this video.
- sample encryption/decryption.
Correct decryption, first, provided before 10 October, 2013 == 10 Lunaro Sterlings award (2020USD www.lunarosterling.com).
Deciphered text send via e-mail to adobri@shaw.ca with subject "Encryption Challenge. Prize" and one line of deciphered text.
Available -
- source code: https://github.com/alexdobrianski/TOTAL_ENCRYPTION
- key file used in encryption - 111.tkey
- video used in key generation - in current clip.
- sample: text un-encrypted:
NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THE PARTY
cipher text after encryption (same key 111.tkey used):
=400000000000000000000000584fba6e203321df73fe0c07f8fa9903d4d2c80ff0dd62ad87413cf289f5e1251d44766b9156d76495a022263be1b04fa8ab075fe8cc44b0e45a4ed60a2cb727=
after decryption:
NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THE PARTY
--------
interesting article about elliptic curves :
http://www.pereplet.ru/nauka/Soros/pdf/9710_138.pdf
============================================================
Приз – 10 Лунаро Стерлингов.
Первый расшифровавший сообщение до 10 октября 2013 года получает приз – 10 Лунаро Стерлингов (стоимость сегодня 2020$б стоимость 10 октября – 2030USD www.lunarosterling.com).
(кликните ниже чтобы загрузить точный шифротекст):
Для расшифровки предоставляется
- исходный код программы шифрования
https://github.com/alexdobrianski/TOTAL_ENCRYPTION
- исполняемая программа для windows (там же)
- ключ использованный для шифрования 111.tkey (там же)
- видео файл используемый для создания ключа
http://www.youtube.com/watch?v=jdMq4RzKZaU
- пример
text un-encrypted:
NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THE PARTY
cipher text after encryption (same key 111.tkey used):
=400000000000000000000000584fba6e203321df73fe0c07f8fa9903d4d2c80ff0dd62ad87413cf289f5e1251d44766b9156d76495a022263be1b04fa8ab075fe8cc44b0e45a4ed60a2cb727=
after decryption:
NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THE PARTY
Криптовальная программа предназначена для создания ключей шифроблокнотного типа для обеспечения защиты передаваемых данных между космическими аппаратами и наземными станциями связи, расположенными удаленно от центрального пункта управления полетом.
Данный приз предназначен для проверки метода шифрования коммуникации спутниковой связи, предоставляемого Adobri Solutions Ltd на “open source” основе.
JULY 17, 2013 12:57 PM Video update, July 16, 2013.
013.
Grounds station, communication protocol, flash memory, molds, carbon fiber.
JUNE 27, 2013 11:11 PM Modem, Lunaro, RF noise pattern detection.
2.4 communication protocol implementation to be continued. If Implementation "as a Modem" is not good - to bad for implementation - source code was to be cut. Lunaro sterling coins database and web interface mock-up. Small program to detect noise patterns in RF. That's it for a past 1.5 week.
Модем не подходит - модем должен быть перепрограммирован. Лунаро монета - мок-ап базы даннах и веб интерфейса.
JUNE 18, 2013 12:45 PM Data protocol extension. GPS implementation.
Packets transferred between microprocessors can be noisy, data can be lost. To recover from errors in header of the packet was added double unit address. Last byte in a packet can be skipped. Re transmit of the data to different micro-unit implemented on interrupt level.
Communication module do not work "like-modem" anymore. For upload data over radio-link in a packet was introduced CMD*. After CMD* rest of the packet transfer ether back to serial com (if no connection) or to the other communication module. CMD= extended to re transmit data to a another micro-unit.
GPS has a bad reception in concrete building. That creates problems in debugging GPS data processing inside main controller, - needs to take laptop and go outside.
Another SMD device able to retrieve raw GPS/GLOSNAT data was discovered - SE4110L. Without limitations on traveling speed and altitude. Device outputs data after ADC conversion. All data has to be processed in micro controller. Disadvantage - industrial temperature range.
Another alternative to GPS/GLOSSNAT was investigated but it is premature to say anything now - needs to process captured digitized data.
Serg was asked to embed some jokes to his presentation.
Внесены изменения в протокол обмена данными. Для восстановления от потерь хвостов пакетов в заголовок разрешен дублированный адрес. Закрывающий байт пакета может быть пропущен. Коммуникационные модули перестали быть модемами, для космической коммуникации это не практично. Внесена команда * - загрузки данных на подсоединенное устройство. Расширена (восстановлена из предыдущего небытия) команда = для ретрансляции пакетов.
GPS задрал - очень плохой прием в железобетонном здании. Как дурак берешь лаптоп и прешся в скверик, и вместо работы рассказываешь лекцию на тему - а что такое космос.
Появилась микросхема с полными причандалами GPS/GLOSNATA - SE4110L, до АЦП включительно, коштуе 3 бакса, хреноватый температурный режим -40+85. Достоинство - всю математику нужно считать самому и можно не платить за сертификацинную GPS (цена больше 10 штук, плюс нужно доказывать, что не был и в верблюдах не состоял) с отключенной защитой от скоростей больше 500 метров в секунду.
Другая альтернатива GPS обдумывалась, компонеты заказаны, и даже идея была опробована, - но пока все это несерьезные спекуляции - нужно обработать данные.
JUNE 11, 2013 01:45 PM Clock synchronization between modules.
For proper functionality of Mission Control web site, Ground Station’s software, Ground Station’s microcontrollers, communication modules on ground station and on CubeSat, needs to synchronize clocks and timers on all devices. That process can be done in hardware. Software implementation of the process, has it is own challenges, but can bring advantages like ability to get orbit parameters.
Assembled part of ground station. Gear & wheels.
MARCH 04, 2013 10:12 PM 2.4Ghz LNA, test's failures, and finally == worked.
A lot of failures and attempts to make “2.4Ghz LNA” working, and at clear sky over Vancouver it finally done. Tests includes standard BlueTooth transmitter/receiver 1mWt (0 dBm) and second device (LNA with cascade 3x12 =36 dB, transmitter 6dBm 4mWt). “Standard 0dBm” transmitting signal needs to be picked up from 10km. At the same time “standard – receive” will be picked up from 4 km. Two persons with cell-phones call each other and confirm communication session by looking on a blinking LED. LED blinks only when proper packet was received and processed (including restoration of noisy packets from different BT and WiFi transmitters in urban environment). Noise also has to be suppressed from cell-pones stationary transmitters (on top of SFU hill and QE park at Vancouver).
Design from the beginning was successful but was not able to be proved by range tests, each time max range was 1km. Finally problem was resolved when Gregory an Boris pointed that “coaxial wire” is probably is not a “real coaxial. Impedance of wire was measured, adjustments was done, and at rainy day poaring rain brought conformation that everything is working, then on march day at clear sky over Vancouver comes conformation of range tests, 2.5km-OK; 4.km-OK;
Even to do test on 10km was not necessary. Signal received by standard BT from 6dBm was picked up on 4km, and according “rainy test” that mean antennas-amplifiers system must to pickup signal over 20km which is more than it was expected.
FEBRUARY 27, 2013 02:40 PM Technical obstacle – communication design at 2.4GHz – done.
Well, under Vancouver’s rain, range tests was successful – sprayed by shower
antennas and prototype boards showed stable reception over 33th street up to
distance 1200m. In the middle of the tests shower became pouring rain, and at
the end (in 15min) equipment become totally wet (like submerged in water).
Etalon BT recipient was able to pickup signal

on distances of 10m at the same time(!) LNA was able to get 0dBm signal on
distance 190-160m. Thanks to the weather (loss of a signal), the last question,
“how to design communication equipment for 2.4GHz?” was passed. No problem in
PCB, no problem with LNA, impedance matching was The Problem.
Actual fix was: the connection cable (for prototype only) from the LNA’s PCB to
the antenna was not a coaxial cable with 50om impedance, but “microphone”
shielded cable with an impedance of 33om. When that was accounted (together with
physical dimensions of all connectors) and
series:16pF->shunt:1.2pF->sr:5pF->sr:3.3nH was changed to sr:
2.7nH->shnt:1.0pF->sr:22pF->sr:3.9nH rain become a sunshine in the end of the
tunnel.
If anyone is still reading this, then the following is an "Complete idiot's
guide. Amplifier, 2.4Ghz." (case when 2.4GHz capable measuring equipment,
network analyzers, oscilloscopes ant etc. pricy, totaling 20,000$ min, average==
40,000$ are unaffordable):
a) Trust impedance’s calculation – needs to try different calculators to confirm
(in spreadsheet) different formulas, same input -> calculations -> same
output==result. The best calculator conformed is by Dan McMahill: http://wcalc.softpedia.com/ or download from different pagehttp://publisher.brothersoft.com/dan-mcmahill.html No needs to be afraid to take
integrals by Runge-Kutta formulas to confirm calculations (just kidding! – some
knowledge in math is OK). People already spend a lot of time and study to get
proper approximation’s formulas, they knows what they are doing, needs to use
already accumulated knowledge. For impedance matching the best is Smith’s
software (free version does allow using less than 6 components).
b) Calibrate capacitance meter – needs to have at hands different SMD capacitors
with known values, calculation of a delta from readings takes 10 min. Needs to
use the same meter’s pins for measurement.
c) Better to use SMD components - to solder the best is an infrared oven with a
profile temperature’s control (todays it is on E-bay), to rework the best is a
hot-air station, good tweezers is mandatory. Needs to calibrate the oven –
usually it requires 10mm stand inside the tray, needs to place the electronic
thermometer on the stand, insert the tray into an oven (check a max measuring
range for the thermometer) and by lowering or elevating the stand, needs to get
the best match for profile on LCD screen and actual temperature readings, it is
taking a time (couple of hours), but oven’s calibration is mandatory. Soldering
paste - for earth is Pb40%Sn60%, - for space In60%Pb40%. Soldering paste is
preferable, but indium paste sometime unaffordable, alloy InPb is expensive –
better to mix by weight Pb with In (lead from 3WET store == fishing equipment,
and indium from e-bay). If soldering can be done by the alloy only (not by the
paste) thanit is better to use a hot-air instead of an infrared oven. If
soldering will done by an soldering iron than amount of the alloy can be
controlled. . . (designers! Pls! do not laugh – it is my way).
d) Measure impedance of any piece of a wire pretending to be named as the
coaxial cable – (on a picture connection btw PCB and the antenna actually done
by a microphone wire – all designers was laughing looking on it). To measure an
impedance cut piece of cable 20cm, 40 cm, 60cm, and measure the capacitance btw
the central wire and the shield. Open a calculator for a "coaxial transmission
line" and enter physical parameter of a coaxial cable. One parameter left
unknown, it is Er (dielectric constants for insulator), change it to match the
capacitance per mm(or m or ft) with already measured for the small wire. Confirm
for a different wire’s size – take the medium for Er values. Then the value for
the impedance in calculator will be what are you looking for.

e) In PCB calculations needs to use “coplanar waveguide with ground plane”
instead of a microstrip - do not be confused with the name “microstrip” – the
microstrip requires empty space btw components on PCB – usually it is
unaffordable. Difference in the microstrip and the “co-we-wi-gr-pl” is 25%.
Difference also in == for microstrip it require precise thickness, for waveguide
it less dependable.
f) In any PCB/wire/coaxial calculation needs to use as much as possible details
(connectors are separate elements, soldering pads are separate elements). No
need to burry yourself under lot of details, but more details brings better
result, anyway all small details will be accounted, better to do it at the
beginning than at the end.
g) Do not trust what component’s supplier send,(it is not their fault – mistakes
are possible during packing 100 small, same looking pieces of paper, with
0.5mmx1mm components embedded in it) measurement needs to be done before use,
capacitors can be different values, resistors - different precisions, inductors-
varies, instead for a capacitor you can get the resistor, that can burn active
components and etc. No needs to be a paranoid, but basic component‘s checks
better be done.
h) Needs to measure PCB parameters, manufacturer's spec needs to be verified –
order PCB with big "testing" microstrip(or “co-we-wi-gr-pl”) and measure
physical dimensions of dielectric. Measure physical dimension with PCB with
plates on top and bottom and measure capacitance of a tested element. Use
calculator to get range of Er – error in 1pF will give a range of a dielectric
constant (Er) for a PCB.
i) Better to use two layers PCB instead of 4 (actually that is preference for
ExpressPCB – for different PCB manufacturer that can be a different case)
variation of Er and thickness of dielectric brings less variation for impedance
for “coplanar waveguide with ground plate” in case of 2 layers board then for 4
layers.
Thanks Gregory for impedance calculation explanation. Thanks Boris for rifle
sight (scope pointing), Thanks Shura for explanation of interference on
transmitting antenna/diagram. Thanks Luda & Serg for catching cold under
Vancouver’s winter rain.

Project will be continued for cubesat/ground station 1WT transmitter (with possibility boost power to 10 WT).
FEBRUARY 26, 2013 10:41 AM Tests, test, and again tests.
Critical task for today is communication LNA. Attempt to match antenna gives some promising results 0bDm (Bluetooth regular transmitted power) was stable communication over 1690m, second antenna was mismatched from 50om and lose was -3dBm but just one antenna match gives perfect result(1690m). LNA shows (instead of amplifying) lose around -6dB, but it is a progress: Sunday it was -20dB. Was made attempt to re-calculate impedance of a coaxial cable by measuring capacitance and inductance, it shows funny 33om instead of 50om. Also was made attempt to measure parameters of PCB, thickness varies from summer 2013 till today from 1.56 -> 1.47, Er calculated by capacitance of a microstrip (5pF) PCB shows range Er from 4.5 - 4.9, not so much difference from manufacturer (4.2-5.0 spec), it gives difference for microstrip from 81 to 85 Ohm. Recalculated Impedance assuming measured length of a cable and assumption of 33om – gives new parameters to try for today.
FEBRUARY 25, 2013 02:09 PM Impedance matching in LNA
Helical antenna 138 +0J, LNA matching with patch cable 50om X*Lambda +
0.04*Lambda -> 1.2pF + 3.3nH + strip 83om (w=0.33mm d=0.36mm) 21mm
Helical Antenna 138+0J, BT input/output 50+0J matching 3.3nH patch cable
X*Lambda + 0.04*Lambda.
Both helical perfectly working on 1200m with 0dBm power (BT).
3 cascade LNA each with 3.3nH and capacitors 1.3 on input does 1200m not more.
3 cascade LNA each with 2.7nH->3.3nH->3.3nH and capacitors 1.3 on input does
100m not more.
3 cascade LNA each with 2.7nH and capacitors 1.3 on input does 50m.
3 cascade LNA each with 3.3nH -> 2.7nH -> 2.7nH and capacitors 1.3 on input does
100m not more.
But it allow to calculate diagram 10 degree for 3 turns, and 2degree for 16
turns, angle in direction of a end of conductor wire, it is stupid – on a
school’s football field that angle was missed. That make adjustment for a test
over SFU. Angle has to be tried in direction of end of a wire.
Frustration == definitely, if for LNA will not be able to find solution –
everything else does not make sense – communication will be not possible on a
lunar distances. The same amplifier chip working perfectly on output, but 3 in
cascade works like attenuator reducing signal instead of amplifying. Attempt
to switch sides (on top QE park cellular phone transmitters) did not help at
all. Best suggestions to check signal with network analyzer and oscilloscope is
out of reach for me. Thanks Boris for tip == needs to try connect both parts
with attenuator 30dB (10k/9om) in that case it can be a brutal force = no need
to go outside == all parts will be on table and soldering each of cascade for a
best performance can be done faster.
Sorry no video today – even with 45min technical recording – some idiot virus
crushed inventory website (chances ==2/365) , same time prime HDD crashed
(chances == 1/3*365), same day change of a password request
change(chances==2/365) -> retype->wrong password(chances=1/3) ->computer locked
till Monday (2/7) , same day system CD disk not readable at 9PM (chances 1/10)
total probability to happened in one day is: 2*2*2/365*3*365*365*3*7*10 == 1 in
3 billion – Way! And it really happened! Definitely moon is easy!
FEBRUARY 18, 2013 11:18 AM Third fiasco with range tests, reason - cascade of LNA .
Based on calculations from www.ti.com/lit/an/swra046a/swra046a.pdf,
particularly on formula from page 23 path loss =
20*log(4Pi/Lambda)+10*N*log(distance) with 1mwt transmitter and distance ==
625m, value N == 2.2 matches loss of signal (2 is free space path loss, N==2.2
is close to it). Vancouver's rain does not influence on that value (on heavy
rain it should be 2dB per 1km). Then attempt to work with 3.5 km and 3 cascades
10dB LNA brought fiasco. Assuming N is same 2.2 (over Burrard Inlet) gives 3 LNA
combine value less then 12dB. From another hand 3 LNA somehow works, range from
625m definitely improved to 1050m (can not be measured more in the same
environment, same N value). That mean losses btw LNA or LNA and switches needs
to be re calculated and impedance matching should be adjusted. Do make sure that
problem was in LNA instead of antennas both ground station's and cubesat's
helical antennas was measured for a HPBW (Half Power BW) on a school's football
field. 16 turns antenna showed 25 degree (half power on -85dBm sensitivity with
distance for 1mWt is 149m) theoretical value is 26.5, and helical 3 turns showed
61 degree matched theoretical value.
Positive part of the tests – was found spot over 33th street, half block from
Royal Canadian Mounted Police down hill to Oak st., top of the hill Granville
st.(1100m), then again down-and-top of the hill on Vine st. or Larch st.
(1000m). On 33th no cables over that distance and top 50m on Granville allows to
calculate (http://www.tapr.org/ve3jf.dcc97.html)
diffraction loses over single obstacle modeled as a knife edge (the loss of
non-LOS path) it gives loss 32 dB. Sliding position from Larch st. allows to
adjust loss in range of 3 dB. That makes that place practical to test 1WT
(30bBm) transmitter (instead of 200km range LOS Baker Mnt - Grouse Mnt).
LNA matching:
https://github.com/alexdobrianski/STM_BT/blob/master/LNA_MATCHING_2.bmp
Test 1 PCB:
https://github.com/alexdobrianski/STM_BT/blob/master/bt_comm_test1.pcb
test 1 Schematics:
https://github.com/alexdobrianski/STM_BT/blob/master/bt_comm_test1.sch
Path loss calculation with different formulas:
https://github.com/alexdobrianski/STM_BT/blob/master/air%20path%20loss.xls
Some video will be posted.
Aug 8, 2012
Questions, question (translation prev post)
Hello Serg!
Files with schematics - http://www.adobri.com/misc/stm_bt/RF_GrSt.sch and
http://www.adobri.com/misc/stm_bt/RF_GrSt.pcb file with PCB of 2.4
amplifier.
If provider will block files use .zip
http://www.adobri.com/misc/stm_bt/RF_GrSt.zip
I use ExpressPCB – not best but not bad – most important for me – I get PCB
manufactured on a 3 day after order.
Antenna for ground station -
http://www.shapeways.com/model/322767/2-4ghz-antena.html , Antenna for Cube
Sat -
http://www.shapeways.com/model/322768/small-2-4ghz-antena-for-cubesat.html
Pictures:
,

Bluetooth -
http://www.nordicsemi.com/eng/content/download/2730/34105/file/nRF24L01_Product_Specification_v2_0.pdf
Power amplifier-
http://ww1.microchip.com/downloads/en/DeviceDoc/S71291.pdf
Low noise amplifiers -
http://cache.freescale.com/files/rf_if/doc/data_sheet/MC13850.pdf
Switches -
http://semicon.njr.co.jp/njr/hp/fileDownloadMedia.do?_mediaId=788
Voltage regulators 500ma
http://www.analog.com/static/imported-files/Data_Sheets/ADP3335.pdf and
http://cds.linear.com/docs/Datasheet/1761sff.pdf 100 ma
All components in database - http://174.6.165.86/dbadobri/Search.aspx
In Australia on two antennas like for ground station with regular wi-fi distance
12km without problem – limit is horizon (or height of antenna mount) – no need
for any amplifiers — I think with 20-40mwt for wi-fi distance can be 20-60 km.
If to connect Bluetooth that it must work on 1 km. One man claimed that on 4
antennas together (made less fancy made then my – people used cut PVC sewage
pipes) he get signal from Mars orbiter.
Schematic which I send in last tests was without regulators 3.3v – for power
amplifier and for LNA. I removed them and connect 3.3v from 1amp regulator –
regulators works somehow unstable – I think is just some of my mistake with
capacitors – I need individual regulators for Bluetooth+PIC and separate supply
for a TX and RX
R1 and R2 in power amplifier — I set 2.9V by a separate variable resistor for a
voltage reference – conformed value – in original schematic was bug - fixed
С26 — my inserts — otherwise switches does not works – another bug – fixed
С34 — same bug - fixed
L2 — have no idea - in typical application 12nH – but I put 8.2nH
Then I fixed problem in control signals for TX-RX – was stupid bug in tracing.
Then was a bug in soldering on U4 (I believe this is when I baked voltage
regulator 3.3 100ma)
Then was bug with sizes — capacitors size 402 (1мм х 0.5мм) and resistors 805
(2мм х 1.25мм), but on PCB I placed all sizes 402 – as a result I have to cut
spaces for a bigger resistors and 10uF capacitors.
If two antennas used then stable signal is over open air - 500 -670 m. If one
antenna will be behind window glass then distance reduced to 120m. If I put
amplifiers, then on 500m over glass packets travels fine. Another sign that
power amplifier somehow working – with antennas only (1mwt) behind trees no
receptions on 100m – with amplifiers at the same spot perfect reception. Also
over air 500m is definitely better reception (LED blinking only on packets used
in protocol – period of blinking give rough estimates). But power amplifier
should give 36 dB – am I right or not – input 1mwt – 36dB output 1Wt (current
also shows 350 ma)? If it is 1Wt – than signal must be really strong – even on
another side of downtown with reflection I should see reception? With 1mwt I
perfectly get reflection from nearest building – with 1Wt – no reflection – only
direct open air.
Run with CubeSat prototype at 3AM aroundVancouveris interesting task – all Boms
are curious – usual question – Is that technology can be used to get high? At
day time it is funny too – tourists
I also do not understand – first – capacitors on RF-IN RF-OUT? What sizes of
traces before and after capacitors should be?
And actually what for that capacitors? – lest assume for decoupling. Then why
on power amplifier it is 1.2pF and for LNA it is 2.4pF? – Frequency of a sample
application for a same 2.4GHz, or this picoF just what you have today for
soldering? Or this pico depend on width and length of a trace?
Does they depend on a height? No seriously – after soldering a lot of buggers on
traces – trace like hatchbacks – does it require to clean buggers or make it
bigger – to adjust picoF? Then thickness of PCB – how account this?
And what a hack this L1 – bloody inductor! In recommendation it is stated:
“Could be removed (really?!) if -7dB(?!) return (!?) loss (??!) is acceptable
(?!)” – What loss? Why loss back? — is it -8 is OK and -6 is very bad? What is
ACCEPTaBLE? dB of what? And that documentation is really good – in other specs
for a different chips – only pins – event horizon for a creativity – try what
you like with combinations 16*15*14*… etc.
Now antenna – I soldered it on J3 over capacitor (1.2?.2.4?) – as on a picture –
direct connection of a antenna to a capacitor and without capacitor – What will
be proper way to soldering /connect with or without?
Then connection to a Bluetooth – today it is a coaxial 25cm (2.4Ghz length of
wave) in a future Bluetooth will be on same PCB but now coaxial – question –
from a point of connection length/width of a trace to capacitors should be???
1/6 or 1/32 of wave’s length. Or nature likes different fractions?
Next – “50om /85 mil” or “50om/120mil” or something even more mysterious – “50om
RFIN” “50om RFOUT” – Yes I know – it was a man with a last name Ohm – also Ommm
is Tibetan song – and what? 120mil * 3 = 360 +15 = 375 = small bottle in liquor
store. But how liquor store related to U=I*R?
May be needs additional amplifier? The power amplifier designed to work for
wi-fi. And 1mWt is not enough to work?
Also on schematics present noise canceling QHX220IQT7. But I am fighting with
difference noise - in a head mostly. I even did not soldered it.
If you understand – you help will be appreciated. My knowledge is limited in RF
area - as you know.
Alex.
Aug 7, 2012.
Questions about amplifier.
Привет Серега!
Файлы со схематикой -
http://www.adobri.com/misc/stm_bt/RF_GrSt.sch and
http://www.adobri.com/misc/stm_bt/RF_GrSt.pcb с печатной платой (я
также добавил эти файлы в письмо.
Если мой дурацкий провайдер на загрузиться попробуй
http://www.adobri.com/misc/stm_bt/RF_GrSt.zip
Программа — ExpressPCB – такая — немного ограниченная - не дорогая
— ее пользую — главное - плату получаю на второй день после заказа
Антена -
http://www.shapeways.com/model/322767/2-4ghz-antena.html для граунд станции
и антена на спутнике
http://www.shapeways.com/model/322768/small-2-4ghz-antena-for-cubesat.html
Фотки
,

блутюз -
http://www.nordicsemi.com/eng/content/download/2730/34105/file/nRF24L01_Product_Specification_v2_0.pdf
усилитель мощности
http://ww1.microchip.com/downloads/en/DeviceDoc/S71291.pdf
низкошумящие усилители
http://cache.freescale.com/files/rf_if/doc/data_sheet/MC13850.pdf
свитчи
http://semicon.njr.co.jp/njr/hp/fileDownloadMedia.do?_mediaId=788
регуляторы
http://www.analog.com/static/imported-files/Data_Sheets/ADP3335.pdf 500 ма
http://cds.linear.com/docs/Datasheet/1761sff.pdf
100 ма
все компоненты которые я использую в базе данных -
http://174.6.165.86/dbadobri/Search.aspx
если взять просто две антены (для граунд станции) то австралийцы работают на
расстоянии 12 км просто подключив на wi-fi бокс эти антены —
ограничение горизонт — высота на которую поднимают антены — никакие усилители в
.том случае не нужны — я думаю при 20-40мв для wi-fi должно хватить
и на 20км-60 км. Если поставить блутюз то наверно будет работать на километр. В
принципе чувак на счетверенную такую антену (наматывают проще меня - на
канализационную трубу) принимает сигнал с марс орбитера.
схемы которые я тебе прислал в последнем варианте я выпаял регуляторы 3.3
вольтов как для усилителя мощьности так и для низкошумящего усилителя и
подсоединил 3.3 вольтов 1 ампер — вел себя регулятор совсем загадочно — поэтому
и выпаял
R1 and R2 в усилителе мощности — я поставил делитель и подобрал
сопротивление чтобы было 2.9 вольт — подтвердил осцилографом — в оригинальной
схеме была ошибка - исправил
С26 — моя вставка — иначе свитчи не работают — ошибка которую исправил
С34 — тоже - исправил ошибку
L2 — не знаю почему но поставил вместо 12nH — 8.2nH
затем исправил сигналы управляющие TX – RX – была глупая ошибка
разводки
затем была ошибка пропайки на U4
затем ошибся с размерчиками — конденсаторы 402 (1мм х 0.5мм) а резисторы 805
(2мм х 1.25мм) а я все зафуговал 402 — пришлось резать перед пайкой граунд
особождать место для больших резисторов.
если работать на одни антены то устойчивый прием по воздуху 500 -670 метров.
Если антену занести за стекло — то ничего не принимает и не передает — когда
поставил усилители — то на 500 метров проибивает через стекло — чувствуется что
усилитель начал работать — еще один признак работающего усилителя — когда захожу
за деревья — с услилителем достаточно направить антены — работает (а за темиже
деревьями с одной антеной — ни гу-гу) — также кажеться работает улилитель
низкошумящий — на расстоянии 500 метров по воздуху прием в обе стороны был более
уверенный чем на чистые антены
Что я не понимаю — первое — это конденсаторы на выходе и на входе — какой
длинны нужно держать трассы до и после конденсатора ?
И нахрень эти конденсатьры? Допустим для развязки — почему тогда в примере на
усилитьль мощьности 1.2 пикоФарады а на низкошумящий 2.4 пикофарады — или эти
пики типа, что попало под руку? Или эти пикофарады завясят от длинны х ширины ?
А от высоты не зависят? - Не я серьезно - пока все пропаяешь, на
дорожки припоя - насоплишь - горбатые дорожки получаются — нужно ли эти сопли
убирать или наоборот соплями регулировть пикофарады? А толщина платы - наверно
на емкость тоже влияет?
На кой ляд L1 – он мне столько крови попил — в рекомендованой
схеме написано — Could be removed (really?!) if -7dB(?!)
return (!?) loss (??!) is acceptable (?!) - Кому ЛОСС ?почему ПОТЕРЯ
ВЗАД? — а что -8 это значит нормально?
или -6 это совсем плохо? DB чево? — а в каких случаях АКСЕПТАБЛЕ —
и это я скажу очень грамотная документация — по другим усилителям мощьности даже
ножек не приводят — паяй чо-хош — 16х15х15х... комбинаторных комбинаций —
простор для творчества.
Теперь антена — я ее припаивал на J3 через конденсатор и без
конденсатьра — вся плата как на снимке - тонкий провод прямо на конденсатор —
Yes ! вызывает интерес — антену как по науке паять - с конденсором
или беc?
Теперь подсоединение к блутюзу — сейчас это кусок японскиго коаксиального
уабеля (покупаю по большому блату и только у Ли на Мэйне — у других если
коаксиал дак солидный - в мизинец) длиной 25 см (длинна волны 2.4 Гига - в
будущем прямо на плате буду паять блутюз, но сейчас кабелюка) вопрос - от точки
припайки до конденсаторов сколько должно быть — 1/16 ? 1/32 ? -
длины волны? Или природа знает другие дроби?
Дальше — везде говорят «50 ом / 85 mil” or “50om /120mil” – и
умные такие фразы «50 ом выход» «50 ом на вход» — ну да! был такой дядя -
Ом, жену даже может Омшей звали— из тибета— с ударением на согласную -
все зудили ом-м-м - — ну и что! — 120 mil – это понимаю — на троих
будет 360 — в аккурат чекушка — разливающему бонус 15 грамм - Но причем тут Ом?
Может надо предварительный услилитель сварганить от блутюза ? — всетаки
усилитель мощьности для Wi-Fi. - а я его блутюзом — он бедненький
поднатужится поднапружиться — а мощьности нет как нет
Там еще на схеме шумоподавитель на QHX220IQT7 – но не с тем
шумом борюсь сейчас — я ее даже и не припаивал.
Как сказанно в понедельнике — не интегрируется функция типа звездной статистики
- там они потрошили золотую рыбку, а затем задавались вопросом - чего она
плавает - потому что ауквариум с живой водой или от осознания сказочной
реальности. А у меня ни воды, не аквариума, ни мыслей, ни золотой рыбки,
один ступор. Может тебе чего в голову придет
Шура
Jun 3, 2012.
Well, communication protocol done. Now core BT module (cubesat/lunar
modem) is capable to work in modes:
(a) 3 frequencies listening; 3 frequencies for transmit; 2
from 3 majority bits correction, bits shifting correction fix for preamble lost;
synchronization of a frequency switch; lost switch frequency correction; adjust
frequency on temperature drift.
(b) 1 frequency listening; 1 transmitting; the same functionality as
on (a) but switching is disabled.
(c) 1 frequency listening; 3 transmitting; again same
functionality; that will be main mode for a cubesat and lunar probe.
(d) 3 frequency listening; 1 transmitting; difference from (a) that
it will be 3 receivers monitoring 3 frequency but transmitting goes over 1
frequency. That mode will be on ground station – to maximize probability for
cubesat/lunar probe to get less noisy data;
In mode (d) instead of processing and fixing packets inside micro processor
data will be tunneled to a PC and fix of data can be done locally on a more
powerful desktop, or distributed to network of a computers for simultaneously
error correction (for such process can be used screen savers with instant win
notification for a Team Plan B supporters).
Mode (c) allow to have transfer data from cubesat/lunar probe without delay for
frequency switch synchronization. That can increase data transfer from 50
kbit/sec to 70-80. Transfer date for upload is not critical. Another reserve is
tweaking core module from 250kbs to 1mbs – that can give increase of a speed up
to 160kbs for download data from cubesat/lunar probe, for sure such increase
will require more computer power after ground station processing, and will make
a sense only with good network of a “fixing” packets screen savers.
Why to invent a communication protocol? Usually 99% of a time of software
development spend (lost) on following standards. Needs to do something fast ==
ignore standards and write from scratch (see code at
http://www.adobri.com/misc/STM_BT/STM_BTCM.c).
Range test, two helical antennas, one for Cubesat prototype 3 turns
http://www.shapeways.com/model/322768/small_2_4ghz_antena__for_cubesat_.html?gid=sg85851,
another for a ground station with 1/3 of a turns on 3D printed antenna
http://www.shapeways.com/model/322767/2-4ghz-antena.html/?material=6,
transmitting power 1mWt, LNA 12dB. Normally that is a Bluetooth with a range of
10m. Testing on 25m == OK, testing on 100m == OK, but it shows that best
reception will be with antennas pointing 10-15 degrees up instead of direct
pointing (do not judge seriously = truly speaking designers was zero experience
in antenna’s design), test over water at False Creek at Vancouver did not show
good reception – looks like ground or water disturb signal, lifting tripod with
transmitter and receiver manually just 1m up improve communication. Problem was
corrected on a 5 block near Queen Elisabeth Park – road is strait, not much
cars, hills from both side == manual holding and pointing allows to confirm
communication over 450m.
That actually brings limits of a test for a ground station, the best place will
be a Squamish Chief == face of cliff is around 700m and ground station has to be
pointed with 45-60 degree to horizon.
Next step – amplifiers to increase power transmitting to 1Wt (in Canada allowed
4Wt), and mobile ground station assembly/functionality.
Nov 3, 2011. (translation
of a prev) Ok Alex - this is a situation – the
magnetometer – yesterday (all my troubles seemed so far away…) got from it
accuracy 0.3 degree with capability to increase accuracy to any desired
precision (first luck in last month). For sure in the magnetometer exists error
related to a different measurements on different axis, but this error can be
corrected by calibration, on big paper sheet I just marked angles – taped
magnetometer to a wooden cube (yes, I am still playing with a wooden cubes – the
are not magnetic) with long aluminum ruler, do measurement on each axis and
corrections hammered directly into a (flash memory) table.
Magnetometer allowed to confirm (surprise!) latitude of aVancouver– yesterday on
my uneven table 18.1 degrees matched perfectly (angle btw horizon and direction
of a magnetic field’s vector).
Model of a (earth) magnetic field is simple – some cos() – sin() functions and
somewhere (already forget where – in saved spreadsheet) something divided in
half. Loaded yesterday (year 1977) FORTRAN’s programs by Nikolai Tzigankov. He
made nice model of Earth magnetic field including influence of a solar wind on
far distances from the earth. Needs to convert code to C, and adapt it to my
simulator/tra-calculator. This for sure will take a time (no less a week),
conversion takes no longer then hour(s), but needs to be careful with default
names of integer/float variables, and mostly time spend on each line
verification.
About “gyro navigation device” == “my shame” == “not finished” – one week ago
understood what needs to do (or may be just foolish-ing myself that understood)
– after magnetometer calibrations and implementing (magnetic) model plan-b for
software == 2 second on a orbit == 16 km == vector of a magnetic field can
change 0.3 degree – the same error will be in the magnetometer – for one second
confirmed error is 0.3 (for 2 seconds it will be 0.15-0.2 degree ), then gyro’s
readings corrected by temperature calibration, that will give: (a) gyro angles,
(b) magnetometers angles, (c) difference in angles by gyro, (d) difference in
angles by magnetometer. (a) + (b) flying independently against each other, but
if (d) is less 0.3 on all axis then (c) is a correction’s value. On my
microprocessor with 500 bytes can be perfectly implemented (c) and (d) without
losing single bit – 2000 readings == 32K, dividing (like in a school) by
logarithms and arctan(sqrt()) from Bradis table (school’s technology proved
faster 100 times). Correction on magnetometer axis’s readings is in flash table
too. I think it can be fit into 1MB (1.20$). if (not) then 1.81$ (4MB) will be
suitable;
Difference in gyro implementation for rover – instead of a magnetometer it will
be accelerometer – all software is the same.
Difference in gyro implementation for a ground station == zero (it is possible
to use magnetometer + gyro + accelerometer to demonstrate effective trick ==
detection of earth rotation with a device totally not capable to so – trick will
be nice but it is extra == does not worth spend time on it).
I thought that I was loosing time (and time is not my friend for today), but
after careful examination Boris Chertok’s book I found that story about Luna9
has had similar problems/questions – 1 second (1/60 degree) error == 200km error
on the moon, gyro, not enough power for a gyro, burned devices at tests, power
station does not work, absence of telemetry out of a ground stations,
orientation using sun-earth-moon, gyro does not get enough time to reach
precision because of a power limitation, earth’s image was on a corner of
sensor, failed deadlines, lost money and etc. One of a sample “bug” reported by
Boris – after lost probe was found that one department (hundreds of people
assigned to do trajectory calculation) understood “clockwise” direction totally
opposite the understanding by another department. Only 14th attempt was
successful.
Oct 25, 2011..Саня,
докладаю - ситуевина значит такая – магнитометр == позавчера - получил от него
наконецто точность в 0.3 градуса - могу теперь эту точность повышать практически
до бесконечного нуля - в магнитометре конечно присутствует ошибка связанная с
неравномерностью замера силы магнитного поля (полля!) по осям – но эту ошибку
приготовился исправлять с помощью калибровки - на листе бумаги нарисовал углы -
прискотчил прибор к детскому деревянному кубику с люминевой линейкой, замеряю по
трем осям и прямиком в таблицу.
Магнитометр позволил определить широту Ванкувера по наклону магнитного поля -
вчера для моего колченогого стола 18.1 градус совпали прекрасно.
Модель магнитного поля простая - синус - косинус и уж непомню где, но пополам .
Загрузил вчера 1977 года фортрановские программы Николая Циганкова - он сделал
достаточно точную модель магнитного поля земли - включая солнечный ветер на
больших расстояниях от земли. Нужно будет переводить код в Си для моделирования
- займет конечно временя - не меньше недели.
По поводу гироскопа - незакончил - неделю назад понял что нужно делать (или
думаю что понял)- после проверок точности магнитометра буду с софтвером так - 2
секунды полета == 16 км - за две секунды магнитное поле уйдет на 0.3 градуса -
та же точность будет у магнитометра - за одну секунду 0.3, (за две будет гдето
0.15-0.2) - т.е. порог замера. Затем гироскоп считывает по уже существующей
температурной калибровке и получаю- (а) гироскоповские углы (бэ)
магнетометоровские углы (цэ) гиро за 2 секунды (дэ) магнитометр за две сукунды -
(а) и (бэ) плывут друг от друга как труба им на душу положит. Но если
магнитометр покажет (дэ) меньше 0.3 по всем осям - значит (це) это ошибка -
которую и принимаем в какчестве корректировки. На своем микрочипе в 500 байов
памяти прекрасно могу сделать (цэ) и (дэ) плавющими без потери точности -2000
замеров == всего лишь 32К - деление как в школе по логарифмам - арктангенс из
квадратного корня по таблице брадиса (разов 100 быстрее) - коррекция осей
магнитометра в ней же - даже думаю в доллар 20 умесчюсь (1МБ), если нет - то
доллар 81 пойдет (4МБ). Может придется делать температурную калибровку гироскопа
по каждой оси отдельно (перпендикулярно земле).
Разница в гироскопе для луного трактора - вместо магнитометра беру акселерометр
и весь софтвер тот же. Разница в гироскопе для наземной станции – никакой
(моожно конечно испоользовать магнитометр для эффектного фокуса –
демонстрировать вращение земли на обрудовании неспособном такое вращение
детектировать – но это лишнее). Думал что теряю вермя - затем заглянул в книгу
Бориса Чертока – все теже мои проблемы - гироскоп - его питание – спалили прибор
при тестирвании - отсутствие телеметрии вне наземной станции - ориентировка по
солнцу земле луне - гироскопу дали недостаточно времени на раскрутку, земля
попала в край картинки. С четырнадцатого раза только удалось все правильно
сделать.
Oct 11, 2011.
Fiasco with Gyro. Hope with magneto sensor
Testing gyro was calibrated for range of temperatures, calibrating values 64K of
3x16-bit words was stored in memory. Gyro has fixed in stable position with X
axe oriented to a North Star, Y to the West and Z orthogonal to X-Y forward to
the Earth’s rotation axe. Drift of a zero was in a range of 5 degree per 256sec
(4 minutes). Sensor was forced to max possible sensitivity (undocumented future
in ITG-3200, but it gives 1/115=0.009 degree per sec – it still require 10
better sensitivity to detect earth rotation). Sensor set to 296 samples per sec
(microprocessor is slow – needs to be at least 32MHz).
Zero drift was random (range from 0.01 – 5.0 degree per 4 minutes) and not
depend of a derivative of a temperature. Drift was related to an orientation of
a gyro, and on a previous gyro’s readings (possible that factory calibration
gives drift).
Such drift is totally not acceptable for navigation, needs to eliminate error
first.
On The Earth or on The Moon it is possible to do this by reading accelerometer
and magnetic sensor orientation. Field of gravity is stable on the Earth and the
Moon, and magneto sensor readings on the Earth are stable too (for sure to some
extend). Reading from accelerometer gives absolute reading. Flying average from
accelerometer can give good indication of an absence or existence of rotation
and can allow to exterminate gyro’s zero drift.
Normally this is done by Kalman filter, it assuming that absolute direction is
for a gravity field and based on that assumption correction to gyro’s readings
(speed of a rotation) can be done. Kalman filter works good when noisy
measurements done for predictable object. It is nice and well known approach,
source code available for such filters including combination of 3-x
accelerometer and 3-x magneto sensor. But such approach is not working on the
low Earth orbit.
Hope is for a magneto sensors – first needs to calculate flying average of a 3D
magnetic field orientation. If flying average during 2 sec (500 samples) is not
in moving than current drift of a gyro assumed as a zero. Then time measured for
a slowest changes (derivative of a orientation) gives point on a orbit when
satellite crossed equator. Two times btw crossing the equator can give Keplers
elements of a orbit. Checking point will be apogee and perigee – direction of a
magnetic field at those two points must achieve maximum of a derivative of a
direction of a magnetic field. Current position of a magnetic poles will give
offset for a final Kepler position’s calculations (offsets unlikely will be
known until reaching the orbit).
To fire engine at precision direction offsets of a targeting magnetic fields
series of magentic sensor orientations can be downloaded to onboard microchip
and verified during 15-20 minutes before engine’s ignition. This will require
8Mb data transfer from ground station 1-2 orbits prior engines firing. Less
precision will require for antenna orientation to support such data transfer
session. The same approach but with accelerometer can be done for orientation
antenna on the Moon surface. For testing magnetic sensors approach can be used
rotated magnet in shielded camera, different plane rotation gives simulation a
different inclination of the orbit.
Oct 3, 2011.
Power Plant.
Solar panels combined in 4 groups. 4 high capacitance capacitors can be charged
by any solar panel’s groups . To control such process require 16 pins for a
control. Then 4 charged capacitors can give power to 4 main users of a power –
(a) backup micropocessor and main electronic including main computer;
(b) backup communication;
(c) main communication amplifiers;
(d) orientation stepper motors/ 2.4GHz antenna deployment.
This power distribution require another 16 pins.
Power source for main communication amplifier controls by pins on a STM_BT
microprocessor. Power source for stepper motors controls by STM_SM
microprocessor. Power source for a main electronics controls by STM_MEM
microprocessor.
Assumed 3 different mode of power operation.
- Initially first capacitor gives power to STM_MEM module. When it powered up it
can monitor state of any 4 capacitors and switch itself power source to any of
it. At this point all onboard electronics and users are switched off.
- Then at a time when it is enough power accumulated by power plant STM_MEM can
go to second mode - powered backup communication module, gyro module, camera
module, stepper motors/orientation module, main communication module. Each of
the modules on a request from command stream from STM_MEM can initiate backup
communication, make a picture, store it in STM_MEM flash memory.
- All power mode can be initiated from this moment – STM_MEM can power main
processor module (80-90 mA 3.3 V). From this point of a time main processor
takes care of all control. Main processor can prepare sequence of a commands and
stored it back to STM_MEM module and can send a request to power down itself to
save power in orientation stage and backup communication time. Main computer has
to be powered on for a communication session with a ground station, session time
window is 5 minutes.
Goals for a test flight are: see ref.
Sep 17, 2011. Supporting commands for transport layer reduced to 3:
1) <unit>~<unit>
serial communication loop is functional.
2) <unit>=XCY<unit> Where:
X
– unit to retransmit data
C – command to retransmit
Y == ‘I’ – retransmit output
from com to I2C
== ‘C’ – retransmit output from I2C to com
== ‘i’ - I2C output
expected to be processed inside unit
In unit allocated 3 queue – One for serial
input, another for I2C input, and third for output (output can be serial or I2C,
but output queue is only one). Command “=XCI” force input from serial to be
transmitted to unit ‘X’ with command ‘C’ over I2C line. Command “=XCc” force
input from I2C to be transmitted over serial output to unit ‘X’ with command
‘C’. CMD ‘C’ can be set as ‘ ‘ (space) this will skip inserting command into a
retransmission. The same correct for a ‘X’ unit address for retransmission –
setting ‘ ‘ (space) will force retransmit but without sending unit address. This
is convenient to retransmit data from memory storage over I2C to any unit. Also
setting X =’ ‘ and C = ‘ ‘, useful to accept stream from a file on memory
storage as a command stream. Stream from serial (like camera data) can be
processed as a command or as not command stream. “=XCy” command take effect
after finishing process of a CMD stream of ether from serial or I2C. Y == ‘i’
placed for convenience – normally unit commands can manipulate flag
I2CReplyExpected and I2CReplyCMD for process responses (read operation) from I2C
devices.
3) <unit> ‘<’ <I2Caddr><data>’@’
or:
<unit> ‘<’ <I2Caddr><data><unit> or:
<unit>‘<’ <I2Caddr><data> ‘>’
<bytes-to-read>'@' or:
<unit> ‘<’ <I2Caddr>
<data> ‘>’<bytes-to-read><unit>
When received this command (from I2C or serial input) this force
retransmit data over I2C to device with I2Caddr. Placing ‘>’ at the end of the
command with force I2C set Stop-Start condition and read response data from I2C
device.
Unit processing individual commands can insert sequence ‘<’ to work with
I2C device. For doing this needs to call the same function ProcessCMD.
For
command/stream handling used 3 callback functions.
unsigned char
CallBkComm(void) // return 1 == process queue;
// 0 == do not process;
// 2 = do
not process and finish process
// 3 == process and finish internal process
Function called in a serial->I2C retransmit state each time before processing
bytes from input queues. Return code allows specify end conditions for
retransmission. In case 0 function needs to pop queue byte by itself.
unsigned
char CallBkI2C(void) // return 1 == process queue;
// 0 == do not process;
// 2
= do not process and finish process
// 3 == process and finish internal process
With the same logic for handling retransmit conditions I2C -> serial.
unsigned
char CallBkMain(void) // 0 = do continue; 1 = process queues
This function calls
each time in a loop of processing both input queues. I2C queue has priority over
serial.
Timer / clock layer:
Timer / clock to measure correct time inside unit – it
has 5 bytes
unsigned char TMR130;
unsigned char TMR1SEC;
unsigned char TMR1MIN;
unsigned char TMR1HOUR;
unsigned char TMR1DAY;
Clock based on 8Mhz internal
oscillator and it gives around 30 interrupts per second, seconds accuracy depend
only on a stability of a internal oscillator. 29 counts of a 1/30 of a second
different from last count – last count adjusted to properly set seconds. For
synchronization of a timer command is:
‘T’<Day<hour><min><sec><adjust1>
Next MCR will be set clock to adjusted value. Setting any of day/min/hh/sec
as a (space) will skip adjusting corresponded parameter.
Second timer can be
used for setting any timers events – CallBkMain can be used to check firing
timer conditions via Timer0Fired flag. ‘t’ prescaler timeout can set both
prescaler and timeout value.
Source code organization for units:
1.
For retransmission serial->I2C, I2C -> serial, code for individual unit can be
placed in call back functions for handling retransmissions.
2. For out of queue
processing and for timer related events code for individual unit can be laced in
Main Call Back function.
3. For processing stream out of CMD, code can be placed
in a section before commc3.h include.
4. For processing executing prioritized
CMD execution, code can be placed before commc4.h include.
5. For processing CMD
normally, code can be placed after commc4.h include (till end of a function
ProcessCMD).
Design considerations:
1. Each unit can accept command from each
unit. Each command can produce commands for any unit. Functionality of each unit
independent from other unit. Stream of a commands traveling over serial and I2C
support functionality of a vehicle and craft. Functionality of each unit for
craft should be used for vehicle.
2. Protocol layers separated into a modules
and can be included in individual unit’s source code by include statement (not
library).
3. Debugging of a code has to be done over simulators as much as
possible.
4. Debugging of a code out of simulator has to be done by LD
indicators with traps to switch LED on-off. This make debugging process more
complicated but force to keep all code "in-head".
5. Encouraged to use
“goto” operators – this gives a real binary size savings (50%). Saving the size
can give advantage to place two version of the same software in the same unit
and quickly switch use of not damaged part of a binary.
6. For each individual
unit must be accomplished testing serial sequence with verification expected
output.
7. This is not a “good” design according modern technique software
practice. All modern recommendations about software design was analyzed and
accepted as not suitable for critical missions like space flight.
see download page for source code
Camera unit
commands (module STM_CM.C controls available Jpeg camera):
“R” – reset camera
“P” – take picture
“G” – transfer image file serial->I2C
“B” – picture size
640x480
“M” – picture size 320x240
“S” – picture size 160x120 0x76 – responses
from camera
Format of transferring file <0x76> <length-of-the-file-4-bytes><jpeg stream>
Memory storage unit commands (module
STM_MEM.C controls OpenLog flash memory
storage);
“S” set file name for a storage
“G” prepare to get file from any unit
“O” output file to any unit
“E” executes file as a command stream
0x76 store
stream from I2C to memory unit
Gyro control and stepper’s motor units (for now
they are the same unit, module STM_GYRO.C)
“t” – set percaler and timer
“w” –
wait for timer’s timeout
“s” set bits control on stepper motor
“p” – plus step
“m” – minus step
“g” – hold Gyro position X Y Z
“G” – hold Gyro position X Y Z
with delta offset DX, DY, DZ, in N steps with delay btw steps T
“l” – learn
response on a step of a stepper motor.
Sep 12, 2011.
Protocol supporting commands (I2C multimaster, com as a loop):
=X
- reply to unit
!X
- reply CMD to unit
~
- com loop is working
"<"<I2CAddr><DATA>@ or:
"<" <I2Caddr><data> <unit> - for transfer data to <I2CAddr>
via I2C
"<" <I2Caddr><data>">"L@ or:
"<"<I2Caddr><data>">"L<unit> - where L is a
length data to read – transfer data to via I2C and wait for reply from
the I2C unit
^ - retransmit reply from com to I2C
% - stop retransmit reply
from com to I2C
+ - starts to treat everything from a com as a CMD
- - stop
to treat everything from a com as a CMD
For camera CMD:
'B' - big picture 640
480
'M' - medium picture 320 240
'S' - medium picture 160 120
0x76 - this will
be response from camera
'R' - reset camera
'P' - take picture
'G' - get jpeg
picture
Testing source code for camera on PC : cm_test.cpp,
cm_test.h,
cm_test.rc,
cm_test.sln,
cm_test.vcxproj,
Resource.h,
stdafx.cpp,
stdafx.h,
targetver.h
Camera module source code in progress: commc0.h,
commc1.h, commc2.h,
commc3.h, commc4.h,
commc5.h, commc6.h,
commc7.h, serial.txt,
STM_CM.c,
STM_CM.mcp,
STM_CM.mcw
Testing source code for Gyro on PC: gyro_test.cpp,
gyro_test.h,
gyro_test.rc,
gyro_test.sln,
gyro_test.vcxproj,
Resource.h,
stdafx.cpp,
stdafx.h,
targetver.h.
Gyro module source code in progress:
STM_GYRO.c,
STM_GYRO.mcp,
STM_GYRO.mcw,
serial.txt
Sept 6, 2011
- Communication protocol changes. (Source code in progress). Unit
must be capable to support serial and I2C multi-master protocol in different
configuration. Unit interfacing “serial device” needs to relay received and
transmitted data from “serial device” to another unit via I2C. Units interfacing
“I2C devices” needs to relay received / transmitted data via serial. All serial
units linked each other into a ring. Serial out of each unit connects to serial
in of a next unit. Propagation delay (in transfer data from unit N to unit K
will depend on an amount of units btw N and K. Serial communication speed -
56K/s, I2C around 200-300Kbit/s. Un-standard speed for serial can be set to
100Kbit/s, but temperature instability can reduce speed back to 56-32k. Each
unit can change speed of communication. On master reset serial speed is 9600.
Each unit on “power-on” transfer over serial loop sends greetings message.
Traveling over the loop this message ended up at originated unit and loops
functionality verified. Main processor unit can monitor traffic and detect all
functional units. The same technique of traffic monitoring can be useful to
avoid re-transition the same data. I.e. “Camera unit” send data to a “memory”
unit at the same time main processor grab data for IKV processing and/or “24Ghz
communication” unit can relay packages from “Camera unit” to “memory” with
retransmitting same packages to ground station.
Packets over I2C addressed to a unit process as CMD stream inside the unit.
Serial packets format:
<unit><packet><unit>
Unit scans serial stream for matching unit’s address, relay data not addressed
to unit. If inside a packet present byte equal any Unit-Address-In-System, the
byte has to be escaped (by transmitter) with ESC char = “#’. Out of packed data
stream also can have ESC chars to distinguish data from a packets.
3 queues: (a) for input serial stream, (b) for a output serial stream/I2C, (c)
for input I2C stream. If unit require I2C communication output queue was to be
emptied. The same with serial - only when output queue will be empty from I2C
write stream, then serial output takes control.
Packets:
<unit>~[message]<unit> - serial loop test message – unit send its own address – message
will end up in originated unit. Command “~” is indication that loop is
functional.
<unit>Ayyyyyxx@<unit> - request for unit to send a message “yy..yy” over I2C to unit
“A”; “xx” is requests of a bytes to be read from the I2C. If message is big it
sends over I2C by 10 bytes packets.
<units><speed><unit> - where speed = ‘9’(9600)| ‘1’(19200) | ‘3’(38400)| ’5’(57600)|
’0’ (max)
<unit>=A<unit> - request to set address of the “reply” unit.
<unit>!C<unit> - request to set CMD in reply packet.
i.e unit <5> needs to check on unit
<3. what is a clock reading – it send this stream:
3=#5!t$3 - <3> is a target
unit address,
“=#5” == “=5” set reply address
“!t” = set “t” command for reply
“$” – read timer value
Response (reply) from unit 3 will be:
5t#1#2#3#4#5#6#7#895 – <5> is a target unit
“t” timer reading 12:34:56 counter
789 (with maximum units in system ==8)
Over I2C first packet will be 3=5*t$ and
response packet will be 5t12345678.
Another sample: Power plant unit <4> needs
to orient satellite by XXX YYY ZZZ for better energy harvesting. It send packet
to a stepper motor unit <3>:
3-XXXYYYZZZ3
Stepper motor will compare readings
from gyro and adjust positions.
Same command can be send by main processor to
adjust direction to a ground station.
Command 3+xxxyyyzzzDvxDvyDvzNNNLLLL3 can
be send by backup communication to set communication session. Xxx yyy zzz is a
starting orientation, and Dvx, Dvy, Dvz is a delta for a linear approximation of
motion on the orbit, NNN is delay to apply delta, LLLL is amount of cycles to
perform.
Sequence for commands like 3+xx..3 can be presorted in a memory unit.
At the finish of command execution unit can send request to memory for another
command.
<unit>^<unit> - echo everything from serial-in to out with ESC insertion
<unit>v<unit> - remove any ESC from serial-in
i.e. Main processor unit <8> using com1 as
IP dial up connection. Communication <2> unit’s TX connects to <8> unit’s RX.
<8> unit’s TX connects to power plant <3> unit’s RX. At the end of the loop
communication <2> unit’s RX getting the stream. Sequence send by unit <8> is :
2v23^3 . . . . . . . whatever stream require for IP communication. ….
To switch
off that mode needs to set MCLR for unit <2> and <3>
Packets can be inside each other
– for example last sample 2v23^3 can be changed to
2v3^32.
If serial stream is
out of packet any unit can insert its own packets for transfer.
If unit echoing
some serial packed addressed to unit N, then unit can insert another packet
addressed to unit K, where K < N, otherwise it needs to wait for the end of the
packet.
Execution of a CMD can be immediate after receiving command or delayed
to the end of the package.
Each unit has MCLR(RA5) (h-l-h for reset),
PRG(RB3,RB6,RB7) pins. Units with less pins used can be utilized to perform
reset and reprogramming functions for neighbor unit. Four unused pins can
reprogram / reset one unit, 5 unused pin – 2 unit, 8 can reprogram and reset 5
units. Separate programming port and reset shell be used for a main processor
unit.
June 17, 2011 – IUP
(Inter Unit Protocol) was re-designed from old code – now each unit has serial
output connected to nearest unit’s serial input. I.e. main computer serial
output connect to Transmitter’s serial input, then Transmitter’s serial output
connected to Receiver’s serial input, and Receiver output connected back to main
computer serial input. In passive state bytes from any units travels (looping)
over entire net. Integrity of all network can be verified by any units
individually. NAND gates can be used to bypass un-functional unit. RST in high
state will enable transmit data btw nearest units, and pull-down resistor can be
used to skip broken. Both microcontrollers (16LF88) for LDF (Laser Distance
Finder) transmitter and receiver designed to be exactly the same (difference in
command “wW” and “wV’ – W set W/R high, and V set ports bus into input mode).
Source code: STM_LTRX.c, and for and
project: STM_LTRX.mcp,
STM_LTRX.mcw
Everything under this line when to the garbage.
================================================================================
Feb 5, 2011 – From
redirection cases one remain unimplemented – in a time of receiving /
transmitting packet needs to switch (by default) two remain channels in
redirection state. It will be not a problem but needs to find “good” solution.
Good in sense to be a small code. Also implementation of a time sensitive motor
commands will require some tailoring – ether it will require special event block
for TMR1/TMR0 or independent implementation using TMR2. Main function 0x3X for
stepper motor implemented (by the way it takes only one processor command MOV).
Now it is possible to port protocol to communication unit (modem), guidance
unit, storage unit, and camera unit.
For stepper motor also needs
to implement temperature sensor reading via analog/serial input.
Power station for stepper
motor will include analog reading on capacitor/battery.
Changes in design was updated
blow.
Jan 26 2011 – Original
design was changed - 3 pins only will be available to connect network
RB7,RB6,RB4 (or RB5 depended on communication serial/ I2C / serial asynchronous)
speed was reduced dramatically to 8 kbit per second (data actually can be
transferred twice faster 16 kbit) for now the code works with send/receive.
Redirection will be later. Commands for discovery neighbourhood will be on Unit
level. Code size for communication (only) 1024 bytes. Communication code will be
base for another Units like Storage, Cameras, BT, Gyro, accelerometers. Left to
implement Redirection (will add some size), stepper motors commands.
Source code here.
Jan 11 2011 – well – it
is hard to mix together coding and
birthday
party
+ Christmas
celebration – but it is not evening et. Interrupts on PIC16F88 are working –
max # channels per unit limited to 3 (one pin has to be reserved to Serial/ I2C
communication- it is pity), and serial communication over channels better be
coded not using regular algorithms (check for high-low transition – delay time=
½ of a bit’s speed – delay time= bit’s speed – read bit and accumulate byte –
delay –read-delay-read, etc.). Better approach (in view of saving progr memory)
is to – interrupt on pin changes – then check time elapsed from first high-low
transition – timing will give nice transmitting byte – and if value of a byte
can be ignored (re-transmission from neighbor unit) it give processor slice of time.
Jan 7, 2011
– controller communication design. Target device PIC16F88. Design target - to
get communication independent from connection’s configuration. Each unit
(Stepper motors, transmitter/receiver, main on-board computer, gyro-system,
power station, backup control unit, cameras) will be connected based on topology
of a probe/vehicle.
Targets in development on Jan 7, 2011:
-
Jan 10 2011, get draft communication working
-
Jan 17 2011, get working on-board computer with
stepper motor unit.
-
XXXX 2011, get working on-board computer with
transmitter/receiver.
Lets see how it will go.
Stepper motor
controller communication draft.
UNIT – internal unit number 1 byte
U – 0xXX – copy of the unit number stored in offset 0x00
Unit address is 6
bit long, total 63 addresses. Address 0x3f reserved for all units.
CLOCK - Internal clock format 6 bytes:
for set time copy in EEPROM offset 0x01
DHMSXX
D
0xDD - day
H
0xHH – hour
M
0xMM – minute
S
0xSS - second
XX 0xXXXX – 1/65535 of
a second
DELAY - Internal delay for a steps in
sequence, 2 bytes
copy delay's value stored in EEPROM offset 0x07
DD
0xDDDD – delay btw steps in sequence of 4
1000 – 0010 – 0100 – 0001 or 1001 – 1010 –
0110 – 0101
SEQ - internal sequence for movement 4
bytes
copy stored in EEPROM offset 0x09
SSSS -
S
- 1 step
S - 2
step
S - 3 step
S - 4 step
ISPC - next CMD in sequence (in EEPROM), one byte:
C
0x00 execute command from a memory buffer
0xCC – read command from 0xCC EEPROM location and execute it
0xFF – nothing to do – controller in wait state (not a "sleep)
commands:
in EEPROm offset starting from address pointed by ISPC
NBR - Neighbor Unit
1000 0000 -
(implemented) received message used as to identify neighbor unit –
basically this is NOP operation – one unit inform its address.
1100 0000 -
(implemented) received message used as to identify neighbor unit –
and ask to transmit back its address In response unit send back 1000 0000
command.
OUTPUT –
(implemented) output 4 bits for stepper motor
0011 XXXX – set bits for Stepper motor
FWD – forward movements movements
0001 0001 - 1
step FWRD
0001 xxxx
- '0001' – '1110' 1-14 steps forward
0001 1111
- continuous forward
BWD – backward movements
0010 0001 – 1 step back
0010 xxxx – '0001' – '1110' 1-14 steps backward
0010 1111 – continuous backward
WAIT – switch controller in wait/SLEEP state
1111 0000 – controller in wait state (different from a
SLEEP state)
1111 0001 dddd dddd dddd dddd – wait DD timer ticks
1111 0010 DHMSXX
- wait clock for DHMSXX
in this mode controller can not be in SLEEP state
this command has to be
1111 0011 – switch controller to SLEEP state (low power) –
switching to SLEEP state makes clock unpredictable
WRT – write to program memory
1110 0000 LLLL LLLL AAAA AAAA AAAA AAAA DDDD
L-L bytes to write
A-A – address
D-D – data
RDM – read program memory and send to U
1101 0000 LLLL LLLL AAAA AAAA AAAA AAAA UUUU UUUU
L-L bytes to read
A-A – address
U-U – byte receiver unit
RDA – read analog inputs from A1-A4 and send to U
1101 00XX UUUU UUUU
RDE – read EEPROM and send to U
1101 0100 LLLL LLLL AAAA AAAA UUUU UUUU
CHK – calculate checksum for a EEPROM and send it to Unit
1011 0001 LLLL LLLL AAAA AAAA AAAA AAAA UUUU UUUU
L-L bytes to read
A-A – address
U-U – byte receiver unit
CHK – calculate checksum for a program memory and send it
to Unit
1011 0000 LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA UUUU UUUU
L-L bytes to read
A-A – address
U-U – byte receiver unit
SET
1100 0001 D
set byte D to ISPC
1100 0010 DHMSXX – set Clock to DHMSXX
1100 0011 DD -
set 2 bytes delay btw sequence
1100 0100 P -
set presaler
1100 0101 SSSS – set 4 bytes sequence for motor movement
1100 0110 B – set mask for Port B input bus
1100 0111 B – set mask for Port B output bus
Each unit set status “BUSY” on command execution. In "WAIT"
state unit can accept new command. If unit in “BUSY” state it can be interrupted
by command with interruption request.
Changes in design.
Case 1:

message from ch0:a0 02 11 80
a0
to neighbor
02
len = 2 bytes
11 from unit 11
80 store neighbor adr
then second message
ch1:81 02 21 80
81
to unit 81
02
len = 2 bytes
21
from unit 21
80
store neighbor adr
fc /b test_1_nbr_adr.bmp test_1_nbr_adr.sam
>error.txt
if errorlevel 1 goto ERROR1
echo test_1_nbr_adr OK
goto nexttest
:ERROR1
echo ERROR in test_1_nbr_adr
:nexttest
case2:

message from ch0:81 02 11 c0
81
to unit 81
02 len = 2 bytes
11 from unit 11
c0 store neighbor adr
and sand back on same ch CMD 80 on ch0 unit will
response:
11 02 81 80
11
to unit 11
02
len = 2 bytes
81
from unit 81
80
CMD 80
case 3:

message from ch0:21 02 11 80
21
to 21
02 len = 2 bytes
11 from unit 11
80 store neighbor adr
this will redirect to ch1 all message
21 ->
wait for OK impulse
02 11 c0
case 4:

message from ch0:21 02 11 c0
21
to unit 21
02 len = 2 bytes
11 from unit 11
80 store neighbor adr
this will redirect to ch1 all message:
21 -> "NO" impulse
to ch2
21 -> wait for "OK" impulse
02 11 c0
case 5:

message from ch0:21 02 11 80
21
to unit 21
02 len = 2
bytes
11 from unit 11
80 store neighbor adr
this will redirect to ch1 all message:
21 -> "NO" impulse
to ch2:
21 -> "NO" impulse
case 6:

message from ch0: 81 + timeout
case 7:

Communication protocol (see changes above).
Input buses monitored and serial input from any - read,
stored internally into buffer, and then executed if unit’s address matched. If
unit’s address does not match then data transferred to neighbour unit. On each
session neighbour’s addresses updated. Direction chooses by closest addresses in
unit’s neighbourhood.
Connection btw units can be in state “BUSY”. When data
transfer finished by event
(a)end-of-data +checksum
(b)end-of-data-TO(timeout)
(c)TO(timeout)
connection’s status assigned “FREE”.
Packets are:
<TO><I_AM><FROM><LENGTH><DATA>[<CHSUM>]
<TO> - 1 byte, whom this message to be delivered
<I_AM> - 1 byte, transmitting unit number
<FROM> - 1 byte, original message from
<LENGTH> - 2 bytes – length max 64K
<CHSUM> - 2 bytes CRC checksum. Can be skipped
<DATA>:
<FLAG> <COMMAND>
<FLAG='0x00'> – execute <CMD> immediately
<FLAG= 0xAA'> – store <CMD> in EEPROM at address 0xAA
If in field <TO>
high bit set ‘1’ – unit <TO> needs to interrupt execution of a command.
If in field <TO> high
bit cleared ‘0’ – and unit <TO> in “BUSY” state then response from<TO> unit fill
be with high bit set ‘1’. This bit will propagated to original transmitter
station and transmitter stop transfer.
If on
re-transmitter station all connections will be in “BUSY” state, then
re-transmitter reply its address with high bit set and transmitter will stop
transfer.
Samples 1.
On-board computer (Unit 0x01) needs to set a clock to day 7 hour 12
min 15
sec 16 xsec 0000 in stepper motor (unit 0x14):
first packed it send data to EPPROM memory for each unit
3F 01 01 00 09 10 c2 07 0c 0f 10 00 00 F0
3F
-
stepper motor 4 and all units
01
– On-board computer
01
– On-board computer
00 09
- 9 bytes of data
10
- store to EEPROM adr 0x10
c2
- cmd set clock
07 0c 0f 10 00 00
F0 – cmd WAIT
then On-board computer send command at 07 12:15:15:YYY
time:
3F 01 01 cc 00 03 00 c1 10
3F
-
stepper motor 4 and all units
01
-
On-board computer
01
- On-board computer
00 03
- 3 bytes of data
00
- execute immediately
C1
- cmd set ISPC
10 - execute at EEPROM
0x10
(where prev cmd stored)
YYY calculates by – 1000 msc - minus transmission time
– minus EEPROM read time (7 bytes) – minus store time (6 bytes) into internal
clock.
Addressing unit 0x3f instead of 0x14 will sets clock for
all units.