Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Motor Control in an Airsoft gun


  • Please log in to reply
8 replies to this topic

#1 stacyh3

stacyh3

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts

Posted 01 September 2010 - 04:12 PM

Hello all,

I'm pretty new to electronics and still developing basic design skills (I'm a software person). I'm hoping someone can give me some simple guidance.

My son and one of his friends are modifying an electric airsoft gun so that the firing mechanism is controlled by a microcontroller. They want to be able to have the trigger be a button press that the microcontroller reads and depending on the programming will activate the motor in the airsoft gun. There's a little lever in the gun that moves each time the gun is fired. By adding another switch that this lever will hit, we can count how many times the gun has fired. The microcontroller can then be programmed to give us variable bursts when firing.

My questions are:
  • Does this seem reasonable so far?
  • What's the best way to control the motor?
  • Should we use a MOSFET or a solid state relay? What are the practical differences in the two?
  • Anyone care to venture a circuit diagram that will help us?

I realize that being new to this, my questions may not all be well-formed, but I'm hoping this will get us moving in the right direction.

Thanks,
Stacy

#2 Szymon

Szymon

    Advanced Member

  • Members
  • PipPipPip
  • 108 posts
  • LocationPoland, Krakow

Posted 01 September 2010 - 06:45 PM

Hi Stacy, Recenty there was a series of posts on the Make Blog about using Arduino to control aNerf Sentry Gun. Maybe this will give you some ideas to start with: Here are few of the posts in this series: http://blog.makezine...uild_wirin.html http://blog.makezine...emassembly.html http://blog.makezine...uild_prima.html http://blog.makezine...denclosure.html http://blog.makezine...king_stand.html http://blog.makezine...uild_motor.html They apparently used relays for this project: http://blog.makezine...olderrelay.html

#3 stacyh3

stacyh3

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts

Posted 01 September 2010 - 07:40 PM

Thanks! I'll check out those links. I'll take all the knowledge I can get on this one. If anyone else has thoughts, please chime in. I'm going to try to get some photos of the mechanism in the airsoft gun. It's all very heavy and mechanical. I'm also worried about how we're thinking of using a moving lever to tap a switch that will count shots. If we can get that and the motor control nailed, then the rest is just software. Stacy

#4 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 01 September 2010 - 08:33 PM

I'm also worried about how we're thinking of using a moving lever to tap a switch that will count shots.

There are numerous types of microswitches that could be used. However, mechanical switch may not be the best option (it will wear off, bounce etc.), I would suggest one of non-mechanical sensors like optical (transmissive or reflective) or Hall effect (magnetic). Personally, I would go with the optical sensor, because it is very cheap, reliable, can be easily connected to a microcontroller and will last for ages.

Transmissive optical sensor (aka Slotted Interrupter): Place a light source (LED, visible light or IR) on one side of the lever and a phototransistor (better than photodiode, because can produce digital output) on the opposite. Drill small hole in the lever so the beam from LED can go through the hole to the phototransistor; or use any protrusion on the lever to interrupt the beam while moving (falling edge is sometimes easier to handle).

Reflective optical sensor: It may work 'as-is' using a moving protrusion to reflect beam to detector, or you can (e.g.) glue some reflective tape on the lever.

Hall sensor: Glue small magnet on the lever so it moves over the Hall sensor. They are available with either linear (voltage) or digital outputs, even with bus interface (I2C, etc.).

If we can get that and the motor control nailed, then the rest is just software.

What kind of motor? Do you need to control its speed or just start/stop?

#5 stacyh3

stacyh3

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts

Posted 01 September 2010 - 08:58 PM

Yes, those ideas make more sense than the switch. I'll take another look at the lever in the gun to see what we can do. This is fantastic help. Thanks very much!

The motor is this one: ICS Turbo-3000. I haven't found an actual spec sheet yet. We just need to control on/off really.

I also ran across this: Using a transistor to control high current loads with an Arduino which seems like it would work.

Thanks again!

#6 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 01 September 2010 - 09:40 PM

The motor is this one: ICS Turbo-3000. I haven't found an actual spec sheet yet. We just need to control on/off really.

Are there any ratings (voltage, current, power) on the motor? It seems to have ~102 W power at 8.4 V, which means current ~12 A - this is way too much for the transistor used in that Arduino article (it has 5 A continuous, 8 A peak). You'd need a power MOSFET or IGBT transistor. The wiring is rather simple, just connect transistor's gate to Netduino pin using a current limiting resistor (it limits the instantaneous current that is drawn from the pin when the transistor is turned on), load (motor) between Drain and Vdd (motor supply voltage), Source to ground. It is also recommended to use a clamping diode to protect the transistor (it may have one built-in) when switching inductive loads (like motors or solenoids).

#7 stacyh3

stacyh3

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts

Posted 02 September 2010 - 01:18 AM

Okay. I'm starting to understand a bit more. I'll ask my son and his friend to look on the motor itself for any additional specs, and I'll look at the types of transistors you mentioned. I appreciate the great explanations! It makes this fun for novices like me when we get such great help. Thanks! Stacy

#8 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 02 September 2010 - 08:06 AM

I'll look at the types of transistors you mentioned.

Transistor selecting parameters guide:

  • VDDS (Drain to Source Breakdown Voltage) > ~10 V (depending on the motor),
  • ID (Continuous Drain Current) > ~15 A (max current calculated from motor power, plus some % 'just to be sure'),
  • RDS (Static Drain-to-Source On Resistance) - lower is better
For example, IRFZ44 (pdf) should be fine (VDDS = 60 V, ID = 50 A, RDS = 0.028 Ω, diode built-in). The transistor will have to dissipate about 4 Watts at 25 ºC, so check the package temperature and consider adding a heatsink in case it gets hot (there are formulas available on the Internet to calculate the heatsink size).

#9 stacyh3

stacyh3

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts

Posted 02 September 2010 - 10:57 AM

Very cool! Thanks! I'll keep this thread up to date as we make progress. Stacy




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.