Go to Post One button, ten copyrights, you do the math. - StephLee [more]
Home
Go Back   Chief Delphi > ChiefDelphi.com Website > Extra Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 13-03-2015, 13:24
KMBruggeman KMBruggeman is offline
Registered User
FRC #3737 (RotoRaports)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Goldsboro, NC
Posts: 8
KMBruggeman is an unknown quantity at this point
Re: paper: Driver Station Encoder Support using the TI LaunchPad

Thanks again for the reply. We are in a frenzy as well as our regional is next week.

That being said from a Labview post programming of the Launchpad, do you know of anyway I can read what the Launchpad is outputting to the USB port of the driver station (pre-processing).

Would I just use a USB sniffer? Additionally, IIRC if I put the reading routine in a custom dashboard I should be able to run it and check it's operation without having to connect the robot (real or otherwise simulated) right?

I spent a good amount of time on it last night and may post some snippets later on if I don't make more progress after looking at the user guide.

Cheers!
Reply With Quote
  #2   Spotlight this post!  
Unread 13-03-2015, 14:06
ayeckley's Avatar
ayeckley ayeckley is offline
Registered User
AKA: Alex Yeckley
FRC #2252 (Mavericks)
Team Role: Mentor
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Sandusky, OH
Posts: 268
ayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond repute
Re: paper: Driver Station Encoder Support using the TI LaunchPad

Quote:
Originally Posted by KMBruggeman View Post
do you know of anyway I can read what the Launchpad is outputting to the USB port of the driver station (pre-processing)
I'm not sure I understand the question. Are you asking if there's a way to access the raw USB datastream from the LaunchPad, without going thru the roboRio first? I'm afraid I don't know the answer to that. My recollection is that in past years this was not possible, although we never attempted exactly what you are describing (since the Enhanced I/O gave us everything we needed). With the new control system architecture that may have changed. If it could be done I'm confident it would require writing a Custom Dashboard (as I think you are suggesting).
__________________

Reply With Quote
  #3   Spotlight this post!  
Unread 13-03-2015, 14:30
KMBruggeman KMBruggeman is offline
Registered User
FRC #3737 (RotoRaports)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Goldsboro, NC
Posts: 8
KMBruggeman is an unknown quantity at this point
Re: paper: Driver Station Encoder Support using the TI LaunchPad

That is what I was thinking - and since I have a custom dashboard was attempting to just put the custom Labview code with indicators on the "custom" tab of the dashboard to output the buttons and the encoder count.

I figured since I could see the buttons lighting up at the bottom of the driver station and in my custom dashboard I should be able to read that input without actually running "main.vi" to either a live robot or a simulated robot (to help out my old and wheezing processor).

I'm not seeing the button outputs though and when I tried to tie into the data stream that is on the standard dashboard project I was not getting anything from the Launchpad (My process is 1 encoder then modify to get a 2nd and if I have any hair and patience left maybe a 3rd).

That being said I am looking to see if there's a way I can "see" what's happening along the process to troubleshoot. (Similar to my cheap way of putting "Alert('here');" when doing poor man's javascript troubleshooting to see where the process is breaking down.

I see three critical places I would like to check thus far.

1 - Can I tell what software is actually loaded on the Launchpad? (Validate the software install) Currently when I use the little debug button I am getting HW stops where I have a steady red LED and I have to restart the Launchpad via unplugging/plugging it in. When setting the OPTION2 and OPTION3 flag it does show with the appropriate # of buttons afterwards via a Labview Custom DB.

2 - Is the Launchpad actually calculating a value for "encoder_count" and what is it? (Can I see this by using a tool in CCS?)

3 - What is the Launchpad sending via "gamepadReportTX.buttons"?
(Could I see this on my laptop with another tool? I would guess that I could use the LabView Custom Dashboard for this)

I know that's a bit lengthy but hopefully clears things up.

Also if I wanted to use say P1.3 and P1.2 would I need to delete them from the "Indicators" section of "OPTION1" in hal.c and replace two of the dummy inputs after P1.4 in the buttons section? e.g.

#define NUM_BUTTONS 32
#define NUM_INDICATORS 9

{GPIO_PORT_P1, GPIO_PIN4},
{GPIO_PORT_P1, GPIO_PIN3},
{GPIO_PORT_P1, GPIO_PIN2},
... dummy inputs ...

Thanks again for explaining this. If it would be easier I can provide a phone #.

Kurt
Reply With Quote
  #4   Spotlight this post!  
Unread 13-03-2015, 14:54
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: paper: Driver Station Encoder Support using the TI LaunchPad

I do not know if the HID data is transmitted from the driver station to the dashboard but I do not think it is. What are you planning on using the encoders for?

Another way you can consider for transmitting the data is to use serial on the dashboard and keep the HID to the driver station. The LaunchPad has a USB hub, so the debugger chip can also act as a USB <--> Serial bridge, and you can look at both the HID and the serial stream at the same time. You will just need to write software on the dashboard to detect and decode the serial stream.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #5   Spotlight this post!  
Unread 13-03-2015, 15:00
KMBruggeman KMBruggeman is offline
Registered User
FRC #3737 (RotoRaports)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Goldsboro, NC
Posts: 8
KMBruggeman is an unknown quantity at this point
Re: paper: Driver Station Encoder Support using the TI LaunchPad

The plan is to use it for arm control. The robot has the equivalent of a human arm from the shoulder to the wrist with the same joints. The plan is to have a scale version at the driver station to use to control it's movement so it's less clumsy than say driving a backhoe. (sp?)

I'll have to take a look at the reading in the serial stream (I assume it's more complicated than the standard create a constant for "USB0" ...)
Reply With Quote
  #6   Spotlight this post!  
