Arduino

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bwi 971
    Captain
    • Jan 2015
    • 931

    Arduino

    Is there anybody out here who controls the sub with an Arduino board? I have been reading for a while now, and I don't see anything that would work against its use. Maybe I'm wrong, just asking. I agree there will be a steep learning curve to get the hang of Python, but hurdles like that make it fun.
    Have a nice one,
    Bart
    Practical wisdom is only to be learned in the school of experience.
    "Samuel Smiles"
  • Wizzard033
    Lieutenant, Junior Grade
    • Sep 2023
    • 41

    #2
    I was kind of curious about this too. I have some limited experience using Arduino and I think it could be very useful for automated functions.

    Comment

    • bwi 971
      Captain
      • Jan 2015
      • 931

      #3
      Guess we are alone with our quest. Anyways, I will move forward with this; it's a nice winter project. I will keep you informed. Our intention is to make this hobby more accessible, so secrets will not contribute. If it works, it will be open source.
      Practical wisdom is only to be learned in the school of experience.
      "Samuel Smiles"

      Comment

      • redboat219
        Admiral
        • Dec 2008
        • 2893

        #4
         
        Make it simple, make strong, make it work!

        Comment

        • redboat219
          Admiral
          • Dec 2008
          • 2893

          #5
          Check out his other videos.

          Unfortunately John passed away several years ago.
           
          Make it simple, make strong, make it work!

          Comment

          • redboat219
            Admiral
            • Dec 2008
            • 2893

            #6
            Make it simple, make strong, make it work!

            Comment

            • bwi 971
              Captain
              • Jan 2015
              • 931

              #7
              Originally posted by redboat219
              Check out his other videos.

              Unfortunately John passed away several years ago.
              Thanks redboat!

              I'm sorry to hear that he has passed away. I did watch his series on YouTube. He was a frontrunner, in my opinion. Respect to him and his legacy.
              Practical wisdom is only to be learned in the school of experience.
              "Samuel Smiles"

              Comment

              • TuptubBuilder
                Lieutenant, Junior Grade
                • Sep 2020
                • 39

                #8
                I got started in this hobby by setting up a system test bed using an Arduino as a middle-man. I had low battery failsafe, signal loss watch dog timer with ballast blow, pitch controller using an adafruit gyro and led state indicator. Packaging is the biggest issue. I packaged it in a Rubbermaid waterproof container. Hence the moniker, tuptubBuilder. Given the availability and ability of the Frsky 900 mHz gear, I don’t think it’s worth the effort.
                Attached Files

                Comment

                • bwi 971
                  Captain
                  • Jan 2015
                  • 931

                  #9
                  Yeah, packaging also causes problems for me; mine is white and furry.

                  Thanks for the info. I did not consider the signal loss; I will integrate it. I'm almost finished with the line diagrams. I'm laying out the wires, I need to route the air pump and two solenoids. After that, I have to order the parts.

                  Click image for larger version  Name:	Akula (429).jpg Views:	0 Size:	44.1 KB ID:	174509

                  Last edited by bwi 971; 10-02-2023, 02:27 PM.
                  Practical wisdom is only to be learned in the school of experience.
                  "Samuel Smiles"

                  Comment

                  • TuptubBuilder
                    Lieutenant, Junior Grade
                    • Sep 2020
                    • 39

                    #10
                    In the spirit of sharing I've copied a link to my build notes and test bed video. You may find it interesting or it may produce a good yawn. click on this: 2 Items​​

                    Comment

                    • bwi 971
                      Captain
                      • Jan 2015
                      • 931

                      #11
                      Thanks for sharing.That are some nice notes.
                      I saw that you opted for direct control through the receiver for the rudder and ESC as they are staight forward controls. That is a smart approach. That way, you can save some board pins for other stuff. I'm running out of pins... please forgive my lack of decent diagrams.....the purpose is just to have an idea what is needed and were to connect it is still a WIP.
                      The DC motor is a substitute for a (air)pump.


                      Click image for larger version

