Commanding a Rocket Via Radio - Homemade Two-Way Datalink

Поділитися
Вставка
  • Опубліковано 31 тра 2024
  • Have you ever wanted to control your rockets via a radio link? This is a supplement to the DIAMOND-X Block 3 Build series exploring my radio datalink. This lets me send commands to my rockets on the ground or in the air. It also lets me get telemetry back from rockets mid-flight. I also use the same communications protocols when sending data over wired connections to other devices like launch silos and cameras.
    Second Video (Worked Example): • Rocket Datalink Explai...
    Resources:
    Consistent Overhead Byte Stuffing:
    blog.mbedded.ninja/programmin...
    Super useful Arduino Tutorial including COBS and Packet Parsing:
    forum.arduino.cc/t/serial-inp...
    Caveats:
    I am not supplying CAD, Code or other files for the projects you see on the channel.
    The COBS process I describe is slightly different from the usual implementation. Instead of replaced bytes containing how far to look before finding the next replaced one, I replace bytes with the index of the next replaced byte. This is a slight difference but I didn't touch on it in the video.
    0:00 Intro
    0:52 What Is A Datalink
    2:15 Rocket Language
    2:44 Sending Commands
    5:26 Telemetry
    7:19 Making Packets
    12:01 Physical Layer
    13:39 Up Next

