Go to Post You won't find this in a manual anywhere but you will need COUGH DROPS!! If you haven't started losing your voice by Friday afternoon, you aren't getting the full experience. - wendymom [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-03-2012, 22:21
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Arduino using WPI library?

Hello -

I'm going to be using an Arduino for a side project, and it's my first time using an Arduino with LabView.

Does anyone know if I'll be able to use the WPI Robotics LabView library with an Arduino?

Thanks, and sorry for the off-topic forum post!
Reply With Quote
  #2   Spotlight this post!  
Unread 01-03-2012, 22:37
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

I might be wrong, but I'm fairly certain that the WPI Robotics Library is developed specifically for FIRST, and since FIRST does not use the Arduino, it's not supported.

However, check out the LabVIEW Interface for Arduino. It's a Arduino program that communicates over serial to LabVIEW. It's pretty neat, but I would NOT use it for large scale robotics where safety and control is critical, as there are no watchdogs or safety configurations built in.

Check it out:
https://decibel.ni.com/content/group...ce-for-arduino
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #3   Spotlight this post!  
Unread 01-03-2012, 22:39
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

I'm not sure if you have purchased an Arduino board yet, but if you haven't, I'd try to steer you towards the Uno.

The Mega Rev2 board has a bug with serial communication, and LIFA has to run at a much slower baud rate of 9600 compared to the 115,200 baud rate of the Uno.

Of course, you lose quite a bit of functionality with the Uno compared with the Mega 2560.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #4   Spotlight this post!  
Unread 01-03-2012, 22:46
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Arduino using WPI library?

We're building an 8' blimp, so safety isn't as prevalent as if we were building an ankle biter.

I know it's not officially supported, but I thought it might work to some extent. It'd be convenient, but I'm sure it won't work the way it should.

I've put an order in for the Mega R3. Do they have the same serial issue?
Reply With Quote
  #5   Spotlight this post!  
Unread 01-03-2012, 22:54
Garrett.d.w's Avatar
Garrett.d.w Garrett.d.w is offline
Build Lead
FRC #2733 (The Pigmice)
Team Role: Alumni
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Portland
Posts: 318
Garrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to beholdGarrett.d.w is a splendid one to behold
Re: Arduino using WPI library?

Quote:
Originally Posted by DominickC View Post
I've put an order in for the Mega R3. Do they have the same serial issue?
I own a Mega R3 and I haven't had any issues with it.

I recommend trying the native language, start with this sight for some very good robotics oriented libraries.

http://www.billporter.info/
__________________
"A mind once stretched by a thought will never regain it's original dimensions."

Optimists think the glass is half full.
Pessimists think the glass is half empty.
Engineers realize it's twice as big as it needs to be.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-03-2012, 23:07
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Arduino using WPI library?

That's good news, thanks.

I'll probably experiment once it arrives. I'll attempt to use the WPI library, and if it fails, I'll be fine using the Arduino LabView Toolkit or the native Arduino language.

I'll post an update once I make any progress.
Reply With Quote
  #7   Spotlight this post!  
Unread 02-03-2012, 07:35
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

Quote:
Originally Posted by DominickC View Post
We're building an 8' blimp, so safety isn't as prevalent as if we were building an ankle biter.

I know it's not officially supported, but I thought it might work to some extent. It'd be convenient, but I'm sure it won't work the way it should.

I've put an order in for the Mega R3. Do they have the same serial issue?
AFAIK they don't. You'll have to go in and manually change the baud rate in the LIFA package, which isn't hard to do.

I wouldn't recommend this for a blimp though because there is no failsafe. If you lose communication, then your blimp will be on the run. Robots on the run are much easier to catch and disable than a flying blimp.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #8   Spotlight this post!  
Unread 02-03-2012, 10:36
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

I'm not sure how much experience you have, or what hardware you have available, but I've done some playing around with the VEX controller and controlling outputs using LabVIEW... but you have to experienced with C programming to get it working.

It was a short lived project, as I ran out of time on it, but this is how it worked and how it was developed.

I was on a college level robotics team for a while (before college absolutely crushed my life into oblivion), and I took an old IFI robot controller, and wrote a control loop that had constant communication over the RS-232 programming port.

Basically, the system was made very easy to develop (and get Kevin Watson's code from kevin.org).

All the PWMs are 8-bit unsigned, which ranges from 0-255... guess what else ranges from 0-255... the ASCII Table, which means I can control each motor with a simple character. What I did was package up all the PWM channels (16 total into 16 characters. Then there were technically 16 relay outputs (8 FWD, 8 REV) which can be sent in 2 8-bit characters. I didn't have any 'digital' outputs. I just used the relay outputs for this. So, to control all 16 PWM channels and all 8 relay outputs, it took a total of 18 characters.

At the time, it seemed like a great idea to do it that way, but let me tell you, it's more trouble than it sounds. Figure out how to convert it all to HEX, and it'll make the whole serial communication less of a headache when using special characters such as line feed, break, etc... It'll double your string size, but in reality, it's still going so stupid fast that you won't notice it and it's still plenty fast to make it seamless. Anyway, terminate your lines with a new line '\n' Once your program receives the new line, check for the number of characters, and if it's consistent, then process the data. If it's not equal, don't process it.

After processing, it should send back sensor data from the digital input and analog input.

You'll also want to implement a fail safe if for some reason, you lose control... not that it would ever happen at the worst possible time or location. You should set the servos to point the fans to come back to the ground, right? (Implement a Watchdog).

I can send you the code I have, but it's not complete by any means, and I don't even remember how functional it was.

It's a more complicated project that you're anticipating it to be. It's doable, but I would seriously consider not using LabVIEW as a basis. C isn't too hard to learn, and they give you a good starting point for it. You can try Arduino, but you should make your own communication interface if you want to use LabVIEW.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #9   Spotlight this post!  
Unread 02-03-2012, 15:36
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Arduino using WPI library?

Hmm, alright. We're going to need a higher level of control over PWM output to our motors than a simple character. I was hoping to be able to hook up a joystick and read values off of it. This is pretty much a requirement for the project, we're going to need joysticks.

In the event of communication/power loss, we've designed the blimp to be able to coast downward at a safe speed so as to not hurt anyone or damage the airship too much. So I'd have all motor outputs be 0.

I don't have any experience with C, but I've looked at a bit of it and feel like I'd be able to pick it up. I can also learn the Arduino language. I don't know if there are any libraries for my project, but hopefully I'll be able to learn enough to do what I want to do.

Of course, I might as well try to use something off of the WPI library before I discredit it all together. It might work, but I'm certainly not reliant on it or LabView.

EDIT: If I were to use C, would I be able to use the WPI C++ Robotics library?

Last edited by DominickC : 02-03-2012 at 15:47.
Reply With Quote
  #10   Spotlight this post!  
Unread 02-03-2012, 16:55
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

Quote:
Originally Posted by DominickC View Post
Hmm, alright. We're going to need a higher level of control over PWM output to our motors than a simple character. I was hoping to be able to hook up a joystick and read values off of it. This is pretty much a requirement for the project, we're going to need joysticks.

In the event of communication/power loss, we've designed the blimp to be able to coast downward at a safe speed so as to not hurt anyone or damage the airship too much. So I'd have all motor outputs be 0.

I don't have any experience with C, but I've looked at a bit of it and feel like I'd be able to pick it up. I can also learn the Arduino language. I don't know if there are any libraries for my project, but hopefully I'll be able to learn enough to do what I want to do.

Of course, I might as well try to use something off of the WPI library before I discredit it all together. It might work, but I'm certainly not reliant on it or LabView.

EDIT: If I were to use C, would I be able to use the WPI C++ Robotics library?
You can only use the WPI Library for the CompactRIO basically. It like "trying to install MS Word on Linux. It just won't work."
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #11   Spotlight this post!  
Unread 02-03-2012, 23:05
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Arduino using WPI library?

Hmm, that's a shame. I guess I'll go library hunting now!

EDIT: I've taken a look at the WPI Joystick and Camera palate, and I don't see anything which would restrict the platform to the FRC cRIO, however I believe the Camera palate will only work with the Axis M1011 or 206.

Last edited by DominickC : 03-03-2012 at 19:27.
Reply With Quote
  #12   Spotlight this post!  
Unread 05-03-2012, 11:07
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

So I haven't forgotten about you. I've been playing with my Arduino Mega 2560 over the weekend. I got away from the LabVIEW Interface for Arduino because of its various glitches, speed, etc... The Arduino is actually really easy to program. I was told this many times, but I never really tried it out.

It has the power of C++ with the simplicity of the Basic STAMP from Parallax. There's tons of open source code and libraries available, so you can probably find a project where someone implemented an Arduino in a blimp.

As far as communication and control goes, you can still use LabVIEW. You'll have to develop your own communication protocol for it, but it shouldn't be too bad.

Some things to keep in mind. It's usually considered good practice to always include some type of a sync word, meaning that you have a number that increments with each packet of data you send. That way, if you detect a packet out of order (number sent was less than last packet), you'll trash it.

I've been using the BlueSMiRF RP-SMA. There's little configuration to get it working fairly well. I haven't found the max distance yet, but to note, this isn't FCC Legal, as they have changed the antenna configuration.

Quote:
Because we have changed the antenna configuration on the Bluetooth module, the FCC certification is no longer valid. But the module is completely suitable and legal for all home, hobby, and research applications.
I find the best way to send data is using a new line '\n' (ASCII DEC 10 or HEX 0xA) as the termination character. You can create an event driven while loop in LabVIEW using the termination character. On the Arduino side, you'll have the SerialEvent() function, which is triggered on a serial receive event. You can then check to see if the newline '\n' character was sent, and if it was, then process your data.

Here's the format I would use:

"[SYNC_WORD_32_BITS][MOTOR1_VALUE_8_BITS][MOTOR2_VALUE_8_BITS]...[MOTORN_VALUE_8_BITS][DIGITAL_OUTPUTS_GROUP_8_BITS]...[DIGITAL_OUTPUTS_8_BITS][CONTROL_WORD_FOR_SPECIAL_FUNCTIONS]\n"

For receiving back data, the format will be very similar. You'll have a sync word and sensor values. You'll want to look at an ASCII table, and you should note that sending over raw data values is a no-no for the BlueSMiRF unless you format it properly. You'll have data loss, as it doesn't pass through some values. If one of your sensors sends back a 10, then you'll trigger it to send the data. Try to convert all of your sensor values to ASCII text and ASCII number values. It uses more bandwidth, but it should still be relatively fast.

Let me know if you have any questions. The best way to get started with the Arduino is to just get started. Play with it, send numbers to it, try to echo back those numbers, then add numbers. Make an LED turn on when you send it a center character, and make it turn off if you send another one.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #13   Spotlight this post!  
Unread 06-03-2012, 18:10
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Arduino using WPI library?

Gearing up for WPI, will have more time to invest into this project after.

I was planning on using the Ethernet shield to plug it into a router configured to act as an Access Point, and pump info to the Arduino via TCP/UDP. Will this suit my need?

I had my school pay for the Arduino, so I'm waiting on whenever they place the order in...unfortunately, nothing has come to my doorstep yet.
Reply With Quote
  #14   Spotlight this post!  
Unread 06-03-2012, 22:55
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

Quote:
Originally Posted by DominickC View Post
Gearing up for WPI, will have more time to invest into this project after.

I was planning on using the Ethernet shield to plug it into a router configured to act as an Access Point, and pump info to the Arduino via TCP/UDP. Will this suit my need?

I had my school pay for the Arduino, so I'm waiting on whenever they place the order in...unfortunately, nothing has come to my doorstep yet.
I looked at the Ethernet shield library, and it all seemed pretty easy, but I never tried it.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
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 22:09.

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