|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
|
#2
|
|||
|
|||
|
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?
|
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| we need help with PWM problem in autonomous | steve d | Programming | 7 | 03-02-2008 12:46 |
| Problem with PWM outputs on RC | Adam Richards | Control System | 1 | 20-02-2007 06:37 |
| PWM Problem with Default Code | kbregler | Programming | 16 | 03-02-2007 15:14 |
| Victor and PWM Cable Problem | RIgnazio | Electrical | 2 | 13-01-2005 23:02 |
| PWM problem in autonomous | outofcontrol | Programming | 5 | 27-02-2004 11:58 |