Name:	image.jpg
Views:	337
Size:	50.0 KB
ID:	174557


                      Practical wisdom is only to be learned in the school of experience.
                      "Samuel Smiles"

                      Comment

                      • TuptubBuilder
                        Lieutenant, Junior Grade
                        • Sep 2020
                        • 39

                        #12
                        You are welcome. It was hard to tell what was going on from your picture because of the resolution. It looks like you are using a MOSFET to drive the air pump and I could see the brushless motor and ESC. I only saw one output from the receiver. Are you using a serial bus?
                        Maybe you could explain your control scheme. Here is mine in a nutshell. Two channels from the Futaba AM receiver drive the two available interrupts on the UNO. One interrupt is used on the ballast system and watchdog timer and the other is used for the dive planes. The Arduino decides what to do when interrupted by the receiver ballast channel based on the state of its inputs or stored values, i.e. submerged, surfaced, no signal, low voltage, etc. The dive plane channel interrupt overrides the pitch control routine. I never finished the depth control routine. The LEDs served as state indicators like 50% on for low battery, different pulse rates for diving and surfacing and solid on for no signal.

                        Comment

                        • bwi 971
                          Captain
                          • Jan 2015
                          • 931

                          #13
                          I'm not well-versed in serial bus technology, but I did notice that it's possible to define channels within the code, lusing a library.

                          I opted for a MOSFET because it will occupy less space compared to a dedicated relay board.

                          There's one channel designated for managing diving and surfacing operations, which includes controlling the ballast pump, solenoid, aft, and forward planes.
                          Another channel is dedicated to depth control, involving the aft planes and a pressure sensor.
                          Additionally, there's a channel for ESC (Electronic Speed Controller) and a function to control of auto-trim using forward planes and gyroscopes.
                          And a channel for the rudder.
                          In the wishlist, I hope to include functionality to activate auto-trim, and depth control when submerced and when on the surface both of these functions should deactivate.

                          With your input I realize a critical requirement is the detection of signal loss that will activate an emergency surface.

                          Have a nice one,
                          Bart
                          Last edited by bwi 971; 10-06-2023, 03:23 AM.
                          Practical wisdom is only to be learned in the school of experience.
                          "Samuel Smiles"

                          Comment

                          • TuptubBuilder
                            Lieutenant, Junior Grade
                            • Sep 2020
                            • 39

                            #14
                            Good talk and good luck,
                            Jim

                            Comment

                            • bwi 971
                              Captain
                              • Jan 2015
                              • 931

                              #15
                              I couldn't post an update due to a nasty virus that's been draining my energy, and it's still affecting me. However, some parts have arrived, and I want to share my experience as a novice in a straightforward way we call it "jip-en-janneketaal​". Right now, I'm not seeking advice; I'd like to work through this on my own and learn as I go.

                              First, I massively underestimated the complexity of programming. Imagine an Arduino as an empty box that needs instructions to function.

                              My transmitters don't have a common signal output. So, the signal wire from each channel of the receiver has to connect to the Arduino. The servo's signal wires also connect to the Arduino. To power everything, I need 5V DC juice, so I've connected the servos, Arduino, and transmitter to a power source. But I've used a separate power source for the Arduino. O yeah, make sure the ground GND is common for all.

                              The receiver sends a PPM signal that the Arduino has to interpret and then send to the servos to make them move (in microseconds, not degrees – computers can be peculiar, it to easy to make a reference to my Vicky here). There are libraries like "servo" that make this translation easier; I just had to reference them in the code. I had to tell the Arduino which signal wire connects to which pin, so it knows what to read and which wire to use for the servo.

                              The next challenge I encountered was that the range of the PPM signal from the transmitter did not match the range of the servos. Typically, servos operate between 1000 and 2000 microseconds, while I needed to determine the transmitter's range. To address this, I adapted a separate piece of code that allowed me to display these values on my PC monitor as I manipulated the transmitter controls. In the display, the blue values represent the neutral position, the red values represent the minimum, and the yellow values represent the maximum.

                              Click image for larger version  Name:	image (26).jpg Views:	7 Size:	51.6 KB ID:	174958

                              To illustrate the frustration with an with an example, consider the "40000" mentioned in the "void loop" of the code in the above picture. If this value is set to "20000," what its initial value was, the throttle signal will remain at 0. I recall spending half a day troubleshooting and even swapping receivers and transmitters, thinking I had damaged something. In reality, the issue was caused by the delay value in the code, which led to this unexpected behavior.

                              Once I figured out the minimum and maximum values, I had to input them into the Arduino code so it knows how to compare them to the servo's range.

                              I used a trial-and-error approach to work through the above challenges. It was a real test of patience. If it weren't for the virus, I might have launched my breadboard into orbit several times. I think the virus actually helped me by keeping my energy levels low and allowing me to spread my efforts over a longer period.

                              Now, I've successfully managed to control three servos with the Arduino. They all experience some jitter. I've tried different sets of servos from various brands, but the jitter remains. For now, I'll overlook this issue because the code works, and I've eliminated everything I could as a source of interference, possibly originating from the power supply or wiring and breadboard connections. There's nothing more I can do at the moment.

                              I'm moving forward and currently working on writing the code for the auto-leveling and pitch control, which will be controlled by the forward dive planes. These forward dive planes will operate independently and won't be controlled by the transmitter.

                              Have a nice one,
                              Bart
                              Last edited by bwi 971; 10-15-2023, 09:41 AM.
                              Practical wisdom is only to be learned in the school of experience.
                              "Samuel Smiles"

                              Comment

                              Working...