Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Need help programming our swerve with feedback? (http://www.chiefdelphi.com/forums/showthread.php?t=27022)

Ryan M. 06-04-2004 13:07

Re: Need help programming our swerve with feedback?
 
Quote:

Originally Posted by rosebud
hi everyone,
thanks for all ur answers to the swerve program! i think the table i made for inverse tangent was incorrect. also, when i compared and displayed the pot value and the value the pot should be at according to the joystick, printf displays garbage. but when i use it in an equation, it works, so maybe its something with printf, although both variables are signed ints, so it should be ok. anyways, i used the taylor power series expansion to find inverse tangent, and used the difference between pot and where pot should be to find a variable speed of rotation, so the code works. thanks again everyone, and check out mvrt 115 in silicon valley. :)
rebecca

The printf()s can be tricky to format. :)

Grommit 08-04-2004 09:48

Re: Need help programming our swerve with feedback?
 
Quote:

Originally Posted by Astronouth7303
Why not just make a look-up table custom made for your bot?

Update: We tried a lookup table, and it was causing us some trouble. Now we're using floating-point math (gasp!) and the arctangent maclaurin series, with up to the x^7 term. It runs fine.

At Silicon Valley, we found our potentiometer working fine, but instead, our speed was messed up, and often our wheels were going in the wrong direction entirely. Obviously, this was not good, and we ended up reverting to simple manual drive.

Thanks for all the help everyone.

nick180intucson 08-04-2004 17:01

Re: Need help programming our swerve with feedback?
 
if you want some real help keep in contact with my team team 1011 team crush. we used swerve this is our second year and we made it to the semi finals but i would say look for brian on team 1011 or eric on team 1011 or korbin on team 1011

good luck at nats


niick brown :]

activemx 09-04-2004 19:33

Re: Need help programming our swerve with feedback?
 
Quote:

Originally Posted by nick180intucson
if you want some real help keep in contact with my team team 1011 team crush. we used swerve this is our second year and we made it to the semi finals but i would say look for brian on team 1011 or eric on team 1011 or korbin on team 1011

good luck at nats


niick brown :]

well thanks everyone for help again. we figured out how to make it work before SVR this year. Sadly we will not be goin to nationals this year :( . I will post the documentation about the drive and code soon. thanks again

rosebud 10-04-2004 23:24

Re: Need help programming our swerve with feedback?
 
the documentation and code is really long, so there will be a link soon on monta vista's website: www.mvrt.com. id like to thank everyone again for his or her help. the swerve was working perfectly by the end of friday, so we were swerving on saturday and in finals. the speed function wasnt working because i was trying to use the greater of |p1_x | and |p1_y| so the robot would move the fastest sideways and straight. however, near 45 degrees the handoff wasnt smooth. anywas, check out the website if u are interested, or email me at rebecca@mvrt.com. thanks
rebecca
electrical officer
mvrt 115

eugenebrooks 11-04-2004 01:29

Re: Need help programming our swerve with feedback?
 
Quote:

Originally Posted by Cyris12
It sounds a little complicated, but the code is actually pretty simple. The object does tend to overshoot some, and then oscillate a little. This can be minimized by adjusting the constants.

In physics terms, you are creating a harmonic oscillator
about the set point. The oscillation is a natural consequence of the linear force, much in the same manner that a mass bounces back and forth when suspended by a spring. You can reduce the finickyness by adding a damping term that operates much as a shock does on a car. This is done by adding a force that is proportional to, in this case the rotational, velocity and in opposition to the travel. This is easily done in he code by remembering the arm position from the prior poll with the computer, or interrupt as the case may be, and subtracting the current value. If you do this, you will find that you can increase the constant of proportionality for power to the drive motor, tightening up control, while preventing oscillation. There is a value for the damping, referred to as critically damped in physics terms if I remember correctly, that is somewhat magic in behavior.

We used this form of damping on 1280s arm at the
SanJose regional, and it was quite effective...

Jay Lundy 11-04-2004 02:17

Re: Need help programming our swerve with feedback?
 
Quote:

Originally Posted by eugenebrooks
In physics terms, you are creating a harmonic oscillator
about the set point. The oscillation is a natural consequence of the linear force, much in the same manner that a mass bounces back and forth when suspended by a spring. You can reduce the finickyness by adding a damping term that operates much as a shock does on a car. This is done by adding a force that is proportional to, in this case the rotational, velocity and in opposition to the travel. This is easily done in he code by remembering the arm position from the prior poll with the computer, or interrupt as the case may be, and subtracting the current value. If you do this, you will find that you can increase the constant of proportionality for power to the drive motor, tightening up control, while preventing oscillation. There is a value for the damping, referred to as critically damped in physics terms if I remember correctly, that is somewhat magic in behavior.

We used this form of damping on 1280s arm at the
SanJose regional, and it was quite effective...

Well by oscillate a little, he meant it overshot a few inches then returned to it's target spot. In theory it would have a damped oscillation that continued infinitely, but since this is all digital the oscillation dampened quickly and disappeared.

If you were at SVR you probably saw our arm. A lot of programming went into keeping that monster controllable.

eugenebrooks 11-04-2004 16:59

Re: Need help programming our swerve with feedback?
 
Quote:

Originally Posted by Jay Lundy
Well by oscillate a little, he meant it overshot a few inches then returned to it's target spot. In theory it would have a damped oscillation that continued infinitely, but since this is all digital the oscillation dampened quickly and disappeared.

If you were at SVR you probably saw our arm. A lot of programming went into keeping that monster controllable.

A description of the physics of what I am referring to can be found at:
http://hyperphysics.phy-astr.gsu.edu/hbase/oscda.html
by using an electrical damping term, not depending on mechanical
damping, you can get improved speed and control, subject to any slop
in the mechanism, of course.

Astronouth7303 12-04-2004 07:33

Re: Need help programming our swerve with feedback?
 
Quote:

Originally Posted by eugenebrooks
In physics terms, you are creating a harmonic oscillator
about the set point. The oscillation is a natural consequence of the linear force, much in the same manner that a mass bounces back and forth when suspended by a spring. You can reduce the finickyness by adding a damping term that operates much as a shock does on a car. This is done by adding a force that is proportional to, in this case the rotational, velocity and in opposition to the travel. This is easily done in he code by remembering the arm position from the prior poll with the computer, or interrupt as the case may be, and subtracting the current value. If you do this, you will find that you can increase the constant of proportionality for power to the drive motor, tightening up control, while preventing oscillation. There is a value for the damping, referred to as critically damped in physics terms if I remember correctly, that is somewhat magic in behavior.

We used this form of damping on 1280s arm at the
SanJose regional, and it was quite effective...

Yikes :yikes: We had a setup like the one I think you're describing. We did:
-Pot hooked to motor
-Operator set target w/ another pot
-use absdif (a function I wrote and used quite frequently) to find the difference between pot and target
-if difference < variance then stop the arm
-if pot < target then go up/out
-if pot > target then go down/in

no scaling velocities, remembering values, just find the diference and point it in the right direction.

10intheCrunch 12-04-2004 13:12

Re: Need help programming our swerve with feedback?
 
That would work, but only on a very basic level. If your motor value is too high you'll overshoot and oscillate, if it's too low, you will be really really slow, and any impediment (or heavier arm, do you carry the yellow balls around?) will stop it from working. For an arm like ours where we don't know what the torque on it is going to be, or whether its going to have a ball or not, a control system that can handle all the different situations by itself is much more important.

Astronouth7303 13-04-2004 07:29

Re: Need help programming our swerve with feedback?
 
We solved the problem by having a dial for speed.


All times are GMT -5. The time now is 22:27.

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