Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Porportional rotation using gyro (http://www.chiefdelphi.com/forums/showthread.php?t=125562)

mrklempae 31-01-2014 19:17

Porportional rotation using gyro
 
Hello,
I haven't been here in a while, but searching the forums didn't turn up anything relating to this topic. My team has been tying to correct for problems in our drivetrain (caused by uneven weight distribution and improperly mounted wheels) in programming while the build team tries to fix issues with the mechanical part, and everything we've tried has been relatively unsuccessful. What we have in mind is a system that would force the robot to keep at it's current angle of rotation (using the gyro) if the operator isn't currently trying to turn the robot. We've tried to use bang-bang style control (we knew this was a bad idea from the start) and take back half (which seems better suited for other purposes), and have yet to try PID. We reset the gyro and attempt to initiate our closed-loop control system every time we stop deliberately rotating. Does anyone have any suggestions for a proper way to do this (other than fixing the weight distribution and whatnot)? Thanks!

magnets 31-01-2014 20:01

Re: Porportional rotation using gyro
 
The right way to do this is to fix the robot itself.

I would start by just trying proportional control. You don't actually need to use the PID controller class.

If you're using java/c++ with arcade drive, I'd do something like this to travel in a straight line.

drive.arcadeDrive(stick.getY(), kP*gyro.get()).

Make sure to have your code zero the gyro so that when the robot is on target, gyro.get() returns 0.

mrklempae 31-01-2014 21:35

Re: Porportional rotation using gyro
 
For some reason I edited out a few important details... It has a robot-centric mecanum drive train, which from what I hear, will probably never strafe perfectly straight without gyro intervention. We spent about an hour working on it today and (for the moment) are using a series basic statements to determine the rotation speed (which overshoots and is a bit jittery).

lcoreyl 31-01-2014 22:40

Re: Porportional rotation using gyro
 
Quote:

Originally Posted by ekapalka (Post 1335541)
For some reason I edited out a few important details... It has a robot-centric mecanum drive train, which from what I hear, will probably never strafe perfectly straight without gyro intervention. We spent about an hour working on it today and (for the moment) are using a series basic statements to determine the rotation speed (which overshoots and is a bit jittery).

emphasis mine


In my experience, we have had many a prototype drivetrain put together by newbies without any care given to weight distribution and very little care to how perfect a rectangle the frame is. It was just a visually all 4 wheels are on the ground, check. There was a good amount of care given to how well the rollers can spin when they were assembled and this is verified periodically. We've never tried to quantify the amount of deviation from expected travel, but I've never seen a robot deviate so much that we HAD to implement gyro control. We just did so to open the possibility for better driver control. I believe 2 years ago we didn't use a gyro during the competition at all...

so, check your rollers spin nice and smooth, and for big obvious mechanical problems (the wheel mounting? you mentioned, 1 gearbox assembled incorrectly, etc...), but if you are just trying to get a prototype drivetrain moving, you shouldn't need to spend a lot of time on weight distribution. You might post some video in the mechanical section and get some feedback from folks on that side.

As far as the gyro implementation goes, have you tried this?

Ether 31-01-2014 22:58

Re: Porportional rotation using gyro
 
Quote:

Originally Posted by lcoreyl (Post 1335605)
As far as the gyro implementation goes, have you tried this?

Here's a way of using a gyro with a mecanum (or other 3 DoF drive) which takes advantage of the strafing capability of the drive.

For skid-steer vehicles, here's another way to use a gyro.




All times are GMT -5. The time now is 02:31.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi