Go to Post There are always going to be tough calls, and you just have to trust in your officials to do the right thing. - Jeff Waegelin [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 27-07-2011, 14:15
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
Question Sending commands to an arduino

Hi guys,
I have been working on building a robot and have chosen an arduino mega to function as my I/O board. As my role in the team concentrates mainly on building, I am lost when it comes to programming the darn thing. I have mastered programming the arduino, using the native language (something akin to C++), but have yet to be successful in controlling it remotely.

My dilema centers around my inability to write a dashboard program. I would like to know how to send serial data (in the form of numbers) to the arduino using LabView.

Thanks in advance for any advice that you give.
  #2   Spotlight this post!  
Unread 27-07-2011, 18:51
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Sending commands to an arduino

I don't have an answer for you, but the Arduino Mega supports I2C, and the Digital Sidecar also speaks I2C. Similarly, the cRio speaks Serial Data (RS-232 I believe) as does the Mega (but you may need a simple lever converter like a MAX202)

Labview, by itself, can't speak to anything. It's software. I assume you mean to use the FRC hardware (cRio) to communicate with the Mega? The trick then is to find the command block for data communications, address it to the correct port (I2C, Serial, etc) and then all you do is squirt your data in and listen for what comes out. Have to do that on the 'duino too.

There's lots of info for the Arduino side of this; Google it.
__________________

I am N2IRZ - What's your callsign?
  #3   Spotlight this post!  
Unread 27-07-2011, 19:31
Marc P. Marc P. is offline
I fix stuff.
AKA: βetamarc
no team
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Watertown, CT
Posts: 997
Marc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond repute
Send a message via AIM to Marc P.
Re: Sending commands to an arduino

Processing (www.processing.org) is sort of like the arduino's computer-side counterpart. The languages are virtually the same, and there's a wealth of information online about building interfaces with it, and communicating with the arduino either by serial, or (with an ethernet shield on the arduino) TCP/IP (standard networking protocol). Processing itself is java based, and cross platform, just like the arduino IDE.
  #4   Spotlight this post!  
Unread 27-07-2011, 20:21
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: Sending commands to an arduino

I like your idea about using processing... i'l give that a try.
Thanks to both of you.
  #5   Spotlight this post!  
Unread 27-07-2011, 20:26
biojae's Avatar
biojae biojae is offline
Likes Omni drives :)
AKA: Justin Stocking
FTC #5011 (BOT SQUAD) && FTC#72(Garage bots)&& FRC#0399 (Eagle Robotics)
Team Role: College Student
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Lancaster
Posts: 276
biojae is a jewel in the roughbiojae is a jewel in the roughbiojae is a jewel in the rough
Re: Sending commands to an arduino

There is also this:
https://decibel.ni.com/content/group...ce-for-arduino

Labview interface for Arduino.

I have not tried it yet, but it looks interesting.
__________________
FTC Team 72 - No site
FRC Team 399 - http://www.team399.org
2010 Rockwell Collins Innovation in Control Award - (Use of the CAN bus, among other reasons) Phoenix, Arizona!
  #6   Spotlight this post!  
Unread 27-07-2011, 21:25
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Sending commands to an arduino

Quote:
Originally Posted by biojae View Post
There is also this:
https://decibel.ni.com/content/group...ce-for-arduino

Labview interface for Arduino.
Going off of this, you can also download an LV Interface for Arduino from VI Package Manager, a LabVIEW library management application to make adding other libraries/tools to LV easy. I'm not sure if the two are the same, but it's at least worth looking into.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
  #7   Spotlight this post!  
Unread 27-07-2011, 23: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: Sending commands to an arduino

Thanks guys, I have it figured out.
Ill use processing and the Serial I/O library.
  #8   Spotlight this post!  
Unread 29-07-2011, 22:06
docdavies's Avatar
docdavies docdavies is offline
Doc Davies
FRC #0346 (RoboHawks)
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 1998
Location: Richmond, VA
Posts: 70
docdavies is an unknown quantity at this point
Re: Sending commands to an arduino

I've been looking into this same problem. We'd like to use Arduino's to control our old robots rather than buying new cRIOs each year.

I've got all the aspects of using the Arduino to control all of our 2010 Breakaway robots functions. That part took a bit but now works well. I have attached a Joystick shield to my Arduino and can run the robot quite nicely.

Now I've got to figure out a way to interface the Arduino. I would PREFER to use either an Ethernet Shield attached to the robot modem, or using a WiFi Shield ($$$). Then comes the herculean task of figuring out how to receive the commands from the LabView Program on the drive station, interpret them in the Arduino, and run the robot. The good news is at least initially, all I need to do is make the connection from a laptop to the Arduino. If I can do that, I can use a variety of programs to make my own "drive station" and worry about the LV drive station interaction later.

If anyone has figured out how to make the Arduino "wireless" and allow it to accept commands from from a separate laptop?

Doc
  #9   Spotlight this post!  
Unread 30-07-2011, 00:32
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Sending commands to an arduino

Quote:
Originally Posted by docdavies View Post
If anyone has figured out how to make the Arduino "wireless" and allow it to accept commands from from a separate laptop?

Doc
For CARD (Collegiate Arial Robotics Demostration) Team #6, I developed what was supposed to be an FRC compatible Arduino "robot" and Driver Station.

We used the 2009-2010 wireless bridge, since we could "borrow" it from an FRC team, an Arduino Mega 2560 and an ethernet shield. The robot code unfortunatly is not compatible with the official driver station. This is due to the fact that the Arduino could not read the data from the shield fast enough. We used the FRC protocol, but had to reduce the user data sizes such that the total packet size was under 128 bytes, vs the FRC 1024 bytes.

We never tested the limits of the ethernet shield other than that it couldn't do 1024 bytes/packet, but could do 192 bytes/packet. We shrank the packets to 128 bytes for saftey once we knew the size of our user data. We speculated that it would be possible to support the offical packet size, but it would require significant improvments to the Arduino ethernet library. We opted for the quicker option.

The driver station should be compatible with an FRC robot, but I never tested it with a real cRio.

If you try to use any of this, and have issues please contact me.

DISCLAIMER: This worked for us, but it is lacking some of the saftey features of the official cRio/DS. Some of the safties I left out were probably there for good reason. I take no responsiblity for anything you do with this code.

You can find the code from this project on Google Code. Search for "SCOE".
__________________
Eric Haskins KC9JVH
  #10   Spotlight this post!  
Unread 30-07-2011, 03:37
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: Sending commands to an arduino

I love your drivers station (and the fact that it works with arduino). I would like to know the guidelines that would allow me to retrieve the data packets that are sent from the DS to the arduino (using the native arduino language, if possible).

Just warning you... NOOB PROGRAMMER ALERT!!!
this is my first large scale project that I have done. Just bear with me and all of my stupid questions
__________________
"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.
  #11   Spotlight this post!  
Unread 30-07-2011, 22:06
ajlapp ajlapp is offline
Registered User
AKA: Anthony Lapp
None #0118 (Team RUSH and Robonauts)
 
Join Date: Sep 2001
Rookie Year: 1996
Location: Ortonville, MI
Posts: 648
ajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond repute
Re: Sending commands to an arduino

Quote:
If anyone has figured out how to make the Arduino "wireless" and allow it to accept commands from from a separate laptop?
We discussed some of these concepts in a previous post.....I have linked to the source code used to create several Arduino only control systems. Our versions use an Arduino and an Ethernet shield on each end to create a low cost control solution. The driver side Ardunio can be replaced with a laptop that interprets the joysticks if you prefer.

Arduino Wifi Control Source Code The code is linked at the bottom of the page.

The robot side code is simply interpreting signals sent from the driver side via wifi.....and signals sent via wifi could be interpreted with some modifications.
__________________
Anthony Lapp
FIRST Engineering Mentor
Owner/Operator 221 Robotic Systems
221 Robotics Systems - Quality Hardware, Made in the USA
RobotOpen
anthony@221robotics.com
Twitter us: @221RobotSystems
Team 1 --> 94 --> 68 --> 221 --> 857 --> 27 --> 118
Design Engineer/Fabricator and 17 year vet
Team Rush (FRC27) and Robonauts (FRC118)
  #12   Spotlight this post!  
Unread 31-07-2011, 03:11
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: Sending commands to an arduino

thanks for the link to the code, this will be very helpful when writing my own version.
my only question as far as this code is where you got the PS/2 library and the network client library.

#include <Ethernet.h> (I already have this one)
#include <ClientUDP.h>(I need these two)
#include <PS2X_lib.h>

Am I correct to assume that you connected to the network using the ethernet shield?
  #13   Spotlight this post!  
Unread 31-07-2011, 03:30
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: Sending commands to an arduino

ignore the hardware question in my last post
__________________
"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.
  #14   Spotlight this post!  
Unread 31-07-2011, 12:14
docdavies's Avatar
docdavies docdavies is offline
Doc Davies
FRC #0346 (RoboHawks)
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 1998
Location: Richmond, VA
Posts: 70
docdavies is an unknown quantity at this point
Re: Sending commands to an arduino

Anthony,

Your code and setup is great and gives me great hope. Your comments go a long way toward explaining what's happening. The problem is, I am just a beginner in Arduino programming and much of the code is still over my head. Could you be prevailed upon to provide some small tutorial as to what's happening and "How things Work!"?

EHaskins,

In the same vein. I am highly impressed with what you've done, but again, it's well beyond where I am now and I desperately need to catch up. Anything you could do to explain not only how you got your information, but also what it means and how do I make use of it....would be GREAT!.

I find it very interesting, and highly encouraging that I've gotten a TON of good help from the FIRST oriented people here on Chief Delphi, but have been mostly ignored or ridiculed on the Arduino Forums. Must be the stuff we learn in FIRST works!

Thanks ALL,
Doc
  #15   Spotlight this post!  
Unread 01-08-2011, 10:39
ericbarch's Avatar
ericbarch ericbarch is offline
221 Robotic Systems Engineer
FRC #0027 (Team Rush)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Clarkston, MI
Posts: 15
ericbarch is a jewel in the roughericbarch is a jewel in the roughericbarch is a jewel in the roughericbarch is a jewel in the rough
Send a message via AIM to ericbarch
Re: Sending commands to an arduino

Quote:
Originally Posted by Garrett.d.w View Post
thanks for the link to the code, this will be very helpful when writing my own version.
my only question as far as this code is where you got the PS/2 library and the network client library.

#include <Ethernet.h> (I already have this one)
#include <ClientUDP.h>(I need these two)
#include <PS2X_lib.h>

Am I correct to assume that you connected to the network using the ethernet shield?
Hey Garrett,

I worked with Anthony to develop the Arduino control system. Since we've released that source code, the official Arduino code has added in support for UDP packets. You no longer need a 3rd party library, but the code will have to be modified slightly. More on this below.

As far as the PS2X library, you can get it here:

http://www.billporter.info/playstati...-library-v1-0/

Please let me know if you're able to get this working, as I believe this is a new version of the library that we have yet to test.

I've gone ahead and released source code for a basic tank drive robot control system that uses an Arduino (I'd suggest an Ethernet Pro: http://www.sparkfun.com/products/10536) or a Netduino (programmed in Visual Studio). I've released a free/open source Android app that you can use to control the Arduino or Netduino in addition to a Python app that will allow you to use a laptop as a driver station with any USB gamepad.

All the instructions and source code are located here:

http://ttjcrew.com/?p=156 (my personal site)
http://code.google.com/p/ipgamepad/ (google code project)

All of this code uses the latest Arduino version, so you should be able to get a basic system up and running without modifying anything. This works with the native Arduino Ethernet code to send UDP packets.

Hope this will get you off to a good start. I'm always available to answer questions, just shoot me a PM if you need any assistance. Good luck!
__________________
Eric Barch
221 Robotic Systems
Controls Engineer
http://team221.com
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


All times are GMT -5. The time now is 18:56.

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