![]() |
What's your favorite programming/control system magic this year?
Effective programming/control system techniques almost work like magic. Unlikely mechanical designs, they are frequently hidden from regular observers.
Which cool techniques have you seen or adopted this year that are creative and worth highlighting for your peers? I saw a few cool ones:
What's your favorite? |
Re: What's your favorite programming/control system magic this year?
I personally love feedback systems. Like in 2012 and 2013, vision would be calculating how far away the robot is to the goal, and the shooter would always be adjusting to be ready to shoot. 341 had this in 2012 and I'm sure again in 2013, we(1706) had it for both years. It is truly amazing.
|
Re: What's your favorite programming/control system magic this year?
The devil's in the details. Most of my favorite cases of programming are very much behind the scenes:
*An aside: I'm curious to see whether or not they (Gordian, and other in-house scripting languages) are displaced with other solutions: the roboRIO is supposed to have Java 8, which should allow usage of Jython and/or Rhino (Java engines for Python and Javascript, respectively) for Java teams. |
Re: What's your favorite programming/control system magic this year?
254 had code that allowed them to set waypoints on the field and have the computer make a spline in that path. The spline was then translated into different motor curves for each side of the drivetrain. They could literally draw a path and have the robot follow it.
From Kevin Sheridan on /r/frc: "We generated a path using quintic hermite spline interpolation. This creates two individual paths for the right side of the drivetrain and the left side of the drivetrain. We can tell the path generator the goal location, goal velocity, goal heading, starting location, starting velocity and starting heading. We can also set the max velocity for a path. This way we can set a path using multiple waypoints to navigate to a certain spot on the field in a specific way such as driving in a s-curve." |
Re: What's your favorite programming/control system magic this year?
Quote:
|
Re: What's your favorite programming/control system magic this year?
Quote:
For the record, my favorite magic so far is our team's quadratic deadband. |
Re: What's your favorite programming/control system magic this year?
Quote:
|
Re: What's your favorite programming/control system magic this year?
Quote:
|
Re: What's your favorite programming/control system magic this year?
At Championships we had a fairly interesting system controlling our pneumatic catapult pulses. We had a pressure sensor that measured the pressure feeding to our launcher pistons. We used a polynomial function based on collected data that would match pressures to pulse times so that the shot is consistent regardless of pressure. Our programmer could probably tell you more about it if you want.
|
Re: What's your favorite programming/control system magic this year?
1986 had really simple yet effective targeting system setup. A ultrasonic sensor set low to the ground told them how far away they were from the wall. When the robot was in shooting range, LEDs on the back of the robot lit up to inform the drivers.
|
Re: What's your favorite programming/control system magic this year?
Quote:
|
Re: What's your favorite programming/control system magic this year?
Quote:
Code:
ForwardSpeed = map(rangefinder_distance - target_distance, 0, 200, 0, 1); |
Re: What's your favorite programming/control system magic this year?
Quote:
|
Re: What's your favorite programming/control system magic this year?
Quote:
And yes, the name is made up. |
Re: What's your favorite programming/control system magic this year?
Quote:
|
Re: What's your favorite programming/control system magic this year?
One of our team's members developed an emulator as part of our software framework that let us thoroughly test our code without a real robot:
![]() This let us have our robot code mostly ready before we even had a prototype robot, and then let us make sure our changes would work before deploying. |
Re: What's your favorite programming/control system magic this year?
Quote:
I would very much look forward to seeing this running on the new roboRIO platform. Very well thought-out. Thanks for sharing it here! |
Re: What's your favorite programming/control system magic this year?
Quote:
I would like to elaborate on this system a bit though. From the start of the season (Or rather, once we were set on a robot that carried 3 balls to a closer shooting position) we wanted the ability to drive smooth S curves. The reasoning was we knew we were going to need to get over to the one point goal to avoid defensive goalie robots by the time Einstein came around. In place of this system we could have used the typical "Drive, turn X degrees, Drive" auto driving architecture, but decided this was not going to work based on our troubles with translating and spinning in 2012 and 2011. The implementation of this system was a tool [1] that allowed the programmer to specify a list of waypoints for the robot to drive. Each waypoint consisted of a X coordinate, a Y coordinate, and heading (Assume the robot starts at 0,0,0). From there, we found a set of splines that intersect each waypoint (at the desired heading) and fit within a maximum radius which was something that we knew we could drive (aka no abrupt 180* turns). Next, we figured out what it would take to get the robot to drive that path.Given a maximum velocity, acceleration, and jerk (derivative of acceleration) for the robot to drive with, we walked the spline-y path generated above in steps of 0.01 seconds. For each step, we generated (Position, Velocity, Acceleration, Jerk, Heading, X, Y, and current time step) for the geometric center of the robot. These values corresponded to how the robot /should/ be moving at that point in time. From there, given the wheel base of the robot, we were able to build two sets of steps, one for each wheel. These lists of steps were built into arrays which we serialized to a text file.[2] On the robot side we built a controller that would drive the robot on the path (after deserializing). The controller that made the robot move consisted of 3 sub controllers: 2 wheel controllers for the left and right wheel, and a heading controller that would correct the angle of the robot on the field. The wheel controller which followed the trajectory basically looked like this (one running for each wheel, using the given wheel's path data: Code:
double update() {Code:
double updateHeadingController() {Code:
updateDrive() {We will release this code over the summer. Hopefully it will make more sense then. [1] This tool was run on a laptop, as the math to build all the paths was pretty slow on the cRIO. [2] We originally wanted to render java class files with static arrays defined for each path, but we ran into an issue with the tool that packages the final jar file for deploying. It could not handle more than about 1KB of static data in any Java class. [3] We did no work to validate that our paths did not cause motor saturation. Whenever the driving looked weird we would down the velocity or move the waypoints to make bigger curves. |
Re: What's your favorite programming/control system magic this year?
Quote:
What I can gather from this code is that the motor speed for each side is first calculated with a feedforward term from the velocity, acceleration, and jerk, and then additionally a proportional feedback term is added using feedback from the actual encoder position. Is this correct? If I'm reading it correctly, is there a reason why the feedforward velocity (the velocity, acceleration, and jerk sum) is calculated on the robot using the curve values rather than calculated beforehand and output as motor velocity values? |
Re: What's your favorite programming/control system magic this year?
Quote:
Yes, you could also back out the motor values on the front end since it is all open loop. We did not because we wanted everything in the path to be in same units, and it made it a bit easier to tune the gains on the robot without re-generating a path. The neat part is it's crazy easy to find K_acc and K_vel. Put your robot on the ground, give it full joystick forward, and log encoder values and time. Plot velocity and acceleration. Find max velocity and max acceleration. K_vel = 1.0/Max_vel and K_acc = 1.0/max_acc. Think about it, when you are commanding half your max velocity, your feedforward term should be about half max voltage. The acceleration term will add a bit more power in and the loop closed around position should help fix any error you get (from chain tension or battery voltage differences). |
Re: What's your favorite programming/control system magic this year?
Quote:
|
Re: What's your favorite programming/control system magic this year?
Quote:
We find the position controller gains (we have I and D terms coded in, but we ended using 0 as a gain for those) by plotting the position setpoint and measured position over time. The setpoint moves and you can watch how closely the sensor is catching up to it. If it's slow, up the gain until it starts to overshoot. Then back it off a little. For this application, close enough is fine. |
| All times are GMT -5. The time now is 22:00. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi