Go to Post By affiliating yourself with a team, you are representing them at all times, as you are a member and part of that team. - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2007, 00:38
brennerator brennerator is offline
Registered User
#1560
 
Join Date: Jan 2005
Location: Silicon Valley
Posts: 75
brennerator is an unknown quantity at this point
Programming our Arm

Our arm is controlled by a motor with a sprocket at the base of a long beam. Obviously there is much torque on this system, and when the motor moves slightly, the arm jerks a lot. Understandable. How can we make the arm motion more fluid persay--if we just twitch the joystick right now the arm makes a wide movement.

Second: If the motor stops the arm immedietly jerks back down. Suppose we wanted to keep the arm in a set position--how would we do that? So if we let go of the joystick, the arm would stay in the same position that it was in.
  #2   Spotlight this post!  
Unread 01-02-2007, 01:16
dpick1055's Avatar
dpick1055 dpick1055 is offline
David Pick
FRC #1739 (Chicago Knights)
Team Role: Alumni
 
Join Date: May 2005
Rookie Year: 2004
Location: Chicago
Posts: 75
dpick1055 is on a distinguished road
Send a message via AIM to dpick1055
Re: Programming our Arm

You could use a potentiometer and write some code to only use the max value sent to the arm. Then when you want to reset or go to some preset height press a button on the joystick. You can also create a dead band so that if the joystick moves to 135 it only sends 130 to the motor. You may also want to consider moving to different motors (I'm not exactly sure which ones) but out team has been able to create a smooth arm without any special code.
__________________
Always remember to take your powered wheels off the ground when first testing code. Otherwise you'll end up with holes in the wall like us
  #3   Spotlight this post!  
Unread 01-02-2007, 02:00
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,188
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Programming our Arm

While programming may help this issue, it wont completely fix the problem.

Based off of your description of the mechanism, it seems like the bounce in your arm can be attributed to slack in the chain drive system. Try tensioning the chain, and possibly writing code to limit your motor output values. Now, it doesn't have to be full out closed loop control.. some ramping up/ramping down of the output values should do the trick.
  #4   Spotlight this post!  
Unread 01-02-2007, 02:47
dtengineering's Avatar
dtengineering dtengineering is offline
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,833
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
Re: Programming our Arm

If you are going to use a motor to actively hold the arm in position, just watch current consumption and temperature on the motor. The Fisher Price motors that come attached to the plastic gearboxes, in particular, can let out the magic smoke fairly quickly if they draw current while moving slowly or stopped.

Not that they can't do it... just watch for it. Some of the other motors, such as the window motors, are less powerful, but also much happier holding position when stopped.

Jason
  #5   Spotlight this post!  
Unread 01-02-2007, 12:34
brennerator brennerator is offline
Registered User
#1560
 
Join Date: Jan 2005
Location: Silicon Valley
Posts: 75
brennerator is an unknown quantity at this point
Re: Programming our Arm

Also, how would we sense rotation? Is there anything better than a potentiometer? THe potentiometer has only 300 degrees of motion, which is not suitable for our application. We would also like something that can easily attach to 1/2 inch shaft.
  #6   Spotlight this post!  
Unread 01-02-2007, 12:42
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,188
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Programming our Arm

Quote:
Originally Posted by brennerator View Post
Also, how would we sense rotation? Is there anything better than a potentiometer? THe potentiometer has only 300 degrees of motion, which is not suitable for our application. We would also like something that can easily attach to 1/2 inch shaft.
10 turn pot? Encoder? Gear Tooth Sensor? Accelerometer? Gyro?

What is the application?
  #7   Spotlight this post!  
Unread 01-02-2007, 12:58
brennerator brennerator is offline
Registered User
#1560
 
Join Date: Jan 2005
Location: Silicon Valley
Posts: 75
brennerator is an unknown quantity at this point
Re: Programming our Arm

I am trying to measure how far each motor should move for presetting the arm. The arm is jointed with powered 1/2 inch shafts. I have not figured out an effective way to attach the pots to it.
  #8   Spotlight this post!  
Unread 01-02-2007, 13:04
Jonathan Norris Jonathan Norris is offline
Jno
FRC #0610 (Crescent Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Toronto
Posts: 1,082
Jonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond reputeJonathan Norris has a reputation beyond repute
Re: Programming our Arm

Quote:
Originally Posted by brennerator View Post
I am trying to measure how far each motor should move for presetting the arm. The arm is jointed with powered 1/2 inch shafts. I have not figured out an effective way to attach the pots to it.
Its simple, get access to a simple lathe, and bore a small hole in the end of one (its usually 1/4"). Then if you can setscrew the POT in place, or grab some hot glue. Then all you need is some simple mount to keep it in place and hopefully protect it.
__________________
Co-Founder of Taplytics.com
2013 World Champions (1241, 1477, 610)
Crescent Robotics Team 610 Mentor
K-Botics Team 2809 Founding Mentor ('09-'11)
Queen's University Mechanical Engineering, Applied Science '11

Crescent Robotics Team 610 Alumni
  #9   Spotlight this post!  
Unread 01-02-2007, 14:33
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Programming our Arm

Quote:
Originally Posted by dtengineering View Post
If you are going to use a motor to actively hold the arm in position, just watch current consumption and temperature on the motor. The Fisher Price motors that come attached to the plastic gearboxes, in particular, can let out the magic smoke fairly quickly if they draw current while moving slowly or stopped.
I'll second this. Team 95 has used FP's for running arms before, and we had to add a deliberate "twitch" to the arm to make sure the motors weren't stalling (after burning two FPs).
  #10   Spotlight this post!  
Unread 02-02-2007, 12:09
brennerator brennerator is offline
Registered User
#1560
 
Join Date: Jan 2005
Location: Silicon Valley
Posts: 75
brennerator is an unknown quantity at this point
Re: Programming our Arm

Can we put ten turn pots on the motor shaft itself? Would that be effective. I know that it will only turn 4 times...Is a ten turn pot a beast to program tho?
  #11   Spotlight this post!  
Unread 02-02-2007, 19:18
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,082
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Programming our Arm

One solution to help reduce the "jerkiness" is to apply a low-pass filter to that motor's output. A low-pass filter smooths everything out so that the arm motor PWM value can only change by so much in a given time.

http://en.wikipedia.org/wiki/Digital_filter

If you need help implementing one, I'd be glad to help. A simple, first order IIR low-pass filter on PWM01 would be like this:

Code:
// Put this at the top of user_routines.c
#define LP_PARAM_N 900l
#define LP_PARAM_D 1000l

// Declare this variable at the top of Default_Routine()
static unsigned char pwm01_old = 127;

// And this one too
unsigned char arm_command = 127;

...

// After you do whatever calculations you need for the arm, store the value in arm_command
pwm01 = (unsigned char)(pwm01_old*LP_PARAM_N/LP_PARAM_D + arm_command*(1000-LP_PARAM_N)/LP_PARAM_D);
Tweak the "LP_PARAM_N" parameter (the numerator of the filter constant) between 1 and 999 as you need. The lower this is, the quicker the response will be, but the more jerkiness. The higher it is, the slower the response, but it will be much more smooth.

You can do the same thing with floats more intuitively, but I try to avoid them wherever possible.
  #12   Spotlight this post!  
Unread 05-02-2007, 23:33
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,079
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Programming our Arm

Simplest solution to the falling problem I'd say would be gas shocks to help hold the arm up... granted I can only go from what Ive managed to overhear from the people who do the building on the team (I'm almost exclusively electrical and programming)

As for positioning the arm, a pot is the simplest way. If you are worried about not being accurate enough there is a relatively simple work around that will make the pot 4 times more accurate (or seem that way). Inside the user_routines.h file where the analog inputs are #defined as whatever you call them you should see a bunch of code that looks similar to "(unsigned char)getAnalogVal(pwm01)>>2" or something like that... If you remove the >>2 and the (unsigned char) your pot will be returning values from 0-1023 instead of 0-255. The pots are actually built to do this as are the analog inputs in the brain. For some reason most people think that 8 bits is enough info. Oh well.

If you need to be REALLY accurate with the positioning of the arm I would say you should use a software PID loop. Try running a google search on it (or CD search) If you cant find anything PM me and I can try to help.
  #13   Spotlight this post!  
Unread 05-02-2007, 23:45
burkechrs1 burkechrs1 is offline
Registered User
AKA: Chris
FRC #0668 (The Apes of Wrath)
Team Role: Driver
 
Join Date: Jan 2007
Rookie Year: 2003
Location: San Jose, CA
Posts: 75
burkechrs1 is a name known to allburkechrs1 is a name known to allburkechrs1 is a name known to allburkechrs1 is a name known to allburkechrs1 is a name known to allburkechrs1 is a name known to all
Send a message via AIM to burkechrs1
Re: Programming our Arm

try a counter wieght with sorings or something like that. we're using springs to help our arm move fluidly around its axis, we had teh same problem. It's pretty lightwieght too.
  #14   Spotlight this post!  
Unread 06-02-2007, 16:25
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: Programming our Arm

Dont stall the motor: the backdrive issue that you are concerned about is something that the mechanical team has to fix. We got around this with a worm gear drive in the shoulder joint of the arm, along with a spring to add force while going down and working against gravity.

stalling the motor will let out the genie (=
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY

Last edited by Uberbots : 06-02-2007 at 16:25. Reason: down... not up
  #15   Spotlight this post!  
Unread 07-02-2007, 15:18
shawger shawger is offline
Programming Subteam Leader
FRC #1732 (Hilltopper Robotics)
Team Role: Alumni
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Wisconsin
Posts: 60
shawger will become famous soon enough
Re: Programming our Arm

We are using a similar setup to the one the original poster described, except we have a 10-turn pot attached. We then have a proportional closed loop control system in which we specify a setpoint, and the code evaluates our current location, finds an error, and applies a correction to the motor. The logic really isn't that hard, but it will require tuning.

With this system, we are able to set three automatic heights as well as control it manually. It is important to note that manual control is still accomplished through the closed loop control, but the driver is varying the setpoint (in our case with a pot on the control board). We don't have any jerky movements so far.

The closed loop control system will automatically keep the arm in a set position. It will maintain its setpoint once it gets there. If you are using a joystick for control, the joystick will always return to the middle, so you will need some sort of code for remembering the value you were at.

Hope that helps.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make our own VEX programming cable? Chris_Elston Programming 5 18-04-2006 00:02
pic: Who needs teasers... here's our arm! [CRUSH: 1011] CD47-Bot Robot Showcase 11 09-02-2004 22:32
Arm Rotation (1 Button Programming!!) Joelster Technical Discussion 1 14-02-2002 13:15
Arm Turning (programming) Joelster Programming 4 13-02-2002 21:35


All times are GMT -5. The time now is 15:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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