Shop OBEX P1 Docs P2 Docs Learn Events
What's a Microcontroller Book Chapter 4 Controlling Motion Servo — Parallax Forums

What's a Microcontroller Book Chapter 4 Controlling Motion Servo


Servo lesson it is.Fool with stepper motor later.

Any tips about this?

Can't find some of the Homework boards around here.

Comments


  • All we can find right now is USB Board of Education that is mint unused.

    Will sacrifice it in the name of science just to get going here.

    Okay. Will test it and read servo chapter.
  • What's a Microcontroller - ServoCenter.bs2
    ' Hold the servo in its 90 degree center position.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    DEBUG "Program Running!", CR
    DO
    PULSOUT 14, 750
    PAUSE 20
    LOOP
    

    Here's the fist chunk of code in the lesson.

    Will post assembler version in a bit here.

  • We have liftoff!

    Sort of.Ready to begin this without distractions.

    Accounted for all BOE boards. The only used one is at our other location.

    Found these:

    Homework boards-2

    Stamp 1 Activity board

    So a productive search.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-04-04 05:13
    Some more things happened.

    Used Startech USB/Serial adapter cable and serial port Homework board and Pbasic IDE like it!

    Little problem of low 9v battery at the start but now everything is hunky dory.

    So assembling circuit and running code snippet should go well.


  • Remember where we left off with this before.

    https://www.parallax.com/sites/default/files/downloads/27964-Stepper-Motor-Documentation.pdf

    What is this stepper motor we have?

    Two part numbers.

    PM4222

    20120726

    7.5 degree 100 ohm

    Is this the parallax stepper motor?
  • Microcontrolleruser,

    Remember that motors are power devices so they need a considerable amount of current operate.
    The current a motor needs to start or when it's stalled can be many times what the stated or no-load current is.

    A servo for example may draw up to Amp when starting or stalled.

    Since 9V batteries are usually made of 6 batteries that are smaller than AAAs they don't have a very high capacity and a servo will quickly suck them dry.
    You may notice that the servo stutters and if the battery is very weak then the BS2 may even reset as the servo moves.

    A servo will try to hold it's position as long as you keep sending pulses to it but as soon as you stop sending pulses the servo can be turned easily.
    Standard servos are not designed to move completely around and can be damaged if moved beyond their limits.

    As for Stepper motors, there are 2 main types, called Unipolar and Bipolar but many steppers are actually hybrids and can be wired either way.
    All steppers have several coils such as 2 so the type depends on how the coils are connected.
    The ends of each coil will always come out of the stepper so for a 2 coil stepper there will be 4 wires and if there aren't any more wires then it's a bipolar stepper.
    To move a Bipolar stepper you need to control the current direction of each coil which makes the control electronics more complicated.
    In a Unipolar stepper the center of each coil is connected to another set of wires.
    These center wires may be separate or connected to one common wire.
    If the center wire is connected to one end of power then connecting one of the coil ends will move the stepper.
    The control electronics for a Unipolar stepper are just simple switches but since only half of a coil is used at a time it's not as strong as a Bipolar.

    A Unipolar is simpler to use but a Bipolar has a lot more torque or holding power.
    There is a particular order that coils need to cycle through to move the stepper and reversing that order will make it move in the other direction.
    It's called a Stepper Motor because each time a coil is cycled the motor will "step" to the next position.
    There are ribs on the rotor or moving parts of the motor that engage with teeth on the stator or fixed part of the motor.
    The coils are in the stator and each coil has it's set of the teeth.
    There are several ways to move a stepper motor.
    The motor can be cycled in sequence called Full Stepping or the midpoint between teeth can also be used called Half Stepping.
    Half Stepping gives a smoother movement but it also takes twice as many steps to move the motor around.
    There is a limit to how fast the motor can be stepped before it starts skipping or jumping steps.

  • Thank you!

    Yes. That's a mistake asking about stepper in this post.

    Sorry.Oops!

    What's going on is ultimately we will do the STEPPER.

    Right now we are doing the SERVO because it's doable.

  • Getting one of these.

    https://www.parallax.com/product/pbasic1_p

    Stamp 1 DIP.Might come to our senses and get a Stamp 2. More memory.Better instruction set.

    Anybody can confirm that the 93LC56 EEPROM is the right one for Stamp 1?
  • Mike GreenMike Green Posts: 23,101
    edited 2018-04-05 16:05
    As for any other questions of this type, go to the product webpage, look under the "Downloads & Documentation" tab and you'll find a link to the schematic. Open that and you'll see what parts are used including the EEPROM.

    I have a couple of Basic Stamp 1 boards around that I still use (Prop-1 from EFX-TEK). For small, slow programs, they work fine. I have one that provides a timer for a small "sump pump" to drain the tank of a dehumidifier in our basement.

  • Mike

    I came to my senses about that.

    Basic Stamp 2 SX. Pretty neat. It is a SX that stays within the Basic Stamp editor.

    More memory and more of everything really.

    Fits the PIC buying rule of get the most features you can when looking for a chip.

    Will grab a Stamp 1 DIP after SX and BS2. I like the little guys.:)

  • I keep forgetting to say.

    Getting a DIP Stamp to get rid of the cluttter and distractions.

    Plus do things the 'real' micro development way.

    Prototype on a breadboard.Commit to solder next.

    I don't want to jumper over to breadboard from a Homework/BOE board.
  • The BS1 and BS2 are the only Basic Stamps still available that are based on the PICs. All the others are based on the SX if that makes any difference for you.

  • 'The BS1 and BS2 are the only Basic Stamps still available that are based on the PICs'

    Will look into swapping between stamps and pics in a socket.

    Have looked at it a couple times and Parallax really scrambled the pins for doing something like that.

  • "scrambled the pins" ??? ... hardly

    Groups of 8 I/O pins on opposite sides of the module running 0-7 and 15-8 towards one end ...
    clearly to make the use of groups of I/O pins easier.

  • Let me make it clearer.

    Matching up Stamp1 or Stamp2 DIP with corresponding PIC.

    I think VDD and VSS match up and it goes down hill from there.


  • Getting organized here.

    Will put the stepper motor away and get out the servo motor.

    Will used Stamp 2 board to get going on this.It matches What's a Microcontroller text.

    Have something to do first.LED experiment.

  • Big news.

    Pulled the Stamp 2 module off of BOE and put it on breadboard.

    Much better. No clutter.

    Looks like connect VDD and VSS and off you go.

    Little bit about connect to VDD or VNN but it all make sense.

    We're using a 3 AA battery box.It's a nice clean ilttle setup
  • microcontrolleruser,

    If you are using 3 AAs then keep an eye on their voltage because you are not far from the "brown-out" voltage or the voltage where the Stamp will stop working and reset.

    Also remember that the Stamp does have a built-in voltage regulator but it's only meant to power the module itself so it doesn't supply a lot of current.

    Development boards have large voltage regulators on them.

  • Thank you.

    Have 5v power supply if the battery box causes problems

    I intrigued by how the Stamp Help Hardware section in Stamp Editor says something.

    5v to VNN pin and you're ready to roll.There's more in the section.

    It's in the pin description.
  • microcontrolleruser,

    Batteries are best for a servo unless you are positive that the power supply is regulated.
    4 AAs would be perfect for the Stamp and a servo.

    Also check if your power supply a positive or a negative center pin.
    Most should be center positive but older ones may be center negative.

    Hooking power connections backwards can definitely release the magic smoke.

  • Using the Stamp 2 module in place of Stamp 2 DIP.

    I am a little reluctant to come bombing in with a wall power adapter.

    Like 9v or 7.5v.Do have barrel to terminal adapters.

    Stamp 2 Module has option of connecting regulated 5v straight to module.

    4.5 volt battery box is regulated @5v for now.

    Keeping it simple.


  • I forgot about the programming connections.

    Will order one of these.

    http://futurlec.com/Computer_Adapters.shtml#USB_ADAPTER_A

    It's the second one down.

    If you do this make sure you get a female DB9 adapter.

    In the meantime will put Stamp 2 module back on BOE board.
Sign In or Register to comment.