Arduino newbie - expandability question

(The more i write this out, the less rover related it gets, so feel free to move it. Also, read through without replying…I’m continually editting and researching and designing, so I’ve answered several of my own questions, but haven’t removed them))

I’m looking to get started in the Arduino world, and the Rover looks like the perfect starting platform for what I’m interested in. I have experience in robotics with the BEST program, and I’m currently mechanical engineering intended, may switch to CSE.

I’ve always wanted to build a multi-surface mobility platform, similar to a mars rover type theory, crossed with the rescue vehicle kit.

Question 1: in the manual, it mentions that 6 volt motors are available for the gearbox, but I can’t find them online. Do they actually exist?

Question 2: I hate AA batteries. What battery pack would be budget-friendly and with with the PCB? The article/manual mentions the Li-pack that was mentioned is discontinued, is there a replacement?

Question 3 (theory 1): I have 6 12V gear motors and a 7AH 12V sealed lead battery. If I fabbed my own sub-chassis (which is entirely possible), is there a way I could replace the small gearbox motors with 2 of my gearmotors, modify the drive wheels to fit the gear motors, and power the motors (via a motor controller, more than likely?) using the Pb battery with the PCB on Li-pack? (I’d also be lengthening the chassis and contact patch to match the increased weight, using the bare tamiya tracks kit, and adding suspension to the tracks (inner ground idlers only) using shocks i already have, and using an idler sprocket on top loop). I’d also have no less than 2 proximity sensors, one on each end, to tell it when to change direction or turn.

Question 4 (theory 2): Now to the creativity. Suppose I wanted to ditch the tracks, and use all 6 gear motors (which would be my actual plan, to straight ditch question #2, if possible).

I would use that to run all 6 wheels in the same direction wired parallel), and construct an axle that would allow the motor cups to steer, using right-angle gear motors (front axle and rear axle wired inversely) to a single motor controller. So in essence, I’d be running output channel 1 as drive motors, output channel 2 as steer motors. Could the PCB do this? I’d also have no less than 2 proximity sensors, one on each end, to tell it when to change direction or turn.

Question 5: Now, I may be exceeding limitations, but I also wouldn’t complain if I could also put my 7ch reciever on it, and be able to flip the landing gear switch, and take it from autonomous mode to RF control mode, and back again, in the event that it got stuck or was going out of RF range (like down the street), I could hand-drive it out, and put it back to self-control. In the simplicity of my mind, I would think that all I would have to do, is have the motor controllers for the arduino, I already have ESC’s for my RF reciever, and use a 4PDT relay- 2 poles to put Pb battery from arduino MC to ESC, and 2 poles to put motors from arduino MC to ESC. OR is there a way I could just use the same motor control, and switch input from arduino to RF?

Bonus question: in addition to the 2 proximity sensors, could I have a switch set up, so the motors only run if that switch is depressed? Basically, so the arduino program is still running if I have to do a control override, and I’m not producing an arc when I switch between sources- I can release the switch via RF, shut off the motors, flip the override switch to RF control, drive it out, switch from RF to arduino, then flip the other switch, to turn the motors back on.

Yes, i know these ideas are VERY dependent on diodes to prevent catastrophe and current backflow.


I’d like to go the full steer at some point, but for the near future, I would be happy with just taking the rover, making it bigger (probably 12" wide, 18" top platform, 12" drive patch, 5" from ground to bottom of platform), and putting proximity sensors on it to make it semi-autonomous.

Basically, if I could buy JUST the PCB, 2 sets of track kits, a couple proximity sensors, I would be set. The goal is to be autonomous, have tons of ground clearance between tracks (a good 4 or 5"), be able to run in wet conditions (I’d make a cover for the electronics), and be able to climb stairs/ledges no problem.\

I’m not liking how narrow the tamiya tracks are, I’m thinking to go with the 2" lynxmotion tracks, and use a 253rpm 138oz-in on each side with a 9 tooth drive sprocket, then I would have (253 * 3.75 * pi / 720 =) 4.1 FPS at (138 / 1.875 / 16 =) 4.6 pounds per side, 9.2 pounds total. I like this combination (but costs more). They would also give me a good starting point if I ever stepped up to the 6 wheel drive system. As a bonus, the 6mm lynxmotion hubs are perfect for the motor choice, and being cheaper than the idler hubs, I can use them (drilled out) with 1/4-20 bolts for the idler supports.

At this point, All I would be using from the rover would be the PCB…but I don’t suppose you sell it as a standalone. That said, as a beginner, I’m not 100% sure I understand how to link an arduino, an H bridge, and a motor controller, at which point this would also no longer become a DFR Rover, but a custom creation with no rover parts at all. And the budget is actually way cheaper than to go the RC/6 wheeled route (that was going to be over $600)

2 motors- $60 (robotshop.com/lynxmotion-ghm-12-gear-head-motor.html)
12 feet of track- $150 (robotshop.com/lynxmotion-track-trk-01.html)
2 sets 9 tooth sprockets- $20 (robotshop.com/lynxmotion-sprocket-9-tooth.html)
10 sets of 6 tooth idlers- $80 (robotshop.com/lynxmotion-sprocket-6-tooth.html)
6 sets of 6mm hubs- $48 (robotshop.com/lynxmotion-hub-02-universal-hub.html)
Arduido basic kit- $40 (robotshop.com/robotshop-arduino-basic-kit-7.html)
1 Arduino Motor Controller- $50 (robotshop.com/pololu-dual-motor-driver-9a.html)
1 Sabertooth RC motor controller- $60 (robotshop.com/Sabertooth-2x5-en-1.html)
4 prximity sensors- $60 (robotshop.com/seeedstudio-ultrasonic-range-finder-2.html)

Chassis- $348 plus hardware (1" square tube and 1" angle iron)
Arduino Required Electronics- $90
Arduino Optional Electronics- $60
RC electronics- $60

I’m thinking for the autopilot over-ride, I would put a switch on the arduino digital input, that would put both PWM outputs off. Then have a digital pin delay 500 (to allow the controller to degenerize and robot to stop) trip a pair of DPDT relays that move the motor leads from the PWM controller to the sabertooth. It’s an extra expendature, but it’s the best sure-fire way to know that it will work, and will look cleaner than a mess of relays flip-flopping the entire wiring structure.

What I don’t understand, is if the Pololu controller has an H bridge and is PWM controlled, how does the Arduino PWM output tell it to activate the H bridge, and turn the motor over backwards? Is backwards 0-2.5V, neutral is 2.5V, and forwards is 2.5 to 5V?

Here’s what I have now, running on skid steer, runs about 2ft/sec and weighs 30 pounds, running on standard 7 channel RC RF controller, 10" tall wheels:

magnethead794.com/AIRT/images/robot117.jpg

video: magnethead794.com/AIRT/images/robot124.avi (keep in mind that’s 30 pounds going up a 22 degree smooth surface)

The version 2 that I planned to build, until college occured, and I want to revive via arduino, just not as complex, and not with the huge body on it…

axle design: magnethead794.com/AIRT2/images/robot141.jpg

CAD rendering: magnethead794.com/AIRT2/images/robot129.jpg

I’ve come up with this pseudo code:

const int LFsensor = (pin);
const int RFsensor = (pin);
const int LRsensor = (pin);
const int RRsensor = (pin);
const int cutoff = (pin);
const int autopilot = (pin);

if(cutoff = 0){

  void forward(){
    
    unsigned long starttime = millis();
    
    if ((LFsensor > 7104) && (RFsensor > 7104)){
      
      // If there is nothing within 8 feet, run half power forward.
      
      analogWrite(leftmotor, 192); 
      analogWrite(rightmotor,192);
      
    } else {
      
      // Something must be within 8 feet. Lets see how close it is.
      
      if ((LFsensor > 3552) && (RFsensor > 3552)){
        
          //If it's within 8 feet but not within 4 feet, lets run at 3/8 speed.
      
          analogWrite(leftmotor,175); 
          analogWrite(rightmotor,175);
          
      } else {
        
        if ((LFsensor < 888) || (RFsensor < 888)){
        
          // If within a foot, STOP! And let's think about repositioning. Oh, and stop the travel time counter.
      
          analogWrite(leftmotor, 127);
          analogWrite(rightmotor, 127);
        
          unsigned long currentMillis = millis();
        
          reposition();  
          
        } else {
          
        // Is it within 4 feet but not 1 foot of either sensor? If so, 1/4 power forward.
        
          analogWrite(leftmotor, 160);
          analogWrite(rightmotor, 160);
          
        }
      }
        
    }
    
  }
  
  void reposition(){
    
    // Lets find out which of the front sensors are obstructed
    
    if ((LFsensor < 888) && (RFsensor > 888)){
      
      // If Left Front is obstructed, turn right until clear for 4 feet
      
      while (LFsensor < 3552){
       analogWrite(leftmotor, 130);
       analogWrite(rightmotor, 124); 
      }
      if (LFsensor > 3551){
        forward();
      }
      
    } else if ((RFsensor < 888) && (LFsensor > 888)){
      
      // If Right Front is obstructed, turn left until clear for 4 feet
      
      while (RFsensor < 3552){
       analogWrite(leftmotor, 124);
       analogWrite(rightmotor, 130); 
      }
      if (RFsensor > 3551){
        forward();
      }
      
    } else {
       
      // If we can't go forward, we can sweep from left to right, compare how long it takes to get both sensors clear, and go the way that was shorter.
      
    }
    
  }
  
} else {
 
 // IF the cutoff pin has power, shut down the outputs, wait half a second, and flip the motors to RC control.
 
 analogWrite(leftmotor, 127);
 analogWrite(rightmotor, 127);
 
 delay (500);
 
 digitalWrite(autopilot,0)
  
}

Something I thought about, would it be possible to use a servo on each end, with a sensor on each, so it could pan for obstructions? I know most bots just use one center mounted sensor, but for something 12" or wider, that becomes a difficult guestimation.

In the composite vew, I have the sub-frame drawn bigger than I’d have it actually be. It’s only be 1/4" polypolypropylene, so It will be just barely big enough to have the suspension bolt to it. The main frame from the body will add strength, as the it will also be 1/4" polypropylene, and will be on top of spacers, since it will be wider than the tracks.

By building it using polypropylene sheet for a body, and using the selected track materials and design, the robot will be able to drive in up to 4.5 inches of water, with the drive motors being the lowest electrical item. If it were possible to relocate the motors to the chassis, and use a slip-joint driveshaft, then this would increase to 6 inches of water depth.

The Rustler (again, everything i try to use stuff from, since i have it handy to make sure it will work) driveshaft takes a 5mm shaft that is double-flatted to 4mm with a setscrew that goes through the full diameter on the drive end, with a 4mm output shaft that has a uninut.

The input side would be easy, as going from a 5mm opening to a 6mm opening would be no problem- there is plenty of material. Since the collar is soft plastic, I can tap it for whatever set screw I want on the motor side, like a 4-40, to replace the long screw of unknown thread.

Using these 4mm hubs, I could grind a flat on the 4mm shaft for the setscrew, fit the uninut on the back to hold the hub on, then piggyback it to these 6mm motor hubs. Assuming the bolt holes are the same pattern, it would make for a perfectly balanced, lightweight, fairly cheap 4mm -> 6mm driveshaft adapter.

That would allow me to mount the motors on the chassis, taking half a pound of unsprung weight from the tracks, and increasing the liquids clearance to 6 inches, while unaffecting the ground clearance, since the suspension members are lower than the motors would be. Plus, having the motors mounted in back on the chassis, would help offset the weight of the battery/electronics tray in the front in the transport body.

To run the cargo gate, could I use a bi-Polar motor driver with a Unipolar Stepper? The setup I’m going for is like an enclosed trailer, having a wire come down on each side of the opening.

That would add an extra output to the arduino, though. How many outputs does an arduino have, again? 14 Digital I/O and 6 analog output-only, correct?

I’d also need to add 2 servos, one for each bay door.

Then, I like the idea of using this gearbox with the replacement 12V motor in the 5402:1 setting. I was hoping to find a gearbox that would allow use of a gearmotor, but this may work as well. It’s for a lifting mechanism, which will be picking up the entire cargo box, and removing it from the vehicle. The cargo box when full, probably won’t way more than 2 pounds- but it will be on the end of a 10" arm, moving on a 135 degree arc. Would also require a second motor controller.

I/O total:

2 servos
1 stepper motor
2 drive motors
1 camera pan servo
1 Cargo lift motor

I read up, and apparently there is an RC receiver decoder? Does this mean I could use the landing gear switch to switch the arduino from autopilot to RC input, without using relays, sabertooth, ect?

Polypropylene sheet -> onlinemetals.com/merchant.cfm?pid=15654&step=4&showunits=inches&id=1154&top_cat=0

The latest design (at bottom) is a 18" lower contact with a 28" upper length. I imagine I’m getting some crazy looks about now. Based on 6 sets of tracks @ 23 inches, I have 3 spare inches on each side, so I could afford to go up 1 more inch on the front sprocket, if I wanted (which I do).

Each corner has 3 shocks- 4" long in rear, 3.5" long in front. The front sprocket uses rustler tie rods as tensioners. If I need to add a forced idler, I could add a sprocket in the middle on top, and use shocks to force the system taunt. I can only imagine the chain flop on a 28" span, even with the front tensioners snug.

The cargo bay requirements that I’m going with, is 17" long, 14" wide, no less than 8" high, no more than 10" high (interior height).

magnet794.dyndns.info/AIRT3/tracks_th.jpg

magnet794.dyndns.info/AIRT3/suspension_th.jpg

magnet794.dyndns.info/AIRT3/composite_th.jpg

Here is the latest, and I believe to be final design for the treads. 67" of tread, 15" on bottom, 24" top span, 6.4" departure height, 8.2" approach height- more than enough (= just right) for most ledges. I just threw this together on my way to bed, so there’s a few bolts missing here and there. Chassis design doesn’t change, other than locations of the A arm mounts.

This allows me ~22" of chassis length, which is cargo bay + 5" for electronics. By way of adding an inch of track height, the ground clearances just increased an inch (to something like 7") and motor clearance for liquid travel via driveshaft is now something in the 6.5-7.5 ballpark as well. With the bump in height, I’m also going to increase the track by 2", to 18" outside to outside (14" on insides- perfect for 14" wide body with articulatory clearance aplenty)

magnet794.dyndns.info/AIRT3/tracks_final_th.jpg

Coleman,

Could you answer my questions about the arduino? Since that’s the center brain I want to make sure I can do everything I want to.

I/O total:

2 servos (driven by arduino PWM)
1 stepper motor (using external driver by PWM)
2 drive motors (motor controller, PWM)
1 camera pan servo (driven by arduino PWM)
1 Cargo lift motor (motor controller by PWM
2 Limit switch inputs

I read up, and rather than use wireless RC, I’m thinking that using bluetooth from my laptop (instructables.com/id/how-to-Control-arduino-by-bluetooth-from-PC-pock/step6/controlling-from-a-pocket-PC-PDA/) using Sena Bluetooth Terminal Emulator might be a better option.

With BT between the computer and Arduino, I can use a USB joystick to control the arduino?

2 motors- $60 (robotshop.com/lynxmotion-ghm-12-gear-head-motor.html)
12 feet of track- $150 (robotshop.com/lynxmotion-track-trk-01.html)
2 sets 9 tooth sprockets- $20 (robotshop.com/lynxmotion-sprocket-9-tooth.html)
10 sets of 6 tooth idlers- $80 (robotshop.com/lynxmotion-sprocket-6-tooth.html)
6 sets of 6mm hubs- $48 (robotshop.com/lynxmotion-hub-02-universal-hub.html)
Arduido basic kit- $40 (robotshop.com/robotshop-arduino-basic-kit-7.html)
1 Arduino Motor Controller- $50 (robotshop.com/pololu-dual-motor-driver-9a.html)
2 proximity sensors- $30 (robotshop.com/seeedstudio-ultrasonic-range-finder-2.html)
Bluetooth board- $65 - robotshop.com/spark-fun-bluesmirf-rp-sma-3.html
Long range antenna- $10 - robotshop.com/sfe-2-4-ghz-rp-sma-antenna-large.html

Chassis- $358 plus hardware (1" square tube, 1" angle iron, polypropylene sheet)
Arduino Required Electronics- $90
Arduino Optional Electronics- $105

What Li-pack batteries will work with the arduino, and how long will they last? Would it be more efficient to use an external 5-6V NiMh reciever battery with the proper barrel plug on it?

I could use the “roller coaster” method of moving the payload bay, by having it pulled back and forth by a winch motor on a continuous loop. I could use the cheap tamiya tracks, and have a catcher on the front of the payload container, which locks into the track.

This would yield a triangle of height 8.5" and hypotenuse of 17" (length of container), forming a 30 degree angle with the ground. With the tailgate down and the door open, this would be sufficient for most any cargo I could conceive, and still be a lightweight design. Theoretically, if I put small wheels on the back corners of the container and attached a cable drum to the track motor, I could lower the container all the way down to the ground, then winch it back up, using a single motor (obviously no longer needing the track-hook on the container). I guess this would be the same method as a dumpster truck? Since polypropylene is smooth, I would only need 1 guide on each side of the frame, to make sure the container stayed straight. The only minor issue would be the wires going to the 2 door servos and the stepper motor for the tailgate. I know most designs like this use a ribbon cable that folds below the platform (what comes to mind, is the launching platforms for Mr. Freeze at 6 flags). I suppose I could make it work that way, using 2 fixed bars to guide the wire curling process.

Coleman, thanks for your input. Since it’s not longer rover related, I went over to the Arduino forums to ask my questions.

arduino.cc/forum/index.php/topic,63289.0.html

It will be an interesting - and expensive - build when completely finished. I’m looking at a price tag of around $800 to have it all complete, with bluetooth and all the sensors. It’s still changing, because I’m trying to get the desired body design to fit within the confines of the tracks, so that the tracks stick out on each end (for climbing ledges and such in both directions) so the track length may get longer, but I’m going to lock the contact patch at 15" with an 18" outside width. Right now it’s 9.5" from ground to centerline of the front sprocket and 6.5 to centerline of back.

I’m trying to implement weight savings where I can, but it’s hard to maintain strength…a standard engineering problem. The drive motors are half a pound each, each track will be a pound and even with the cargo container removed (removing with it 6 feet of 1" angle iron, 1 stepper motor, and 2 servos), I don’t think I can get under 4 pounds of body. The 12V lead acid battery is 5.5 pounds by itself, so the robot will be terribly nose-heavy, unfortunately, with it’s 5.5 pounds on the nose, and only 1 pound of motors on the back. Even with the cargo container put on, I don’t think I’ll have more than 2 pounds of tailweight.

Parts list:

2 motors- $60 (robotshop.com/lynxmotion-…ead-motor.html)
12 feet of track- $150 (robotshop.com/lynxmotion-track-trk-01.html)
2 sets 9 tooth sprockets- $20 (robotshop.com/lynxmotion-…t-9-tooth.html)
10 sets of 6 tooth idlers- $80 (robotshop.com/lynxmotion-…t-6-tooth.html)
6 sets of 6mm hubs- $48 (robotshop.com/lynxmotion-…ersal-hub.html)
Arduido basic kit- $40 (robotshop.com/robotshop-a…sic-kit-7.html)

Total Cost: $772
magnet794.dyndns.info/AIRT3/2D-CAD-1_th.jpg

Question about tracks:

Is there a “golden number” for how many carrier wheels should be used on the driving span of the track (the bottom)? Right now I have it designed (as shown above) with a 15" drive length, 4 carriers @ 5 inches apart. Would that be enough, or do I need to add another one @ 3.75 spacing?

Right now the main platform will be weighing around 14.5 pounds, based on the design above. I was planning to use .375 polypropylene for the bottom chassis, .25 polypropylene for the cargo side walls, tailgate, and bulkhead, and .125 for the cargo front wall and top doors.

The structural bars for the tracks will be .25 aluminum bar, with crossmembers aplenty.

Hi magnethead794,

Welcome to the RobotShop Forum. Sounds like you are brainstorming a bit here :slight_smile: The DFRobotShop Rover doesn’t really sound like the right platform for your needs. You will really need to think long and hard if you want the rover to climb stairs and budget accordingly. You had said you were still doing research and had answered some of your questions already. We’ll wait until you better assess what you are looking for.

Sincerely,

Hi,

3 servos: 1x analog or digital pin each
1 stepper motor: 4 digital pins
3 drive motors: 1 digital pin + 1 PWM pin each or I2C
2 limit switches: 1 digital pin each
BT: pins 1 and 0

Total digital: 10
Total analog: 3

The Arduino Uno has 13 digital pins (including pins 1 and 0) and 6/7 analog pins, which should be more than enough. If you need more, then use an Arduino MEGA.

Yes, you can use a joystick, but if you choose an “off the shelf” joystick like a Logitech, you may need to write a custom code to read the values and then send them to the robot.

For power, you can either use one pack which powers everything (you would likely need to include at least one voltage regulator) or two packs: one for the microcontroller and another for the motors. A 7.4V LiPo pack would work, so you might use two 3.7V, though at this time we don’t offer a 7.4V (likely coming soon). An NiMh battery would work well too.

Looking forward to seeing your design progress.

Knowing if there is an ideal configuration would take quite a bit of research. Unfortunately we do not know of any “ideal” track / ilder configuration without doing added research. We hope you post yur results here.

Sincerely,