Shop OBEX P1 Docs P2 Docs Learn Events
Basic stamp in a paintball marker! - Page 2 — Parallax Forums

Basic stamp in a paintball marker!

2»

Comments

  • FireHelixFireHelix Posts: 42
    edited 2006-08-29 17:25
    Does the "address" parameter of the BUTTON command act as a GOTO or a GOSUB? hopefully it acts like a GOSUB as it would knock out a few lines of code that would be necessary if it's GOTO

    here's what i got so far based off of BUTTON acting as a GOTO.... attached file

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...

    Post Edited (FireHelix) : 8/29/2006 6:02:56 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-08-29 17:40
    FireHelix -

    As described in the PBASIC Help File, and the PABSIC Syntax and Reference Manual, the "address" is a target for a BRANCH (aka GOTO), NOT the target of a SUB-ROUTINE. Please note the exact wording:

    "Address is a label that specifies where to branch if the button is in the target state."

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • FireHelixFireHelix Posts: 42
    edited 2006-08-29 18:03
    ok thanks for clearing that up Bruce

    also... could someone double check my counting on nested GOSUB's? I dont think I nest deeper than 4 (the BS2's max) but I do get upto 4. is this ok? and did I count right?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...
  • willis123willis123 Posts: 11
    edited 2006-08-31 17:53
    Firehelix,
    Are you using factory (paintball specific) eyes or are you using an IR detector and emitter? I would check your code, but I know next to nothing about pbasic.
  • FireHelixFireHelix Posts: 42
    edited 2006-08-31 19:35
    i am using TMC (The Matrix Center) eyes in my project gun though right now im setting my program up as an emitter detector pair.


    Im up to beta 3.2 now and got some stuff i needed for hardware testing. i loaded the code (takes damn near all the EEPROM with the comments) and operated it using just the trigger and safety buttons as inputs, and had just the safety led hooked up. many bugs... and i ran out of room for comments to follow the program flow in the debug window.

    anywho... my code is attached if someone could please give it a look over and see if theres anything a different set of eyes can spot that may be wrong

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...
  • jdoleckijdolecki Posts: 726
    edited 2006-09-02 23:14
    Why would you want to monitor the ball in the breach anyways? I did a similar project for my kids marker when i first got my stamp
    it was basically a electronic trigger with three modes, single shot, three round burst, and full auto. its been a while since i been on the fourms but a new project has started and im using the stamp for my cnc machine. if you want i could try and find the code and wiring diragam but my kids dont paintball any more and im not sure what they did with it
  • FireHelixFireHelix Posts: 42
    edited 2006-09-03 05:57
    the reason most modern paintball markers have eyes (ir or laser and detector combo) in the breech is to be able to tell if a paintball is completely loaded or not and prevent the gun from firing if there isnt one loaded (may not have completely fallen into the breech yet). this helps prevent "chopped" paintballs. in the tournament paintball world, chopping a paintball can quickly turn an easily won match into an embarrasing defeat.

    how did you set up the marker you worked on to select between the 3 modes? extra button that cycled between them? i'm also curious as to how you structured your program to handle the different modes of fire. what kind of marker did you build and code for? do you happen to have any pictures of the setup?

    my current draw back is my lack of knowledge in designing schematics and PC board layouts. well, i'm not doing too bad in the schematics part so far... theyre just kinda messy and need a little refinement. it'd probably also help if I had a little better background in electronic fundamentals. handling the wiring for the trigger, button and leds I can handle just fine (i think i got a decient understanding of pull-downs and most of the basics) but seting up the solenoid could be a challenge. at first i thought id just run the 'noid right off the stamp itself, but then decided it may be wiser to have the stamp drive a transistor that controls it instead. but I read somewhere that I should probably have diodes in line with the solenoid leads to prevent damage to the transistor. I guess all that is what I'm a little fuzzy on.

    current parts interacting with the stamp in my setup:
    -inputs- trigger, safety button, eyes
    -outputs- solenoid, power/status led, safety status led

    the eyes im not sure how to hook up... the connector has 3 wires which i would assume one is +v supplying both led and detector, one ground for the emitter, and one for the signal from the detector but im not 100% sure on that yet (broke my only screwdriver small enough for the screws that hold the eye assembly in).

    the solenoid... not sure as described above

    the rest I think I got covered

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...
  • FireHelixFireHelix Posts: 42
    edited 2006-09-05 19:01
    update:

    I talked to my paintball team / field owner and he has an o-scope that I could use. now I have a way to inspect the "referance board" a little closer than before. eye pulses will be checked on the stock board and on mine, as will solenoid pulse length. I'm also thinking about pulsing a pin during the loop that scans for the initial trigger contact to see how many times per second the trigger is being scanned.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...
  • willis123willis123 Posts: 11
    edited 2006-09-05 20:24
    I'd really appreciate it if you posted the results (you probably would have anyways......)
  • FireHelixFireHelix Posts: 42
    edited 2006-09-05 21:40
    I will most definitely post up my results, but it will probably be a week or so before i can get access to the scope as my sponsor is on a business trip right now.


    edit:
    ok... i opened up the breech eye housing to check the wiring and i also took a close look at the stock board from my gun and i think i got the layout for the eye control drawn out. problem is, i dont understand how it works. could someone tell me how the PIC on the stock board can tell when the eye is blocked (gimme a rough walkthrough of whats going on in the circut?)

    for the eyes, one is labled as "dark" led and one as "clear". im guessing the dark is the emitter and the clear is the detector. please correct me if i'm wrong

    attached is the schematic i came up with after visually following the traces on the stock board.

    edit #2:

    i tried rebuilding the circut on my good old trusty 500-in-1 project kit from when i was a kid... unfortunately i cant emulate it in a fashion that would act as eyes.
    im bloody confused as it appears that the yellow and red wires are both V+ with a common ground, black.

    emitter and detector both share a common ground. therefor detection of a paintball requires the processor to supply the power but be able to tell whether the detector is using the power or not.

    from using my multi-meter i was able to tell that in a resting state no power goes to either the emitter or detector. when the trigger is pulled the non-ground lead of both eye parts goes to + voltage. what voltage specificly i dont know as my meter doesnt react quick enough to measure this pulse.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...

    Post Edited (FireHelix) : 9/6/2006 1:04:17 AM GMT
  • willis123willis123 Posts: 11
    edited 2006-09-07 16:37
    I don't know if this helps or not, but here you go:
    http://www.reconnsworld.com/ir_ultrasonic_basicirdetectemit.html

    This may be a dumb question, but what is the component on the schematic that's labeled D251 PN 3565.....photosensitive resistor perhaps? Also, I'm pretty sure that the black "LED" is the detector. I may be wrong, but I think the black might block out visible light.
  • FireHelixFireHelix Posts: 42
    edited 2006-09-07 19:52
    it's a transistor.
    http://www.mouser.com/search/ProductDetail.aspx?R=PN3565virtualkey51210000
    i think thats the one.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...
  • FireHelixFireHelix Posts: 42
    edited 2006-09-12 22:13
    well, i botched the eye drawing from before. i had 2 of the leads going to the transistor switched in my drawing. attached is an updated drawing.

    my question still stands, how does this board "see" a blockage? how does the PIC sence a block in this setup?

    unless im completely missing some traces in drawing the stock board, i just dont understand how it can tell.

    EDIT:
    latest update and testing...

    ok... so i did some experimenting with the eye setup. i loaded my stamp with a pin testing program that pulses all the pins on and off.
    the eye harness has 3 leads coming from the led/detector pair, yellow= +v to led, red= +v to detector, black= ground for both parts.
    i wired yellow to one of the pins on my stamp, thereby pulsing the led on and off with the program.
    black was wired to ground
    red (the detector) was the part i wanted to test. for this, i wired from batt to a led/resistor pair originally used for pin testing, and from there to the red wire leading to the detector. this allowed me to "see" what the detector was seeing.

    when powered i noted that the emitter led blinked on and off as expected (cell phone camera can see ir) as did the led wired in series with the detector. hence, no paintball = electron flow.
    when i blocked the path to simulate a paintball in the breech the detector led shut off and stayed off.

    my idea is to tie the yellow wire (emitter +v) to a pin, say pin 1 for this example. then i can control the emitter on/off status via the stamp.
    for the detector, i thought i could use pin 2 to test for a HIGH or LOW status, tie the pin to a pull-up resistor to force it HIGH. after the pull-up, the pin goes to the red wire (+v to the detector). i figured id be able to detect a paintball by pulling the pin high and when no paintball is present, the detector will let electrons flow thus drawing the pin LOW (it would remain HIGH when a paintball is present)

    the 2nd attachment is a lil visual of my idea

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...

    Post Edited (FireHelix) : 9/13/2006 12:45:21 AM GMT
  • willis123willis123 Posts: 11
    edited 2006-09-25 16:05
    Not to raise a dead topic, but what's the latest on the project?· Did you get your eyes working correctly?
  • FireHelixFireHelix Posts: 42
    edited 2006-09-25 22:30
    well, right now the eyes are working properly. im checking over my design before i actually hook it up to my paintball gun... id rather not break anything. i should have an "on gun" test very soon. lately ive been working on the schematic for the board that will actually go in the gun. the main problem im running into at this point is the power regulator for the board. most of the project boards ive seen (BOE and such...) have fairly large voltage regulators on them. since i have limited space inside the handle itself for the board, i need to know if there's possibly a smaller footprint regulator that would work since theres not a whole lot i have to power. the hardest i would guess would be the solenoid, but if needed, i could use probably use 2.

    any ideas on a smaller voltage regulator either 1 to power all, or 1 for 'noid and 1 for everything else?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...
  • willis123willis123 Posts: 11
    edited 2006-09-26 12:09
    How about these regulators:

    Digikey P/N: MCP1700-5002E/TO-ND· (TO-92 package)---Should run your noid (250 mA)
    Digikey P/N: LM7805CT-ND·(TO-220 package)---Should definitely be large enough to run everything (1A)
    Digikey P/N: 296-12290-1-ND·(SOT-223 package)---Should be large enough to run everything (500 mA)--Surface Mount!!!

    For the record, I'm definitely not an electronics expert.· But, in my opinion (however uneducated it may be), those ones should work for you.
  • FireHelixFireHelix Posts: 42
    edited 2006-09-26 13:43
    thank you very much for your reply!! most definitely a good place to start. have you worked with surface mount at all before? i never have and im curious as to how hard it is to use.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...
  • willis123willis123 Posts: 11
    edited 2006-09-27 12:17
    I have never worked with surface mount at all. I just googled "hand soldering SMT". What I got from it was that if you're using a professionally made board (with solder mask), it isn't bad. I'm looking at using some SMD's to save on space because my grip frame is going to be packed. That BS2 takes up a lot of room.
  • willis123willis123 Posts: 11
    edited 2006-10-16 16:18
    Sorry to keep resurrecting this topic, but I don't see too many projects like this and I have a special interest in it because I am working on a very similar project.

    So, what's the latest on the project?· Any testing yet?·Have you done any programming concerning ramping?· I'm trying to think of a clean, easy way to ramp up to a set bps.··Also, on markers with factory eyes and your project gun, are the eyes on all the time, or do they turn on after the trigger is pulled, read whether a ball has loaded or not, then turn back off?
Sign In or Register to comment.