serial motor control..

Discussion in 'Mac Programming' started by jer446, Nov 2, 2006.

  1. jer446 macrumors 6502a

    Dec 28, 2004
    I would like some help on how to control two motors through a serial port, and then add some sort of graphical interface. (it will run on windows ehh) i can use basic x or a pic if i wanted to.. i already made two h-bridges to control the motors (would i still need them?) yeah right?
    If anyone would like to help me, i would love them :)
  2. jer446 thread starter macrumors 6502a

    Dec 28, 2004
  3. darkwing macrumors 65816

    Jan 6, 2004
    This is the kind of thing I've done a lot. It sounds like you need to send the step signal to stepper motors at a pretty constant rate. You also probably want to vary the rate at the beginning and end of a movement in order to smoothly accelerate and decelerate the motor. Is this correct?

    If so, using Windows to do this is not really going to work. It's important for a stepper motor to receive a very consistent signal in terms of timing, and Windows is not a realtime operating system. I suggest using a PIC to control the motors and have them receive their commands over the serial port. Or, there's always RTAI on top of Linux out the parallel port.

    Let me know if I can be any help.
  4. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
  5. R.Youden macrumors 68020


    Apr 1, 2005

    The best way to do this would be to control it via a PIC. Any type would do really. The best way to inteface with the PIC would probably be through hyper-terminal I guess if you are in a Windows environment.

    As stated you will need to 'ramp' your stepper motor to prevent it from stalling if you try and run it too fast at the start. If you look on themaxim website you may be able to find something that will do it for you. The problem you will have is that you need to purchase the software side of things to program the PIC which is often what is so expensive.

    EDIT: I had a quick scan through this AN3161 and it may do what you want. If you want some graphical interface then you will need a feedback sensor which I believe this chip can provide.

    Also you stated that you had built a H-bridge (out of interest was that a pure transistor bridge or made out of a standard chip?) so I guess you are going to be using a brushless DC motor or something like that therefore you wont be using a stepper motor so ramping is not such an issue but should still be considered. At high speed when you are braking the motor you will get inertia effects which you should be able to control with a good feedback loop. Anyway if you want any help just left me know and I will see what I can do.
  6. jer446 thread starter macrumors 6502a

    Dec 28, 2004
    yeah im not going to be using stepper motors.. just some dc gear head motors.. maybe windshield wipers or something like that.
    My h-bridge is a smokeless h-bridge, i think it was originally designed by Bob Blick. I am so angry at myself right now, I think i completely ruined one of my boards.. or at least the transistors..
    I had to switch batteries because one was low. I took it out of the pigtail, and put the new battery on. I did not realize that on this battery the terminals were opposite, so I just left it plugged into my board... then the magic smoke came :(..
    so anyways i will have to get my h-bridges back up and running.. and i need to figure out my software solution to controlling the motors..

Share This Page