![]() |
Re: Bizarre Driving Issue
1 Attachment(s)
Really the math almost succeeds by accident ... try out the following code:
Attachment 5029 Code:
#include <stdio.h>I left the rest alone just so you could see how it almost works... I'm very suprised and delighted at how close it comes to being correct :yikes: But you still have a further overflow problem with the lines like: Code:
pair1 = deady+127-deadx; |
Re: Bizarre Driving Issue
Quote:
|
Re: Bizarre Driving Issue
Actually, I'm hoping that we can avoid the use of a gyro (and the overhead from running four PID loops), but could someone please explain what exactly a PID loop is? We're all essentially self-taught here, with no mentor, so we're lost on some of the finer points.
Perhaps as a simple example, just one motor, one joystick, and one encoder? We know how to set up and run all the separate parts, and we know essentially what a PID loop should do (compare input to output), but how exactly it does it do the calculation? |
Re: Bizarre Driving Issue
A PID loop controls by looking at error.
The proportional portion says: "Where should I be" - "Where I am". Then it multiples that by a gain factor. So - in pseudocode Gyro_Proportional_Amount = (Current_Gyro_Heading - Gyro_Heading_We_Want) * Gain Modify the drive values going to the motors with the Gyro_Proportional_Amount. The I and D are basically the same, but one works on the accumulated error (the I or integrative) and one works on the error rate of change (D or derivative). There is a bit of sample code in the PID whitepaper you can search for here - it does a great job of explaining. MOST times, you can get away with just the "P" portion of the code I showed above. |
Re: Bizarre Driving Issue
Quote:
|
Re: Bizarre Driving Issue
Oh, and we just uploaded the code. Sure enough:
Overflow. It works fine now. We flipped around the motors that were reversed so now the deadzones for going forward and backward are matched, but going left and right still suffers from the weird "two get going faster before the others." They seem even enough after they make it past a certain point, but it's still upleasant. kaszeta: Although PID loops may not contain much overhead, that would still need four geartooth sensors, which WOULD generate a lot of overhead. Though, I guess technically we... might be able to put only two on and just force all the pairs to match. It's still unfortunate to need any gearteeth, just because it's difficult to mount them as close as they need to be on the robot, and when we crash, they tend to crash into the gears (well... okay that only happened once on a testbed, but still stinks to buy new parts). |
Re: Bizarre Driving Issue
Quote:
|
Re: Bizarre Driving Issue
We didn't recieve our gyro panel in the mail, and realized too late :- (
But anyway: Whoa! I think I may have figured out something awesome. Everyone has been talking about these "asymmetrical" deadzones, but no one has ever found a good solution outside of lookup tables (at least not in this thread). But weirdly enough has anyone ever tried recalibration of the Victors? We set up this simple code like so: Code:
void Process_Data_From_Master_uP(void) |
Re: Bizarre Driving Issue
We had a problem with uneven deadzones on the four wheels in our holonomic drive; calibrating the Victors completely solved this problem. I highly recommend calibration.
|
| All times are GMT -5. The time now is 00:23. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi