Shop OBEX P1 Docs P2 Docs Learn Events
Controlling two motors with joystick or two dials — Parallax Forums

Controlling two motors with joystick or two dials

edited 2007-10-29 01:11 in BASIC Stamp
I've spent an hour searching, but can't really find a similar project to steal the ideas from, so I'm hoping someone can nudge me in the right direction:

I'm planning on building a cable-operated camera mount that can pan and tilt via two motors.
The camera mount should be controlled either by a joystick or via two dials, one for each axis.

I'm afraid regular RC servos won't be strong enough, so I imagine I will have to use motors (DC or step?) connected to the axis via gears to provide enough torque.

Crucial features:
* Silent or near-silent operation
* Super-smooth (no jerky steps)
* Variable speed (a quick dial-turn/joystick-push should result in quick camera movement)

I have a BASIC Stamp 2p 24-Pin module and a USB Board of Education.

Any tips appreciated!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-28 23:19
    The HB-25 motor controller will handle a pretty good size motor and makes it look like a servo to the Stamp. The speed and direction depend on the width of the servo pulse (as it does with a continuous motion servo. DC motors won't give you feedback on motor position, but it sounds like the motion will be with visual feedback.

    You could use a potentiometer for each axis with the Stamp reading the resistance value using RCTIME. Center position would be stop while to either side would provide a direction and the distance would give the speed to use. You'd need some kind of limit switch to prevent damage to the pan/tilt head.

    Good references are : The "What's a Microcontroller?" tutorial, www.emesystems.com, and the "Industrial Control" tutorial. The tutorials are downloadable from Parallax's website (see the Downloads menu).
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-10-28 23:25
  • edited 2007-10-28 23:51
    Thanks for the quick replies.

    Yes, the positioning would be done visually, so no need to monitor the position of the motors.

    Could I use any of the smaller motor controllers from Parallax, or would I need two of the heavy-duty and expensive HB-25s?

    Mike, if I understand you correctly, I would use RCTIME to monitor any difference in the resistance, and use that to calculate the speed and direction of the movement? Isn't there a risk of reaching the outer limits of the potentiometer, wouldn't it be better to somehow get a dial that just provided pulses that could be counted so that I wouldn't reach the outer limit of the potentiometer's range and not be able to get the the camera head's outer limit?

    The JimmyJibs are far too expensive at over $7,000. However, the Underslung head:
    http://www.b-hague.co.uk/pan__tilt_power_head.htm#UPH
    ...looks far more in my price range. I'd love to build one myself, if I felt confident it could be done over a weekend.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-29 00:06
    The Pololu controller looks like it would do what you want ... assuming that the motors you choose are compatible (in terms of voltage / current).

    I'm assuming that you will use the potentiometer to set the motor's speed and direction, not the actual position. As a result, the "outer limits" of the potentiometer's range are not very important. You will need limit switches as I mentioned to prevent the motors from going too far in any direction. You could use an optical (flag) sensor or a mechanical sensor ... it depends on how you've built the head.
  • edited 2007-10-29 00:24
    Mike,

    Would I need a special kind of potentiometer that has a "zero" position in the middle, or would I just determine that a certain value in the middle of the range was to be interpreted as "stop?" I assume I'd handle this in software.

    Seems like I'd only need one Pololu controller for two independent motors up to 1A each, right? That would be a lot cheaper than using two HB-25s.

    If I attach one switch at each extreme position of the axis and then make sure that the corresponding switch isn't activated before telling the motor controller to turn the motor in that direction, that would do it, right?

    Thanks again for all the help!
  • D FaustD Faust Posts: 608
    edited 2007-10-29 00:46
    Find the middle value for the pot.

    Yep, one controller

    Limit switches are good ideas too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --DFaust
  • edited 2007-10-29 01:11
    Great, thanks! Seems like an old Atari joystick would make for a cool controller!

    If you know any code that would be a good starting point, please post a link. It's been a while since I was coding...

    I've found some starter code in the What's a Microcontroller, I'll go from there when I get the Pololu.

    Post Edited (General Specialist) : 10/29/2007 1:23:38 AM GMT
Sign In or Register to comment.