Show Posts
Pages: [1] 2 3 ... 13
1  Using Arduino / Sensors / Multiple encoders and maximising pins on: September 11, 2014, 04:41:57 pm
I am attempting to have 3 optical encoders (https://www.sparkfun.com/products/10982)

I using a Sparkfun Fio board that has 5 interrupt pins. Encoders take 2 interrupt and I'm wondering if I can put two encoder on two interrupt pins each and for the third encoder use the final interrupt pin and a digital pin.

I have tested code that just reads the encoder on digital pins and it is not accurate at all. With the same setup I have tested the encoder with the interrupt pins and it works great.

Wondering how you would program.
2  Using Arduino / Motors, Mechanics, and Power / Re: Driving 4 small geared motors on: July 02, 2013, 04:46:59 pm
Quote
The output current is rated up to 1.2A per channel (or up to 3.2A for a short, single pulse).
A fuse is useful.

I would say for LiPo and lead-acid batteries (both capable of currents high enough to set fire to
wiring) a fuse (or over-current protection circuit) is essential.   Place fuse on +ve wire right next to
the battery, then any wiring downstream is protected should there be an accidental short.

So reading over the sparkfun product again it says this:
Output current:
Iout=1.2A(average) / 3.2A (peak)
It also says this:
1.2A per channel
So shouldn't applying 2.2amps to the board be totally fine?
3  Using Arduino / Motors, Mechanics, and Power / Re: Driving 4 small geared motors on: July 01, 2013, 04:37:57 pm
That's what I originally found. Talks about voltage but not input amperage. Just don't want to toast the board with that lipo.
4  Using Arduino / Motors, Mechanics, and Power / Re: Driving 4 small geared motors on: July 01, 2013, 04:14:27 pm
After looking around a bit after I posted this I found this:
https://www.sparkfun.com/products/9457

Cheap (under $20 for 4 controlled motors) and simple!

How would I go about using a 7.4v 2200Mah battery with this?
5  Using Arduino / Motors, Mechanics, and Power / Re: Driving 4 small geared motors on: July 01, 2013, 03:37:20 pm
Quote
I would like to control direction and speed isn't an issue. I'm looking for the most affordable option with the smallest package.
Quote
smallest package
What are your specifications?


I just need direction such as: on, off, high, low, 0, 255. Then just CW and CCW. Preferably if the size could be a few IC's or something. Really the smaller the better but I can work from anything.
6  Using Arduino / Motors, Mechanics, and Power / Driving 4 small geared motors on: July 01, 2013, 03:17:48 pm
Hello!

Hopefully this is simple enough. I need to drive 4 of these:
http://www.robotmarketplace.com/products/0-FT-SPARK16-360.html
Operating Voltage    4.5V-22.2V (>7.4V decreses motor life)
Nominal Voltage    6V DC
No Load RPM    11530 RPM
No Load Current    0.05A
Stall Current    1.3A
Stall Torque    0.0461 kg-cm (0.64 oz-in.)
Kt    0.0352 kg-cm (0.49 oz-in./A)
Kv    1573 rpm/V
Efficiency    52%
RPM at Peak Efficiency    9100
Current at Peak Efficiency    0.34A


I would like to control direction and speed isn't an issue. I'm looking for the most affordable option with the smallest package.

Thank you!
7  Using Arduino / Programming Questions / Re: Controlling 2 DC motors at once on: September 15, 2012, 03:22:11 pm
Looks like your Sholder function never returns. smiley-sad

What I would do:

Global variables for the desired position of each of the motors.

In loop(), check each of the motors to see if it need to move.  For each that needs to move, set it going in the desired direction.

For best motion you should be using a PID control loop for each motor.  This will run the motor fast if it is far from the desired position and slow if it is near the desired position.
I attached my final code. The movement and everything else is not an issue at all. All i need is to have the elbow go down as the shoulder rises. I was thinking about maybe having them move one at a time like how I have it but really fast so it looks fluid.
8  Using Arduino / Programming Questions / Controlling 2 DC motors at once [For TV] on: September 15, 2012, 02:25:41 pm
Here is a part of the code from the robotic arm I am making. I have 3 motors (2 shoulder, 1 elbow) with pot feedback, basically I made a giant DC servo. Right now I can only control 1 motor at a time. I need to move 2 of them. Im taking my robotic arm on monday to Hollywood for a Nickelodeon show so I need help ASAP.
Code:

void Shoulder(int potDestPosition) //*****************************************************//
  {
    while(true)
    {
      int currentPotPos = analogRead(shoulder);
      Serial.print("pot value: ");
      Serial.println(currentPotPos);

      if (currentPotPos - potDestPosition > 5)
      {
        turnDirection(true);
      }
      
      else if (potDestPosition - currentPotPos > 5)
      {
        turnDirection(false);
      }
   }
}

void turnDirection(boolean dir) {
    if (dir)
    {
        analogWrite(D1pin1, 0);
        analogWrite(D1pin2, 20);
    }
    else
    {
        analogWrite(D1pin1, shoulderSpeed);
        analogWrite(D1pin2, 0);
    }
  }
      
9  Using Arduino / Programming Questions / Re: Wireless control system problem on: February 07, 2012, 10:21:10 pm
Also comment-out the debugging prints in the receiving end.
That did it! perfect!! im going to see if the client wants the feedback system and ill do the code and post it on here

Thank you so much! I will credit you as much as i can! thank you smiley
10  Using Arduino / Programming Questions / Re: Wireless control system problem on: February 07, 2012, 09:52:03 pm
I'd forgotten about them. If you can, yes, if you are talking through them. I found with my robot car that a slow communication rate can make the response to controls a bit sluggish.

For example:

Code:
.123,100,92,42,99/

That's 18 bytes. At 9600 baud (960 characters per second) that would take 18.7 mS to send. Maybe the problem is something else.
Could it be the delay? should i change that?
Code:
   Serial.print(".");
   Serial.print(servoVal1, DEC);
   Serial.print(",");
   Serial.print(servoVal2, DEC);
   Serial.print(",");
   Serial.print(servoVal3, DEC);
   Serial.print(",");
   Serial.print(servoVal4, DEC);
   Serial.print(",");
   Serial.print(RotationV1, DEC);
   Serial.print("/");
   
   delay(10);
11  Using Arduino / Programming Questions / Re: Wireless control system problem on: February 07, 2012, 09:22:03 pm
Try increasing the baud rate to 115200 on both sides.
hmmm now nothing is happening. It is still receiving though. Do i need to reconfigure the xbees for 115200?
12  Using Arduino / Programming Questions / Re: Wireless control system problem on: February 07, 2012, 09:07:05 pm
So i fallowed this diagram and it works fine smiley one thing with the code is that it is really jumpy and random. The fingers do move when i move mine but there is a weird delay and the servos are pretty much always moving no matter if i flex my hand or not. We are really close!!!
13  Using Arduino / Programming Questions / Re: Wireless control system problem on: February 07, 2012, 08:51:38 pm
Is this different to what you said earlier?

Quote
should i just power these servos with the 5v and gnd from the arduino or something else?

Certainly you should have the grounds common. I agree with that. And from the battery I would run a wire to the Arduino's "power in" socket (so it gets voltage regulated). And also direct from the battery to the motor shield.

Sounds OK, subject to seeing a schematic.
I believe it should be something like this?
14  Using Arduino / Programming Questions / Re: Wireless control system problem on: February 07, 2012, 08:10:27 pm
I certainly would not power them from the Arduino 5V line. That goes through a voltage regulator that is not designed to handle that amount of current. I assume (hope) you are using some kind of motor board to actually drive the motors. That should be independently powered, not from the Arduino's 5V line.
I made a custom shield that i have the digital lines from the arduino tied to then the power from the lipo battery. I have common grounds connected also. Should this work?
15  Using Arduino / Programming Questions / Re: Wireless control system problem on: February 07, 2012, 06:47:28 pm
Did you think to open the serial monitor on the sending side and check what was actually being sent? I did and saw this:

Code:
,350/35/<some gibberish>

Hardly the numbers you expect, eh?

Now if we change the sending code to send "decimal" numbers like this:

Code:
  Serial.print(".");
   Serial.print(servoVal1, DEC);
   Serial.print(",");
   Serial.print(servoVal2, DEC);
   Serial.print(",");
   Serial.print(servoVal3, DEC);
   Serial.print(",");
   Serial.print(servoVal4, DEC);
   Serial.print(",");
   Serial.print(RotationV1, DEC);
   Serial.print("/");

Then we get better results:

Code:
.255,0,0,255,340/.255,0,0,255,344/.255,0,0,255,368/
Ah perfect! Now another problem... So i have 5 of these: http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=6221

I am using an arduino for all this also. Now should i just power these servos with the 5v and gnd from the arduino or something else? When i power it with the arduino it powers then restarts then repeats all that. I have a 7.2v 2200mah lipo battery that im using for all this. I am also powering the xbee too.
Pages: [1] 2 3 ... 13