Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   PWM Problem (http://www.chiefdelphi.com/forums/showthread.php?t=63824)

Ryan O 11-02-2008 19:15

PWM Problem
 
Ok, so for the past few years our team has used a servo shifting system. However, this requires that the program know the current position, since it is a three position drive and the commands are shift up and down. My question is if there is a sort of GetPWM function for the FRC controller, because in the past with the FRC code, we have just used the values themselves. Any help would be greatly appreciated. I know that VEX has a GEt function, but cuoldn't find a likely candidate for FRC

tdlrali 11-02-2008 19:32

Re: PWM Problem
 
You're trying to read the position that the servo is at? Why don't you just keep track of which gear you're in, and shift up or down based on that?

BradAMiller 12-02-2008 09:17

Re: PWM Problem
 
That's actually a good question. The problem is knowing when the servo reached the commanded position. The small hobby servos don't return the current position, that single wire is an input to the servo and there is no position output.

We have tried to solve that problem in the past (and this year too) with limit switches to know when the motion is complete. In our case it was even more important because the servo controlled a latch to keep a motor from backdriving. If we try to run the motor before the servo finishes moving the motor or the latch will break.

Ryan O 12-02-2008 09:50

Re: PWM Problem
 
We were looking at also using values from other stuff, not just servos. We would like an easy way to access them, like using teh pwm0~ as a value in FRC Default. One of our variables could too easiely escape an update and mess stuff up.

BradAMiller 13-02-2008 10:07

Re: PWM Problem
 
The compass driver (for the CMPS04) reads PWM values from interrupt ports. It's a little compute intensive, but might work for you.

You could connect whatever you have that's generating PWM signals and give that a try. The values you get back will be related to the duty cycle of the input signal.


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

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