Unread 13-03-2015, 16:00
KMBruggeman KMBruggeman is offline
Registered User
FRC #3737 (RotoRaports)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Goldsboro, NC
Posts: 8
KMBruggeman is an unknown quantity at this point
Using the A x-axis data stream

As I was meandering through the code this afternoon I had this random thought. It looks the axis values are defined in "USB_gamepad.h" source such that they are contained in the data structure "USB_GamepadReportTx".

https://github.com/TI-FIRST/MSP430-G.../USB_gamepad.h

If I look at that it appears that *.ax, *.ay, etc are all 16bit integers. Could I modify the code from https://github.com/TI-FIRST/MSP430-G...b/master/hal.c (line 517)

from: "gamepadReportTx.ax = Convert8Bit(ADC12_A_getResults(ADC12_A_BASE, ADC12_A_MEMORY_12));"
to "gamepadReportTx.ax = encoder_count;" as that would allow me in essence to have up to 8 x 16BIT signed integers in my HID data stream?

(gamepadReportTx is defined on line 151 to type USB_GamepadReportTX from the first linked file.)

I would then just need to see how LV views/processes that data converting it into a float with the range -1.0 to 1.0 but my guess would be by dividing it by 2^15 ...

Am I totally off base here or is my lack of sleep starting to pay off?
Reply With Quote
  #7   Spotlight this post!  
Unread 13-03-2015, 16:12
ayeckley's Avatar
ayeckley ayeckley is offline
Registered User
AKA: Alex Yeckley
FRC #2252 (Mavericks)
Team Role: Mentor
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Sandusky, OH
Posts: 268
ayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond repute
Re: Using the A x-axis data stream

Quote:
Originally Posted by KMBruggeman View Post
If I look at that it appears that *.ax, *.ay, etc are all 16bit integers. Could I modify the code from https://github.com/TI-FIRST/MSP430-G...b/master/hal.c (line 517)

from: "gamepadReportTx.ax = Convert8Bit(ADC12_A_getResults(ADC12_A_BASE, ADC12_A_MEMORY_12));"
to "gamepadReportTx.ax = encoder_count;" as that would allow me in essence to have up to 8 x 16BIT signed integers in my HID data stream?
I believe that would work.
__________________

Reply With Quote
  #8   Spotlight this post!  
Unread 13-03-2015, 16:46
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: paper: Driver Station Encoder Support using the TI LaunchPad

Quote:
Originally Posted by KMBruggeman View Post
The plan is to use it for arm control. The robot has the equivalent of a human arm from the shoulder to the wrist with the same joints. The plan is to have a scale version at the driver station to use to control it's movement so it's less clumsy than say driving a backhoe. (sp?)
Are you are using an incremental encoder to develop this? How are you planning on getting an absolute value for the arms?
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #9   Spotlight this post!  
Unread 13-03-2015, 16:51
ayeckley's Avatar
ayeckley ayeckley is offline
Registered User
AKA: Alex Yeckley
FRC #2252 (Mavericks)
Team Role: Mentor
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Sandusky, OH
Posts: 268
ayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond reputeayeckley has a reputation beyond repute
Re: paper: Driver Station Encoder Support using the TI LaunchPad

Big Picture Thought first: If you are intending to control a jointed arm, it might make more sense to use potentiometers and the analog inputs on the Launchpad instead of quadrature encoders. You wouldn't have to modify the default FRC Launchpad code to do that. You could just go directly to the Ax, Ay, Az etc. inputs.

