OCCRA
Go to Post But now we know what's inside Shaun's backpack! ...Don Rotolo's plastic egg. - MishraArtificer [more]
Home
Go Back   Chief Delphi > Competition > OCCRA > OCCRA Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 11-19-2012, 07:45 AM
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: Clarkston, 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
[OCCRA]: Halo Drive 'Default' Code

All,

I wrote this for several VRC teams to allow them to do development and such without writing any code. It maps buttons to PWM ports, and Halo Drive using the same code OCCRA/VRC33 is currently using for the second year. It might be useful to other teams in similar situations, so I'll post it here. It's written for RobotC 3.51, you'll need that to compile (although it will probably compile in older versions, but upgrading is free anyway).

PWM mapping is as follows:The IO mappings are as follows:
PWM 2 => Left Drivetrain Halo Drive (Halo from Primary transmitter left Y and right X)
PWM 3 => Right Drivetrain Halo Drive
PWM 4 => Secondary transmitter left Y
PWM 5 => Secondary transmitter right Y
PWM 6 => Primary transmitter left buttons (up/down are forward/reverse) - Btn5
PWM 7 => Primary transmitter right buttons - Btn6
PWM 8 => Secondary transmitter left buttons - Btn5
PWM 9 => Secondary transmitter right buttons - Btn6

There are no limit switch inputs, or any sensors at all.

The file itself includes a main task running at 40hz (25ms loop time) which runs always. It also includes the Halo Drive function usually located in cheesydrive.c, and some math functions (usually in kbmath.c)

Just above the do_halo_drive() function is the cheesy/halo drive constants. They're #define s and you can tune them as you with. These constants are used as-is on many VEX prototypes and competition robots, we tune them more for the FRC robots. It's mainly driver preference, they essentially the turn gain.
Attached Files
File Type: c default.c (4.3 KB, 88 views)
__________________
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
Reply With Quote
Reply


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 09:56 AM.

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


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