Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. OpenHardware.io
  3. 💬 Long Range Vehicle Controller

💬 Long Range Vehicle Controller

Scheduled Pinned Locked Moved OpenHardware.io
uavroboticsauvrobotroversautonomousrover
6 Posts 3 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • openhardware.ioO Offline
    openhardware.ioO Offline
    openhardware.io
    wrote on last edited by
    #1

    https://www.openhardware.io/view/492/Long-Range-Vehicle-Controller

    dbemowskD 1 Reply Last reply
    0
    • openhardware.ioO openhardware.io

      https://www.openhardware.io/view/492/Long-Range-Vehicle-Controller

      dbemowskD Offline
      dbemowskD Offline
      dbemowsk
      wrote on last edited by
      #2

      @openhardware.io Can you explain more of what this would be used for? I am guessing that it wouldn't be for the directional motor control as I don't see any kind of H bridge drivers. H-bridge drivers would give it differential steering, though you do say "Includes tilt-compensated compass for fully automated hold-heading and/or course correction." I also don't see any programming header.

      Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
      Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

      1 Reply Last reply
      0
      • CORTEX SystemsC Offline
        CORTEX SystemsC Offline
        CORTEX Systems
        Hardware Contributor
        wrote on last edited by
        #3

        It can be used to engage up to 3 thrusters, solenoids, or other unidirectional actuators . Speed is controlled by pulse width modulation. Directional control is achieved by varying the speeds of two identical motors rather than reversing motor direction. There is no programming header. The Atmega chip is in a socket, and can be easily removed for programming on a breadboard or Arduino socket.

        I am trying to keep the price and number of parts as low as possible because I will be using this with robotic ocean craft that may have a high rate of loss due to extreme weather.

        dbemowskD 1 Reply Last reply
        0
        • CORTEX SystemsC CORTEX Systems

          It can be used to engage up to 3 thrusters, solenoids, or other unidirectional actuators . Speed is controlled by pulse width modulation. Directional control is achieved by varying the speeds of two identical motors rather than reversing motor direction. There is no programming header. The Atmega chip is in a socket, and can be easily removed for programming on a breadboard or Arduino socket.

          I am trying to keep the price and number of parts as low as possible because I will be using this with robotic ocean craft that may have a high rate of loss due to extreme weather.

          dbemowskD Offline
          dbemowskD Offline
          dbemowsk
          wrote on last edited by
          #4

          @CORTEX-Systems My reason for the question was for an old project I am resurecting. I just started a forum post about it. https://forum.mysensors.org/topic/7852/mowbot-resurecting-a-15-year-old-project/

          I am basically looking to redo all of the electronics and one of the things I have to think of is navigation. You mention "fully automated hold-heading and/or course correction". Do you do this using the LSM303? I would be curious to see some code.

          Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
          Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

          1 Reply Last reply
          0
          • CORTEX SystemsC Offline
            CORTEX SystemsC Offline
            CORTEX Systems
            Hardware Contributor
            wrote on last edited by CORTEX Systems
            #5

            The mowbot looks pretty interesting -- I like the variety of sensors you incorporated.

            Here is some basic code you can use to test the course correcting ability of the LSM303. The code will print to screen "turn right" or "turn left." After a set amount of time, the code will print "reverse" and set you on a new heading.

            #include <Wire.h>
            #include <LSM303.h>
            
            int target = 350;
            int target2 = 180;
            unsigned long timer = 60000;
            boolean reverse = false;
            
            LSM303 compass;
            
            void setup() {
              Serial.begin(9600);
              Wire.begin();
              compass.init();
              compass.enableDefault();
              
              /*
              Calibration values; the default values of +/-32767 for each axis
              lead to an assumed magnetometer bias of 0. Use the Calibrate example
              program to determine appropriate values for your particular unit.
              */
              compass.m_min = (LSM303::vector<int16_t>){-485, -508, -291};
              compass.m_max = (LSM303::vector<int16_t>){+476, +456, +588};
            }
            
            void loop() {
              compass.read();
              
              /*
              When given no arguments, the heading() function returns the angular
              difference in the horizontal plane between a default vector and
              north, in degrees.
              
              The default vector is chosen by the library to point along the
              surface of the PCB, in the direction of the top of the text on the
              silkscreen. This is the +X axis on the Pololu LSM303D carrier and
              the -Y axis on the Pololu LSM303DLHC, LSM303DLM, and LSM303DLH
              carriers.
              
              To use a different vector as a reference, use the version of heading()
              that takes a vector argument; for example, use
              
                compass.heading((LSM303::vector<int>){0, 0, 1});
              
              to use the +Z axis as a reference.
              */
              int heading = compass.heading();
              float deviation = abs(target - heading);
            if (deviation > 1){
              if (deviation >= 180){
                if (heading < target){
                  Serial.println("turn left");}
                  else{
                    Serial.println("turn right");}
                    }
              else {
                if (heading < target){
                  Serial.println("turn right");}
                  else{Serial.println("turn left");}
              }}
              else{Serial.println("On Course");}
              
              Serial.println(heading);
              if (reverse == false) {
                if (millis() >= timer){
                target = target2;
                reverse = true;
                Serial.println("Reverse");}} 
              
              delay(100);
            }
            

            You can change the variables target, target2 and timer, the delay interval and also deviation in the line of code:

            if (deviation > 1){
            

            You can further modify the code so that instead of (or in addition to) to printing commands, the commands are sent to the motors. For smoother operation, you can average the deviation over several loops before course-correcting.

            1 Reply Last reply
            0
            • dbemowskD Offline
              dbemowskD Offline
              dbemowsk
              wrote on last edited by
              #6

              Nice, Thanks

              Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
              Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              15

              Online

              11.7k

              Users

              11.2k

              Topics

              113.1k

              Posts


              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • MySensors
              • OpenHardware.io
              • Categories
              • Recent
              • Tags
              • Popular