Go to Post How do You Chiefdelphi? :cool: - SpaceOsc [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 13-02-2011, 20:20
dmitch's Avatar
dmitch dmitch is offline
Chief Head Electrical Guy
AKA: Daniel Mitchell
FRC #1997 (Stag Robotics)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Bishop Miege High School
Posts: 142
dmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the rough
Code Check

Our teams goal is to use 2 window motors to drive the first segment of our arm and one as yet undefined motor to drive the second part (the farther out part). Attached is the code that I believe will do this. I will check it tomorrow but if there is something blatantly wrong I would like to have it solved by tomorrow morning so I don't waste much-needed time.

On the example the open and close blocks are together in the sequence structure. In the code they are closed in the proper place in the FRC framework.

We are using potentiometers, we have yet to find the correct voltage for the correct positions so I just put zeros there for now. This is just one example the actual robot code is on the last 3 attachments. Thank You for any and all Help!
Attached Files
File Type: vi Motor.vi (24.5 KB, 10 views)
File Type: vi Teleop.vi (14.5 KB, 13 views)
File Type: vi Begin.vi (27.8 KB, 7 views)
File Type: vi Finish.vi (15.1 KB, 5 views)
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2011, 20:45
Wolfgang Wolfgang is offline
Registered User
AKA: Mehmed
FRC #1245 (Shazbots)
Team Role: Programmer
 
Join Date: Oct 2009
Rookie Year: 2010
Location: Denver
Posts: 47
Wolfgang is an unknown quantity at this point
Re: Code Check

There are a few things I notice.

- Generally, you should be defining refnums in the begin.vi portion of the code.

- There should be no need to use close vi's on the motors or analog stuff.

- It appears in motor.vi that all the motors have the same PWM channel. This means only one motor. Set only one to PWM 1, others to 2,3, etc.

- It is unclear to me why you are taking voltage info and from where, but since I do not know exactly how your bot works, just let it be.

My team's bot works similarly but with only two motors: one stationary, and one moving up and down while moving another part of our arm.

These were not big things that would be hard to find, but I hope it helps!
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2011, 15:31
dmitch's Avatar
dmitch dmitch is offline
Chief Head Electrical Guy
AKA: Daniel Mitchell
FRC #1997 (Stag Robotics)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Bishop Miege High School
Posts: 142
dmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the rough
Re: Code Check

That does help quite a bit. So do I need to open and define in begin.vi? If so, how do I say "motor 1 is actually referenced as 'window 1'"?

Sorry, I know the PWMs are supposed to be different numbers for the motors, I justy have not yet done that. Thanks, though.

We are taking voltage readings from a pot to position the arm.

So the basic syntax will be right if i move the refnum, is the PID correct? As in, will it move window 1 and window 2 to position x when button y is pressed?
__________________
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 20:35.

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