View Full Version : pulsin from futaba reciever
02-27-2005, 02:38 PM
im trying to "read" a signal sent to a servo, i want to declare a dead zone, from aprox 140 - 160, and determine if servo signal is 160 + or 140 - , signal is from a futaba reciever, i am currently running 110k ohm resistor from signal wire of servo, to pin 15,· and using
pulsin 15, 1 , pls
if pls < 140 then goto tst
if pls > 160 then goto rst
the problem is when i debug pls, i get the ascii o with 2 circles above it, or 149, but when i change the symbol out of the reciever , i dont see proportional change from the var pls.. from what i see it should work to decode the pulses sent by the reciever, but doesnt work to use logic to create program flow,
i also thought about using pwm,
how do i get this to work , i just need to see if the end result of the signal is center (in dead band) , clock wise or cc, and have a program send it self to the corosponding leg of the program, about every 1/4 second or less ,
maybee is the 110k resistor to large,·
02-27-2005, 07:31 PM
is my question clear? can any one help?
02-27-2005, 08:13 PM
···· I've only recently played with servo's but the attached piece of code allowed me to read a two channel radio without difficulty. I think the servo outputs are standard in the industry with about 1.5 mSec being the center and 1 mSec and 2 mSec being clockwise and counterclockwise. Therefore, using a BS2, the numbers range from about 490 to 950, with center being about 745 in my case.
·· Hope this helps.
· Tom Sisk
ch1 VAR Word· 'left-right direction
ch2 VAR Word· ' forward-reverse
DEBUG DEC ch1,"· ",DEC ch2,HOME
IF ch1 < 300 OR ch2 < 300 THEN nolink
IF ch2 < 700 THEN revboth
IF ch2 > 715 THEN forward
02-27-2005, 08:30 PM
so, do i need a resistor run between input and signal wire from the reciever, mebe this is why i cant see a diff when i create change via remote controll, i really thought my circut should have worked, but it didnt,, pulsin comand does infact work this way though,? must be my wireing or my resistor, i think its the reistor, , any sugestions on a beter value for it ,, or is it needed,
comon sence says if a i/o pin from bs2 can prouduce the signal i shouldnt need a resistor to recieve the signal, but fear of "noobing " one of my inputs had me place it,
K de Jong
02-27-2005, 08:48 PM
Yes, it is best to use a resistor on your input pin, but about 1 kOhm will work better than the 100k you have now.
02-27-2005, 11:44 PM
··· The other thing I noted was that the voltage level of the pulses out of the radio was only about 4 volts; so, you may find that the resistor can be eliminated or reduced even further to about 100 ohms.
·· As well, in the code I posted, the pulsin parameter in my case was set to '0' because I used a transistor off the radio to invert the signal. Yours is OK I think, but make sure the variable is big enough ( a word, not a byte).
·· The debug statement should include the DEC parameter so that a number is displayed.
02-28-2005, 03:06 AM
alright man, im geting closer, i switched to 100 ohms, and 90 % of the time it reads corectly, the thing im noticing, is that when i leave the controler alone, i sometimes read left, and it only seems to regester a right,,, when i turn the remote 1/6th of the way turning all the way does not exact a change in program flow, and sometimes it reads a change when none is present,
do i need to change the numbers i have reading the positions ie 700 715,,
or is it posibly the resistor doing me wrong, over all it works but ,, seems to be "glitchy"
02-28-2005, 05:36 AM
quick question relating so ill drop it here,
curent configuration includes
homework board, 9volt ,
futaba reciever / tx ,2 servos, run off a nmhi rechargable, 6 volt pack,
i keep getting funny results, and driving my self crazy, but i suspect the two runing off the same sorce, might yeild me corect results,, with my curent circutry and programing,
is there any weight in this? can supply circutry drawings, but dontthink its necesary
02-28-2005, 05:51 AM
··· Glad to see you making some progress.
·· For sure, the neg of the radio power pack and the negative of your stamp board should be tied together. They don't have to be the same source as long as they have a common negative.
··· Its normal for the numbers to move around a bit. Its due to the way pulsin measures time, in chunks of 2 uSec. What I did was run the test program and note the numbers as I moved the stick to various positions. Then you can write some·IF statements or SELECT CASE statements so that they are triggered whenever the number is between some "bracket".
· Good Luck.
02-28-2005, 09:14 AM
ureeka working :)