Go to Post I did everything in high school... but only FIRST allowed me to be me. - treffk [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-12-2010, 19:12
team3329 team3329 is offline
Registered User
None #3329
 
Join Date: Mar 2010
Location: Kingsland Ga
Posts: 34
team3329 is an unknown quantity at this point
Servo Help

Since March I have been trying to develop a proper code for the servos. Recently I have been watching Labview tutorials from the FRC Mastery Tip Jar videos (http://www.lvmastery.com/tipjar) and have learned a great deal about clusters and creating codes via a typedef - in fact that is where I have gotten the idea to link up my objects and such. I have created a project and inside the begin VI i have created a separate typedef from the MatchInfo.ctl (for debugging purposes) and put a servo dev type into this cluster. I then linked it to the Teleop Vi where I used a unbundle by name to access this servo and then developed a code that would set the angles based on inputs from the controller. When I run this code nothing happens and all I get is an error that tells me that there is an improper refnum get. Must I use the refnum get and set for the latest Labview projects? Also, I am only trying to run one servo, not two so I don't need a splitter (if any clarity on this could be issued that would be great) and I have assumed that the black wire (i have black,red,yellow) is negative and have plugged it into the proper port on the PWM channel. If any one could help me on getting these darn things to work that would be helpful. Thanks
  #2   Spotlight this post!  
Unread 09-12-2010, 19:29
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Servo Help

I'd recommend probing the inputs to the Get. I suspect that the value assigned in begin isn't really being read, and that an empty string or default string is being used.

As for the rest, the code and wiring are pretty independent. You could test the wiring with simpler code, perhaps an example. Once you don't get an error when the code runs, you may be able to use that to determine if the wiring is correct.

Greg McKaskle
  #3   Spotlight this post!  
Unread 09-12-2010, 19:51
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,856
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Servo Help

For the wiring you don't need a PWM splitter. You can plug the servo directly into a PWM output on the sidecar or add a straight extender cable.
For a servo you do need a jumper on the pair of pins directly beside the PWM output you've chosen to use. Jumping those pins passes 6v power though to the center PWM output pin and that is where the servo gets the power to move from.

I like using the simple servo example code Greg's team provided for testing that the servo is correctly wired up. You'll find it from the LabVIEW Startup Screen under more examples in the lower right.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #4   Spotlight this post!  
Unread 09-12-2010, 19:55
team3329 team3329 is offline
Registered User
None #3329
 
Join Date: Mar 2010
Location: Kingsland Ga
Posts: 34
team3329 is an unknown quantity at this point
Re: Servo Help

Ok. I think that this might work. So I'm guessing it's not a good idea to wire all of the devices to a typedef via bunddling with out setting the refnum first. Also, do these jumpers come with the Kit of Parts? If not what do they look like? I'll give this a shot and report my findings thanks! (ps. is there any way to test this without deploying onto the robot?)

Last edited by team3329 : 09-12-2010 at 19:59.
  #5   Spotlight this post!  
Unread 09-12-2010, 22:59
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,856
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Servo Help

4 Jumpers came in the kit, in one of the small plastic bags mixed in with other electrical parts, probably with the Wago connectors. They are tiny and either white or black. You'll see the same jumpers already on your Jags in the limit switch slots, although they're unobtrusive, recessed into the Jag case and hard to notice.
Here is the KOP description and the picture


You can test and work out basic concepts such as generic use of typedefs on your PC by writing your own test programs under My Computer, but if your program uses anything from the WPI Robotics Library then you'll have to have the cRIO to test it.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 09-12-2010 at 23:12.
  #6   Spotlight this post!  
Unread 10-12-2010, 07:23
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Servo Help

To further answer the question about deploying and testing. If you are testing the logic value of something algorithmic, you can write a quick VI to run on the PC. To do this, you can choose File >> New and if the lower left corner says the VI is targeted to the cRIO, right click on it and set it to My Computer. At that point, you can do math, strings, loops, and anything that doesn't do robot I/O.

There are also two ways of running on the robot. The way to debug is to simply press the run button on the VI. Typically in the framework, that is the RobotMain VI.

Later, when things are relatively bug-free, you Build the project and Set it as Startup, and reboot the cRIO.

I'd suggest going through the steps of a deployment tutorial if you haven't done it before.

Greg McKaskle
  #7   Spotlight this post!  
Unread 10-12-2010, 19:26
team3329 team3329 is offline
Registered User
None #3329
 
Join Date: Mar 2010
Location: Kingsland Ga
Posts: 34
team3329 is an unknown quantity at this point
Re: Servo Help

to Leod: Thanks for the advice on the Jumpers! The servos work perfectly now thank you so much.

to McKaskle: Thank you on your advice for running the VI"s separately. I also have another question. Instead of wiring separate refnums to each device that I open in the Begin.vi, could I instead add all the devices to a cluster and wire that to my teleop or whatever state that I am programming? Would this be essentially the same as opening a device-like a solenoid, setting it, and then closing it on the same DeviceRef wire that I opened it on as in a Basic Robot Main.vi ? Here is what I did:
Begin: http://www.chiefdelphi.com/forums/at...d=129202727 3

Teleop: http://www.chiefdelphi.com/forums/at...d=129202728 9
Attached Thumbnails
Click image for larger version

Name:	deviceref.jpg
Views:	77
Size:	15.9 KB
ID:	9486  Click image for larger version

Name:	devicerefs.jpg
Views:	56
Size:	24.6 KB
ID:	9487  

Last edited by team3329 : 10-12-2010 at 19:29.
  #8   Spotlight this post!  
Unread 10-12-2010, 22:24
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Servo Help

The framework shows one way to pass data between the open, updates, and close. There are in fact many ways that will work, and if you understand how to make clusters and use parameters, then you are set.

Greg McKaskle
  #9   Spotlight this post!  
Unread 10-12-2010, 22:50
team3329 team3329 is offline
Registered User
None #3329
 
Join Date: Mar 2010
Location: Kingsland Ga
Posts: 34
team3329 is an unknown quantity at this point
Re: Servo Help

If i send you the full project could you tell me if there is an error? Every time I run the code I get errors dealling with Refnums on the Servo Get angle and Set angle.
  #10   Spotlight this post!  
Unread 11-12-2010, 07:37
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Servo Help

If you post a zip, someone can almost certainly spot the issue. If you want to debug it yourself, use probes and the run button.

Greg McKaskle
  #11   Spotlight this post!  
Unread 16-12-2010, 20:15
team3329 team3329 is offline
Registered User
None #3329
 
Join Date: Mar 2010
Location: Kingsland Ga
Posts: 34
team3329 is an unknown quantity at this point
Re: Servo Help

I think I found the problem but thanks for the advice!
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Servo help Cody Ryu Programming 1 25-01-2010 21:58
Servo Help GunfighterJ Programming 1 09-01-2009 17:12
Servo Help Newzealand38 Programming 10 13-01-2008 23:14
Servo Help Chase Programming 1 06-02-2006 17:53
Servo Help Dominator_Legen Motors 3 11-03-2005 19:50


All times are GMT -5. The time now is 23:07.

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