Go to Post While many teams like to go fast, only a select few do it well. - Al Skierkiewicz [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
  #13   Spotlight this post!  
Unread 30-04-2010, 17:38
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: Servo on joystick

ooooohhh.. you're using a 3-speed DeWalt transmission... we've used those before.

This year we had two robots and only used gears 1 and 2 (only one shifter, it was for our arm).

In LabVIEW I created a 2x2 matrix for the shift states. The column was the numeric equivalent to the boolean robot variable (false for competition, true for practice). The row was the numeric equivalent to the boolean shift state variable. This worked just fine for only going from 1 to 2. I set the shift point when deploying so there was not much load on the arm at the time it shifted and it never missed a shift.

In the past, we have used all three gears (for drivetrains), and had the servo overshoot and come back when shifting into second, to make more certain the shift was successful (the shift from 2 to 3 at speed is kinda hard anyway).

The simple way to do this would be to use a state-machine and have a value for "Low", "Mid", and "High". This will make the robot stay in gear when you remove your hands from the buttons. To do this, create an Enum control, right-click, and hit "Edit Items". Then, type in your three states, preferably with Low as 0 and High as 2. Then, create an array and place a Numeric type inside, making a numeric array. This will store your shift points. There are three rows in the numeric array that we care about: the first three. The first one corresponds to Low (assuming Low is the 0 in the list), and so on. Servo values are between 0 and 170 in degrees. When you have set them (you can do this while the code is running), stop the code, right-click on the array, and go to Data Operations -> Make Current Value Default. Then, go to the place where you set the servo, get the array and enum, and Index the array (using Arrau->Index Array) where the index is the enum. This will give you the correct angle for the state that the Enum is set to, which you can set to your servo. Then, to set the enum, you can have a button for Low, Mid, and High. Just have a Switch for each button, and feed the current state of the enum into the False of the first one (then string the output of the first to the False of the second and so on). Then, set the True to the value of the button, either Low Mid or High. The output of the last one gets set to the enum. You could save buttons by having a Shiftup and Shiftdn button, but that would require an indicator of the current gear (Dashboard or LED) and a rising-edge trigger, both of which are more complex then you probably want. I would make pictures to go along with this but my LabVIEW laptop is broken.

Also, don't forget to remove the detent from the shifter (a little black tab that holds it in gear, it makes it harder for the servo to shift)
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Servo control with a joystick Robototes2412 Java 5 09-05-2010 19:31
Joystick Read modification to breakout joystick buttons sparks-1784 NI LabVIEW 2 02-03-2010 14:54
Joystick-Servo control Lumit NI LabVIEW 1 08-02-2010 23:21
Camera servo control off of the Joystick axes m3rc1l3ss NI LabVIEW 5 13-03-2009 20:00
Servo behavior question / advanced servo/PIC programming question DanL Electrical 12 18-10-2005 18:33


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

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