View Full Version : Help an old dog w/ new tricks
dipmeinaluminum
18-05-2015, 16:19
With the 2015 season behind us, I am begging for help, I am not afraid to ask for help. I have thrown in the towel.
I have been around FIRST for 15 consecutive season and I am asking for help with Java.
Where do I go to learn to write Java for FRC? The team and I figured out teleop mode with limit switches and simple drive motor functions. Autonomous mode on the other hand, I cant figure it out!!!
We failed trying to have our gyro sensor operating the way we would have liked it to. The idea was to have it turn 90Deg and drive forward and stay the course, if the robot started walking off the 90Deg path, it would auto correct itself. Getting the encoders to work together. The last thing I am looking for help on is having the camera come through clear with no lag in our driver station. If teams don't want to disclose their secrets, maybe you can help VIA email? I'll send you shirts, I'll fly out to you, If you're in the NYC area, I'll buy you dinner, I don't care, I am at my end and I'm asking for help.
MichaelVilarelle@gmail.com
I have a practice robot wired and ready to attempt different codes and ideas.
:(
I have a few questions before I answer some of the specific questions that you asked.
Are you using a tank drive, or some other drivetrain?
Are you capable of reading the speed of your encoders, tracking the distance your encoders have traveled, and sucessfully determining the angle of your robot using the gyroscope?
Are you familiar with using PID loops?
dipmeinaluminum
19-05-2015, 08:16
We used the AM14U2 chassis, with one joystick arcade drive.
When it comes to the encoders, we can see the value, and the team can even assign it to a certain RPM. We can watch it, but in a isolated situation we notice that its a not consistent, and certain situation we would need accuracy.
I think that is all the sensors, where nothing is 100% Maybe its the type of sensor?
But I do need help tracking distance, and other functions with success. The Gyro, we can see the angle, we can also have it turn 90. When it comes to using the PID Loops to achieve what we want, we are failing.
knuckleduster
03-08-2015, 13:14
https://wpilib.screenstepslive.com/s/4485/m/13809
This site has tons of code examples to help you get started, and once your questions get more specific, we are here to help you still.
DonRotolo
03-08-2015, 17:18
I'm not a programmer, but I can offer some advice. Let's start with the encoders:
RPM doesn't help much, but the number of "counts" does. If you determine, empirically if necessary, the number of inches that, say, 1,000 counts equals, you can measure distance. If for example 1,000 counts equals 75 inches, then each count is 0.75 (3/4) inch. If you want to go xx feet, just run the motors until you're 'close' to xx feet, then slow down more and more until you stop at xx feet (which is nn,nnn counts). The key here: Make sure that you are counting consistently. If you are not, nothing gets done until you are counting consistently. This becomes a mechanical or sensor thing.
Now the Gyro: You can turn 90 degrees, that's HUGE. The 'staying on track after" is not a trivial problem, but the basic idea is to set the direction after the turn (that means, read the gyro and make that youer "set point" or "goal"). Then track your direction and, if the path deviates from the goal, make corrections.
The key to this is tracking the deviation in a reasonable way. A difference of 0.01 degree would be impossible, from a mechanical view, to correct. So you average a reading every 1/4 second and, if after 8 readings the average is more than, say, 2 degrees to one side, you go to a subroutine that tweaks the power to the other side by reducing it slightly. Now, 'tweaks slightly' can be related to the number of degrees error: Bigger tweak for 5 degrees, smaller tweak for 2 degrees, huge tweak for 15 degrees.
Just don't do this too fast: a change every 1/2 to 2 seconds is on the order of magnitude for what you want.
Many years ago I posted a few posts on PID; if you find them they'll explain in a more logical way the concepts of error, corrections, and how often you apply corrections.
But doing all this in theory is not going to teach you what you need: get the robot, and focus on ONE thing at a time. Get that thing nailed flat and fully understood - fool with it to see what happens - and write down what you learned (your memory will not suffice. The faintest ink is superior to the strongest memory). Then move to the next thing.
And keep asking us here.
SamcFuchs
07-08-2015, 17:55
Check out my code on github:
https://github.com/Team236/2016-Practice
And wpi has great docs here:
https://wpilib.screenstepslive.com/s/4485/m/13809
With the 2015 season behind us, I am begging for help, I am not afraid to ask for help. I have thrown in the towel.
I have been around FIRST for 15 consecutive season and I am asking for help with Java.
Where do I go to learn to write Java for FRC? The team and I figured out teleop mode with limit switches and simple drive motor functions. Autonomous mode on the other hand, I cant figure it out!!!
We failed trying to have our gyro sensor operating the way we would have liked it to. The idea was to have it turn 90Deg and drive forward and stay the course, if the robot started walking off the 90Deg path, it would auto correct itself. Getting the encoders to work together. The last thing I am looking for help on is having the camera come through clear with no lag in our driver station. If teams don't want to disclose their secrets, maybe you can help VIA email? I'll send you shirts, I'll fly out to you, If you're in the NYC area, I'll buy you dinner, I don't care, I am at my end and I'm asking for help.
MichaelVilarelle@gmail.com
I have a practice robot wired and ready to attempt different codes and ideas.
:(
Hey I'm still new to java however I know of a very good internet totorial series that covers a large variety of Java subjects into small bite size pieces for all levels of experience. Google thenewboston java, and it should be the first thing to pop up. Good luck to you sir :)
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.