|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
pwm signal delay
hi there,
it is known that there are intervals between pwm signals, these intervals can vary between 10mS and 20mS, my question is, where is the code that handles the pwm signals? well, our team's camera servos are tweeching, and I suspect it may be caused by irregulations in the pwm signal. many operations are done in the period between signals, and that fact might cause the intervals to extend beyond range. for example, it was written in CD, that ini one team, tweeching occured while writing to EEPROM, an action (for those who aren't familiar with EEPROM), that consists of a few cycles => it takes some time to finish. is it possible to change the default delay period? thanks in advance, Ran. ![]() |
|
#2
|
|||||
|
|||||
|
Re: pwm signal delay
Quote:
The last four PWM signals are generated by the user CPU. The default code does not deal with interrupts perfectly, and the pulse width can sometimes be longer than desired when serial port and wheel encoder interrupts occur. Kevin Watson wrote some code to correct the jittery behavior, which you can find here: http://www.kevin.org/frc/frc_pwm.zip There is still some occasional twitchiness with Kevin's code when writing EEPROM. It doesn't affect normal robot operation, and I haven't taken the time to figure out whether it's due to interrupts being disabled briefly or some other cause. The code for PWMs 1-12 runs in the master CPU, and is not usually a problem. If you're seeing twitchy camera servos connected to one of those signals, you are probably getting interference from the serial data signal. Try rerouting the wires to keep the servo and serial data physically separated. |
|
#3
|
||||
|
||||
|
Re: pwm signal delay
thanks
I'll try fixing it as quickly as possible, as it's a holiday here in Israel. BTW, it's a good opertnity to say "Happy Sukkot" to everyone who celebrates it. Ran. Last edited by 3dude_2231 : 03-10-2007 at 12:48. |
|
#4
|
||||
|
||||
|
Re: pwm signal delay
Happy Sukkot!
|
|
#5
|
||||
|
||||
|
Re: pwm signal delay
If you are having huge gigantic problem, you could just run your own pwms using (E)CCP modules.
-q |
|
#6
|
||||
|
||||
|
Re: pwm signal delay
Your twitching is most likely from motors and static electricity. We had a bad problem with this two years ago because one of our motors what right need the wire going up to the servo and caused bad twitching.. are you running motors by the the camera or pwm wires?
|
|
#7
|
||||
|
||||
|
Re: pwm signal delay
Quote:
-Kevin |
|
#8
|
|||||
|
|||||
|
Re: pwm signal delay
Quote:
But we agree that it isn't a problem in practice. I consider it a minor cosmetic blemish on otherwise shiny code. |
|
#9
|
||||
|
||||
|
Re: pwm signal delay
Quote:
BTW, when you say it only happens when EEPROM is being written, is it my code that's doing the writing? Is my camera code running too? -Kevin |
|
#10
|
|||
|
|||
|
Re: pwm signal delay
The data sheet shows a byte erase write cycle taking 4ms. The question is for multiple writes are interrupts enabled between writes?
|
|
#11
|
||||
|
||||
|
Re: pwm signal delay
whats your setup is this a benchtest or is it on a robot? Are you extending the pwm cables at all?
|
|
#12
|
||||
|
||||
|
Re: pwm signal delay
Quote:
-Kevin |
|
#13
|
|||||
|
|||||
|
Re: pwm signal delay
Quote:
In our software, we've generalized the EEPROM and menuing support and added several additional menus (drivebase PID tuning, arm PID tuning, sensor and navigation status, and automode targeting setup). To keep from rewriting what's already provided to us, there is a small bit of "wrapper" code around the calls to the camera and tracking menuing functions. However, those functions do still get called just as often as they do in the unmodified camera code. |
|
#14
|
||||
|
||||
|
Re: pwm signal delay
Well since those servos use a linear carbon filament pot for feedback, and simply use proportional control for positioning (Just P, not PI, PD, etc...) then if your supply voltage to the servo(s) is/are too low (I believe 5v is the absolute minimum) then the voltage reference onboard the servo for the analog feedback may be skewed... or it might dip too low whenever the servo attempts to move... causing a 'twitch' as the position the porportional chip in the servo gets back would vary with a low voltage reference. Maybe when you write to your EEPROM your voltage dips ever so slightly and this occurs.
Or, as a more probable option, some EEPROM uses a very high voltage to flash the bits into memory. This could theoretically casue a high voltage spike to go out of the processor as the lines driving the EEPROM decay after flashing a bit in. Maybe i'm barking up the wrong tree... but it sounds like most other things have been defined as working. -q |
|
#15
|
||||
|
||||
|
Re: pwm signal delay
thanks for your response, guys.
I'll be checking it out soon. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Digital out signal speed on off, almost like PWM but at max 60Hz | Generalx5 | Electrical | 2 | 27-03-2007 12:26 |
| PWM Signal Noise? | Danny Diaz | Electrical | 3 | 28-01-2007 17:02 |
| Delay | Gal Longin | Programming | 1 | 09-12-2004 10:37 |
| Fading LEDs using a PWM signal from the Edubot | DanL | Programming | 22 | 30-03-2004 00:07 |
| Loss of signal in PWM cables. | archiver | 2001 | 6 | 23-06-2002 23:29 |