--personal defense turret--v1
sushiandmorihiko
Posts: 40
yoo people,
first of all,thanks for the help lately,
as perhaps some of you may have read my thread before, i am going to tell you guys what i am doing right now.
i am making a turret with pan and tilt system (2 servo) which on the top,i am planning to mount an airsoft cannon from rc tank toy (that i am going to take it off apart and use its cannon to be placed on my pan and tilt).other than airsoft gun on top of the pan and tilt, i am gonna attach a camera and some sensors like infra-red.i am going to explain a little bit further on the use of these later on.
lastly and probably,the whole of this turret will be placed on my boe-bot so that it may move--my boe-bot have line following sensor from parallax itself--so i hope it will follow marker line that i draw.hopefully.
this turret will have 2 modes:
1.automatic:
here,the turret makes use of its infra-red sensor to detect any interference, for this case,i hope it can detect and follow the movement of my hand.it goes up and down, left and right.i hope that once the sensor finds an interference,it will lock to that interference and and follow it all the way-just like shadowbot code/following boe-bot code and wait for my ultimate command to declare the first blood with its bb gun.
2.manual:
here,i am almost done with this part.here how this part works.as the pan and tilt consists of 2 servos,i use 2 potentiometer to drive the servos.so when i turn the knob of the potentiometer,the servo will turn propotionally as the turns of the potentiometer.what i like in this part is that,i ll be using the camera mounted on top too.so i should see what the camera seeing in my computer ,then i have every control of my turret and ready to shoot its bb bullet by aiming with my camera--(optionally i will add laser beam as for aiming targets).
so far,my progress for the manual is quite ok, but for the automatic,it is indeed tough and kinda stuck.it is really tough to code the infra-red to act that way, i am trying D Faust idea (he had mentioned that i should try 4 infra-reds--2 on top--2 below.i really do hope if someone could help me in this part--to help me finish the automatic mode.
any kind of ideas,comments or suggestion either long winded ones or impossible ones will be welcomed-because all along this project comes partly from the help of you guys.
thank you,people
best regards
first of all,thanks for the help lately,
as perhaps some of you may have read my thread before, i am going to tell you guys what i am doing right now.
i am making a turret with pan and tilt system (2 servo) which on the top,i am planning to mount an airsoft cannon from rc tank toy (that i am going to take it off apart and use its cannon to be placed on my pan and tilt).other than airsoft gun on top of the pan and tilt, i am gonna attach a camera and some sensors like infra-red.i am going to explain a little bit further on the use of these later on.
lastly and probably,the whole of this turret will be placed on my boe-bot so that it may move--my boe-bot have line following sensor from parallax itself--so i hope it will follow marker line that i draw.hopefully.
this turret will have 2 modes:
1.automatic:
here,the turret makes use of its infra-red sensor to detect any interference, for this case,i hope it can detect and follow the movement of my hand.it goes up and down, left and right.i hope that once the sensor finds an interference,it will lock to that interference and and follow it all the way-just like shadowbot code/following boe-bot code and wait for my ultimate command to declare the first blood with its bb gun.
2.manual:
here,i am almost done with this part.here how this part works.as the pan and tilt consists of 2 servos,i use 2 potentiometer to drive the servos.so when i turn the knob of the potentiometer,the servo will turn propotionally as the turns of the potentiometer.what i like in this part is that,i ll be using the camera mounted on top too.so i should see what the camera seeing in my computer ,then i have every control of my turret and ready to shoot its bb bullet by aiming with my camera--(optionally i will add laser beam as for aiming targets).
so far,my progress for the manual is quite ok, but for the automatic,it is indeed tough and kinda stuck.it is really tough to code the infra-red to act that way, i am trying D Faust idea (he had mentioned that i should try 4 infra-reds--2 on top--2 below.i really do hope if someone could help me in this part--to help me finish the automatic mode.
any kind of ideas,comments or suggestion either long winded ones or impossible ones will be welcomed-because all along this project comes partly from the help of you guys.
thank you,people
best regards
Comments
its me again,
i am now having some problem in infra-red. i dont know why the value of the infra-red keeps on changing from 1 to 0 and 0 to 1 when even no interference is detected
this is the sample code:
DO
FREQOUT 10,1,38500
value1 = IN11
FREQOUT 13,1,38500
value2 = IN12
DEBUG CRSRXY,2,3, BIN1 value1
DEBUG CRSRXY,9,3, BIN1 value2
loop
anyone knows how to make the value1 and value2 stable?
thank you
Are you sure those are you input pins? They would float if not connected to anything. Are you getting mostly 1s and a few 0s, vice versa, or is it 50%-50%.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
right now i am testing with 2 infra-reds.so it detects left and right--and it works but not so perfect.when i place my hand over the left infrared--the servo turns accordingly and so on for the right one too.however,i encounter a little problem here. there are some times-like every 5 seconds--the value change from 0 to 1 and 1 to 0 very fast/unstable although i didnt place my hand over the sensors-causing the servos to get confused and turned a little bit left and right--stuck.
is the any way i can get the value to be stable--
thanks for the help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.waterhobo.com/
He uses a webcam and open source image tracking software to locate kids crossing his yard and then squirt then with water. He's not actually using tracking information to target, but rather as a robust trigger.
The site has some amusing videos to watch...
Thanks,
PeterM
You might want to try a Thermal Sensor Array (TSA) as described in Steve Norris' article "Follow Me" in the Summer edition of Robot Magazine.
I successfully duplicated his TSA tracker except that I used a BS2p in place of his PIC.
The TSA tracker works very nicely and will pick up my thermal signature about 6 feet away.
The I2C TSA is a bit pricey at ~$100, but it works very reliably.
Just a thought.
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
however i still want to finish up what i have started for the time being. i am still stuck in the infrared part--its tough. it works pretty well when my hands are over it but when it goes idle and i do not place my hand there--the values (1 and 0) will keep on changing causing confusion to the servo---i dont know why this happens--i dont think there is any interference. oya about D Faust idea on averaging the value--may i know hoe do you do that----because i only have 2 value---either 1 or 0?
here is the program: (it may seems long but quite direct--i am using D Faust codes)
' {$STAMP BS2}
' {$PBASIC 2.5}
value1 VAR Word
value2 VAR Word
OK_Difference VAR Word
pulse VAR Word
counter VAR Word
DO
FREQOUT 10,1,38500
value1 = IN11
FREQOUT 13,1,38500
value2 = IN12
DEBUG CRSRXY,2,3, BIN1 value1
DEBUG CRSRXY,9,3, BIN1 value2
IF value1 > value2 + OK_Difference THEN
pulse = pulse + 20
IF pulse > 1000 THEN 'all the way one direction
pulse = 1000
ENDIF
ENDIF
IF value2 > value1 + OK_Difference THEN
pulse = pulse - 20
IF pulse < 100 THEN 'all the way the other direction
pulse = 100
ENDIF
ENDIF
pls tell me what goes wrong.
thank you--greatly appreciate your guys help
reading1+reading2+reading3+reading4+reading5
= 1 or 0
5
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
i am still stuck with my infrared detector being unstable if she does not detect anything--eg.if she does not detect anything,it should read up 1 on the screen but it once in a while the value changes very fast to 0 and vice versa causing confusion to the servo.
sorry guys that i have to post the same problem again but i did try it for a couple of days and it didnt work
i know it is something wrong with my infrared detector bcos when i plug out the infrared--the value still changes from 1 to 0 once in while very fast.(less than 0.2 s)
i come up with this idea but i dont how to translate this idea to basic code:
IF input = 1 FOR less than 0.2 second then x = 1 (off/not detecting anything)
can i do this way--
thanks guys
For countr = 0 to 100
If input = 0 then goto main
Next
.....
.....
.....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--DFaust
This depends a LOT on the particular Decoder being used. Just a thought.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--DFaust
i am thinking that i will get some "Sharp GP2D12 Infrared Sensor" instead---what do you think guys---is it worth it? i never tried this sensor before--how can i fit the education board with basic stamp--can it work together? cos i think parallax does not sell this type of sensor if not i ll get it from parallax as i am more familiar with it.
pls give me some advice about this sensor and how does it fit my project? thanks guys
One last thing you might try is to get a piece of IR filter and put it front of the IR receiver. You can get a piece from an old VCR. It is the piece of plastic covering the IR receiver. If your problem is ambient light, like flourescent lights, this may help.
As to GP2D12, it is more stable than regular IR receivers. It's range isn't that great, I find about 5 feet. To use it would will need an ADC (analog to digital converter) to read the output. The sensors also require some calibration to use.
For more information, check out my website at: http://madlabs.info/gp2d12/sharp_gp2d12.shtml
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
thinking that each of this device will cost you like 4 times the normal infrared transmitter and receiver--i am really scared it wont work when i purchase them cos i need 4 of the with 2 panners,so that will cost quite a lot.--is it worth it?
thanks a lot for you help
Glad the webpage was useful. I doubt that the GP2D12 will have the range that you need. I use it for short range object detection along with a Ping sensor. The sensor and ADC will work with the BS2 however. How far away are you trying to detect? Since the whole thing is to be mounted on a BOE, I'm also not sure you can get the two sensor far enough apart that they won't just both pick up any object in range. What size object? Human?
I'll see if I can find the time to dig a couple of these sensors out and do a quick test, but no promises, I am very busy this week.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot