![]() |
Problems with the Gyro
Hi,
I started to learn how to use the gyro. I downloaded Kevin's code from the internet and tried to use it. There are some things which I haven't understood completely. I tried to print the variable "gyro_rate", but its values were between 1800-2200. Shouldn't it be much lower? Shouldn't this variable be measuring the angular velocity in (radians/seconds)? I don't know if there is something wrong with the code, or something wrong with my understanding. I then tried to print the value from the function Get_Gyro_Angle(), but again, the printed values were unreasonable. The value jumped from positive to negative numbers without any logical order. I would be very glad if someone could guide me through it. Thanks, Guy |
Re: Problems with the Gyro
Quote:
Sorry I don't know the complete answer to your question, but it's a start. |
Re: Problems with the Gyro
Hey, I don't have the code in front of me but I can look at it when I get back to my dorm.
For your First question neilsonster is right about the units. That would explain the large numbers 1.8 radians per second is alot easier to explain than 1800. I am assuming that the values you are giving us are when the robot is at rest if this is not the case then please specify what you are doing to the robot while it is printing out the data. If the robot is just sitting there than your problem is probably in the initialization of the gyro. When you enable the robot let it sit for a second or two, also make sure the gyro isn't too close to the compressor or anything else that may cause it to vibrate. If this doesn't help then give us any more information that you can and I'll try again. |
Re: Problems with the Gyro
The value of "gyro_rate" is about 2030 while not moving. When I do rotate the gyro the value decreases or increases depending on the direction. My guess is that the gyro is somehow not calibrated or initialized well, but I don't know how to make it correct....
|
Re: Problems with the Gyro
That sounds like a problem with the bias. You should try calling Get_Gyro_Bias() and printing the return value, which I think should be something relatively close to 512 if I remember correctly, also make sure that you called Initialize_Gyro() at some point in the code, otherwise it might be the case that the variable holding the bias was never initialized, and contains a random number, offsetting all of your data by that number.
|
Re: Problems with the Gyro
hey , whats up, ask our programmer Dan about the gyro, we put one in Rambo last year and Dan has some great experience with it, good luck.
|
Re: Problems with the Gyro
Quote:
|
Re: Problems with the Gyro
Quote:
|
Re: Problems with the Gyro
Any idea what the problem could be?
|
Re: Problems with the Gyro
Do you have your code calling the StartGyroCalibration() and StopGyroCalibration()?
If you tried to integrate Kevin's code into your own code you might not be initializing the gyro correctly. Look at the ProcessDataFromMasteruP() in Kevin's code. |
Re: Problems with the Gyro
You need to set the gyro's bias.. You do this by using the Start_Gyro_Bias_Calc() and
Stop_Gyro_Bias_Calc(). Let The start_bias_calc() run for a few secs while the robot isn't moving. If you need anymore help u can email me at avivgalon@gmail.com I haven't seen you for a while... (Samur) |
Re: Problems with the Gyro
Quote:
The actual gyro only outputs the angular rate but his code integrates to give you the actual angle at that point in time. Read the "Readme" file that came with the gyro code. It should help you setup and calibrate the whole gyro. |
Re: Problems with the Gyro
I'm such a fool. I forgot that there was code executed in the Process_Data_From_Master_uP function, and I worked with the gyro with the RC turned off...
When I did work with the RC switched on, the gyro's bias was indeed calculated, but its value was 2040.... As a consequence, I believe, the angle and the angular rate were not calculated correctly. Any idea how can I correct it? |
Re: Problems with the Gyro
Please, someone?
|
Re: Problems with the Gyro
Try running a "clean" copy of kevin's code . Then if the gyro acts correctly you'll know its your code. If it still has problems it could be a hardware issue.
|
| All times are GMT -5. The time now is 01:25. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi