how much equipment needed for robot arm control?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: how much equipment needed for robot arm control?

Post by adafruit »

kgraf wrote:Your search choice is much better than gyro+arduino+motor+wiring diagram

I can't log into my account to check my order status
Order Number is: 198436
Is this because I paid through paypal?
How can I find out if my order has shipped?
hi kgraf,

please email [email protected] and we can give you a status and also how to log in to your account.

thanks,
adafruit support, phil

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

order problem figured out with customer service. ignore above

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

I need a pressure sensor for the operator's hand to squeeze to make the gripper open and close, do you recommend any particular type of pressure sensor or specific pressure sensor?

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

Either an FSR or a flex sensor would be my choice. The flex sensor would probably give you better control. Both are easy to interface via an analog pin.
https://www.adafruit.com/index.php?main ... arch&q=fsr

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

I bought a https://www.adafruit.com/products/1075 Square Force-Sensitive Resistor (FSR) - Interlink 406. Do you recommend any code source to begin programming the arduino mega?
I now have the components (except for the FSR). 9V ac to dc adapter ok for mega? I have arduino for windows installed in win7.

My initial problem is connecting the gyro to the arduino and then reading the data from the gyro. the gyro is to detect angular motions of a human arm mastering the robot' arm's slave motion. Do you recommend any reference to begin writing code from? The idea is gyro data to arduino mega to motor driver like drv8833 to dc motor on the owi 535 robot arm. The same for the FSR to control the gripper. I'm guessing the gyro is a lot harder to program than the FSR.

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

The 9v adapter will work fine with the Mega.
There is a tutorial link for the FSR in the product description. http://learn.adafruit.com/force-sensitive-resistor-fsr
The gyro has a library with example code to get you started: https://github.com/adafruit/Adafruit_L3GD20

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

Trying to connect the L3GD20 gyro breakout board to mega2560 R3 microcontroller.
Uncertain about which pins to connect from gyro to mega
gnd on gyro board to any gnd on mega?
Vcc on gyro board to 3.3V or 5V on mega?
SCL on gyro to SCL 21 on mega? //communications section of mega
SDA on gyro to SDA 20 on mega? //communications section of mega

also, what is Wire.h and how include Adafruit_L3GD20.h with Adafruit_L3GD20.test in
sketchpad - sketch/add file?
#include <Wire.h>
#include <Adafruit_L3GD20.h>

when is the power connection needed on the mega board? I did the sample blink with
only the usb connected and it worked fine.

Re:
Getting started is easy - simply connect SDA to your Arduino I2C data pin (On the UNO this is A4), SCL to I2C clock (Uno: A5), GND to ground, and Vin to 3 or 5VDC. Then install and run our easy to use Arduino library, which will print out the XYZ sensor data to the serial terminal. Our library also supports SPI on any 4 digital I/O pins, see the example for wiring.

// By default, uses I2C
//Adafruit_L3GD20 gyro;
// Alternately, you can use SPI, but you have to define the pins
#define GYRO_CS 4 // labeled CS
#define GYRO_DO 5 // labeled SA0
#define GYRO_DI 6 // labeled SDA
#define GYRO_CLK 7 // labeled SCL
Adafruit_L3GD20 gyro(GYRO_CS, GYRO_DO, GYRO_DI, GYRO_CLK);

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

gnd on gyro board to any gnd on mega?
Vcc on gyro board to 3.3V or 5V on mega?
SCL on gyro to SCL 21 on mega? //communications section of mega
SDA on gyro to SDA 20 on mega? //communications section of mega
Yes.
what is Wire.h
Wire.h is part of the standard Arduino libraries. It is used for I2C communication with the Gyro.
and how include Adafruit_L3GD20.h with Adafruit_L3GD20.test in
sketchpad - sketch/add file?
Just install the library and open the example sketch in the IDE. http://www.ladyada.net/library/arduino/libraries.html
when is the power connection needed on the mega board? I did the sample blink with
only the usb connected and it worked fine.
The USB connection will typically handle up to 500mA total. The Mega & gyro combined probably draw 25-30mA.

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

