Servo control with RC receiver...
Freddy F
Posts: 3
I am trying to have my BS2-IC (mounted on the BOE board) read in the signal from an RC receiver to control 4 RC servos. I am using four successive PULSIN commands to capture the receiver signals, followed by four successive PULSOUT commands to the servos. My problem is that the BS2 seems to be missing frames from the receiver in that it captures Channel 1 signal fine, but then misses the corresponding Channel 2 pulse and has to wait until the following Channel 2 pulse (about 20 msec). Once that Ch.2 pulse is captured by PULSIN, the immediately following Ch. 3 pulse is missed and again another 20 ms go by before the next Ch.3 pulse is read. This situation repeats with Ch.4.
Obviously all these missed frames hamper servo performance and preclude real time control through the BS2.
I have tested the code reading in only alternating receiver channels, and that seems to work fine, suggesting that the PULSIN command on the BS2-IC too slow to read in successive receiver channels. Is this correct, or is there another explanation?(wiring, etc...) I unfortunately don't have a scope to confirm what the signal timing is like.
Apologies for the long post, but I searched the forums and did not come across this problem. Thanks for your help!
Federico
Obviously all these missed frames hamper servo performance and preclude real time control through the BS2.
I have tested the code reading in only alternating receiver channels, and that seems to work fine, suggesting that the PULSIN command on the BS2-IC too slow to read in successive receiver channels. Is this correct, or is there another explanation?(wiring, etc...) I unfortunately don't have a scope to confirm what the signal timing is like.
Apologies for the long post, but I searched the forums and did not come across this problem. Thanks for your help!
Federico
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
Http://www.parallax.com
In your case though I believe the signal is staggered and what you are seeing, or not seeing for that matter, is
the transition from high to low of one signal, and the transition of low to high of the adjacent signal being virtually
on-top of one another. In this case there is not enough time for one pulsin to finish before the next pulsin starts.
As you mentioned, one solution is to read every other signal (1-3 and then 2-4)
You might get a slight increase of performance if you read 2,4,1, and then 3
The reason this might work better, is because you start out reading 2, and 4 (staggered)
then you have a 20mS delay before 1 is ready (effectively staggering again), and then 3
is ready to go. (staggered once again)
The net result is that it takes slightly more than 20 mS to read all 4 signals with 1&3 phase delayed by 20mS
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Thanks very much,
Federico
Federico
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
Http://www.parallax.com
Post Edited (Dave Andreae (Parallax)) : 8/16/2006 4:50:02 PM GMT