Shop OBEX P1 Docs P2 Docs Learn Events
i need help writing a very basic motor control program — Parallax Forums

i need help writing a very basic motor control program

RHSYSTEMSRHSYSTEMS Posts: 2
edited 2008-01-31 14:21 in BASIC Stamp
im make a device that raps coils and it uses 2 motors. one motor raps the coil while the other guides the coil back and forth. it is just like a fishing rod reel. its for making electro magnets. i just need to run the motors for about 45 seconds and be able to adjust the speed of each motor. the motors are small and use low electricty and can proably run right off the board. im happy with using paluses to control the speed. does anyone have any suggestions? im making coils for micro RC planes and would be happy to make you some coils in exchange for programming help, if your into indoor RC.

Thanks!

Robert

Comments

  • ZootZoot Posts: 2,227
    edited 2008-01-25 23:23
    What device (microcontroller) were you planning on programming?

    Depending on the kind of motor control you need, and the motors, the Stamp may or may not be suited (by itself) to your needs.

    Have you worked out any circuitry yet for amplifying the signal from the programmed device to actually run the motors, or were you going to buy an "off the shelf" motor driver for that purpose?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • VinayVinay Posts: 1
    edited 2008-01-29 02:26
    To control any kind of inductive load, you would need a good driver. To control DC motors you need H Bridge circuits and with enough back EMF protection to prevent any influences on you Basic Stamp. I have worked with some ready driver board kits from Anykits www.anykits.com/catalog/index.php?cPath=46 and they interface very well with stamps and provide an easy solution to driving heavy duty motors.
  • unteerunteer Posts: 5
    edited 2008-01-30 02:12
    I am actually using commercially available Electronic Speed Controls, which are basically digital reiostats with some cool circuitry like battery eliminator circuits. But i need my esc's to be doing a lot more work than coiling wire, so it may be overkill for your project.
  • Sadao Fujiwara-sanSadao Fujiwara-san Posts: 31
    edited 2008-01-31 14:21
    when i was hacking a little toy car this is the code i used to control it you can modify it to your needs just ignore the comment's in it also read the what is a microcontroller tutorial

    ' Electric Vehicle program electricvehicle.BS2
    ' By: Tristan Bissinger 1-28-07

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    ' objective run car for 5-10m. find target time.

    '

    ' I/O ports ' This lables the I/O ports that the bs2 will use.
    fforward PIN 1 ' If this segment was not here the stamp would not
    rreverse PIN 0 ' know which ports(pins) to use, it also labels the
    lleft PIN 15 ' variables that will be used.
    rright PIN 14
    '

    ' Switch to outputs ' This segments tells the bs2 that the variables are
    LOW fforward ' all outputs.
    LOW rreverse
    LOW lleft
    LOW rright
    '

    ' Main line ' This is the part progam that makes the little car
    HIGH fforward ' go and can be motifide in any way.
    PAUSE 5000
    LOW fforward


    END
Sign In or Register to comment.