Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how to keep the previous value and use it again

Hi,
i have to read the gyro from gyroscope SN-imu5D-LC

 

when i rotate the sensor i could get the angle , but the problem when i stop the angle going to be zero 
so actually i want to know how can i keep the angle when i stop moving ???

the reson why it going to zero because the output from the sensor is velocity so when i stop moving the velocity going to be zero so the value also go to be zero 

gyro.jpg

0 Kudos
Message 1 of 8
(4,498 Views)

Shift register on your While loop.  A shift register is a way to pass data from one iteration to the next.  You make one by right-clicking on the While loop and find the right menu item.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(4,478 Views)

thatnk you for replying
when i use shift rigester
when i stop moving the value goes to be zero and the angle also
so i need the value before i stop moving

0 Kudos
Message 3 of 8
(4,469 Views)

Are you storing the position in the shift register or the last read angles?  If you store the position and then add the change in position, then the position shouldn't change when you stop moving.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 8
(4,462 Views)

thanks alot 
can you provide me any explenation how to store data in shift register ?

thanks 

0 Kudos
Message 5 of 8
(4,445 Views)

gyro.jpg

untill this point i can get the change between the new value and the old value , how can i complete it ?
thanks 

0 Kudos
Message 6 of 8
(4,441 Views)

You don't want to subtract to get the change in angular velocity.  You need to add.  That will give you the current angle.

 

X0 +dX1 = X1.  Your gyro is giving you dX1.  You should initialize your shift register to be 0.  Then add inside.  Your shift register needs to hold the angular position.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(4,434 Views)

in my programing
(analog_reading - ZERO reading)/ sensitivity = position
zero reading = the reading when angular velocity is 0

still not clear i hope if i can have more explanation
thanks

0 Kudos
Message 8 of 8
(4,432 Views)