Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Has anyone gotten useful data from the accelerometer? (http://www.chiefdelphi.com/forums/showthread.php?t=42217)

KenWittlief 28-01-2006 16:08

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.

yoyodyne 28-01-2006 21:31

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

p1r0o2g7 11-02-2006 13:34

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.


All times are GMT -5. The time now is 17:41.

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