Quote:
Originally Posted by KMBruggeman View Post
I figured since I could see the buttons lighting up at the bottom of the driver station and in my custom dashboard I should be able to read that input without actually running "main.vi" to either a live robot or a simulated robot (to help out my old and wheezing processor).
Right, the encoders will still be "live" even if the roboRio code is not running, and you should see flashing virtual LEDs on the DS corresponding to the buttons that have been "stolen" for the encoder (unless you remove them from the "raw" button datastream, which we didn't). We've found that seeing the button states is very useful for diagnostic purposes.

Quote:
I'm not seeing the button outputs though and when I tried to tie into the data stream that is on the standard dashboard project I was not getting anything from the Launchpad.
That sounds consistent with previous years then; you'd may have to transmit that data back to a Custom Dashboard from the roboRIO using the Smart Dashboard/Network Table feature.

Quote:
1 - Can I tell what software is actually loaded on the Launchpad? (Validate the software install) Currently when I use the little debug button I am getting HW stops where I have a steady red LED and I have to restart the Launchpad via unplugging/plugging it in.
Perhaps a breakpoint is set? Unlike the roboRIO, code on the Launchpad doesn't/can't run in RAM - just Flash memory. Whenever you hit Debug, it's overwriting the old Flash contents with the new. About the only way to know what's currently loaded into Flash would be via the checksum.
Quote:
2 - Is the Launchpad actually calculating a value for "encoder_count" and what is it? (Can I see this by using a tool in CCS?)
In theory you should be able to see the value using the Variables tab in Debug mode, but for some reason that didn't work for us (even thought it's declared as a STATIC). What you might try instead is setting breakpoints at places of interest within the ISR to see what it "thinks" it's doing.
Quote:
Could I see this on my laptop with another tool? I would guess that I could use the LabView Custom Dashboard for this
Dunno, sorry.

Quote:
Also if I wanted to use say P1.3 and P1.2 would I need to delete them from the "Indicators" section of "OPTION1" in hal.c and replace two of the dummy inputs after P1.4 in the buttons section?
I don't have the info re: the original OPTION1 configuration handy at the moment, but in general yes - if OPTION1 configures those as outputs (indicators) they you'd need to change them to inputs (buttons) instead. Maybe that's what's going wrong.

I've got your email address; I'll try to drop you a line later tonight. It might be best if you .zip up your code for me to take a look at. I'll bring a Launchpad and two encoders home to work with.
__________________


Last edited by ayeckley : 13-03-2015 at 16:54. Reason: Clarified the question I was trying to answer
Reply With Quote
  #10   Spotlight this post!  
Unread 13-03-2015, 22:47
KMBruggeman KMBruggeman is offline
Registered User
FRC #3737 (RotoRaports)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Goldsboro, NC
Posts: 8
KMBruggeman is an unknown quantity at this point
Re: paper: Driver Station Encoder Support using the TI LaunchPad

I also was pushing for the potentiometer solution but it met with much resistance based upon the idea that it would be less precise.

In any case I have posted the code in .zip file here. I commented out some ideas I had and tried to run it as pure to your example.

https://onedrive.live.com/redir?resid=94CA3E1384343D7D!1159&authkey=!AM07Cq1 eGOhWI68&ithint=file%2czip

Here's some screen shots below of the HW Breakpoints

https://onedrive.live.com/redir?resi...nt=photo%2cPNG

https://onedrive.live.com/redir?resi...nt=photo%2cPNG

kmbworkemail@gmail.com
Reply With Quote
  #11   Spotlight this post!  
Unread 14-03-2015, 09:18
KMBruggeman KMBruggeman is offline
Registered User
FRC #3737 (RotoRaports)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Goldsboro, NC
Posts: 8
KMBruggeman is an unknown quantity at this point
Re: paper: Driver Station Encoder Support using the TI LaunchPad

I was planning on resetting to a known home position to re-zero required. When doing so I would re-zero the encoders on the robot and essentially us the current encoder count from the launchpad as the new 0 ref point.
Reply With Quote
  #12   Spotlight this post!  
Unread 14-03-2015, 10:20
Steven Smith Steven Smith is offline
Registered User
FRC #3005 (RoboChargers)
Team Role: Mentor
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Dallas, TX
Posts: 212
Steven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond reputeSteven Smith has a reputation beyond repute
Re: paper: Driver Station Encoder Support using the TI LaunchPad

Quote:
I also was pushing for the potentiometer solution but it met with much resistance
__________________
2013 - 2017 - Mentor - Robochargers 3005
2014 - 2017 - Mentor - FLL 5817 / 7913
2013 - Day I Die - Robot Fanatic
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 18:35.

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