Go to Post If we miss in autonomous, the team blames the programmer, If we miss in teleop, the team blames the drivers - Jared Russell [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 31-05-2002, 16:51
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Makin' a home-brewn dashboard program, and I need theory help!

Okay, so Ian and I have decided to make our home-brewn Dashboard program (after all, wheres the fun in using someone elses?). Anyways, before we do any programming, we want to make sure we have the theory correct.

Basically, this document describes whats in a Dashboard packet. Now, if I understand it correctly, ANALOG1-7 are the analog inputs on the RC, SWITCH_A, _B are the digi inputs on the RC, and PORT 1/2/3/4 Y-Axis are the raw joystick feedback from the OI?

Now, before we go further, my first question is the x/y axises in the dashboard packet, are these the inputs from the oi, or the appropriate variables in the default code?

Anyways, moving on... So basically, our main question is where do these variables come from? Do they come from the OI master processor, or do they come from the information processed by the PBASIC processor?

Basically, the reason why we want to know is we want to be able to check the processed variables, kinda as if we were debugging them. Now, the diagram on page 5 of the user manual was kinda ambiguous. It appears that it outputs the 'dashboard bits' (analog1-7, switches_a, _b ?) after the processing. Does this mean that we can have the code manipulate the input variables and then use these to view it from the dashboard port? Meaning, say that we wanted to view a PROCESSED pwm output. Could we set an unused Analog input from the RC to the PWM value and thus, be able to view the final PWM output on a dashboard program?

Any clarifications would be helpful
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
  #2   Spotlight this post!  
Unread 31-05-2002, 18:04
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
We also need some help on the 'reading a packet' part. I have the Firestorm Dashboard program, which was written by Matt Leese. I was looking at the packet.c and packet.h files, and well, they're a bit confusing to me. I understood the basic idea of what they did, but how they do it, I have no clue. If someone could clarify how these work (Matt, you out there ), that would be great. The biggest problem I'm having is that I only know basic C++ commands (everything up to link-lists, if that helps). I know there's ways to make Bytes and Bits, and run loops ~40 times a second, but how, I do not know. I tried reading Matt's packet.c/.h files, but I couldn't get anything beyond the basics.

So, what me and Dan need is someone to tell us how it works, or a website that tells us where to get info on how this stuff works. Seeing as I don't know what I'd even be looking for, I haven't really done any searches. Kind of hard to look for something, when you don't know what it is you're looking for .
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #3   Spotlight this post!  
Unread 31-05-2002, 19:58
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
Re: Makin' a home-brewn dashboard program, and I need theory help!

Quote:
Originally posted by SuperDanman
Okay, so Ian and I have decided to make our home-brewn Dashboard program (after all, wheres the fun in using someone elses?). Anyways, before we do any programming, we want to make sure we have the theory correct.

Basically, this document describes whats in a Dashboard packet. Now, if I understand it correctly, ANALOG1-7 are the analog inputs on the RC, SWITCH_A, _B are the digi inputs on the RC, and PORT 1/2/3/4 Y-Axis are the raw joystick feedback from the OI?

Now, before we go further, my first question is the x/y axises in the dashboard packet, are these the inputs from the oi, or the appropriate variables in the default code?

Anyways, moving on... So basically, our main question is where do these variables come from? Do they come from the OI master processor, or do they come from the information processed by the PBASIC processor?

Basically, the reason why we want to know is we want to be able to check the processed variables, kinda as if we were debugging them. Now, the diagram on page 5 of the user manual was kinda ambiguous. It appears that it outputs the 'dashboard bits' (analog1-7, switches_a, _b ?) after the processing. Does this mean that we can have the code manipulate the input variables and then use these to view it from the dashboard port? Meaning, say that we wanted to view a PROCESSED pwm output. Could we set an unused Analog input from the RC to the PWM value and thus, be able to view the final PWM output on a dashboard program?

Any clarifications would be helpful
All of the values returned through the dashboard port are the hard-wired values, meaning that you can not change, for example, analog5, in code and have that modified value returned to the dashboard.
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
  #4   Spotlight this post!  
Unread 31-05-2002, 21:46
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
hmm, that bursts my bubble. Well what about the axis bytes? It seems kinda silly to hardwire only p1_x, p1_y, p2_y, p3_y, p4_y, and p2_wheel without being able to change it according to the setup. Can you change THESE values?
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
  #5   Spotlight this post!  
Unread 01-06-2002, 13:37
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
Quote:
Originally posted by SuperDanman
hmm, that bursts my bubble. Well what about the axis bytes? It seems kinda silly to hardwire only p1_x, p1_y, p2_y, p3_y, p4_y, and p2_wheel without being able to change it according to the setup. Can you change THESE values?
Nope...the only byte you have control over is the LED byte(don't remember the exact name right now)...the general workaround for the x and y axes is that if you want one to come through the dashboard that doesn't right now, rewire how the joystick connects to the OI...
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
  #6   Spotlight this post!  
Unread 01-06-2002, 14:15
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Hmm, okay, well thanks for the help. Arrg, I think in the future InnovationFIRST should give us one or two bytes that we can access in the code and send through the dashboard port...
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
  #7   Spotlight this post!  
Unread 01-06-2002, 16:46
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
I know quite a few of the teams used the LED control byte(and sometimes just taped over the corresponding LEDs on the OI), to feed data back...it is possible, however, that when the new-generation control system comes out(by 2004, I've heard), that the dashboard structure will be different.

[EDIT]Something else to keep in mind, as well, is that without updating the default code and the firmware in the master CPU, the only data that currently gets output from the user control program anyway is the 9 LEDs(basic run + LED control byte) and the PWM/Relay outputs.[/EDIT]
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...

Last edited by Nate Smith : 01-06-2002 at 16:48.
  #8   Spotlight this post!  
Unread 01-06-2002, 17:06
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
But by 2004 I'll be a senior, or if it's fall 2004, I'd be in college! There's no fun in having a really cool feed-back system if i can't use it! Oh well, i guess i'll just have to find a FIRST team, and make sure that i'm the mentor.
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #9   Spotlight this post!  
Unread 01-06-2002, 17:31
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
hmm, just out of curiosity, would it be possible to somehow loop a PWM signal back into an analog input? I'm not exactly sure about how the whole Pulse-Width-Modulated stuff works in comparison with the analog inputs, but would it be possible to somehow take a pwm output and loop it back into an analog input?
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
  #10   Spotlight this post!  
Unread 02-06-2002, 01:46
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Actually, I've been thinking.... they give us control over one byte. That means we can send either 8 digital outputs to the dashboard, or one 0-255 output...

If the 0-255 method is done by having
bit 0 = 1
bit 1 = 2
bit 2 = 4
bit 3 = 8
bit 4 = 16
bit 5 = 32
bit 6 = 64
bit 7 = 128
then turning on/off the appropriate bits to get any number from 0-255 (1+2+4+8+16+32+64+128 = 255), couldn't this method also be used to get two numbers from 0-15? Meaning....
bit 0 = 1
bit 1 = 2
bit 2 = 4
bit 3 = 8
bit 4 = 1
bit 5 = 2
bit 6 = 4
bit 7 = 8
So, using this method, we could program the Robot Feedback byte to actually carry two PWM values, but just the PWM value ±16. Since the maximum value is 255, if we divide it by 16, we get a number between 0 and 15. Thus, we could send to a dashboard program approximately two PWM values.

Say the code outputs a value of, oh, 123 to a pwm. We can take 123 and divide it by 16. Since PBASIC doesn't handle decimals, the final result would be 7 (it's actually 7.6875). This number will always be between 0 and 15, so we could use bits 0 through 3 to 'encode' it (bit 0 - on; bit 1 - on; bit 2 - on; bit 3 - off; 1+2+3 = 7). The same could be used with bits 4-7.

In the end, the dashboard program would read the Robot Feedback (LED) byte and from it, decode two numbers between 0 and 15 - or, two PWM outputs to the nearest 16. Sure, it's not perfect, but it's an approximation of what your robot code is sending out to the PWM.

This method could also be used to transfer to a dashboard program an approximate PWM value AND 4 digital outputs.

You guys understand what I'm trying to say?
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies

Last edited by DanL : 02-06-2002 at 01:48.
  #11   Spotlight this post!  
Unread 02-06-2002, 15:04
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,559
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
That's correct, and you can break it up anyway you like, because you are in control on both ends you can do whatever you want with that byte and break it up whichever way is best for your robot.

Just remember that the digital inputs are already sent back, so you only need to send it back if you do some type of calculations with the results.
  #12   Spotlight this post!  
Unread 02-06-2002, 20:45
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
There's all kinds of tricks you can pull to cram more data through those 8 bits. If you need to send back two values, you can use one of those bits to indicate which value you are sending, then use the other 7 bits as the value. For instance, use the most significant bit as the value selector:

Bits
7 6 5 4 3 2 1 0
----------------------
0 0 0 0 0 0 0 1 = Variable A = 1
1 0 0 0 0 0 0 1 = Variable B = 1

This way you can send back a number between 0 and 127 for each variable and just alternate which one you send. You can carry this idea further and trade a bit of precision for another power of 2 of variables, i.e. 6 bits for the value, 2 bits for the variable number, etc.

If you need to send back lots of values and only need to do so a couple times a second, you could something like this: Send the values 0xFF, 0x01, 0xFE, 0x26, 0xFF, 0x02, 0xFE, 0x67... In this sequence, 0xFF is an attention signal: it means that the next number will be the variable number. Then 0xFE is another attention signal and means that the following number is the variable data. So the above sequence tells you that variable 1 == 0x26 and variable 2 == 0x67. Now obviously you can't use 0xFF and 0XFE as either a variable number of a variable value. The downside to this is that it takes 4 dashboard packets to send each value, so you can only send 10 variables a second. There's also a problem which is that you don't know exactly when the master CPU is going to send a packet, so you can't really send 40 different bytes a second. Probably it's more like 10-15 bytes a second, so using this method you could maybe send like 2 to 4 variables per second.

Anyway, I hope this gives you some ideas. Basically you can do a lot with 8 bits by trading either time or precision. Sorry for rambling on so long
  #13   Spotlight this post!  
Unread 02-06-2002, 21:36
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Nah, the more help we get, the better. It's always interesting to find ways around problems.
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #14   Spotlight this post!  
Unread 02-06-2002, 21:56
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
hmmm, that alternating trick is actually a great idea. Thanks =)
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
  #15   Spotlight this post!  
Unread 02-06-2002, 22:27
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Ian just pointed out something to me.... you have one more bit to play around with - the Basic Run LED. Since the code by default toggles this guy on and off every cycle, you could use it for your own purposes. You actually have 1 byte and 1 bit to send back to the dashboard =)
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies
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
Creating a dashboard program Jeff_Rice Programming 18 04-05-2003 23:21
Anyone looking for more program space? archiver 2001 13 24-06-2002 02:20
Custom dashboard program available. Interest? archiver 2001 4 24-06-2002 00:45
miroboworks dashboard program? archiver 2000 3 23-06-2002 23:04
Yet another dashboard program Neal Probert Programming 3 12-05-2002 10:43


All times are GMT -5. The time now is 12:48.

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