Modeling with Motion Scale Model Animation Scale Model Animation 3.1 Presented by Geoff Bunza My Animation Influences Disneyland Great Moments with Mr. Lincoln Grabs and Holds the Imagination Pendon Museum (Long Wittenham, Abingdon, Oxfordshire, U.K.) preserves the idyllic rural scene and transport of the 1920s and 30s (pendonmuseum.com) The Model is the Story 2 What Makes Something Appear to Be Alive? 3 Animated versus Animation You can create animated features Blinking lights lights, Body movements movements, etc etc. When creating an animation consider the whole: • Movement • Light Li ht • Sound • Synchronization • Story 4 Movement • Circular Ci l (likely continuous) (lik l i ) Linear (movement along a line, possibly with pauses and reversals) • Steered (forced path by track, trough, or other means) • • Guided (Intelligently steered without obvious constraints) • Random (arbitrary, chaotic, nonārepeating) 5 Drives for Movement HiTec HS-55 LS-0003 Vibrator Motors Right Angle Drive Gearmotors Servo Motors Micro Stepper Motor Planetary Gearmotors Screw Drives Gearmotor Belt or String Drive 6 Motors and Gears 7 Simple Rotation One Direction 2mm Brass Tube w/ 2 2-56 56 Threaded End 2.5mm Guide Tube Hole Tapped For 2-56 Thread 8 Simple Rotation One Direction 9 Gear Reduction Drives 10 Gear Drives In Action “Bring a Wrecking Crane to Life” Model Railroad Hobbyist August 2012 http://tinyurl com/mjtwdp4 http://tinyurl.com/mjtwdp4 11 Gear Drive Mounting Alternatives 12 “Invite a Flock of Animated Cranes to Your Layout” Model Railroad Hobbyist, Hobbyist To Be Published Q4 2015 13 Screw Drives 14 Screw Drives 15 Stall Motors 16 “Teach Your Engineers to Turn Heads,” Model Railroad Hobbyist, February 2013 http://mrhpub.com/2013-02-feb/land/#100 Belts and Bands 18 “A Visit to Bob’s Barber Shop – Animation in HO Scale” Railroad Model Craftsman. To Be Published 19 Band Drive 20 Hammer and Anvil • 6mm 6mm Planetary Planetary Drive Motor • 0.012 Wire Linkage to Arm 21 Hammer and Anvil 22 Turning DC Motors On Magnetic Reed Switch IR Proximity Sensor Hall Effect Magnetic Sensors Switches Transistor Switch Hi In – Low Out S Sensors (Environmental Switches) Relays (5V & 12V) (Switch on a Switch) L298N Dual H-Bridge DCC Decoders 23 Servo Motors 3G Servo Blade Servo 9G Servo 3 Wi Control: 3-Wire C l 1. 2. 3 3. 4.5-6.0 Volts DC Common/Ground Control Signal (Pulse Train) 50 Hz / 20ms Duration 24 Example: Servo Drivers Arduino Button Control* (About $5) TAM Valley Octopus III A d i DCC M Arduino Multifunction ltif ti Decoder D d Control** C t l** (About $5) ** http://model-railroad-hobbyist.com/node/20739 Team Digital SC8 The Proto:87 Smartswitch *Program “Clinic_ServoTestSet_4_switched_slow.ino” is in: http://home.comcast.net/~gbglacier/Clinics/AnimationControl_Clinic_adds.zip Servo Door Openers 26 Stepper Motors o 18 Step! pp Motor Stepper Geared Steppers pp Miniature Stepper pp w/Screw Drive 4 5 6 - Wire Control: 4,5,6 1. 2. 3. 4-12 Volts DC Complex Sequencing Pulsed & Polarityy Reversals (Bi-Polar & Unipolar) o 0.18 Step! 27 Stepper Motor Control 4,5,6 - Wire Control: 1. 2. 3. 4-12 Volts DC Complex p Sequencing q g Pulsed & Polarity Reversals (Unipolar & Bi-Polar) & Arduino Pro Mini L298N Dual H-Bridge Gearmotor/Servo/Stepper Issues 29 Timing, Cueing, & Synchronization • Consider Animation as a sequence of actions – – – – – – • • • • Move this… Play these sounds… Set this speed… Turn this light on… off… on… … Wait so long… Wait until something happens happens… How does an action start ? What are the delay times among actions ? How are the actions coordinated ? How does an action end ? 30 Triggers & Cueing • A Trigger is a detectable change – Switch closure: metal contacts, push button, switch… – A sensor change: h optical i l sensor, magnetic i sensor… – The end of a timer: mechanical or electrical or program • A Timer is some mechanism that has a known delayy • A Sequencer provokes one or more actions at different time intervals • Cueing is the coordinated start of multiple actions– like movement start and sound generation • Action ends with: – – – – Completion of sequence End of time period Ending trigger No end – continuous loop 31 Mechanical Timing & Sequencing 32 Mechanical Timing & Sequencing Brass Drum Battery y + Insulating Tape MOTOR Start Button Contact Wipers Resistors LEDs Start Button Moves Drum Off “Stopping” Tape Wipers Close the Circuit to the LEDs 33 Scripted DCC Control • JMRI • JMRI/Jython Scripts ##### Set Speed to Forward, stopped self.throttle.speedSetting = 0. self.throttle.setIsForward(True) self.waitMsec(self.delay*400) ( y ) ############## F8 on, forward" self.throttle.setF8(True); self.throttle.setIsForward(True) ( ) self.waitMsec(self.delay*50) ############## F6 rear light on self.throttle.setF6(True); self.waitMsec(self.delay*500) ############## Mute (F8) off" self.throttle.setF8(False); self.throttle.setIsForward(True) self.waitMsec(self.delay*1000) ######### Whistle self.throttle.setF2(True); self.waitMsec(self.delay*500) self.throttle.setF2(False); 34 Scripted DCC Control 35 Programmed Timing & Sequencing • Why Bother? – Way y More Flexibility y Than ANY other Method – Low Cost – Easy to Modify/Change • Multiple triggers • Multiple Kinds of Triggers • Lights, Motors, Relays, Servos, Sensors • Pseudo Random Sequencing • Different Sequences Can Run Simultaneously • DCC Library Already Written • Support S tF For Sound S d Generators G t (MP3, (MP3 WAV & AD4) • Additional Tutorials, Books, Libraries, Examples • Low Power for Battery Applications & On-Board Loco/Car Animation 36 Programmed Timing & Sequencing Arduino Pro Mini Digispark $3.84 $2.59!! Qty 1 http://tinyurl.com/oamynj5 Arduino Uno $11-$30 $11 $30 Qty1 Atmel 328P on SurplusGizmos.com Atmel Lite Kit $6.75 Kit Only Atmel ATMega328P Mouser.com $2.24 Qty1 Solderless Breadboard // http://www.arduino.cc http://sparkfun.com http://www.adafruit.com Alternatives: MC PIC Processor TI LaunchPad 37 The Essentials for Programmed Sequencing http://tinyurl.com/oamynj5 http://tinyurl.com/ld6sgy3 Arduino Pro Mini-$2.59 USB to Pro Mini Cable-$6.88 (Need One) PLUS http://arduino.cc/en/Main/Software http://www.arduino.cc/ Download Software for FREE An Arduino Cookbook for Modelers: Starting from Scratch with an Arduino Pro Mini (or Moteino) http://mrhpub.com/2014-11-nov/land/#99 38 Now Combine Sensors and Control Wi G id d Mobile Wire-Guided M bil Crane C 39 What Model Drives Were Left Out? 1. Solenoids 2. Spring Drives 3. Ultrasonic Piezoelectric Motors 4 Nichrome Wire 4. 5. Miniature Gas Engines 6. Miniature Live Steam Engines 7. Miniature Jet Engines 8. Elastic Drives 9. Muscle Wire 10.Pneumatic Piston Drive 11.Hydraulic Piston Drive 40 Useful Links and Sources: Electronics Parts sources: http://www.digikey.com -- Commercial first quality parts http://www.mouser.com -- Commercial first quality parts http://www.allelectronics.com -- Surplus Parts, LEDs, motors http://www.surplusgizmos.com p p g – Surplus p p parts http://www.goldmine-elec-products.com -- Surplus parts http://stores.ebay.com/ledbaron -- Wired SMD micro LEDs http://www.ngineering.com -- Wire LEDs & tools http://stores.ebay.com/tech-fixx p y -- 38 Gauge g Wire Source: Arduino parts of all sorts: http://sparkfun.com -- Stuff for sale & reference material http://www.adafruit.com -- Stuff for sale & reference material http://ebay.com/ p y -- Lowest cost Pro Mini boards Arduino reference material: http://www.arduino.cc -- Arduino website: libraries, tutorials & reference http://railstars.com/software/cmdrarduino -- Free DCC Software Library for Arduinos http://tinyurl.com/mvqmrlj p y q j -- ModelRailroadingWithArduino2.pdf g p -- John Plocher Clinic Slides from 2011 NMRA Convention in Sacramento, CA This Presentation: home.comcast.net/~gbglacier/Clinics/Modeling_w_Motion_NMRA2015.pdf Clinic Supplemental Materials: home.comcast.net/~gbglacier/Clinics/AnimationControl_Clinic_adds.zip 41 Here are links to some of my animation articles which are all in free online Modeling Magazines: Using Micro LEDs on Your Layout MRH http://model-railroad-hobbyist.com/magazine/mrh-2012-02-feb htt // d l il d h bb i t / i / h 2012 02 f b (Page (P 74) Crossbucks and Crossing Gates NYCSHS http://www.nycshs.org/pdf/NYCM_2Q2012.pdf (Page 24) Bring a Wrecking Crane to Life MRH http://tinyurl.com/mjtwdp4 (Cover Article, Page 53) Teach Your Engineers to Turn Heads MRH http://publ.com/5nm2Wxy#/100 Scale Flash Photography MRH http://mrhpub.com/2013-07-jul/land/#/51 Scale Model Animation Adding Life to a Layout Railroad Model Craftsman Magazine, g Mayy 2014 Battery Powered Models in HO Scale MRH http://mrhpub.com/2014-11-nov/land/#/83 Starting from Scratch with an Arduino Pro Mini (or Moteino) http://mrhpub com/2014 11 nov/land/#99 http://mrhpub.com/2014-11-nov/land/#99 You can read my Scale Model Animation blog here (Animation & DCC decoders): http://model-railroad-hobbyist.com/blog/geoff-bunza and y you can see additional videos on my y YouTube channel on animation: http://www.youtube.com/user/DrGeoffB I hope you enjoy them too! 42 A Step by Step Cookbook for the Modeler Using the Pro Mini can be found here: Starting from Scratch with an Arduino Pro Mini (or Moteino): http://mrhpub.com/2014 11 nov/land/#99 http://mrhpub.com/2014-11-nov/land/#99 A good start for the Arduino Learning curve would be the tutorials at: http://arduino.cc/en/Tutorial/HomePage and d there th are allot ll t off topics t i there th for f search h ffor a subject bj t or b browse or http://www.instructables.com/files/orig/F3J/MTJN/FVW22MXN/F3JMTJNFVW22MXN .pdf p or http://www.richardvannoy.info/arduino.php or http://arduino info wikispaces com/TUTORIALS http://arduino-info.wikispaces.com/TUTORIALS Now these offer info at different learning levels so pick one you are comfortable with, or ask a specific question and I will point you in the right direction. If you are using an Arduino Pro Mini (cheapest full function available) try: http://arduino.cc/en/Guide/ArduinoProMini for getting started. For combining DCC decoder control of Building Lighting animation try: Scale Model Animation 18: DCC Control for Random Building Lighting http://model-railroad-hobbyist.com/node/23026 43 Modeling with Motion Scale Model Animation Scale Model Animation 3.1 2.0 Geoff Bunza gbglacier@comcast.net