Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Timed servo control?

  1. Feb 10, 2010 #1
    I am a computer programmer and not an electrical engineer so please pardon my ignorance in your field. I am interested in turning a knob 5 times per day, the fifth turn is for returning to the neutral position at the end of the day using a servo (unless you know of another method).

    I basically want to set a programmable timing device capable of 5 settings in a 24 hour period (alarm clock maybe?) that will deliver the correct voltage and pulse length(s) to a servo and cause the servo to turn x number of degrees at each time setting. The fifth setting returning the servo to the neutral position.

    Any ideas how I can achieve this? It is meant to turn a small knob on an electronic ballast for a set of lights to simulate the phases of sunlight throughout the day without opening the ballast and messing with the internal circuitry.

    Thank you.
     
  2. jcsd
  3. Feb 10, 2010 #2

    vk6kro

    User Avatar
    Science Advisor

    As a computer programmer, you might enjoy getting used to microcontrollers.

    Depending on your background, you can get different chips that are programmed in C or Basic and then the chip can use a large library of built-in tools to control its many inputs or outputs. The Picaxe has a "debug ' command and this feeds information back to the computer while the program is running, so you can easily find programming errors.

    I have used the Picaxe chips and like them, but there are others like Arduino and Stamp.

    Have a look at this:
    https://www.physicsforums.com/showpost.php?p=2521600&postcount=6

    This link gives more info about these chips and some programming examples.
    http://www.picaxe.orconhosting.net.nz/ [Broken]

    Or do a search on this Forum for "Picaxe". There have been a lot of articles about them and I have posted a few of those.

    Doing this with a micro would allow you to make changes to the servo setting each second during the day if you like.

    If you used incandescent lamps, you could skip the servo and control the lights with pulse width modulation from the micro.
     
    Last edited by a moderator: May 4, 2017
  4. Feb 10, 2010 #3
    Perfect. Thank you.
     
  5. Feb 11, 2010 #4
    I have read about picaxe and microcontrollers in regard to servo control and it seems like a good fit however, I dont work with breadboards and electrical circuits so I dont know how to mount the picaxe chip, power it, wire the servo, etc.

    Is there a kit that has the power supply, circuit board with picaxe wired, compatible servo, etc that I can buy? Then use the picaxe programmer software and cable to program the picaxe chip to control the servo?

    Thank you.
     
  6. Feb 11, 2010 #5

    dlgoff

    User Avatar
    Science Advisor
    Gold Member

    vk6kro might have a better suggestion but this http://www.apogeekits.com/pic_programmer_vm111.htm" [Broken] is pre-assembled.

    Edit: For a power supply, a simple "wall wort" like this one will work.
    http://www.apogeekits.com/12vdc_adapter.htm" [Broken]
     
    Last edited by a moderator: May 4, 2017
  7. Feb 12, 2010 #6
    The experiment board does not have a servo integrated and does not use picaxe so the cost is too high given my project and considering the fact that I still have to obtain and wire up the servo.

    The ac to 12v dc converter is helpful but I thought I read that picaxe runs at 6v and that anything higher would burn the chip. I assume that if that is true and I used the ac to 12v dc converter that I would have to use a resistor on the board to step the 12v down to 6v before it gets to the picaxe chip? Please keep in mind that I am not an electrical engineer and do not know about resistors/transistors/capacitors/relays in any detail.

    All I am looking for is an actuator that can be set to mechanically turn a knob x degrees a few times a day and since I am a computer programmer, it was suggested to use a microcontroller.

    I have read and I do understand the logic behind setting the microprocessor to send x voltage for x seconds on output pin x to the servo to change the servo position and if I am using the picaxe servo command to do this, picaxe will also send the pulse commands to keep the servo in the last command position until a new command is sent or until the program exits. This is easy for me to grasp and works for my project. My issue is that I cant read electrical diagrams or build the board so I need a board that can:

    (1) take 12v dc and step it down to the input voltage for picaxe.
    (2) have a usb interface so I can program the picaxe chip.
    (3) have a single servo integrated that has an output lead from picaxe going to the servo control lead.

    Thats really all that I need and I should be able to tell picaxe to:

    (1) send x voltage for x seconds on pin x to the servo control and reposition the servo.
    (2) hold the servo there while pausing for x seconds.
    (3) after x seconds, send y voltage for y seconds on pin x to the servo control and reposition the servo.
    (4) hold the servo there while pausing for y seconds.

    .... you get the idea.

    I dont need programming or concept help at this point. I just need the assembled hardware.

    Any ideas where to get this hardware? I can assemble something as long as i have a complete list of parts and a wiring diagram that is written for a layman vs an electrical schematic. Something that says put part 1 in the breadboard in pins 380 and 382.
     
    Last edited by a moderator: May 4, 2017
  8. Feb 14, 2010 #7

    vk6kro

    User Avatar
    Science Advisor

    Any ideas where to get this hardware? I can assemble something as long as i have a complete list of parts and a wiring diagram that is written for a layman vs an electrical schematic. Something that says put part 1 in the breadboard in pins 380 and 382.

    Have a look at this:
    http://dl.dropbox.com/u/4222062/Picaxe%2014.PNG [Broken]

    These are very simple circuits. All you need is some way to anchor the parts so they don't short circuit to each other.
    Mostly, you can just lay the circuit out exactly like the schematic.

    If you make up a circuit it only takes a couple of resistors to make it programmable. So, you would just have a small cable going to the serial port of a computer and you could change the operation whenever you like. If you do this, you can even solder the chip into the circuit and leave it there. It can still be reprogrammed.
     
    Last edited by a moderator: May 4, 2017
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook