Go to Post There will inevitably be enough unintentional failure in any endeavor we take on that adding intentional failure on top of that seems unnecessary. - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 28-01-2006, 16:08
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Has anyone gotten useful data from the accelerometer?

the sensor connects to your analog to digital converters, and the output is an integer. What are the ADCs on the RC this year, 10 bits (I think)? that would give you a reading from 0 to 1024, with the 'zero point' around 512.

there is no need to convert that to a real number. If you are calculating tilt with the accelerometers that might be a different story.
  #17   Spotlight this post!  
Unread 28-01-2006, 21:31
yoyodyne yoyodyne is offline
Registered User
AKA: Greg Smith
FRC #0116 (Epsilon Delta)
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Reston, VA
Posts: 61
yoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to behold
Smile Re: Has anyone gotten useful data from the accelerometer?

Quote:
Originally Posted by Chriszuma
I was playing around with the accelerometer the other day, trying to use its sum to determine velocity. However, I fiddled with my algorithm for a couple of hours and couldn't get it to give me anything close to an accurate reading. Has anyone actually gotten this to work? I think they're just way too sensitive to use for tracking. I'll probably end up just using the gear tooth sensor to measure distance, which makes more sense anyway.
Maybe I need to upgrade to kevin watson's oversampling uart?
This is my frist Chief Delphi post! Hope this information helps someone.

I agree it can be difficult to get reasonable data from the accelerometer. We designed a little test where we mounted the 2006 Gyro and X,Y accelerometer (plan attached) to a roll around cart and recorded the outputs using the NI data logger we got. Our plan for navigation is basically to use the gyro to set a heading and then use shaft encoders or gear tooth counters to drive straight to the next point in the waypoint list, stop, turn and then go straight again so I didn’t really think we would actually use the accelerometers for navigation. I did think that they may come in handy to tell us if we have started up a corner goal ramp and I was curious what I could get out of them. Well, after the data was put in an excel spread sheet, it looks like using only the accelerometer that is in the direction of the robot heading and the gyro and a little trig you can navigate through a few waypoints, travel over 50feet with an X,Y error when you are done of about a foot. See attached spread sheet if you are curious. We will still count wheel rotations but at least for now our controls group will use the gyro and accelerometers for navigation.

The excel files list the raw readings for 5v, Gyro, Temperature, Acc X, Acc Y. The sample rate was slow, 100 s/s but that seems to be fast enough. The actual path and the estimated path using the gyro and accelerometer are shown for two test cases.

The spread sheets basically take the raw gyro and Y accelerometer outputs, remove bias, let you set different dead band widths and gains. The final output is the X,Y position of the robot for each time tick. The heading from the gyro is used to update the robot position every sample. That is probably too much processing for the real application but if you assume the robot drives straight from waypoint to waypoint then you can save processing cycles and only calculate the distance traveled in the heading direction from the last waypoint in order to know when to stop and turn. If you look at the data carefully, you will see that the Y accelerometer output is zeroed while the robot is turning (for question mark that is from 6.93 to 9.23 and 15.33 to 18.74 seconds) this can be done because while turning the robot only uses the feedback from the gyro for our application.


http://members.cox.net/gnsmith/Just%...e1_results.xls

http://members.cox.net/gnsmith/Just%...stion_mark.xls

http://members.cox.net/gnsmith/Team%..._test_plan.pdf

Last edited by yoyodyne : 28-01-2006 at 22:45. Reason: Add more information on the calculations
  #18   Spotlight this post!  
Unread 11-02-2006, 13:34
p1r0o2g7 p1r0o2g7 is offline
Registered User
#1027
 
Join Date: Mar 2005
Location: West Springfield, MA
Posts: 3
p1r0o2g7 is an unknown quantity at this point
Re: Has anyone gotten useful data from the accelerometer?

i used this code to find acceleration. Tipping the accelerometer 90 degrees to one side should read 9.8

place this code in

void Process_Data_From_Master_uP(void)



Code:
  float get_x_value;
  float get_y_value;
  int a = 205;
  float dec_x;
  float dec_y;
  float x;
  float y;


	//get analog values for ana04 and ana05
    x = Get_Analog_Value(rc_ana_in04);
	y = Get_Analog_Value(rc_ana_in05);
	
	/****************************************************/
	/*******divide by a(205) to get voltage**************/
	/****minus 2.5 to get a range from 2.5 to -2.5*******/
	/******multiply by 1000 to get millivolts************/
	/*divide by 290 to get G's (290 = millivolts in 1G)**/
	/***multiply by 9.803(accelertaion due to gravity)***/
	/****************************************************/
	get_x_value = (((((x/a) - 2.5) * 1000) / 290) * 9.803);    
	get_y_value = (((((y/a) - 2.5) * 1000) / 290) * 9.803);   

	//find and print floating point number
	dec_y = ((get_y_value - (int)get_y_value) * 10);
	dec_x = ((get_x_value - (int)get_x_value) * 10);
    if (dec_x < 0)
		dec_x = dec_x * -1;
	
	if (dec_y < 0)
		dec_y = dec_y * -1;
   
	
	printf("acc_x: %3d.%3d  acc_y: %3d.%3dr",  (int)get_x_value, (int)dec_x, (int)get_y_value, (int)dec_y);
i believe multiplying the (acceleration * change in time) should give you velocity.

Last edited by p1r0o2g7 : 11-02-2006 at 13:41.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TTL port to a serial port on a demo board ImmortalAres Programming 16 09-07-2005 23:44
Example accelerometer code released. Kevin Watson Programming 0 20-01-2005 03:45
Accelerometer data sheet Joe Ross Electrical 16 19-01-2005 12:26
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Limiting PWM in pbasic archiver 2001 4 24-06-2002 00:38


All times are GMT -5. The time now is 15:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi