Go to Post Engineering is a big, big type of fishing to teach. Inspiring kids to study it in college might be more practical. - connor.worley [more]
Home
Go Back   Chief Delphi > FIRST > Robot Showcase
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 20-03-2006, 22:45
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: pic: it's a Vex Holonomic Drive!

As requested, here is the code from EasyC ver 2.0 that I used for my Vex Holonomic Drive robot. The main drive controls are relative holonomic drive, which is relative to the current position of the robot. So if you push the left joystick to the left, the robot will go to its left. The code works well, and for a lot of people who I let drive this, it was a lot easiar for them to control than the tank drive on my Triple Play / Space Elevator vex robot.

Here's the code:
Code:
#include "Main.h"

void main ( void )
{
int LF; // Left Front
int RF; // Right Front
int LR; // Left Rear
int RR; // Right Rear
int leftx;
int lefty;
int rightx;
int spin;
      while ( 1 )
      {
            // Get Data 
            leftx = GetRxInput ( 1 , 4 ) ; // Left Joystick, X Axis
            lefty = GetRxInput ( 1 , 3 ) ; // Left Joystick, Y Axis
            rightx = GetRxInput ( 1 , 1 ) ; // Right Joystick, X Axis
            // Half the input signal (so code does not overflow past 255)
            leftx = leftx / 2 ;
            lefty = lefty / 2 ;
            spin = rightx / 2 ;
            // Drive Code Algorithim
            LF = RR = lefty - leftx + 127 ;
            RF = LR = 255 - lefty - leftx ;
            RR = 255 - RR ; // Reverse Direction of RR motor
            LR = 255 - LR ; // Reverse Direction of LR motor
            // Spin Code Algorithim
            RF = RF - spin + 63 ;
            RR = RR - spin + 63 ;
            LF = LF - spin + 63 ;
            LR = LR - spin + 63 ;
            // Code overflow prevention
            if ( LF < 0 )
            {
                  LF = 0 ;
            }
            else if ( LF > 255 )
            {
                  LF = 255 ;
            }
            if ( RF < 0 )
            {
                  RF = 0 ;
            }
            else if ( RF > 255 )
            {
                  RF = 255 ;
            }
            if ( RR < 0 )
            {
                  RR = 0 ;
            }
            else if ( RR > 255 )
            {
                  RR = 255 ;
            }
            if ( LR < 0 )
            {
                  LR = 0 ;
            }
            else if ( LR > 255 )
            {
                  LR = 255 ;
            }
            // Set Motors
            SetMotor ( 1 , RF ) ;
            SetMotor ( 2 , LF ) ;
            SetMotor ( 3 , LR ) ;
            SetMotor ( 4 , RR ) ;
      }
}
I may resurrect this robot (at least the drive platform) at some point over this summer and utilize the gyro from the FIRST KOP to make the robot a true absolute holonomic drive. But that will be added to my list of designs and ideas to try out, now that I have stock-piled enough Vex stuff in my fallout shelter to last through seven world wars.

I'm dead serious too - I really do have like $2000 worth of Vex stuff.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
  #2   Spotlight this post!  
Unread 21-09-2006, 22:00
Dmkaz Dmkaz is offline
Registered User
no team
 
Join Date: Jun 2006
Location: Indiana
Posts: 3
Dmkaz is an unknown quantity at this point
Send a message via AIM to Dmkaz
Re: pic: it's a Vex Holonomic Drive!

I love bringing back up old topics =)

Anyways, I tried to import this code into EasyC 1.1 to see how it actually worked. To no avail though. After the code transfers to the controller, the motors seem to randomly spin at different times. I've tweaked this for numerous hours and still no luck. It would be great if someone could help on this issue. Thanks in advance

P.S. I apologize if I posted this in the wrong area. Didn't want to create a new topic for something that has been discussed numerous times.
  #3   Spotlight this post!  
Unread 10-10-2006, 14:29
Dylan Gramlich's Avatar
Dylan Gramlich Dylan Gramlich is offline
Christian group in FIRST? Ideas?
FRC #1126 (SparX)
Team Role: Tactician
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Webster, NY
Posts: 350
Dylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond reputeDylan Gramlich has a reputation beyond repute
Send a message via AIM to Dylan Gramlich
Re: pic: it's a Vex Holonomic Drive!

did u use just one of the joysticks to control this or some other combination? I should think about building something like that...hmm...
__________________
2005-2008: Student Mechanical and Strategy Lead
2009-2010: Mechanical Mentor
2011-2013: Strategy and Field Team Mentor
  #4   Spotlight this post!  
Unread 10-10-2006, 16:58
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: pic: it's a Vex Holonomic Drive!

Quote:
Originally Posted by Dmkaz
I love bringing back up old topics =)

Anyways, I tried to import this code into EasyC 1.1 to see how it actually worked. To no avail though. After the code transfers to the controller, the motors seem to randomly spin at different times. I've tweaked this for numerous hours and still no luck. It would be great if someone could help on this issue. Thanks in advance
If the motors seem to be randomly moving, it's probably because of a code overflow error. (I.e. 256 would wrap back around to 0, reversing the motor.) EasyC 1.1 does not support the Else If blocks. If you substitute regular If blocks for the If Else ones, the code should work fine.

Also, the variable names are shorthand for which motor is controlled. RF is short for Right Front, LR is short for left rear, and so on. Make sure the your code controls the correct motors; if you were to swap two or three of the motors around, then the motors would appear to move randomly.

If you are still having problems, can you add some PrintScreen commands to display the values for each motor (add them right before the SetMotor blocks, download the original code (posted here), and then post the values you are getting? Or a simpler way would be to look at each of the motors while you control the robot. When you hit forward, the motors should rotate like this:



Quote:
Originally Posted by Dylan Gramlich
did u use just one of the joysticks to control this or some other combination? I should think about building something like that...hmm...
The left joystick controlled the laternal movement - up on the joystick moved the robot forward, left on the joystick moved the robot to the left, and so on. The right joystick was used to control spin. Move the joystick to the right and the robot would spin to the right, etc. Any combination of the two joysticks, such as moving diagonally while applying a spin would mix the values, so it really would spin while driving diagonally.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
  #5   Spotlight this post!  
Unread 01-11-2006, 14:58
Lil' Lavery Lil' Lavery is offline
TSIMFD
AKA: Sean Lavery
FRC #1712 (DAWGMA)
Team Role: Mentor
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Philadelphia, PA
Posts: 6,608
Lil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond repute
Send a message via AIM to Lil' Lavery
Re: pic: it's a Vex Holonomic Drive!

Quote:
Originally Posted by artdutra04
The left joystick controlled the laternal movement - up on the joystick moved the robot forward, left on the joystick moved the robot to the left, and so on. The right joystick was used to control spin. Move the joystick to the right and the robot would spin to the right, etc. Any combination of the two joysticks, such as moving diagonally while applying a spin would mix the values, so it really would spin while driving diagonally.
Did you use a robot-centric or a driver-centric code? In other words, if you pushed the joystick left, would the robot move to it's left, or your left?
__________________
Being correct doesn't mean you don't have to explain yourself.
  #6   Spotlight this post!  
Unread 01-11-2006, 17:02
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: pic: it's a Vex Holonomic Drive!

Quote:
Originally Posted by Lil' Lavery
Did you use a robot-centric or a driver-centric code? In other words, if you pushed the joystick left, would the robot move to it's left, or your left?
Robot-centric. I didn't have any gyros or accelerometers around, so there was no way for me to program absolute (driver-centric) control. That, and at the time I programmed it in EasyC, and I was unsure if sine, cosine, and tangent functions existed. Either way, most people who I let drive that robot found even relative (robot-centric) driving very easy to drive.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
  #7   Spotlight this post!  
Unread 01-11-2006, 19:33
Lil' Lavery Lil' Lavery is offline
TSIMFD
AKA: Sean Lavery
FRC #1712 (DAWGMA)
Team Role: Mentor
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Philadelphia, PA
Posts: 6,608
Lil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond repute
Send a message via AIM to Lil' Lavery
Re: pic: it's a Vex Holonomic Drive!

Quote:
Originally Posted by artdutra04
Robot-centric. I didn't have any gyros or accelerometers around, so there was no way for me to program absolute (driver-centric) control. That, and at the time I programmed it in EasyC, and I was unsure if sine, cosine, and tangent functions existed. Either way, most people who I let drive that robot found even relative (robot-centric) driving very easy to drive.
Just curious how you got it to move in a straight line and spin at the same time then, as with a robot centric system, while spinning and translating, it begins to arc. For instance, if it spins clockwise while translating forwards, the "front" of the robot would move clockwise, causing a clockwise arc of motion (and eventually a circle that the robot moves clockwise along the perimeter).
__________________
Being correct doesn't mean you don't have to explain yourself.
  #8   Spotlight this post!  
Unread 01-11-2006, 23:08
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: pic: it's a Vex Holonomic Drive!

Quote:
Originally Posted by Lil' Lavery
Just curious how you got it to move in a straight line and spin at the same time then, as with a robot centric system, while spinning and translating, it begins to arc. For instance, if it spins clockwise while translating forwards, the "front" of the robot would move clockwise, causing a clockwise arc of motion (and eventually a circle that the robot moves clockwise along the perimeter).
If you do not compensate for that while driving the robot, then yes, that is what it would do. But if you start driving forward and start to rotate to the right, if you move the left (transversal) joystick to the more to the left, you can compensate for the spin and more or less the robot will continue to move "forward" while spinning. With only relative control, it takes a lot more driver skill to translate while transversing.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
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
Direct Drive Four Motor System Collin Fultz Technical Discussion 42 02-11-2006 12:03
Holonomic Drive Question Jeff Waegelin Technical Discussion 12 20-11-2005 21:23
vex programming arcade drive setting Michael Leicht FIRST Tech Challenge 3 17-10-2005 21:26
pic: Team 870 Front Drive Train CD47-Bot Robot Showcase 4 27-02-2003 15:23
pic: Team 870 Rear Drive Train CD47-Bot Robot Showcase 2 27-02-2003 00:22


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

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