Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Interactive DashBoard (http://www.chiefdelphi.com/forums/showthread.php?t=58312)

6600gt 31-07-2007 04:45

Interactive DashBoard
 
5 Attachment(s)
Hi everyone, it has been over a year and I am finally ready to release a beta version. I hope you guys like it.

I knew that no matter how much I begged and screamed, the robot would never be completed with enough time for any decent programming time left. I knew many were on the same boat. Thus, I embarked on developing a program that would allow for more to be accomplished in less time. You never have enough time for programming! Debugging was the most time consuming part of the software development. Since the IFI hardware restrictions don’t allow for the use of In-circuit debuggers, I realized that viewing variables values as they progressed through a function was the best way to debug. This application is intended to improve debugging efficiency by reducing the number of code downloads, allowing to view 10 different variables simultaneously and graph 5 of them, view tons of camera data, and directly control PWMs for hardware diagnostics, all at the same time and in real time. No re-flashing is required to change which variable is being viewed in each column!

This program has been in development for over a year. The DataView has been field tested during the 2007 season and proven to be very effective. It has been the most complex project I have ever worked on with a combination of RC hardware and software along with Visual C++ application development. I have tried to maintain efficiency and reliability in the RC code. But on the Visual C++ application side I only worried about reliability since the PC processor is far more capable and thus, easily able to process application code.

CAUTION: I have tried my best to put the highest priority on safety. The PWM control has not been field tested, thus I cannot guarantee %100 safety while using the PWM. Yet the system has many fail-safes. If the program cord is disconnected, serial port turned off, or the RESET/STOP is clicked, the pwms, relays, and joysticks controls will all reset to default (127 or 0).

NOTE: The reason for its current release is to see if people are interested, and for me to understand problems other might have with their RC or PC while implementing this setup. Right now only the DataView (without data logging), Camera, and PWM work. If people are interested and not too many serious problems are experienced, then a more complete package will be released.

If you want to test it out first, I have included a compiled hex file for the 06-7 RC with the source code. Download this to the RC using the IFI loader and fire up DashBoard for testing. You still need to follow instructions 1 and 2 from “How to get started” in the DashBoard_readme.doc


Requirements:
PC:
.NET Framework 2 or above
MPLAB
RC:
Kevin Watson’s Serial Port
Kevin Watson’s Camera Code (if using the camera feature)
Up the RX1 buffer to 64 in serial_ports.h

If you guys have critiques on anything, please let me know. This is my first release ever so I really don't know what I am doing. I need to give a special thanks to Kevin Watson for all his marvelous code.

6600gt 31-07-2007 11:41

Re: Interactive DashBoard
 
1 Attachment(s)
I can only upload 5 files at a time so here is the last picture. What do you guys think?

eshteyn 31-07-2007 13:53

Re: Interactive DashBoard
 
the program is absolutely fantastic, you did an amazing job

6600gt 31-07-2007 14:07

Re: Interactive DashBoard
 
Quote:

Originally Posted by eshteyn (Post 637292)
the program is absolutely fantastic, you did an amazing job

Thanks, did you have any problems with the instructions or getting it running?

EVERYONE:
I might not have made this clear because it got buried in the instructions, but you need to DISABLE ANY DIAL-UP/FAX modems on your computer(use the device manager). I don't know if this affects USB to Serial converters. For some reason it screws with the serial port and outputs garbage data.

EHaskins 31-07-2007 14:22

Re: Interactive DashBoard
 
Looks great! I haven't had a chance to test it on a robot, but it looks like it could be a lot of help debugging.

bear24rw 31-07-2007 17:06

Re: Interactive DashBoard
 
This looks awsome i'll definitely be trying it out next time i get a chance

6600gt 02-08-2007 16:33

Re: Interactive DashBoard
 
How many are interested?

Has any one gotten a chance to test it?

I would like some feedback on how it's working for others so I can make the required modifications.

lynca 03-08-2007 14:35

Re: Interactive DashBoard
 
It would be nice if this code could be modified to also work with the vex system. That will give a wider user base to develop the features of an interactive dashboard. Hopefully soon we will have a common serial interface to control the FRC RC with a any type of programming language. Overall, great potential !

bear24rw 03-08-2007 17:22

Re: Interactive DashBoard
 
Quote:

Originally Posted by lynca (Post 637680)
Hopefully soon we will have a common serial interface to control the FRC RC with a any type of programming language.

That really wouldnt be that hard to do, we just need to make a standard protocal. Then you can control it through a program running on your computer or you could add a seperate board running, say java that would communicate with the RC over the serial port

whytheheckme 03-08-2007 21:27

Re: Interactive DashBoard
 
zor!

This looks rockin'!!

I can't wait to try it out. This sounds like a 74-hour-marathon-programmer's dream app!

Keep up the good work!

Jacob

6600gt 03-08-2007 22:36

Re: Interactive DashBoard
 
Quote:

Originally Posted by lynca (Post 637680)
It would be nice if this code could be modified to also work with the vex system. That will give a wider user base to develop the features of an interactive dashboard. Hopefully soon we will have a common serial interface to control the FRC RC with a any type of programming language. Overall, great potential !

I believe most people that use vex, probably use Easy C. I don't have either the vex system or the Easy C system to play with. But all we have to do is port over Kevin Watson's serial port code and my DashBoard code and it should work very. I can port over the DashBoard code but I need some one else who knows how to work with interrupts on the Vex to port over the serial code. We could probably have a checkbox or something on the DashBoard, to switch between the RC and the Vex.

EHaskins 03-08-2007 23:14

Re: Interactive DashBoard
 
I've successfully used Kevin's Serial, Camera, and ADC code on the Vex platform.

Since the processors used in the pre-2006 FRC RC is the same as the Vex controller, following Kevin's instructions to run his code on the old or EDU controllers will work for Vex. The only difference is that you need to use the Vex library, which is in the vex "starter code" available here.

EDIT: The instructions I refer to are in the readmes for each of Kevin's projects.

6600gt 04-08-2007 11:23

Re: Interactive DashBoard
 
Quote:

Originally Posted by EHaskins (Post 637730)
I've successfully used Kevin's Serial, Camera, and ADC code on the Vex platform.

Since the processors used in the pre-2006 FRC RC is the same as the Vex controller, following Kevin's instructions to run his code on the old or EDU controllers will work for Vex. The only difference is that you need to use the Vex library, which is in the vex "starter code" available here.

EDIT: The instructions I refer to are in the readmes for each of Kevin's projects.

You used MPLAB and C18 for this, right? I don't know much about Vex but what do most people use to program their VEX system, MPLAB or Easy C?

If you have gotten the serial port code to work, then all you have to do is include the DashBoard.c/h and setup the user_routines.c similar to the sample code(or follow the DashBoard_readme.doc instructions)...maybe get rid of the camera stuff...Does anyone use the camera with the VEX?

EHaskins 04-08-2007 15:49

Re: Interactive DashBoard
 
Quote:

Originally Posted by 6600gt (Post 637754)
You used MPLAB and C18 for this, right? I don't know much about Vex but what do most people use to program their VEX system, MPLAB or Easy C?

If you have gotten the serial port code to work, then all you have to do is include the DashBoard.c/h and setup the user_routines.c similar to the sample code(or follow the DashBoard_readme.doc instructions)...maybe get rid of the camera stuff...Does anyone use the camera with the VEX?

I use c18 for Vex, the IDE I use changes frequently, but it's normally MPLab. From what I've seen most people are using EasyC for Vex, but like I said the processor is almost the same as the FRC RC, so most tools are compatible with both.

I've used the camera without any issues, there are porting instructions for that code as well.

6600gt 06-08-2007 04:11

Re: Interactive DashBoard
 
Quote:

Originally Posted by EHaskins (Post 637782)
I use c18 for Vex, the IDE I use changes frequently, but it's normally MPLab. From what I've seen most people are using EasyC for Vex, but like I said the processor is almost the same as the FRC RC, so most tools are compatible with both.

I've used the camera without any issues, there are porting instructions for that code as well.

I would gladly help anyone port over the code to VEX. Still, has anyone gotten a chance to test it?

To continue progress, which one should I continue working on right now:
  • Joystick (Allows you to simulate all of the OI inputs from the PC)
  • DataView data Logging into text file
  • Text file based PWM name memory

6600gt 09-08-2007 13:23

Re: Interactive DashBoard
 
Thanks everyone for your support and enthusiasm.

Maybe it's because of the off season or summer, but not too many people seem interested. Is there something missing, or is it too hard to implement?

If someone can give me some pointers or ideas, I would be very thankful.

Thanks in advance.

Lohit

Tottanka 09-08-2007 18:57

Re: Interactive DashBoard
 
i believe it's the off season.
We ar currently working on the mechanical issues on our bot, but we will soon need the programming. I'll be sure to show our lead programmer your software, it looks great.
I can also promise to give you feedback once i have it. It will take a week or 2 though =]

lndnny 09-08-2007 21:15

Re: Interactive DashBoard
 
This program looks great!

Too bad team 808 is out of first for good... but we aren't giving up.
We are doing a program called the national robotics challenge and entering a robot for a grand total of 30 some dollars. With none of the limitations of FIRST, we are actually going to try to send sensor output to a laptop and do all the long calculations there, but we're having problems doing this. Would you mind answering a few questions?

Was this program created in Visual Basic using the .net framework?

If it was, can you provide some source code or provide an example on how to read data into the visual basic program? - every time I try to read input from the serial port in my test program from the RC, I get question marks.

I'm using Kevin's serial port code to send data to the computer. Our team membership currently numbers four and we are all trying to learn as much as we can.

Thanks for your time.
Dan - former team 808

EHaskins 10-08-2007 00:18

Re: Interactive DashBoard
 
Quote:

Originally Posted by lndnny (Post 638263)
This program looks great!

Too bad team 808 is out of first for good... but we aren't giving up.
We are doing a program called the national robotics challenge and entering a robot for a grand total of 30 some dollars. With none of the limitations of FIRST, we are actually going to try to send sensor output to a laptop and do all the long calculations there, but we're having problems doing this. Would you mind answering a few questions?

Was this program created in Visual Basic using the .net framework?

