Page 2 of 24 FirstFirst 123412 ... LastLast
Results 11 to 20 of 233

Thread: GCode: open source paintball gun board/software

  1. #11
    That's awesome

  2. #12
    Yeah. I found a place that will make PCBs. I may have a few Viking boards done up that I can plug the Femto board into in order to test in the gun.

    I was looking over the Tadao board to see what else I'd need, and learned a little more about the electronics by sort of reverse engineering that board. I know the programming side of this way better than the electronics side. But I learned why I need a diode and a voltage regulator sitting between the chip and the solenoid now.

  3. #13
    Insider
    Join Date
    May 2012
    Posts
    1,182
    Flyback emf? Not sure you need a vreg, if so?

  4. #14
    I did some more reading and investigating last night. The chip on the Tadao board is a power MOSFET (transistor) (LR014N). This page explained its need/use in the circuitry. This page explained the need for the diode.

    From what I've read, the microcontrollers don't have enough amperage to power the solenoid directly. So you hook up the pin on the microcontroller to the MOSFET and then hook the MOSFET up to the main power and solenoid. The MOSFET then acts like a switch, and when the pin triggers it, it powers the solenoid. The diode prevents any reverse voltage from frying the microcontroller. I get the general concepts, but I'm going to do more reading in my electronics book so I can fully understand what's going on there.

    I found some suitable S1A diodes on eBay for relatively cheap. I haven't found anywhere online to order small quantities of the LR014N MOSFET (or other equivalent 55V 10A devices), unfortunately.

    However, turns out there actually is still at least one electronics store here in MA. I'm going to go to You Do It Electronics sometime this week and see what I can find for MOSFETs. I may check my local Radio Shack first, but I highly doubt they'll actually have anything useful.

    I'm glad I was cautious about the noid and didn't just hook it up. I probably would have nuked the noid or the board if I'd tried it. I'm definitely at that point where I know enough to be dangerous, and am trying to understand things fully before I try to implement them.
    Last edited by sumorai; 05-08-2013 at 12:07 PM.

  5. #15
    Sumorai,

    Arduinos are great. I use them all the time now for rapid prototyping. It's a cheap way to make sure a basic design works, and then I transfer the project over to a PIC Microchip after I design a circuit board because they're so much faster, and have way more memory.

    If you have any questions about circuit design, just let me know. The viking board is one of my older designs, and I believe International Rectifier has EOL'd the LR014N mosfets. There are plenty of other mosfets out there that will work just fine, though. Plus, much of the newer ones are smaller and take up less PCB real estate.

    Depending on the specific Arduino board you're using, you have a couple interrupts built into the Arduino IDE, but the majority of the i/o ports support interrupts on their own. It's simply a matter of writing code to manipulate the various registers, rather than relying on the Arduino specific nomenclature. Specifically, you configure PCIE0/1/2 interrupts by writing to PCICR and then set PCMSK0, PCMSK1, and PCMSK2 registers to enable them. You also need to have written functions for ISR(PCINT0_vect) etc for all the interrupt vectors to handle the interrupt when it happens.

    Unfortunately it can be slightly confusing because Arduino lists pins as "digital 1" etc, while working with interrupts outside of what Arduino provides you which means you need to keep track of the actual i/o port, such as PB1, PD2, and so forth. It's a good idea to keep a datasheet around for whichever Atmel microcontroller is on the specific Arduino board you're using.

    Also, if you start running into memory space limitations, it typically saves a few instructions whenever you manipulate i/o ports in C via the registers, rather than using the built-in Arduino functions like digitalWrite and digitalRead. The same goes for initialization. Setting the ports by directly using the registers is generally more efficient than calling pinMode.
    Last edited by FlipFlops; 05-08-2013 at 02:36 PM.

  6. #16
    Thanks for the info, Will! Your Tadao board is my primary inspiration here.

    I haven't looked at interrupts yet. That is on my TODO list, though. I did a little reading about that, and found the PinChangeInt lib. I'm not sure, but I think that provides an interface to do the arbitrary pins interrupts you're referring to.

    My primary goal here is to make something that others can hack around with and use for their own purposes. I'll likely end up keeping the code using as much of the high-level/dumbed down Arduino API as possible to keep the barrier to entry low.

    I'm curious, though. How difficult is it to convert your code from Arduino into PICmicro?

    - Gabriel

    Edit: Thanks for the tip about that mosfet. That explains why I can't find those anywhere!

  7. #17
    Insider PBSteve's Avatar
    Join Date
    May 2012
    Location
    Los Angeles
    Posts
    3,084
    Quote Originally Posted by sumorai View Post
    I did some more reading and investigating last night. The chip on the Tadao board is a power MOSFET (transistor) (LR014N). This page explained its need/use in the circuitry. This page explained the need for the diode.

    From what I've read, the microcontrollers don't have enough amperage to power the solenoid directly. So you hook up the pin on the microcontroller to the MOSFET and then hook the MOSFET up to the main power and solenoid. The MOSFET then acts like a switch, and when the pin triggers it, it powers the solenoid. The diode prevents any reverse voltage from frying the microcontroller. I get the general concepts, but I'm going to do more reading in my electronics book so I can fully understand what's going on there.

    I found some suitable S1A diodes on eBay for relatively cheap. I haven't found anywhere online to order small quantities of the LR014N MOSFET (or other equivalent 55V 10A devices), unfortunately.

    However, turns out there actually is still at least one electronics store here in MA. I'm going to go to You Do It Electronics sometime this week and see what I can find for MOSFETs. I may check my local Radio Shack first, but I highly doubt they'll actually have anything useful.

    I'm glad I was cautious about the noid and didn't just hook it up. I probably would have nuked the noid or the board if I'd tried it. I'm definitely at that point where I know enough to be dangerous, and am trying to understand things fully before I try to implement them.
    If you're looking for a better electronics book, here's the bible: http://www.amazon.com/Art-Electronic...owitz+and+hill

    I avoid Radio Shack on principle. They're not an electronics store anymore.

  8. #18
    Quote Originally Posted by PBSteve View Post
    If you're looking for a better electronics book, here's the bible: http://www.amazon.com/Art-Electronic...owitz+and+hill

    I avoid Radio Shack on principle. They're not an electronics store anymore.
    Yow! That's a pricey book. So far I'm happy with the Grob one, but that's just because I'm familiar with it. It's the one we used in my electronics classes back in high school.

  9. #19
    Ordered some of these MOSFETs. Couldn't find any with the same 55v 10a rating, so I got these that are 55v 10.7a.

  10. #20
    Micro USB cable arrived, so I could finally load a program on the femto and test it. They're not super great with their documentation, but I did find a blog post saying to select Arduino Uno as the board type when uploading code to the femto, and that worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •