Show Posts
Pages: [1]
1  Topics / Robotics / Re: Robotics Shield Market Research on: August 05, 2012, 05:33:52 pm
Quote
Motors often tend to need more voltage not 3.3v, but a lot of other things need 3.3 volts.

Ah sorry I should have clarified.  I meant a split between 3.3V pins and 5V pins to provide extra compatibility.  And as for the motors I could always have an extra header that takes power directly from the battery port so the motor can be supplied by whatever voltage the battery is.  I know TI also has some good PWM extender products so I could also put one of those on there to add support to up to 12 servos or motors and have a built on H-Bridge chip.  That way the shield could support a battery, servos, and some motors.
2  Topics / Robotics / Robotics Shield Market Research on: August 05, 2012, 04:31:32 pm
So senior year of University has rolled around at last and we are finally getting the chance to apply our knowledge from the past three years in our Senior Design class.  For my senior design project I wanted to make a robotics shield that's compatible with the Arduino Uno board and since this class is supposed to prepare us for industry, our professors want us to do some market research and make sure our final product is marketable.

So my question for the hive mind is, what would you guys like to see in a microcontroller shield?
The basic template that I've drawn up so far has the following features
  • Powered 3 Pin Headers for Servos and Sensors
  • 3.3V Power supply
  • Plug for a LiPo battery
  • Onboard battery monitor and charging circuit

So do you guys have any suggestions on what I should add?  What are the most commonly used features in your robots?  Thanks in advance for all of the help!
3  Using Arduino / Programming Questions / Re: Servo Swings Far Left When using Custom Library on: October 26, 2011, 10:27:07 am
@ AWOL, yea that was what I thought, but I verified that they are connected with a multimeter.

@PaulS, my header file is below.  As for the new and delete, when I don't have get the error "undefined reference to `operator new(unsigned int)'" and when looked up, I was told to add the new and delete operators at the top.  My next step is going to be to replace all pointers with stack objects since I'm beginning to suspect that the problem is either pointers not being handled well, or that my robot has actually gained sentience and is just trying to mess with me.

Code:
/*
Keith Elliott
 Created: 10/21/11
 DESC: A library for controlling a rotating scanner with a servo and distance sensors
 */

#ifndef Scanner_h
#define Scanner_h

#include "Sweep.h"
#include "Servo.h"
#include "USSensor.h"
#include "WProgram.h"

#define CENT_OFF 90
#define SERVO_MAX 180
#define SERVO_MIN 0

class Scanner{
public:
  Scanner();
  Servo *servo;
  USSensor *sonar;
  Sweep *sweep;
  Sweep doSweep(int inc);
  int scan(int threshold, unsigned int timeout);
};

#endif
4  Using Arduino / Programming Questions / Re: Servo Swings Far Left When using Custom Library on: October 25, 2011, 10:16:28 pm
I'm starting to think there's something inherently wrong with my pointers and memory allocation.  My motor drivers don't work either smiley-sad
5  Using Arduino / Programming Questions / Re: Servo Swings Far Left When using Custom Library on: October 25, 2011, 09:31:34 pm
Yea and that was my first thought.  However, I've quadruple-checked my wiring and it all seems right.  I've also tested the example code, like I said above.  But as of right now it seems like my code and the example code should, for all intensive purposes, be the exact same with the exception of a library call.  So I have no idea why it's not working.
6  Using Arduino / Programming Questions / Servo Swings Far Left When using Custom Library on: October 25, 2011, 08:09:11 pm
So for a robotics program of mine I'm attempting to build a 180 degree sonar scanner and so I developed a scanner library for this purpose.  However, when I implement this library on a servo it causes the servo to one side of its boundaries and cease to work.  When I use the Sweep example though, it works fine.  If someone could help me and tell me what I'm doing wrong that'd be awesome.  The relevant code is below.  Let me know if you you guys need more.  Thank you!

The main sketch
Code:
#include <stdlib.h>
#include "MotorController.h"
#include "DiffDrive.h"
#include "Scanner.h"

void * operator new(size_t size)
{
  return malloc(size);
}

void operator delete(void * ptr)
{
  free(ptr);
}