If it was, can you provide some source code or provide an example on how to read data into the visual basic program? - every time I try to read input from the serial port in my test program from the RC, I get question marks.

I'm using Kevin's serial port code to send data to the computer. Our team membership currently numbers four and we are all trying to learn as much as we can.

Thanks for your time.
Dan - former team 808

This program is written on .net, I believe its managed C++, but I'm not sure.

If you want to see how to use .net serial comm to communicate with the RC have a look at seanwitte's dashboard viewer. Its written in C#, but the implementation is very similar.

If you want help with .net serial comm, or .net in general feel free to PM me.

6600gt 10-08-2007 03:20

Re: Interactive DashBoard
 
Quote:

Originally Posted by lndnny (Post 638263)
This program looks great!

Too bad team 808 is out of first for good... but we aren't giving up.
We are doing a program called the national robotics challenge and entering a robot for a grand total of 30 some dollars. With none of the limitations of FIRST, we are actually going to try to send sensor output to a laptop and do all the long calculations there, but we're having problems doing this. Would you mind answering a few questions?

Was this program created in Visual Basic using the .net framework?

If it was, can you provide some source code or provide an example on how to read data into the visual basic program? - every time I try to read input from the serial port in my test program from the RC, I get question marks.

I'm using Kevin's serial port code to send data to the computer. Our team membership currently numbers four and we are all trying to learn as much as we can.

Thanks for your time.
Dan - former team 808

It's written in C++. I don't really know C++ so the code is quite crude. If you want it, I will release the code to you. The serial port part is easy but I have no idea of Visual Basic syntax...

Make sure your baud rate on the program matches the RC's, which is 115200.

Trying to set up a communication protocol between the RC and the computer was probably one of the most time consuming parts of the whole project. I actually used a software called Free Serial Port Monitor to see every byte that entered and left the serial port. This helps you see the difference between what you believe it is sending and what it is actually sending. The software has some major bugs: feeding it too much data crashes it(ex. reading the bytes while flashing the RC will crash it). It was not that hard to freeze it but it was a valuable asset to my project. If it does start freezing go into Task Manager->Processes->Select Device Monitor->End Process. Don't try to do it by closing or ending task because it just hangs for a while. You might be able to find some better software but this was the only FREE one that I could find.

http://www.freedownloadscenter.com/P...t_Monitor.html
Go to the bottom.

Just because you are getting a question mark doesn't mean you are not getting garbage data. ? = 63 in decimal...try reading byte instead of char from the serial port.

Could you elaborate a little bit more on your goal or setup?

Lohit

lndnny 10-08-2007 13:37

Re: Interactive DashBoard
 
Wow. Thanks for the quick replies.

EHaskins - thank you for showing me that white paper. I thought I had done a thorough search on serial ports in the white papers section, but it never occurred to me to search for another dashboard viewer. :ahh:

6600gt - thank you for the program. It seems like it would help me a lot. It would be great to see what was truly being sent. To elaborate on what I'm doing: our robot is going to be a heavyweight sumo robot - 150 lbs fully autonomous. We hope to take all our sensor readings - both digital and analog - and send them to a laptop through a wireless serial transmitter. The laptop should then read the information and perform heavy math to find where the robot and the opponent are on the field. The laptop will then send pwm outputs back to the robot (within one program loop - would that be possible?). Thanks for the suggestion - I'm going to try reading bytes whenever I get the chance to.

Once again, thanks - these tips are great
Dan - 808

6600gt 10-08-2007 23:50

Re: Interactive DashBoard
 
Quote:

Originally Posted by lndnny (Post 638318)
The laptop should then read the information and perform heavy math to find where the robot and the opponent are on the field. The laptop will then send pwm outputs back to the robot (within one program loop - would that be possible?).
Dan - 808

It is possible if you can get the RC to transmit and the PC to process and transmit back all in 26.2ms! It is probably possible but the whole system will probably lag behind 1 or 2 program loops. Since you send the sensor values in the current loop and receive processed data in the next one.

lndnny 11-08-2007 20:33

Re: Interactive DashBoard
 
It works!!! - thanks for the monitoring program. Seeing what I was really sending helped a lot. :D

One to two loops behind isn't bad based on how slow the opponents are. I was surprised, there were only one or two robots there that moved over 1 fps.

Well - Thanks for the great help and sorry for hijacking your thread for a little bit
Dan - 808

Tottanka 15-08-2007 16:57

Re: Interactive DashBoard
 
OK, so i let my guy run it, and he has a problem.
[quote: programmer]
I downlaoded the binnary version, an every time i run it, it gets stuck. What's the problem/soluion?
[quote]

6600gt 16-08-2007 02:46

Re: Interactive DashBoard
 
Quote:

Originally Posted by Tottanka (Post 638887)
OK, so i let my guy run it, and he has a problem.
[quote: programmer]
I downlaoded the binnary version, an every time i run it, it gets stuck. What's the problem/soluion?
quote

I probably should know this, but I am guessing that the binary version means the .exe file?

I would love to help you but I need some more explanation as to how or when it occurs. Does it run fine without the RC connected? Does it freeze when the data starts to pour into the DataView? Does the whole program freeze or just the data flow?

If it runs with the RC NOT connected to the computer then PC has everything needed to run the program. If it freezes when the RC is connected then...
Does the RC crash?

Tottanka 16-08-2007 05:58

Re: Interactive DashBoard
 
Quote:

Originally Posted by 6600gt (Post 638942)
I probably should know this, but I am guessing that the binary version means the .exe file?

I would love to help you but I need some more explanation as to how or when it occurs. Does it run fine without the RC connected? Does it freeze when the data starts to pour into the DataView? Does the whole program freeze or just the data flow?

If it runs with the RC NOT connected to the computer then PC has everything needed to run the program. If it freezes when the RC is connected then...
Does the RC crash?

I know that the RC i ok, as it ran with the older IFI loader version.
I will get you more information on that issue today.

6600gt 24-08-2007 00:10

Re: Interactive DashBoard
 
3 Attachment(s)
Well guys, it has been a wonderful 4 years of my High School life, being part of my FIRST team, Team 226 "The Hammerheads", and this FIRST community. I have gained an inexplicable amount of knowledge and wisdom from FIRST. Robots are just toys, but the experiences gained while working on them with others is something completely different. I am in debt to the FIRST society. This project is just a minor contribution. Next week, I am going off to U of M. I don't know if I can continue working with this project or help my team. But sometime in the future, when I have settled and found myself, I hope to rejoin this community and repay my debt.

I hope some of you have gotten a chance to test the software...Remember, it is only a tool, like a lathe. Use it wisely and it will help you, the programmer, breathe a little easier. But you are "real" the programmer. Your job is to make the "perfect" code...but since there is no such thing as "perfect" code...never stop improving on it.

If you guys have any suggestions for improvement, please let me know soon. I will try my best to get the changes done before I leave.


UPDATE:
I have added a new feature, along with a few bug fixes, where the names in the text boxes about the individual pwms is saved in a text file for future memory. This "Pwm_Text.txt" is saved in the same folder as the application residence. I have updated the documentation along with the application. I have also added new "System" variable group where you can watch things like Main and Backup Battery Voltages, along with other things, in the DataView. I have detailed it under the "Feature" section in the updated DashBoard_readme.doc. Note: This require RC code update as well.

NOTE: On the top right corner of the application I put "V 0.2" just to point out that this one is newer than the old one.

Thanks everyone for your support and input.

caffel 27-08-2007 15:17

Re: Interactive DashBoard
 
Dataview
Joystick
Text.

Pls keep up the chat & work on VEX dashboard.
VEX students need this even more than the FRC students (they are younger).

Thanks,
Charlie Affel, mentor

6600gt 27-08-2007 16:46

Re: Interactive DashBoard
 
Quote:

Originally Posted by caffel (Post 640160)
Dataview
Joystick
Text.

Pls keep up the chat & work on VEX dashboard.
VEX students need this even more than the FRC students (they are younger).

Thanks,
Charlie Affel, mentor

I will try my best.

What do you mean by Text and what would you like change/add in DataView?

Most VEX teams use labview right? Can anyone provide me with the source code for the VEX system?

caffel 27-08-2007 19:16

Re: Interactive DashBoard
 
Pls recognize that we do appreciate the dashboard(s).
I was responding to the question of what to prioritize for next developments.
I'm not sure what was meant by text, I just value the others more.
For our purposes, we need to examine a time series of sensor and other values.
We don't have Labview and we need a dashboard.
To teach, we need to measure and view everything about the robot's internals.
Some people can't understand w/o that. Almost everyone is a better debugger with more information about what the robot was sensing (and doing) when a failure occurred.

CA

6600gt 28-08-2007 02:19

Re: Interactive DashBoard
 
Quote:

Originally Posted by caffel (Post 640196)
Pls recognize that we do appreciate the dashboard(s).
I was responding to the question of what to prioritize for next developments.
I'm not sure what was meant by text, I just value the others more.
For our purposes, we need to examine a time series of sensor and other values.
We don't have Labview and we need a dashboard.
To teach, we need to measure and view everything about the robot's internals.
Some people can't understand w/o that. Almost everyone is a better debugger with more information about what the robot was sensing (and doing) when a failure occurred.

CA

LOL...I forgot I put the 3 choices to choose from and rank!

Thank you for your appreciation. I would love to help you but...
The problem is I have never worked with the VEX system, nor do I have access to it for testing...basically, I need some ones help to get it going!

Can you or someone else explain to me how the serialport system works on the VEX? If it doesn't have Kevin Watson's circular queue system then one has be developed for the dashboard to work with it. I am pretty sure that I can easily setup a working code for MPLAB but EasyC is another thing...

-Lohit

SamC 03-09-2007 18:50

Re: Interactive DashBoard
 
Quote:

Originally Posted by caffel (Post 640196)
To teach, we need to measure and view everything about the robot's internals.
Some people can't understand w/o that. Almost everyone is a better debugger with more information about what the robot was sensing (and doing) when a failure occurred.

This isn't a "good" answer to that request, but why not use EasyC's built in terminal window and graphic display? You could setup a debug function that would output the different values and such, and put it on a timer. Here is a rough idea of how you could do that.
Code:

void Debug ( void )
{
  StartTimer ( DebugTimer ) ; //DebugTimer set as 1
  DebugClock = GetTimer ( DebugTimer ) ;
    if ( DebugClock >= 26 ) //26ms
    {
      PresetTimer ( DebugTimer , 0 ) ; //reset timer to 0
      PrintToScreen ( "SENSOR VALUE IS: %d\n" , (int)SENSORvariable ) ; //output "SENSOR VALUE IS:" + the sensor value (SENSORvariable)
    }
}

Its simple, and not nearly as 'flashy' as a dashboard program, but it will get the job done... Good luck!

6600gt 20-09-2007 22:07

Re: Interactive DashBoard
 
Hi everyone,

It has been a while since the DashBoard has been released. I was just wondering if anyone had a chance to test it? If you did, what do you think about it?

Thanks

NOTE: Remember there is a newer version, V0.2, out! Posted in the second page

Tottanka 21-09-2007 10:32

Re: Interactive DashBoard
 
Quote:

Originally Posted by 6600gt (Post 643089)
Hi everyone,

It has been a while since the DashBoard has been released. I was just wondering if anyone had a chance to test it? If you did, what do you think about it?

Thanks

NOTE: Remember there is a newer version, V0.2, out! Posted in the second page

We used it and had some problems with it.
I will give you some more feedback from our programing team if u wish...

6600gt 21-09-2007 20:54

Re: Interactive DashBoard
 
Quote:

Originally Posted by Tottanka (Post 643135)
We used it and had some problems with it.
I will give you some more feedback from our programing team if u wish...

First of all, thank you very much for trying out the software.

Secondly, I would love to here your experience. What kind of problems did you have?

-Lohit


All times are GMT -5. The time now is 01:53.

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