КОМЕНТАРІ • 112

  • @BPSspace
    @BPSspace 20 днів тому +121

    The unacknowledged command list on the GCS is brilliant - might adopt that for my stuff too! Glad to see you landed on sending multiple separate telem packets instead of a long string! I wish I had started doing that earlier, would have saved me a lot of trouble haha. Great video as always!

  • @jorsanflo
    @jorsanflo 20 днів тому +103

    Bipispace uploaded the same day as you, what a blessing

    • @AeonExploration
      @AeonExploration 20 днів тому +17

      ah yes bipispace

    • @Mionwang
      @Mionwang 20 днів тому +3

      I think you meant BiPiEsSpace

    • @Argosh
      @Argosh 20 днів тому +2

      ​@@MionwangI'm more interested what he did to make his autocorrect go there.

    • @t0k4m4k7
      @t0k4m4k7 20 днів тому

      Little competition going on? haha

    • @1islam1
      @1islam1 16 днів тому

      ​@@AeonExploration🔴 What Is Islam?
      🔴 Islam is not just another religion.
      🔵 It is the same message preached by Moses, Jesus and Abraham.
      🔴 Islam literally means ‘submission to God’ and it teaches us to have a direct relationship with God.
      🔵 It reminds us that since God created us, no one should be worshipped except God alone.
      🔴 It also teaches that God is nothing like a human being or like anything that we can imagine.
      🌍 The concept of God is summarized in the Quran as:
      📖 { “Say, He is God, the One. God, the Absolute. He does not give birth, nor was He born, and there is nothing like Him.”} (Quran 112:1-4) 📚
      🔴 Becoming a Muslim is not turning your back to Jesus.
      🔵 Rather it’s going back to the original teachings of Jesus and obeying him.
      More .....👇
      🔴 THE RETURN OF JESUS

  • @MarkHopewell
    @MarkHopewell 19 днів тому +25

    The telemetry theory and practice in itself far more satisfying than the "Ssssssshhhhhhhhf.....Phut!" of a 5 second model rocket flight.

    • @potatosalad68
      @potatosalad68 19 днів тому +2

      both. both is good

    • @MarkHopewell
      @MarkHopewell 18 днів тому +1

      @@potatosalad68
      I apologise if my comment sounded disingenuous. It wasn't meant to be.
      Such was the extraordinary effort put into the telemetry side of the project, it seemed, at least to me, a shame that wasn't put into a vehicle that reached the edged of the atmosphere.
      Everyone's interests, needs and level of fulfilment are different, obviously, but for me it would have been smashing to see it last more than a few seconds of flight - sort of extending the excitement for longer or expanding on the experience.
      I have a similar dilemma here in the UK but in terms of model UAV flights. Here we're forbidden to fly out of sight. Therefore, the type of aircraft I would like to fly, including their telemetry systems and their missions is out of the question. The fun police have put a stop to out of sight model flying after a nutter flew a drone too near aircraft at an airport as part of a harassment-come-protest campaign a few years ago.
      Either way, it [the rocket project] is fantastic work.

  • @Argosh
    @Argosh 20 днів тому +68

    "Error correction that I made myself", I see you like to live dangerously. 😂

    • @t0k4m4k7
      @t0k4m4k7 20 днів тому

      "this guy fucks"

    • @0xmassive526
      @0xmassive526 19 днів тому +3

      And painfully apparently

  • @blakeyoung681
    @blakeyoung681 20 днів тому +25

    bro gotta be on a watchlist by now

  • @frigzy3748
    @frigzy3748 19 днів тому +6

    One improvement you can do to the protocol parser is to store command codes + function pointers in a look up table, that you just iterate through. That gets rid of the switch statement and consolidates the entire protocol definition in one table, separate from the functional code. One step up is to keep the protocol structure separately in a JSON file or similar and generate .c/.h files as a build step. That way you don't need to mess with the code at all if you make changes in the protocol.

  • @alexscarbro796
    @alexscarbro796 20 днів тому +12

    Great treatment of the problem. Using "escape characters" are also a good way of dealing with important control characters (such as Start Of Packet, End of Packet etc) appearing in your data payload. The benefit of "escape characters" are that they can be inserted at the moment of transfer of the data to/from the microcontroller to/from the radio. They do not need to be computed beforehand. They just get inserted in the stream before transmission and extracted from the stream after reception. As an aside, It would be interesting to learn if your radio supports Forward Error Correction as a means of recovering from short bursts of noise.

    • @tijsp.8162
      @tijsp.8162 17 днів тому +1

      Wouldn't that just shift the problem from having a data byte with the same value as the start byte, to having a data byte with the same value as the escape byte?

    • @alexscarbro796
      @alexscarbro796 15 днів тому +1

      @@tijsp.8162 no, there is some particular logic around this solution. Two consecutive escape characters are considered as one data character equal in value to the escape character. Only control characters are preceded by a single escape. Any other character not preceded by an escape character is considered to be itself. It’s absolutely bombproof and works really well at very high speeds in low resource microcontrollers. It’s as old as the original serial port standards and works just as well today.

  • @vosechu
    @vosechu 20 днів тому +10

    How often does a command go unacknowledged? IIRC, for the PSAS rocket we had to do unacked UDP because TCP was taking too long at Mach 3.
    Also, do you have a way of indicating which commands are okay to retry? The launch command probably shouldn’t trigger twice for instance.

    • @LafayetteSystems
      @LafayetteSystems  20 днів тому +6

      On the ground, maybe 1 in 10 commands goes unacknowledged. It depends on distance, antenna geometry and noise floor though. The re-try on some dangerous commands is a good point though. Currently, I only allow about 5 retry attempts with a re-send every 400ms. That means if the command doesn't go through in 2 seconds, it stops trying to send. Currently, that is uniform across every command, but you could totally implement different max re-transmit attempts or different re-transmit delays for each command. I'll add that to the list of future link improvements!

  • @camillovidani2586
    @camillovidani2586 19 днів тому +6

    I think you COULD check the whole packet: since the value of the last COBS byte is almost freely chosen (anything from 29 to 255 is possible), if the CRC evaluates to 0xAA, just change one bit of that byte and the CRC will now be different ;)

    • @LafayetteSystems
      @LafayetteSystems  19 днів тому +5

      That's an interesting idea, I'll have to give it a try!

  • @RiwenX
    @RiwenX 19 днів тому

    Thanks for the video. I'm actually looking to implement some sort of network protocol for my custom-made devices, and it helped me tremendously to get the basic os COBS and how different layers relate. Can't wait for the more in depth video!

  • @KofiAsare0
    @KofiAsare0 20 днів тому

    Another great video, I love this rise in advanced model rocketry!

  • @argfasdfgadfgasdfgsdfgsdfg6351
    @argfasdfgadfgasdfgsdfgsdfg6351 17 днів тому +2

    What if the index that is held by the COPS byte is 170?

  • @aw_dev
    @aw_dev 20 днів тому +3

    You AND Joseph posted on the SAME DAY? Am I dreaming?

  • @fullflowaerospace
    @fullflowaerospace 19 днів тому

    i love this, i’m definitely going to use stuff like this in the future.

  • @yedski999
    @yedski999 20 днів тому +1

    Awesome work, love this series! Regarding multiple transceivers communicating over a shared channel (i.e. radio), do you need to use a multiple access protocol to avoid collisions between messages sent at similar times, or are such issues generally handled within the physical layer or by the checksum?

  • @weirdsciencetv4999
    @weirdsciencetv4999 19 днів тому

    Would chirped spread spectrum be a good candidate for the physical layer?
    There are some high speed LORA chips that could handle the bandwidth needed.

  • @12rjig13gb
    @12rjig13gb 18 днів тому

    I have a fairly similar packet implementation as yours, and what I'd recommend is that to use COBS to escape 0x00, and set the start byte to 0x00. So as long as your length of your payload is not 0 (which is always the case), you won't run into having several start byte in your header. In your example, the SCAPL might run into issue when length == 170

  • @AlnisSmidchens
    @AlnisSmidchens 18 днів тому +1

    Great video, thank you for sharing! How does COBS handle 170 appearing across bytes? For example 0b00001010 (dec 10) followed by 0b10100000 (dec 160) will appear to have 0b10101010 if the message starts to get read partway through. It seems your scheme would work if the starts of bytes are synchronized, but depending on the physical layer, I feel like you may have times when you get a corrupt packet which happens to have an unfortunate 170 in the middle. (or maybe this is rare enough that it does not matter and is handled by the checksum etc.?)

  • @JainZar1
    @JainZar1 19 днів тому

    Do you use multiple antenna or how do you solve the problem of the ground station and rocket sending repeatedly at the same time and how long do those transmissions last?
    If you essentially have to hit two 100 ms windows every second, it might be a good idea to add a clock sync. Depending on how much data you downstream.

  • @vacoff2717
    @vacoff2717 20 днів тому +1

    Great video, I am really interested in the avionics part. If you could make a even more deeper dive than your previous video that would be great

  • @madmonkey7183
    @madmonkey7183 19 днів тому

    That's amazing. Really interesting and very cool. Have you thought about releasing the system specification for others to use ?

  • @skyslycer
    @skyslycer 8 днів тому

    Just a quick question, why don't you just ignore the start byte if it ever shows up in the packet if that byte is still within the length specified at the beginning instead of doing COBS?

  • @simonabunker
    @simonabunker 18 днів тому

    Do you think you could need a version byte at some point, or are you just be going to keep all rockets and launchers in sync. COBS does seem clever - I have been recently experimenting with sending binary data over serial (which is how I found out Arduino Unos use 16 bit integers!) and was wondering about what to use as a start header. I will probably just use two bytes so i can use a number that definitely isn't within my data range. I am using it for a robot remote controller.

  • @akxcix
    @akxcix 20 днів тому

    i dropped my coffee on my board at 2:25, thanks a bunch T.T

  • @AfeezAbdulAziz
    @AfeezAbdulAziz 18 днів тому

    for small rockets like this, whats the fuelused being used?

  • @Muzzled
    @Muzzled 20 днів тому +3

    Very cool and good video, I would appreciate more expanding on the topic in depth.

  • @foolwise4703
    @foolwise4703 19 днів тому +2

    Super great explanation.
    I wondered at the choice of the start byte: Since it is a periodic pattern (10101010), is there not an increased chance it will be falsely received/sent by some physically occuring periodic oscillation/signal/noise whatever?

    • @LafayetteSystems
      @LafayetteSystems  19 днів тому

      Here's my thought process, not sure if it's a good one: Especially when using something like UART, I wanted to make sure a line open or short wouldn't parse correctly. Using 0 or 255 as a delimiter might have that problem. I also wanted to make sure the transmitter and receiver had the same baud rates. I figured if they didn't, the likelihood of receiving this periodic start byte successfully would be low, so we wouldn't risk parsing a packet with an incorrect baud rate. If we did, we could interpret one command as something totally different, though the checksum should prevent these packets from being executed 255/256 times.

    • @foolwise4703
      @foolwise4703 19 днів тому

      @@LafayetteSystems That makes sense. I am by not an expert on communication protocolls but have a physicists perspecive.
      As such, it seemed to me that if there is some EM signal induced somewhere, it would have a good chance of being periodic. That said, I have no idea if this is a real problem in rocket electronics, so feel free to dismiss my input. With baud rates being somewhere in the upper acoustic one could feasibly imagine vibrations somehow coupling to the electronics (induction, piezoelectricity or just a bad contact somewhere). Admittedly, this is more or less far-fetched.
      I believe your arguments would still hold for a not perfectly periodic checksum like 10101110?
      Depending on how easy it is to swap the start bit one could probably test how many false checksums one gets for different start bits.
      But I guess that is a bit much effort as long it works either way :-P
      It is pretty awesome to see what you are kitting together :D

  • @aidanginise
    @aidanginise 20 днів тому

    Have a pair of RFD900s, they're insane.

  • @danymogh
    @danymogh 19 днів тому

    What is the range of the radio transmitter?

  • @dzfeverframe6787
    @dzfeverframe6787 17 днів тому

    Interesting 🤩 go further in details in next videos, do some tutorials for rocketry and control systems enthusiast we will really appreciate it

  • @neojohn9335
    @neojohn9335 19 днів тому

    this is soooooooo cool!

  • @Blankblankblankblank
    @Blankblankblankblank 20 днів тому

    Do you have any other recommendations for resources that you used to learn this? I’m really interested in your work it’s awesome man.

  • @mrphysics2625
    @mrphysics2625 19 днів тому +3

    Doesn't this violate ITAR? I thought we couldn't make guided rockets? Or is it autonomously guided that's prohibited without a license?

    • @garrettwalton7461
      @garrettwalton7461 19 днів тому +1

      I believe the language of the law is indeed “guided” vs “stabilized”. Curious how this fits in. Telemetry data and two way coms are not an issue, so I guess it would come down to if you’re using those to guide the rocket or just communicate flight data.

    • @mrphysics2625
      @mrphysics2625 19 днів тому

      @@garrettwalton7461 thanks, yea i was confused cuz ive been seeing people starting to make more and more videos about making guided rockets i didnt know if they relaxed the regulation or not

    • @AndrewZonenberg
      @AndrewZonenberg 18 днів тому

      As long as you're a US citizen, the only thing ITAR really prevents you from doing is exporting the controlled item (software, physical piece of gear, whatever). The legalese is a bit more complex but generally speaking you can build all the ITAR controlled hardware you want, as long as you don't take it out of the country (including posting controlled digital assets such as source code somewhere that a foreign national could access it) or give it to a foreign national within the US.
      The biggest headache is that if your PCB designs end up ITAR you can't use cheap Chinese manufacturers to fab the boards, so things cost way more. One of the open challenges on my long term dream of putting a phased array radar up on my roof is that I'd like to figure out a way to avoid the the PCBs being ITAR (i.e. either build generic hardware that's not "specially designed" for this purpose, or just use a bank of off the shelf SDRs). If the software is controlled that's not a big deal as it doesn't cost me any more money to do the project, I just can't open source the code. But dotting the Is and crossing the Ts right would require retaining an export lawyer, which would cost enough that the project has remained on my wishlist for years without any active progress.

  • @sampamnl.8964
    @sampamnl.8964 19 днів тому

    ขอบคุณมากครับกับสาระดีๆ

  • @jumanahimana6167
    @jumanahimana6167 19 днів тому

    where do i get that document .

  • @Uterr
    @Uterr 19 днів тому

    So what hardware are you using after all?

  • @AndrewZonenberg
    @AndrewZonenberg 18 днів тому

    Have you considered adjusting the lowest layer based on what your transport medium is? For a radio protocol that is already doing all the framing for you, you should be able to skip a lot of the line coding overhead and get better performance. Your XBee modules probably already do all of the preamble and start/end of frame detection for you.
    This isn't really any different from how a lot of other layered protocols are done, for example Ethernet's link layer doesn't worry about any line coding (just addressing and checksumming) and the scrambling encoding etc is all done in the PHY chip which will vary depending on whether you're running over 10baseT or 200G fiber or whatever.
    So you can keep a common upper layer protocol suite but then vary the lowest coding layer depending on the media in question.

  • @ashraf_dz4769
    @ashraf_dz4769 20 днів тому +1

    Amazing Work! Next Time can you Introduce your First Assistant that shows in 0:14 ,Thanks and Keep up The Great work.

  • @FutureAIDev2015
    @FutureAIDev2015 14 днів тому

    7:00 how do you make an int value represent a number with stuff after the decimal point?

    • @LafayetteSystems
      @LafayetteSystems  4 дні тому

      The worked example video will talk a bit more about this, should be released in the next few days. The short answer is you send the value in question in different units. If you want to send volts with 3 decimal places, you send the value in question as an integer in millivolts and then convert back to volts (with three decimals) on the ground control software. If you want meters with 1 decimal, you send as an integer in decimeters and again convert back to meters with 1 decimal on the ground control software.

  • @karimgobara1475
    @karimgobara1475 15 днів тому

    What is the range of this receiver

  • @oscarpeters1351
    @oscarpeters1351 19 днів тому

    How about FSK on a LoRa chipset, it can do around max 300kbit/s. It’s on the 868mhz/915mhz for longer range comunication

  • @WilliamDye-willdye
    @WilliamDye-willdye 20 днів тому +1

    How important is compression? It takes more on board CPU power, but if you're having trouble getting enough bits up or down in time, I'm pretty sure there are more efficient (group theoretic) algorithms available.

    • @aarbra
      @aarbra 19 днів тому +2

      Depends on how efficient your data is structured on its own. If you are including 4 bytes float for each variable, but in reality they have very limited range, compression can have a huge effect. If you manually arrange your data efficiently, e.g., using 2 byte integers to represent each variable (with a fixed number of after comma positions), you are doing the compression 😂 Information Theory provides the theoretical limits: The shortest achievable average length of your messages is the entropy of your source. Systematic compression can get you very close independent of how you structure your data. But if you are close enough using the manual optimization, the extra overhead for a minimal performance gain is not worth it.

    • @aarbra
      @aarbra 19 днів тому +2

      And this mainly applies to the telemetry packets. While also theoretically applicable to command packets, I only have experience transmitting one command per packet. In this scenario the packets are very short and thus compression does not make sense.

  • @powwow151
    @powwow151 20 днів тому +1

    Curious if you've tried Mavlink or have experience with how robust it is for your use case?

    • @LafayetteSystems
      @LafayetteSystems  20 днів тому +1

      MAVLink is very cool, its more complicated but also more robust than the architecture I use. It should totally work for an application like rocketry but includes more overhead.

    • @powwow151
      @powwow151 19 днів тому

      @@LafayetteSystems interesting good to know. I know it's widely used but wasn't sure since Mavlink is relatively old

  • @skenzyme81
    @skenzyme81 8 днів тому +1

    This rocket is a Foxy One.

  • @hoteny
    @hoteny 19 днів тому

    10:24 and what if that index too is 170? I mean, we can have as many indexes as we want since it is variable length, right?

    • @LafayetteSystems
      @LafayetteSystems  19 днів тому +1

      Good question! That's where the packet length limit comes in. They can only be 32 bytes long, so our highest payload length is 28 bytes so we will never have to put 170 there. This does mean the payload could be up to 169 bytes long without running into any issues, but I've had problems getting packets that long to send reliably.

  • @EZLogikal
    @EZLogikal 18 днів тому

    Wow! Just discovered your channel, and… yeah. Insta-sub.

  • @laxdna3030
    @laxdna3030 16 днів тому

    What about data encryption?

  • @cezarywieczorkowski5642
    @cezarywieczorkowski5642 19 днів тому

    I am wondering why didn't you use some already established protocol like Mavlink ? You just wanted to challange yourself (which is good I suppose) or existing solutions didn't meet yout needs?

  • @Overlord141-ux9ub
    @Overlord141-ux9ub 15 днів тому

    Now Bro is inventing homemade Link-16💀💀💀

  • @constantlychangin
    @constantlychangin 20 днів тому

    Hell Yeah!

  • @jackscott1036
    @jackscott1036 20 днів тому +1

    would you ever consider adding encryption of some sort?

    • @LafayetteSystems
      @LafayetteSystems  20 днів тому +5

      On most radio modules like XBee, you can enable built-in encryption! I don't encrypt commands sent over wired connections though, seems like we have bigger problems if someone else is sending commands over my own USB cable :)

  • @ArchonLicht
    @ArchonLicht 20 днів тому +1

    Why not use something existing like ExpressLRS?

    • @frigzy3748
      @frigzy3748 19 днів тому +1

      I guess, Express LRS is too rigidly intertwined with the RC models, you cannot just send arbitrary data through it, at least not in an efficient way. Without the RC model stuff, it becomes just LoRa which is what he is probably using.

  • @Dan-uo9fw
    @Dan-uo9fw 19 днів тому

    Oooh, if you implement Hamming codes, that would be cool to see.

  • @viduraherath4008
    @viduraherath4008 19 днів тому

    I was just thinking about systems that simplify the amount of work you have to deal with at a base station and for the rocket to autonomously do most of it. However this would be more so for small or simple rockets. Making a set of systems to deal with different stages or of the launch, like a set of numbers. The downside to this is that you don't receive flight data from the rocket, but the upside is that you only have to transmit very small commands, basically like saying 1 to begin preflight checks, 2 to launch, 3 to begin, 4 to adjust to a certain AOA, etc. (this could also even just be the specific radio frequency but that might have its flaws).Now that i think about it its sounds less efficient and means you cant learn anything about the flight performance of the rocket lol. Nvm forget i said anything

  • @Crymoreok
    @Crymoreok 20 днів тому

    Cool

  • @tld8102
    @tld8102 19 днів тому

    This is inspiring/

  • @s9josh778
    @s9josh778 20 днів тому

    You could get rid of the COBS stuff by just checking the length number when a 170 is seen. If position is less than length, it's not a new message.

    • @pierro281279
      @pierro281279 19 днів тому

      COBS is needed ONLY when the protocol specifies that it handles start and stop bytes.
      If you're making your protocol, you don't have to use it.

    • @s9josh778
      @s9josh778 19 днів тому

      @@pierro281279 Re-read the first word of my comment again.

  • @tommyagnello4100
    @tommyagnello4100 19 днів тому

    Momo should be in every video

  • @aviphysics
    @aviphysics 18 днів тому

    I would be worried a command would be sent multiple times, if the acknowledgement wasn't received

    • @aviphysics
      @aviphysics 18 днів тому

      I think adding a number to serialize the commands might be helpful, so that the receiver can tell if it receives two copies of the same command.

  • @TornoyfresadoraRD
    @TornoyfresadoraRD 19 днів тому

    Deberías hacer contenido en español 👍

  • @ArifKhan-bp9zx
    @ArifKhan-bp9zx 20 днів тому

    Now I know why I hate my Long Range LORA SX1262 Radio Transceivers

    • @RiwenX
      @RiwenX 19 днів тому +1

      Why? LoRa is amazing

    • @ArifKhan-bp9zx
      @ArifKhan-bp9zx 19 днів тому

      @@RiwenX LORA is indeed good, but not for this application, Airtime of the signals is quite high, so we can't get data too quickly from Flight Computer to the ground station.

    • @RiwenX
      @RiwenX 19 днів тому

      @@ArifKhan-bp9zx How much data are you sending?

  • @user-mr5sh8hi5p
    @user-mr5sh8hi5p 18 днів тому

    What the heck was I doing studying law?? I could be doing cool stuff such as these😢

  • @iamtwig236
    @iamtwig236 20 днів тому

    man would built a rocket from scratch than to talk to girls (its me, I'm also that man)

  • @Phil-D83
    @Phil-D83 16 днів тому

    1960s tech

  • @mr99official28
    @mr99official28 12 днів тому +1

    Is this even legal?

  • @ghostagent3552
    @ghostagent3552 18 днів тому

    Why would you make something like this?? You better just try to make the rocket go up only alright?

  • @bentheguru4986
    @bentheguru4986 19 днів тому

    13+ minutes of software and nothing on hardware.