Author |
Message |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Gyro Senosr
We do have a gyro module in our FTC library. During initialization, it will determine the zero bias offset and noise margin. It has a GyroTask function that must be called periodically during which it does the integration for heading. http://proj.titanrobotics.net/hg/Ftc/20 ... lib/gyro.hTo use this library module, you have to do the following: 1. Add an include line to include this library module 2. Declare the GYRO object as a global variable. 3. Call the GyroInit() function to initialize the GYRO object. 4. Call the GyroTask() function periodically in your robot loop.
|
Fri Dec 21, 2012 4:56 am |
|
 |
zerroTC
Rookie
Joined: Mon Sep 24, 2012 8:32 am Posts: 13
|
 Re: Gyro Senosr
 |  |  |  | MHTS wrote: We do have a gyro module in our FTC library. During initialization, it will determine the zero bias offset and noise margin. It has a GyroTask function that must be called periodically during which it does the integration for heading. http://proj.titanrobotics.net/hg/Ftc/20 ... lib/gyro.hTo use this library module, you have to do the following: 1. Add an include line to include this library module 2. Declare the GYRO object as a global variable. 3. Call the GyroInit() function to initialize the GYRO object. 4. Call the GyroTask() function periodically in your robot loop. |  |  |  |  |
Thanks. I will try and put the feedback.
|
Sun Dec 23, 2012 3:58 am |
|
 |
zerroTC
Rookie
Joined: Mon Sep 24, 2012 8:32 am Posts: 13
|
 Re: Gyro Senosr
 |  |  |  | MHTS wrote: We do have a gyro module in our FTC library. During initialization, it will determine the zero bias offset and noise margin. It has a GyroTask function that must be called periodically during which it does the integration for heading. http://proj.titanrobotics.net/hg/Ftc/20 ... lib/gyro.hTo use this library module, you have to do the following: 1. Add an include line to include this library module 2. Declare the GYRO object as a global variable. 3. Call the GyroInit() function to initialize the GYRO object. 4. Call the GyroTask() function periodically in your robot loop. |  |  |  |  |
Ok, I have problem with some procedures in yours header file. For 1. procedure(TFuncName) i have this error:**Error**:Undefined procedure 'TFuncName'. **Error**:Too many parameters specified. Call to 'TFuncName'. Parameter: 'N/A' is '"GyroCal"' of type 'string'.For 2. procedure(TLevel) i have this error:**Error**:Undefined procedure 'TLevel'. **Error**:Undefined variable 'API'. 'short' assumed. **Error**:Too many parameters specified. Call to 'TLevel'. Parameter: 'N/A' is 'API' of type 'short'.For last one(DEADBAND)i have this error:**Error**:Undefined procedure 'DEADBAND'. **Error**:Too many parameters specified. Call to 'DEADBAND'. Parameter: 'N/A' is 'gyro.turnRate' of type 'short'.P.S. I understand what means this error, but i dont know were is the bodys of this procedures. Thanks.
|
Wed Dec 26, 2012 9:04 am |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Gyro Senosr
Sorry, forgot about those. Those are debug tracing macros. You can either delete them or include the following files in addition. You can find those here: http://proj.titanrobotics.net/hg/Ftc/20 ... /trcdefs.hhttp://proj.titanrobotics.net/hg/Ftc/20 ... dbgtrace.h
|
Wed Dec 26, 2012 1:38 pm |
|
 |
zerroTC
Rookie
Joined: Mon Sep 24, 2012 8:32 am Posts: 13
|
 Re: Gyro Senosr
Thanks for information for solving the previus problem. Anyway i have next problem, this is my code: I have incrementation of degres. Am I doing something wrong?
|
Wed Dec 26, 2012 2:20 pm |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Gyro Senosr
I am not sure I understand your problem. What do you mean by "I have incrementation of degres"? Would you describe your problem in more details? In any case, I do spot some minor problems in your code (display text formatting). The correction is below:
|
Wed Dec 26, 2012 3:09 pm |
|
 |
zerroTC
Rookie
Joined: Mon Sep 24, 2012 8:32 am Posts: 13
|
 Re: Gyro Senosr
So, I get accumulated error degrees. I do not touch the robot, and the degrees are incremented by themselves and i would say with great speed.
|
Wed Dec 26, 2012 4:32 pm |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Gyro Senosr
Make sure you did not touch the robot when it is "initializing". That's when it is calibrating the zero bias and noise level deadband. Also, you may want to print out the raw value from the gyro and see if it is outputting reasonable numbers. For example:
|
Wed Dec 26, 2012 5:38 pm |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Gyro Senosr
BTW, did you modify gyro.h or used it as is? If you have modified gyro.h, please tell me what you did. I want to make sure it is not due to the modification.
|
Wed Dec 26, 2012 10:58 pm |
|
 |
zerroTC
Rookie
Joined: Mon Sep 24, 2012 8:32 am Posts: 13
|
 Re: Gyro Senosr
Now everything is fine, becouse i include trcdefs.h file in gyro.h and the procedure DEADBAND is working. I do not have incrementation of degres, but when i turn the robot from 0 degres to 90 degres and back again on 0 degres. I get sam "error" in degres eg. 3 degres instead of 0 degres.
|
Thu Dec 27, 2012 6:55 am |
|
 |
zerroTC
Rookie
Joined: Mon Sep 24, 2012 8:32 am Posts: 13
|
 Re: Gyro Senosr
|
Thu Dec 27, 2012 6:55 am |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Gyro Senosr
3 degrees is quite small. I consider it within tolerance. There are a number of reasons why you didn't get back to zero degree: - It could be that your robot is really not back to zero degree quite precisely - It could be that you are turning the robot too fast and exceeding the maximum degrees/sec of the gyro (not likely). - It could be that your integration loop is not frequent enough. In your main robot loop, you have a wait1Msec(100) there (this is the likely reason). Try reducing it to 50 or even 20 and see if it improves. Like I said, 3 degrees is not that significant. So I wouldn't worry about it too much.
|
Thu Dec 27, 2012 1:58 pm |
|
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
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 post attachments in this forum
|
|