Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Accelerometer Example of New Crio (http://www.chiefdelphi.com/forums/showthread.php?t=99772)

baronep 10-01-2012 21:06

Accelerometer Example on New Crio
 
Does anyone know if the ADXL345 SPI example works on the new Crio? I tried to run it and it gave me an error along the lines of 'I can't find DIO module 2' Any ideas?

Alan Anderson 10-01-2012 23:09

Re: Accelerometer Example of New Crio
 
The obvious question is: do you actually have a second DIO module installed in your cRIO? It would go in slot 4 of a 4-slot cRIO-II, or slot 6 of an 8-slot cRIO.

The first DIO module is number 1, even though it's actually installed in slot 2. That's a different way of numbering things from previous years, and I expect it'll trip up a few teams.

baronep 10-01-2012 23:20

Re: Accelerometer Example of New Crio
 
That is what i suspected as well, so I added a control to select crio slot (which defaulted to DIO2 BTW) and changed it to 1 but i received the same error. I know thats not a lot to go on, I will do some more investigative work tomorrow afternoon (how does school always seem to get in the way).

jhersh 11-01-2012 03:22

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by baronep (Post 1102184)
That is what i suspected as well, so I added a control to select crio slot (which defaulted to DIO2 BTW) and changed it to 1 but i received the same error. I know thats not a lot to go on, I will do some more investigative work tomorrow afternoon (how does school always seem to get in the way).

You selected Digital Module 1 and still got an error that said you have no Digital Module 2? Maybe you didn't actually change the value. Did you make it a control on the panel of a VI and then deploy it? Did you re-build?

-Joe

Alan Anderson 11-01-2012 08:15

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by baronep (Post 1102184)
...I added a control to select crio slot (which defaulted to DIO2 BTW)...

"DIO2" sounds like a pin number, not a module number. You might have wired the control up to the wrong terminal on the Open function.

Doug Norman 11-01-2012 09:16

Re: Accelerometer Example of New Crio
 
What Joe said to do should work - wire a control to the DIO Module terminal and set it to Digital Module 1. It looks to me like we have a "bug" in our example. By default the ADXL345 SPI Open.vi should have Digital Module 1 as default. We should probably also wire and show that on the example front panel. I will fix this.

billbo911 11-01-2012 12:36

Re: Accelerometer Example of New Crio
 
Sorry if this has been covered elsewhere, I could not find the info we are looking for and I am not versed enough in LabView to figure it out.....yet. ;)

We can figure out how to run the I2C ADXL345 example, but where we are struggling is how to go about integrating the vi's into our robot project.
As far as we can see, the vi's to add the ADXL345 I2C are not available anywhere in the Functions pallet.

Can someone please point us in the right direction to help us figure out how to add support for the ADXL345 via I2C to our project?

baronep 11-01-2012 14:54

Re: Accelerometer Example of New Crio
 
In the project explorer in the example project, there is a folder called ADXL driver. Just copy these VI's to your robot project

NeatNit 11-01-2012 17:39

Re: Accelerometer Example of New Crio
 
I've spent half of yesterday and all of today trying to get the ADXL345 working. I've tried both examples using two cRIOs, and nothing works. I did change the DIO module constant/control to 1 instead of 2. I did make sure the sensor is wired correctly. I see no reason why it wouldn't be working.

I posted my question here after somehow missing this thread.


Please help! :(

Joe Ross 12-01-2012 15:59

Re: Accelerometer Example of New Crio
 
There's updated files for the SPI ADXL345 example attached to the firstforge bug report. http://firstforge.wpi.edu/sf/go/artf1432

NeatNit 20-01-2012 16:21

Re: Accelerometer Example of New Crio
 
The fixed SPI example still doesn't work for me. I've finally gotten I2C working though, apparently it only works with the flat cable.

jhersh 20-01-2012 16:28

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by NeatNit (Post 1109873)
The fixed SPI example still doesn't work for me. I've finally gotten I2C working though, apparently it only works with the flat cable.

Not sure what "flat cable" you are talking about. If it is the DB-37 cable from the kit, then it "only works" if you fix the cable end to not be reversed.

NeatNit 20-01-2012 16:31

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by jhersh (Post 1109875)
Not sure what "flat cable" you are talking about. If it is the DB-37 cable from the kit, then it "only works" if you fix the cable end to not be reversed.

Yes, I meant that flat cable the replaced the thick round ones in previous years. What I meant to say is that the ADXL345 doesn't work with the old cable, in other words only works with the newer flat one. (our cable needed to be flipped but we already did that)

jhersh 20-01-2012 16:33

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by NeatNit (Post 1109876)
Yes, I meant that flat cable the replaced the thick round ones in previous years. What I meant to say is that the ADXL345 doesn't work with the old cable, in other words only works with the newer flat one. (our cable needed to be flipped but we already did that)

It works with my thick round one. Maybe yours is just damaged.

-Joe

NeatNit 20-01-2012 16:37

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by jhersh (Post 1109879)
It works with my thick round one. Maybe yours is just damaged.

-Joe

Taken from this thread: http://www.chiefdelphi.com/forums/sh...d.php?t=100324

Quote:

Originally Posted by ggorsuch (Post 1106979)
Got it working!
Used the flat db37 cable included in this years Kop, instead of the old round one.

Quote:

Originally Posted by abrightwell (Post 1107073)
That's what we just did and sure enough it worked. Makes sense as when we Ohm'ed it out, pin 1 went to pin 15 on the other end. I didn't think to check the KoP website, but I'm definitely going to check it out. It still seems like a curious situation that the flat works for the accelerometer but the round doesn't. :-/ Oh well, I'll take it at face value for now.

Thanks for the follow up!


Sure, these are Java, but I'm still seeing a recurring pattern....

Joe Ross 20-01-2012 16:44

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by jhersh (Post 1109875)
Not sure what "flat cable" you are talking about. If it is the DB-37 cable from the kit, then it "only works" if you fix the cable end to not be reversed.

Several people have reported it worked with the fixed cable in this year's kit, but not the DB37 from a previous year's kit.

Looking through previous year's KOP lists, it looks like there have been several sources. In 2009 and 2010, it was a cablestogo pn 02688. Last year it was SF Cable pn D720-03. Maybe one of these was missing a pin that related to I2C.

zlong 22-01-2012 14:00

Re: Accelerometer Example of New Crio
 
We also struggled with the ADXL345 in I2C mode. Running the included LabVIEW example the device worked intermittently. I looked at SDA and SCL with an O-Scope and noticed they where kind of floating when communication had error-ed out. My fix for this was to place a 100 ohm pull up resistor on both SDA and SCL. This made the ADXL345 perform wonderfully on the I2C bus. We have implemented this fix on our robot and so far have been very happy with the ADXL345's performance.

Joe Ross 22-01-2012 14:22

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by zlong (Post 1111200)
We also struggled with the ADXL345 in I2C mode. Running the included LabVIEW example the device worked intermittently. I looked at SDA and SCL with an O-Scope and noticed they where kind of floating when communication had error-ed out. My fix for this was to place a 100 ohm pull up resistor on both SDA and SCL. This made the ADXL345 perform wonderfully on the I2C bus. We have implemented this fix on our robot and so far have been very happy with the ADXL345's performance.

100 ohms seems like a lot for I2C to me. The [url=http://www.usfirst.org/sites/default/files/uploadedFiles/Robotics_Programs/FRC/Game_and_Season__Info/2012_Assets/Digital%20Sidecar.pdf]Digital Sidecar is supposed to have 3.16k on SDA and SCL. Can you check if those pullups are working?

Doug Norman 23-01-2012 09:15

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by billbo911 (Post 1102599)
We can figure out how to run the I2C ADXL345 example, but where we are struggling is how to go about integrating the vi's into our robot project.

Can someone please point us in the right direction to help us figure out how to add support for the ADXL345 via I2C to our project?

You might take a look at the tutorial. From the LabVIEW Getting Started Window, click Tutorials, and then choose Tutorial 7 - Integrating Examples into Robot Code.

billbo911 23-01-2012 09:37

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by Doug Norman (Post 1111766)
You might take a look at the tutorial. From the LabVIEW Getting Started Window, click Tutorials, and then choose Tutorial 7 - Integrating Examples into Robot Code.

Thanks Doug, I'll have our programmers do this today.
I believe I have a handle on it now, but I want them to understand the process. So, between the tutorial and my experience, we should be if fine shape!

Gary Bonner 26-01-2012 00:35

Re: Accelerometer Example of New Crio
 
1 Attachment(s)
My Labview Getting Started window does not list any tutorials. Can they be found anywhere else?

Alan Anderson 26-01-2012 01:06

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by Gary Bonner (Post 1113725)
My Labview Getting Started window does not list any tutorials.

It looks like you might not have installed the NI LabVIEW update linked from the Kit of Parts page.

rwood359 26-01-2012 01:12

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by jhersh (Post 1109879)
It works with my thick round one. Maybe yours is just damaged.

-Joe

We couldn't communicate on the I2C bus using the round cable. Switching to the flat cable fixed the problem.

jhersh 26-01-2012 15:21

Re: Accelerometer Example of New Crio
 
Quote:

Originally Posted by rwood359 (Post 1113738)
We couldn't communicate on the I2C bus using the round cable. Switching to the flat cable fixed the problem.

Good to know. Seems like there must have been a bad set of cables one of the previous years. I'm a little surprised that teams didn't complain about this in the year the bad cables were included. I guess no team tried to use I2C in that year. Given that this is the first year with a challenge that benefits from an accelerometer, I guess that makes sense.

-Joe


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

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