//DiffDrive drive(5, 6, 7, 8);
Scanner scanner;
void setup(){
  delay(1000);
}

void loop(){
 for(int pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    scanner.servo->write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for(int pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    scanner.servo->write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}


The Scanner library.
Code:
/*
Keith Elliott
 Created: 10/21/11
 DESC: A library for controlling a rotating scanner with a servo and distance sensors
 */

#include "Scanner.h"

Scanner::Scanner(){
  //sonar = new USSensor();
  //sonar->init();
  servo = new Servo();
  servo->attach(10);
  //sweep = new Sweep();
}

Sweep Scanner::doSweep(int inc){
  servo->write(SERVO_MIN);
  delay(200);
  if (inc > 0){
    for (int i = SERVO_MIN; i <= SERVO_MAX; i+=inc){
      servo->write(i);
      delay(200);
      sweep->addNode(sonar->getDist(), i-CENT_OFF);
    }
  }
  else if (inc < 0){
    for (int i = SERVO_MAX; i >= SERVO_MIN; i+=inc){
      servo->write(i);
      delay(200);
      sweep->addNode(sonar->getDist(), i-CENT_OFF);
    }
  }
}

int Scanner::scan(int threshold, unsigned int timeout){
  unsigned long start = millis();
  int i;
  while (1){
    for (i = CENT_OFF; i <= SERVO_MAX; i+=30){
      if (sonar->getDist() < threshold)
        return i-CENT_OFF;
    }
    for (; i >= SERVO_MIN; i-=30){
      if (sonar->getDist() < threshold)
        return i-CENT_OFF;
    }
    for (; i <= CENT_OFF; i+=30){
      if (sonar->getDist() < threshold)
        return i-CENT_OFF;
    }
    if (millis() - start >= timeout*1000)
      return 0;
  }
}
7  Using Arduino / Installation & Troubleshooting / Re: Problem Replacing Atmega328 on Uno on: June 16, 2011, 08:01:40 am
When running off of USB I get the normal 5V when I measure on the 328 itself, and I triple checked that it's oriented correctly, based on the Uno picture in the hardware section.  As for the U2, I don't really know how I could have overwritten the bootloader.  Is that possible when programming from the ISP?  But I can give it a try when I get the chance.

And I didn't buy one with a preinstalled bootloader because I already had a spare 328 lying around so I didn't see a point in buying another.  Plus at some point I'd like to break away from the arduino board for my robot's subsystems so I needed an ISP anyway. 

EDIT: I tried reprogramming the U2 firmware and I couldn't manage to get it into DFU mode.  I found conflicting instruction on grounding HWB then RESET and vice versa but to the best of my knowledge, it didn't work.  All that happened was that the L light blinked in bursts of 3.
8  Using Arduino / Installation & Troubleshooting / Problem Replacing Atmega328 on Uno on: June 15, 2011, 09:37:50 am
So I've been working with Arduinos for the past 6 months and just recently have been having a pretty major problem.  About a week ago, I was using my Uno to control some relays for my robotics project.  I made a stupid mistake and ended up (I believe) breaking the onboard Atmega by drawing to much current from it.  I assumed this is what happened because the board wasn't programmable and the output pins always were at 4V.  So anyways, I luckily had an extra 328P lying around, and ordered the Sparkfun pocket programmer (http://www.sparkfun.com/products/9825) to program the bootloader and replace it.

So that's what I tried to do today.  I followed the following Sparkfun tutorial (http://www.sparkfun.com/tutorials/247), set the fusebits, and reprogrammed with the bootloader they supplied.  However, this still didn't work so I tried reprogramming the bootloader via the Arduino IDE.  Still can't upload.  So now my problem is that everytime I try to program I get the following error

avrdude: stk500_recv(): programmer is not responding

The correct board and serial port are both selected.  And when I plug in the board, only the on light goes on, and when I hit reset the L light blinks quickly 3 times and then stops.  So does anyone have any suggestions as to what the problem could be and how I could fix it?  I'd really like to be able to get back to my project sometime soon without having to spend another $30 plus shipping for a new microcontroller.  Thanks in advance!
Pages: [1]