View Single Post
  #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