Go to Post I approve of this misuse of machinery! - RoboChair [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 17-02-2007, 02:47
Ben Englert Ben Englert is offline
Registered User
FRC #1072
 
Join Date: Jan 2006
Location: San Jose CA
Posts: 40
Ben Englert has a spectacular aura aboutBen Englert has a spectacular aura aboutBen Englert has a spectacular aura about
Re: Holding a position in our arm

You can't move the arm at a single hardcoded speed and then suddenly reverse it when you pass your target - you will overshoot, as I'm sure you've noticed. While full-fledged PID (PD, anyway) control would be best here, I understand you're short on time so you can implement a rudimentary version of P control like this:

You will need a PWM-limiting function that takes an integer and bounds it between 0 and 254, because otherwise the unsigned char that representes a PWM setting will roll over and you will find your motors moving backwards.

targetVal = 180;
float pGain = 0.5;
int sensor = Get_Analog_Value(foo);
pwm02 = pwm_Limit((pGain*(targetVal-sensor))+127);

And then, just tweak the pGain up or down in small increments until your arm movement is acceptable.

Again, PID feedback is great, so if you have the time to do it properly I definitely would, but you can get away with this in a pinch.
__________________
Before a match at SVR, 3/17/06
Tatsu: "Yo Englert, what's our autonomous mode?"
Me: "We'll find out, won't we."
Both: *maniacal laughter*
After the match's autonomous period ends:
Me: "Well, the basic control system still responds. That's always good."
Both: *further laughter*
 


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
Programming our Arm brennerator Programming 29 15-03-2007 01:17
pic: Team 498 Robot Arm Stowed Position Cactus_Robotics Robot Showcase 1 10-02-2007 21:42
PID How to hold an arm in a fixed position without a locking gear box Ian_Xodus General Forum 29 28-01-2007 08:50
Pneumatics holding their position sanddrag Pneumatics 22 15-01-2004 16:36


All times are GMT -5. The time now is 04:46.

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