Go to Post To me, the changing rules are a big part of the fun. If the rules stayed the same year to year, robots would start to look the same. That would be boring. - Richard Wallace [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 02-02-2011, 11:45
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Motor Encoder code. LabVIEW

1. Potentiometers are better than encoders because the are absolute, so you don't loose your position when you reboot (and if you happen to die during a match, you won't have to return to home before using your robot)

2. You would probably want to use P or PID control. Wikipedia has a great article about it - http://en.wikipedia.org/wiki/PID_controller.

3. Start with P. If it has issues (which generally only happens if it moves very fast, which yours dosen't seem like it does), then you can add D. I might be necessary, but probably not.

4. You would probably have a controller for each joint, and feed the setpoints from an array.

Here's how I would write the code:
1. Create an enumerated type to define the state. In LabVIEW, create an enum and edit the items in the list.
2. Create a cluster (in C++, it's a structure), defining the setpoints for all controllers. For example, you would have a Dbl for each joint, then hit the "align horizontal" button for LabVIEW to make them all nice and neat
3. Create an array of the clusters. Each line in the array will represent one item in the state.
4. Since an enumerated type can be used as a uint8, find the numeric representation of each and label each item in the list. Then, use the Index Array block (just index in C, with an array[item]) and get the item in the array that goes with the state.
5. Drive the arm with the newly aquired cluster of positions
6. Set the state whenever a button is pressed.
Make sense?
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
 


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


All times are GMT -5. The time now is 23:36.

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