Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Servo motor? (http://www.chiefdelphi.com/forums/showthread.php?t=112747)

Team3763 Adam 04-02-2013 18:36

Servo motor?
 
So my team and I were trying to figure out how to program a servo motor in teleop where when we push button 1 the servo spins its full range then once the button is released the servo returns to 0° automatically. No clue how to program this and any help given would be great

James H 04-02-2013 18:53

Re: Servo motor?
 
Quote:

Originally Posted by Team3763 Adam (Post 1227507)
So my team and I were trying to figure out how to program a servo motor in teleop where when we push button 1 the servo spins its full range then once the button is released the servo returns to 0° automatically. No clue how to program this and any help given would be great

This depends on the rate at which you want this to happen at. As fast as possible is pretty easy since the servo just needs you to give it an angle and it does the rest unlike other motors that need a speed input. So before I can give you a definite answer, do you have a rate at which you would like the servo to move?

Alan Anderson 04-02-2013 21:01

Re: Servo motor?
 
Assuming you don't care about slowing down the servo's motion, what you want to do is pretty easy. Use a joystick button to select between 0 (when false) and 180 (when true), and feed the selected value to a Gyro Set Angle.

I think the default maximum is actually only 170 degrees. You can change it to match the servo you're using when you Open it.

Team3763 Adam 06-02-2013 17:59

Re: Servo motor?
 
3 Attachment(s)
We don't care about speed, and we're just trying to get the servo to go from button not pushed: 0°; button pushed 180°, 170 if this is max.

Below is the code we have so far, it's from an example I believe.

Attachment 13831
Attachment 13832
Attachment 13833

Cecil 06-02-2013 19:15

Re: Servo motor?
 
The code looks good to me. Another thing to remember is that the servo needs power applied to it, too. There has to be a jumper across the two pins directly next to the PWM port the servo is plugged into.

Team3763 Adam 06-02-2013 19:43

Re: Servo motor?
 
Quote:

Originally Posted by Cecil (Post 1229033)
The code looks good to me. Another thing to remember is that the servo needs power applied to it, too. There has to be a jumper across the two pins directly next to the PWM port the servo is plugged into.

There's a jumper, and it's wired in PWM 4. We're currently having problems with our Digital Sidecar. There's a thread posted here http://www.chiefdelphi.com/forums/sh...d.php?t=112925

Cecil 06-02-2013 21:05

Re: Servo motor?
 
Well.. That opens up a whole 'nother bag of worms. Based on what you have said from your last thread, have you tried swapping the cable from the cRIO to the digital sidecar with a known working one? Remember that last year's ribbon cables shipped assembled backwards, which would screw up a bunch of things.

Team3763 Adam 06-02-2013 23:13

Re: Servo motor?
 
Quote:

Originally Posted by Cecil (Post 1229093)
Well.. That opens up a whole 'nother bag of worms. Based on what you have said from your last thread, have you tried swapping the cable from the cRIO to the digital sidecar with a known working one? Remember that last year's ribbon cables shipped assembled backwards, which would screw up a bunch of things.

We've differentiated between the round and flat cables, however I do believe the issue MAY be with DS (digital sidecar) as it wasn't receiving full power. Tomorrow I will make adjustments and take photo pictures then upload them here. Here's to hope!

Cecil 07-02-2013 09:25

Re: Servo motor?
 
I saw the other thread, and I can't believe I made the fundamental mistake of not suggesting power to the Digital Sidecar. Hopefully applying power will fix everything easily.


All times are GMT -5. The time now is 12:16.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi