Go to Post The short answer is there is no shortcut. - JDNovak [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-01-2007, 09:55
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Exclamation What are we supposed to do!?!?!?!??!?!

We've went over the code, looked a bit at the functions and other macro stuff.

But we don't have a clue what's going on there!
What's with the PWMs?
Where's the parts with the engines moving?
What are we supposed to write?(as in, in the intilazation, what happens there, the autonomus, what do we use; in the free part, what needs to be modeled....


WHAT ARE WE SUPPOSED TO DO!?!?!
(sorry, just totally desprate trying to understand what we need to do while we're being shouted at from every direction, being asked to start writing while we have no clue what to do).
  #2   Spotlight this post!  
Unread 11-01-2007, 10:06
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: What are we supposed to do!?!?!?!??!?!

If youre totally lost and havent programmed before, I'd suggest that you use the easyC, personally its not my favorite but it is easy to get started... you can find it in your KOP.

The 'pwm's are pulse width modulators, in effect they control the speed of motors. If you want more detailed explanation I'll be happy to give you one. From the programming interface the pwm drives are insanely easy to use, just remember that 127 is neutral, 254 is full forward, and 0 is full reverse. Everywhere in between is variable power output on the motors in forward and reverse directions.

hopefully that answers a few questions, if you have more, i'll be happy to answer them.

-Q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #3   Spotlight this post!  
Unread 11-01-2007, 10:12
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: What are we supposed to do!?!?!?!??!?!

Yes, I know about the PWM numbers of forward and backwards and I'm expirienced with C(even with Visual c++), but what am I supposed to do now? You say the drive system is easy, but I don't understand what am I supposed to look at that it shows that it's easy!
I've asked someone from another team in my country and from what I understood, he said that it is all written there.
But I don't see it! I only see that they put the values of p1_y(which is what?!?!) to pwm01 and all kind of other stuff, but I don't see anything with number values(mabye except with the leds). Is that where I'm supposed to write the engines part??
  #4   Spotlight this post!  
Unread 11-01-2007, 10:12
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,370
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: What are we supposed to do!?!?!?!??!?!

If your using MPLAB and you find yourself blown away, dazed and confused, I would heed the EASY-C recommendation. There are several Easy-C totorials included in the software and online.
  #5   Spotlight this post!  
Unread 11-01-2007, 10:15
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: What are we supposed to do!?!?!?!??!?!

But we don't know what to do in EasyC. We're used to raw C code. These blocks are confusing(safe, but confusing).
  #6   Spotlight this post!  
Unread 11-01-2007, 10:18
Francis-134's Avatar
Francis-134 Francis-134 is offline
Lifer
FRC #0190 (Gompei and the Herd)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Worcester, MA
Posts: 602
Francis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond repute
Re: What are we supposed to do!?!?!?!??!?!

Quote:
Originally Posted by Bomberofdoom View Post
But we don't know what to do in EasyC. We're used to raw C code. These blocks are confusing(safe, but confusing).
If you are at all confused by anything in easyC, simply press F1 on the keyboard and go to the help file. Similarly, there is a button on every block that will bring you directly to the help page about that block. Intelitek spent literally months writing the help file. It is extremely detailed about every function included in easyC Pro.
__________________

Email | Twitter | Facebook | YouTube | Twitch
iTunes Podcast | Snapchat

A proud alumnus of teams 134 and 40 || Mentor of Team 190 || Director of Fun for BattleCry@WPI
  #7   Spotlight this post!  
Unread 11-01-2007, 10:19
P1d40n3's Avatar
P1d40n3 P1d40n3 is offline
Commander Programmer
AKA: Adam Burch
FRC #0842 (Falcon Robotics)
Team Role: Programmer
 
Join Date: Aug 2006
Rookie Year: 2006
Location: Phoenix, Arizona
Posts: 14
P1d40n3 has a spectacular aura aboutP1d40n3 has a spectacular aura aboutP1d40n3 has a spectacular aura about
Re: What are we supposed to do!?!?!?!??!?!

Quote:
Originally Posted by Bomberofdoom View Post
Yes, I know about the PWM numbers of forward and backwards and I'm expirienced with C(even with Visual c++), but what am I supposed to do now? You say the drive system is easy, but I don't understand what am I supposed to look at that it shows that it's easy!
I've asked someone from another team in my country and from what I understood, he said that it is all written there.
But I don't see it! I only see that they put the values of p1_y(which is what?!?!) to pwm01 and all kind of other stuff, but I don't see anything with number values(mabye except with the leds). Is that where I'm supposed to write the engines part??
p1_y -> Port 1's y-axis (Ie: The y-axis of the joystick plugged into port 1)

pwm01 -> this is the code representation of PWM01 on the RC

the code pwm01 = p1_y would map the y-axis of port 1's joystick to PWM output 1.

I recommend the RC Reference guide, found here. Reading that should answer your questions.
  #8   Spotlight this post!  
Unread 11-01-2007, 10:20
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: What are we supposed to do!?!?!?!??!?!

These power points taught me to program the robot 4 years ago. The code has changed a little since then but the concepts are still the same.
http://www.usfirst.org/community/frc...nt.aspx?id=482
Watch all of them.
  #9   Spotlight this post!  
Unread 11-01-2007, 10:22
SoD SoD is offline
Registered User
FRC #2230
 
Join Date: Jan 2007
Location: Israel
Posts: 15
SoD is an unknown quantity at this point
Re: What are we supposed to do!?!?!?!??!?!

Hello, I am from team 2230 too.

We have a default code in our mplab program (like everyone else).
What are we supposed to change in it? It seem to be quite complete
  #10   Spotlight this post!  
Unread 11-01-2007, 10:27
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: What are we supposed to do!?!?!?!??!?!

We already went through the presentation of the C and it didn't give us the real help. It told us where to go but not specifically what to do(yes, write your autonoms code. But what values, varibles, functions etc. are we supposed to use in it?).
What really helped was the the RC reference guide, thx!
  #11   Spotlight this post!  
Unread 11-01-2007, 10:29
jakk jakk is offline
Jonathan Kobayashi
FRC #0368 (Kika Mana)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hawaii
Posts: 39
jakk has a spectacular aura aboutjakk has a spectacular aura about
Re: What are we supposed to do!?!?!?!??!?!

Remember that this program actually runs in a HUGE loop. In other words, the program runs through lots of times per second. Program will check the status of the Operator Interface and will adjust the values of the PWMs accordingly. This is how the robot is able to have variable speeds.

As for the PWMs, looks in user_routines.c and look around for the "pwm=xx;" where xx is a number or perhaps another variable like the value of the joysticks.

The default code provided by FIRST controls the Kitbot rather nicely. If hooked up correctly, the Kitbot can move with either 1 joystick or 2.


-----------------------------
The following explaination is based off of the code we used 2 years ago. I'm sorry if I get some things wrong and if I do, please correct me. It has been 2 years since I was a programmer.

void User_Initialization (void)
this is where you initialize the ports on the RC. In other words, you are setting those pins on the Robot Controller to do something, like be an output(gives out power) or input(receives a signal for a sensor).

void Default_Routine(void)
this is where the controls are at. Remember how I said that the program runs in a HUGE loop? Well this is part of that loop. This function looks at all the values of the Operator Interface (like the joystick values) and through some "if" and "else" statements, it can control the motor's speed.

---------------------------------------

Like Qbranch said, easyC is a good introduction to C programming. I think it is setup so there is an "operator control" section and "autonomous" section so it well orgranized.
__________________
http://www.mckinleyrobotics.org
  #12   Spotlight this post!  
Unread 11-01-2007, 10:30
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: What are we supposed to do!?!?!?!??!?!

There is a function in user_routines.c called Default_Routine(). This is basically your playground, this function runs about 38 times a second (26.2 milliseconds) and you put all your logic in here. Your OI data (joystick values, buttons pushed) is all available in aptly named variables (p1_y, p2_x, p2_sw_trig, etc) that you can check with if statements. For example to make the trigger on the joystick connected to Port 1 drive the robot forward and your motors are on pwm01 and pwm02 you might try this:

Code:
// in Default_Routine()
...
	if(p1_sw_trig) // If the trigger is pushed
	{
		pwm01 = 255; // Left motor full speed forward
		pwm02 = 0; // Right motor full reverse since it's likely facing the  opposite direction
	}
	else // Trigger is not pushed
	{
		pwm01 = 127; // Motor stopped;
		pwm02 = 127; // Motor stopped;
	}
Note this is not a recommend way to drive, you're better off mapping the pwm outputs to the joystick inputs like this:

Code:
...
pwm01 = p1_y;
That should be enough for you to get started, it's all just basic logic.
Good luck!
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #13   Spotlight this post!  
Unread 11-01-2007, 10:31
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: What are we supposed to do!?!?!?!??!?!

Quote:
Originally Posted by Bomberofdoom View Post
Autonomous Mode means that the RC will ignore all data from the Operator Interface and it will not
require a link with the Operator Interface to execute code.

If you wish to run the Robot Controller exclusively in Autonomous Mode, one way to do this is to set
your team number to zero. This is done by setting the team number on your OI to zero, linking your OI
and RC by tether, and then disconnecting from tether. After your RC is reset it will be in Autonomous
Mode.

To exit Autonomous mode if your team number is zero, you must re-tether and change the team number
to anything but zero.

An additional method for getting into Autonomous Mode is described in the Operator Interface
Reference Guide in the “Competition Control LED” section. See the Programming Reference Guide for
details on how to program for Autonomous Mod
Where is the team number value?(which source file?)
  #14   Spotlight this post!  
Unread 11-01-2007, 10:34
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: What are we supposed to do!?!?!?!??!?!

Ok, so I read about the joystick movment thing.
Do we need to build that code of if's? Do we need to make these macros to check the joystick axis status?
  #15   Spotlight this post!  
Unread 11-01-2007, 10:37
jakk jakk is offline
Jonathan Kobayashi
FRC #0368 (Kika Mana)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hawaii
Posts: 39
jakk has a spectacular aura aboutjakk has a spectacular aura about
Re: What are we supposed to do!?!?!?!??!?!

Actually, can't you make something that will simulate the master controllers used at FIRST? You can connect some switches to that 'competition' port on the top and run either autonomous or disable the robot. Not really sure what pins but it can be done.
__________________
http://www.mckinleyrobotics.org
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
What are Potentiometers? Theory6RobotiX Control System 18 30-12-2005 09:57
PBASIC 2.5 Software supposed to be released TODAY. Travis Hoffman Programming 7 13-01-2003 20:43
What are pneumatics? Aignam Pneumatics 23 16-10-2002 21:17
Who was supposed to be in Huntington?? Heather 45 Off-Season Events 4 16-03-2002 22:43


All times are GMT -5. The time now is 20:45.

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