Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Triple Axis Accelerometer

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
13 postsPage 1 of 1
13 postsPage 1 of 1

Triple Axis Accelerometer

Post by subpilot » Mon Mar 06, 2006 2:21 am

Post by subpilot
Mon Mar 06, 2006 2:21 am

I just got my accelerometer board working. Now my RoboNova knows when he has taken a fall and gets back up on his own.
I used the Sparkfun Triple Axis Accelerometer http://www.sparkfun.com/commerce/produc ... cts_id=252

Here's where I put the board. I'm running it from A2D chans 5 & 6 (just using 2 axis so far)

Image

Note: This accelerometer board runs on 3.3V and is NOT 5V tolerent. You must convert the 3024 over to run on 3.3V or provide an external 3.3V source for this board.
I just got my accelerometer board working. Now my RoboNova knows when he has taken a fall and gets back up on his own.
I used the Sparkfun Triple Axis Accelerometer http://www.sparkfun.com/commerce/produc ... cts_id=252

Here's where I put the board. I'm running it from A2D chans 5 & 6 (just using 2 axis so far)

Image

Note: This accelerometer board runs on 3.3V and is NOT 5V tolerent. You must convert the 3024 over to run on 3.3V or provide an external 3.3V source for this board.
subpilot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 146
Joined: Sat Feb 25, 2006 1:00 am
Location: Lake Arrowhead, Ca,USA

Post by Pev » Mon Mar 06, 2006 1:20 pm

Post by Pev
Mon Mar 06, 2006 1:20 pm

Neat - presumably you check this each time through the main routine?

Pev
Neat - presumably you check this each time through the main routine?

Pev
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by subpilot » Mon Mar 06, 2006 5:51 pm

Post by subpilot
Mon Mar 06, 2006 5:51 pm

I just uncommented the robot_tilt line in the main loop and modded the subroutine like below. I'm just checking the one axis to see if he is laying on his back or his belly. Very preliminary.
'================================================
robot_tilt:
A = AD(6)
IF A < &h40 THEN GOTO tilt_back
IF A > &ha0 THEN GOTO tilt_front
RETURN
tilt_back:
A = AD(6)
'IF A < 30 THEN GOTO forward_standup
IF A < &h40 THEN GOTO backward_standup
RETURN
tilt_front:
A = AD(6)
'IF A > 200 THEN GOTO backward_standup
IF A > &ha0 THEN GOTO forward_standup
RETURN
'================================================
I just uncommented the robot_tilt line in the main loop and modded the subroutine like below. I'm just checking the one axis to see if he is laying on his back or his belly. Very preliminary.
'================================================
robot_tilt:
A = AD(6)
IF A < &h40 THEN GOTO tilt_back
IF A > &ha0 THEN GOTO tilt_front
RETURN
tilt_back:
A = AD(6)
'IF A < 30 THEN GOTO forward_standup
IF A < &h40 THEN GOTO backward_standup
RETURN
tilt_front:
A = AD(6)
'IF A > 200 THEN GOTO backward_standup
IF A > &ha0 THEN GOTO forward_standup
RETURN
'================================================
subpilot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 146
Joined: Sat Feb 25, 2006 1:00 am
Location: Lake Arrowhead, Ca,USA

Post by RubikCube » Mon Mar 06, 2006 6:30 pm

Post by RubikCube
Mon Mar 06, 2006 6:30 pm

Why not use this accelerometer ADXL32x Series? ( http://www.sparkfun.com/commerce/produc ... cts_id=406). It does not require voltage change.
Why not use this accelerometer ADXL32x Series? ( http://www.sparkfun.com/commerce/produc ... cts_id=406). It does not require voltage change.
RubikCube
Robot Builder
Robot Builder
User avatar
Posts: 23
Joined: Mon Mar 06, 2006 1:00 am

Post by subpilot » Mon Mar 06, 2006 6:37 pm

Post by subpilot
Mon Mar 06, 2006 6:37 pm

Why not use this accelerometer ADXL32x Series?

Sure, that would work. I switched over to 3.3V in order to use some other mods I have in mind.
Why not use this accelerometer ADXL32x Series?

Sure, that would work. I switched over to 3.3V in order to use some other mods I have in mind.
subpilot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 146
Joined: Sat Feb 25, 2006 1:00 am
Location: Lake Arrowhead, Ca,USA

Dimension Engineering Buffered ±2g Accelerometer

Post by onesandzeros » Sat Feb 17, 2007 4:22 am

Post by onesandzeros
Sat Feb 17, 2007 4:22 am

Image
Dimension Engineering Buffered ±2g Accelerometer
hey guys, is there any reason why this accelerometer wouldnt work?

i figure its 2 axis and thats all i need, and it uses 3-5v
-----
Dimensions: 10mm X 18mm
Weight: 0.9g
Operating Voltage: 3-5V
Draws less then 2mA

Applications:
Motion, tilt and slope measurement
Shock sensing

Performance:
Dual axis ±2g sensing
750mV/g sensitivity at 5VDC
500Hz bandwidth
Accurately drives up to a 3kΩ load
Based on the Analog Devices ADXL322

Protective Features:
Reverse voltage protection
14v overvoltage protection
Output short protection
----
:?:
Image
Dimension Engineering Buffered ±2g Accelerometer
hey guys, is there any reason why this accelerometer wouldnt work?

i figure its 2 axis and thats all i need, and it uses 3-5v
-----
Dimensions: 10mm X 18mm
Weight: 0.9g
Operating Voltage: 3-5V
Draws less then 2mA

Applications:
Motion, tilt and slope measurement
Shock sensing

Performance:
Dual axis ±2g sensing
750mV/g sensitivity at 5VDC
500Hz bandwidth
Accurately drives up to a 3kΩ load
Based on the Analog Devices ADXL322

Protective Features:
Reverse voltage protection
14v overvoltage protection
Output short protection
----
:?:
onesandzeros
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 99
Joined: Mon Apr 03, 2006 1:00 am

Post by beermat » Sat Feb 17, 2007 4:27 am

Post by beermat
Sat Feb 17, 2007 4:27 am

Thats the one I use, onesandzeros. Works like a charm.
Thats the one I use, onesandzeros. Works like a charm.
beermat
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 137
Joined: Sun Jul 23, 2006 1:00 am

Post by onesandzeros » Sat Feb 17, 2007 4:57 am

Post by onesandzeros
Sat Feb 17, 2007 4:57 am

hey beermat
hows it going
thanks for your reply
how did u hook it up? as it has negative,positive x and y .
and where did you put it

:D
hey beermat
hows it going
thanks for your reply
how did u hook it up? as it has negative,positive x and y .
and where did you put it

:D
onesandzeros
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 99
Joined: Mon Apr 03, 2006 1:00 am

Post by beermat » Sat Feb 17, 2007 4:08 pm

Post by beermat
Sat Feb 17, 2007 4:08 pm

I put the accelerometer in a 14 pin DIP IC socket and mounted it inside his head, along with the remote receiver and the tri-colour eyes. I only use the Y axis, and it is wired into AD2.

Image
I put the accelerometer in a 14 pin DIP IC socket and mounted it inside his head, along with the remote receiver and the tri-colour eyes. I only use the Y axis, and it is wired into AD2.

Image
beermat
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 137
Joined: Sun Jul 23, 2006 1:00 am

Post by onesandzeros » Sat Feb 17, 2007 11:40 pm

Post by onesandzeros
Sat Feb 17, 2007 11:40 pm

thanks alot for clarifying that for me
thanks alot for clarifying that for me
onesandzeros
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 99
Joined: Mon Apr 03, 2006 1:00 am

triple axis accel.

Post by engineer » Sat Feb 17, 2007 11:58 pm

Post by engineer
Sat Feb 17, 2007 11:58 pm

hey subpilot; I've got a two axis and couldn't get it to work. When I installed a hitec single axis, uncommented the GOSUB tilt it worked.the reason for the two axis is that sometimes RN-! ends on its side and nothing happens. I DIM x AS BYTE instead of A because A variable is used for the voltage subroutine. I've asked both hive and beermat this question and they show me code that I can't understand like yours.can you pm me with more information,please?
hey subpilot; I've got a two axis and couldn't get it to work. When I installed a hitec single axis, uncommented the GOSUB tilt it worked.the reason for the two axis is that sometimes RN-! ends on its side and nothing happens. I DIM x AS BYTE instead of A because A variable is used for the voltage subroutine. I've asked both hive and beermat this question and they show me code that I can't understand like yours.can you pm me with more information,please?
engineer
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 129
Joined: Wed Aug 09, 2006 1:00 am
Location: northern california

Post by onesandzeros » Sun Feb 18, 2007 2:32 am

Post by onesandzeros
Sun Feb 18, 2007 2:32 am

hmm
i tried a Dimension Engineering Buffered ±2g Accelerometer 2x. hooked up as above, and it doesnt work :cry:
so your saying its because of the A variable?
hmm
i tried a Dimension Engineering Buffered ±2g Accelerometer 2x. hooked up as above, and it doesnt work :cry:
so your saying its because of the A variable?
onesandzeros
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 99
Joined: Mon Apr 03, 2006 1:00 am

Post by engineer » Mon Feb 19, 2007 11:04 pm

Post by engineer
Mon Feb 19, 2007 11:04 pm

this is what I've got running
Code: Select all
robot_voltage:                  ' [ 10 x Value / 256 = Voltage]
   DIM v AS BYTE

   v = AD(6)
   
   IF v <153> 250 THEN RETURN
    
   IF x <30> 200 THEN GOTO tilt_high
   
   RETURN
tilt_low:
   x = AD(2)
    'IF x < 30 THEN  GOTO forward_standup   
   IF x < 30 THEN  GOTO backward_standup
   RETURN
tilt_high:   
   x = AD(2)
   'IF x > 200 THEN GOTO backward_standup
   IF x > 200 THEN GOTO forward_standup
   RETURN
'================================================

this is only the Hitec tilt sensor and the v monitor w/two 51Kohm resistors at ad(2), ad(6) I still haven't got the two axis running yet. I thought that using x & y as byte would work but RN-! doesn't react to a fall with it. :oops:The dim A as byte is used for the remocon I believe :?: I wired the two axis in and took v. readings and they are lower than the RN-1 tilt sensors, subpilot uses a different variable and that might take that into account. I hope he'll come back to this and explain what he did. :oops:
this is what I've got running
Code: Select all
robot_voltage:                  ' [ 10 x Value / 256 = Voltage]
   DIM v AS BYTE

   v = AD(6)
   
   IF v <153> 250 THEN RETURN
    
   IF x <30> 200 THEN GOTO tilt_high
   
   RETURN
tilt_low:
   x = AD(2)
    'IF x < 30 THEN  GOTO forward_standup   
   IF x < 30 THEN  GOTO backward_standup
   RETURN
tilt_high:   
   x = AD(2)
   'IF x > 200 THEN GOTO backward_standup
   IF x > 200 THEN GOTO forward_standup
   RETURN
'================================================

this is only the Hitec tilt sensor and the v monitor w/two 51Kohm resistors at ad(2), ad(6) I still haven't got the two axis running yet. I thought that using x & y as byte would work but RN-! doesn't react to a fall with it. :oops:The dim A as byte is used for the remocon I believe :?: I wired the two axis in and took v. readings and they are lower than the RN-1 tilt sensors, subpilot uses a different variable and that might take that into account. I hope he'll come back to this and explain what he did. :oops:
engineer
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 129
Joined: Wed Aug 09, 2006 1:00 am
Location: northern california


13 postsPage 1 of 1
13 postsPage 1 of 1