Initially, Adafruit_L3GD20_test with the wiring connected gave a compile error msg, then I added Adafruit_L3GD20.h and Adafruit_L3GD20.cpp to the Wire folder under Libraries and it compiled and uploaded and then does nothing - no response - not even a msg. I tried uploading again and got error msg 'com3 already in use' or it just hangs on upload. Is the program uploaded once and then with no changes made subsequent uploads cause problems?
I tried to upload blink and got it running again after disconnecting/reconnecting the usb and then retried Adafruit_L3GD20_test with no wires connected to see if it gave the error msg to 'check wiring' but it doesn't complete the upload.

What can I do? It has hung at 90% upload for 15 minutes or more.
Do I ever need to press the reset button with the mega board? Re:
Note: If you have an Arduino Mini, NG, or other board, you'll need to physically present the reset button on the board immediately before pressing the upload button.)


just noticed these error msgs in compile window
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x10
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500v2_ReceiveMessage(): timeout

//Adafruit_L3GD20_test
#include <Wire.h>
#include <Adafruit_L3GD20.h>
void setup()
{
Serial.begin(9600);

// Try to initialise and warn if we couldn't detect the chip
if (!gyro.begin(gyro.L3DS20_RANGE_250DPS))
//if (!gyro.begin(gyro.L3DS20_RANGE_500DPS))
//if (!gyro.begin(gyro.L3DS20_RANGE_2000DPS))
{
Serial.println("Oops ... unable to initialize the L3GD20. Check your wiring!");
while (1);
}
}

void loop()
{
gyro.read();
Serial.print("X: "); Serial.print((int)gyro.data.x); Serial.print(" ");
Serial.print("Y: "); Serial.print((int)gyro.data.y); Serial.print(" ");
Serial.print("Z: "); Serial.println((int)gyro.data.z); Serial.print(" ");
delay(100);
}

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

Sounds like you have multiple problems there. We will forget about the libraries for the moment and first figure out why the Mega is not communicating.

What LED activity do you see on the Mega whan you attempt an upload?

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

the green led next to the reset button is on constantly
I have no jumpers on the board or with the board currently,
I have no connections to the board except the usb - the gyro board connections have been removed
the yellow led above the TX and RX leds is blinking 2 sec on 1 sec off
from a change in the blink sample program
when I originally uploaded the program after adding the .h .cpp file the rx tx leds
flashed and the yellow led stopped flashing but it didn't give any response to the gyro test program and no error msgs either

now after about 15 minutes of incomplete uploading it gives error msgs and says done uploading:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x11
avrdude: stk500v2_disable(): failed to leave programming mode

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

the yellow led above the TX and RX leds is blinking 2 sec on 1 sec off
No change in that pattern when the upload starts?
What happens when you press the reset button?

Double check to see that you have the right COM port. Sometimes they get re-assigned for no apparent reason.

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

that was the adjusted blink example program
I just put the original blink in and it works fine also
I then directly (without unplugging the usb) uploaded the example fade with led pin 13 (same as blink) instead of 9 and it works just fine also
I am thinking the problem is in the Adafruit_L3GD20_test software or library files
I notice that tools/serial port/com3 is sometimes empty blank (program running?) and sometimes shows com3 with a check next to it. it is the only com listed
the reset button doesn't seem to be needed - programs switch immediately after uploaded even on the fade program that says push the reset button to start

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

I just put the original blink in and it works fine also
'So, you are able to upload programs then?

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

I can't upload the gyro test program Adafruit_L3GD20_test - the upload stops at about 90%.
does it matter where it is located on the hard drive?

I can upload and run blink and fade example programs successfully but they don't use any include
files.

after upload of Adafruit_L3GD20_test fails:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x11
avrdude: stk500v2_disable(): failed to leave programming mode

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”