Being that my car already measures velocity & position, why not fill the void with an accelerometer & measure acceleration? The Personal G-Force Meter Does just that using standard 7-Segment LEDs for output. Check out the video for an overview of how it works!
Posted: Mon Apr 28, 2008 11:35 pm Post subject: Personal G-force meter
Does the g-force meter just read forward and and back G forces?
or if you were to take a tight bend would it tell you how many G forces you are exhibiting on the vehicle?
Looking at the way it was designed with just the Y axis being wired up it seems to be just forward and breaking acceleration? unless im wrong?
Tho saying that great design, i think im going to copy you and make one of my own
Thanks
Mathew
Unfortunately the sensor I had was half broken and I could only measure 1-axis the Y axis. Not wanting to waste the sensor I put it in this project for a simple 1-axis g-meter. Measuring the g-forces applied to you & your car on tight bends would require 2-axis + a little math.
So to answer your question: yup, just forward and backward. Seems sufficient enough to me being that most news websites noticed I only have a civic .
2. The raw ADC reading has the gravity_ss variable subtracted from it, then it is left-shifted by 5 (equivalent to multiplying by 32), and then divided by display_divider (which was set to 20):
Since you are only measuring acceleration in the forwards/backwards direction, orthogonal to gravity, would you say the the variable name gravity_ss is a bit of a misnomer? I understand how the accelerometers work, and that 512 is the value that represents 0g when using a 10-bit ADC, it just seems like naming a variable like this will only serve to confuse people, especially when gravity isn't involved here.
3. Did you do any sensor calibration to see if 32/20 is actually a good number to scale the result by? If you rotate the sensor to be in line with gravity, does it display 1g?
Thanks for the project, and thanks for the good writeup.
Ah, sorry I misunderstood your previous post. Thought you were looking for the schematic for the project already created.
Quite honestly, I could just turn the sensor 90 degrees so that it would measure left to right instead of how it is right now, front to back.
The force you feel when going around turns fast is an angular force. When you turn you accelerate in two axis, y & x. In the middle of the turn you will reach the maximum force from the x-axis. Right now the device I built just measures Y-Axis.
In short, you could build the same device I built except mount the sensor turned 90 degrees OR you could use the data of two axis (x & y) to find the the total instantaneous G-force applied to car from both x & y vectors.
I'm trying not to go too far into the details because I'm not sure of your level with electronics. Let me know if you're curious about more details .
Was there any reason that you didn't simply do the following, and avoid both the loop overhead and the switch statement pipeline flush?
I think that case statement is a leftover from a previous method I had tried and I never changed it. So yea, it could definitely be simplified as you wrote.
Quote:
2. The raw ADC reading has the gravity_ss variable subtracted from it, then it is left-shifted by 5 (equivalent to multiplying by 32), and then divided by display_divider (which was set to 20)
I'm hoping people aren't relying solely on the names of the variables in my code to understand what's going on since the code is so short! Better off going through it and doing the calculations yourself so that you know exactly what's going on.
However, I named it gravity_ss, because in my head ss = SteadyState. When the sensor is not moved 512-512 = 0 so it does nothing and is infact steady state & shows 0.00.
Quote:
Did you do any sensor calibration to see if 32/20 is actually a good number to scale the result by? If you rotate the sensor to be in line with gravity, does it display 1g?
Yes, calibration was done. So that means the data is not actually scaled but instead turned into a whole number. This makes displaying the data easier. The theory section video shows how the tilt affect of natural gravity comes up on the sensor and yes it does hit 1 G when parallel to gravity.
Well, im from a mechanical background so i know what your talking about at the moment. Ive dabed in electronics a bit, and know some java, so i know the basics. - If you start from the most complex end ill either catch up or ask you to 'dumb down' so to speak.
I was thinking about turning the sensor 90degrees, however that doesnt really provide a true 'G' reading if I were to break without turning.
So both X and Y axis need to be part of the calculations.
Yea, well really once you have the X-axis & Y-axis data finding the total force being applied to you/your car would be:
Total Force^2 = X_Data^2 + Y_Data^2
You're adding the X_Data & Y_Data Vectors to find the Total Force vector. But we don't care so much about the vector as just the point that it reaches to.
That should be all the 'little' math you'd have to add into the code.
Posted: Tue Apr 29, 2008 7:42 pm Post subject: Getting the two axis going!
Hi I only spotted this project earlier and I'm going to get my teeth into it tomorrow but Im just have some quick questions, I really want it to have the x and y axis running and to show a true reading, but for the time being could I just connect the x and y terminals together on the accelerometer board? Also Im fairly handy with electronics but just havent got into PIC programming yet so could you please tell me what code to use and where to insert it in the original code to get a true reading of the G-forces, and then finally I presume as metioned already in a previos post the x axis would be connected to the RA1/AN1 input....... yes?
Posted: Tue Apr 29, 2008 8:06 pm Post subject: Re: Getting the two axis going!
eh2k8 wrote:
but for the time being could I just connect the x and y terminals together on the accelerometer board?
This bothers me a lot. You will just get garbage data if you connect the two terminals together.
X-Axis would go to AN0
Y-Axis would go to AN1
or vice versa, however you want to wire it. The modifications of the code would happen where the first ReadADC occurs, you'd add another ReadADC for the new port and shortly after the data is converted to the 'true' g_val for both x & y axis you'd use the formula above to get the total g_val that should be displayed.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum