Calculating angles,calculating velocity

  • Thread starter bradleyk
  • Start date
  • Tags
    Velocity
In summary, Brad is trying to calculate angles and velocity using a sensor that provides relative angular rotation and acceleration data. He is considering using a PID control system to minimize cumulative error, with proportional, integral, and derivative gains as tuning parameters. However, he is unsure of how to reduce error and is seeking advice on the best approach.
  • #1
bradleyk
2
0
hi,
i am trying to calculate angles and velocity.
i believe i have to use PID (never done before)
angles
i have a sensor that is giving a relative angular rotation in degrees per a second
i can sample this a 300htz
but how can i figure out if i have turned xo and i how can i reduce the cumulative error

velocity
i have a sensor that is giving acceleration in g's
i can sample this a 300htz
but how can i figure out if i am moving @ x ms-2 and i how can i reduce the cumulative error

thanks,
brad

if this is in the wrong spot please move it
 
Engineering news on Phys.org
  • #2
bradleyk said:
hi,
i am trying to calculate angles and velocity.
i believe i have to use PID (never done before)
angles
i have a sensor that is giving a relative angular rotation in degrees per a second
i can sample this a 300htz
but how can i figure out if i have turned xo and i how can i reduce the cumulative error

velocity
i have a sensor that is giving acceleration in g's
i can sample this a 300htz
but how can i figure out if i am moving @ x ms-2 and i how can i reduce the cumulative error

thanks,
brad

if this is in the wrong spot please move it

Welcome tol the PF, Brad. I went ahead and moved your question to General Engineering for now.

What are the outputs of these sensors like? Are they a byte or two that you are sampling at 300Hz? Or do they offer some sort of pulse outputs or serial data?

Are you familiar with integration in calculus? that's how you go from a rate to a position. In your case, it would be a discrete integration, basically multiplying the rate by the delta time interval to get the quantity. As for minimizing the error, you might want to use the mean value theorem, or maybe some other type of predictive filtering of the data.

What are your thoughts on how to minimize the errors?
 
  • #3
the output is a 10bit dac where 0 is -300o/s and 1024 is 300o/s and 512 is 0o/s

the output is a 10bit dac where 0 is -1.5g and 1024 is 1.5g and 512 is 0

i believe that
proportional integral derivative
something along the lines of
e3386d1b5511c8ce5b70a4ba8bcfc3e3.png

where the tuning parameters are:

Proportional gain, Kp

Larger values typically mean faster response since the larger the error, the larger the proportional term compensation. An excessively large proportional gain will lead to process instability and oscillation.

Integral gain, Ki

Larger values imply steady state errors are eliminated more quickly. The trade-off is larger overshoot: any negative error integrated during transient response must be integrated away by positive error before reaching steady state.

Derivative gain, Kd

Larger values decrease overshoot, but slow down transient response and may lead to instability due to signal noise amplification in the differentiation of the error.
 
Last edited:

1. How do I calculate the angle between two vectors?

The angle between two vectors can be calculated using the dot product formula: θ = cos^-1((A·B) / (|A||B|)), where A and B are the two vectors and |A| and |B| are their respective magnitudes.

2. How can I calculate the velocity of an object?

The velocity of an object can be calculated by dividing the distance traveled by the time taken. The formula is v = d/t, where v is the velocity, d is the distance, and t is the time.

3. Can I use trigonometry to calculate angles and velocity?

Yes, trigonometry can be used to calculate angles and velocity. Trigonometric functions such as sine, cosine, and tangent can be used to find angles and velocities in various situations.

4. What is the difference between angular velocity and linear velocity?

Angular velocity refers to the rate of change of angular position, while linear velocity refers to the rate of change of linear position. In other words, angular velocity measures how fast an object is rotating, while linear velocity measures how fast an object is moving in a straight line.

5. How do I convert between angular and linear velocity?

To convert between angular and linear velocity, you can use the formula v = rω, where v is the linear velocity, r is the radius of rotation, and ω is the angular velocity. You can also use unit conversions to convert between radians and meters, depending on the units used for angular and linear velocity.

Similar threads

Replies
3
Views
2K
  • General Engineering
Replies
10
Views
2K
Replies
10
Views
370
  • Aerospace Engineering
Replies
5
Views
524
Replies
9
Views
2K
Replies
1
Views
2K
  • Mechanical Engineering
Replies
3
Views
434
Replies
14
Views
1K
  • Mechanical Engineering
Replies
15
Views
397
Replies
24
Views
2K
Back
Top