Camera Tracking With Dc Motor


Something sprung to mind which I'm not too sure about, so hoping somebody can help me.

Can I use a DC motor (with H-bridge) to move while using camera tracking?

I've only ever done this with servos to move a head, and I know you can have a robot move to the tracking direction using "Relitive Tracking" which I believe uses a Movement Panel, but the DC motor I would use wouldn't be using a Movement Panel, as its for neck movement only.

Any ideas or script/project examples on how this is done, if at all. I had a quick look through "The Cloud" projects, but couldn't find anything relevant.



Unless you have a way to establish position feedback with that DC motor then you might be SOL.... Maybe a sabertooth/Kangaroo combo might work.... You can try adapting the custom Movement Panel to use and H-bridge or even easier sabertooth Syren with just 1 motor... But without position feedback control the motor may just spin wildly one way then the next... Since a dc motor can spin 360 degrees you neck may rotate farther than you want it to....


Good point about feedback. Completely overlook that. Thanks for the suggestions as well. That's something I'll have to look in to.

Thanks again Richard.

BTW, good to see you back on the forum buddy. I kinda missed you around here. Hope the new job is going well. Smile


It can be done with either a Sabertooth /roo or an h bridge. Or at least we used to be able to. Back in the ezb V3 days I had a dc motor tracking useing an h bridge. Richard's correct, you need feedback. I was useing a multi turn pot attached to an adc port. I had written a script that watched the voltage change of the pot and after the script did a little math would move the motor to where the camera was tracking. I never really got it smoothed out but it was working pretty good. There used to be a option in the camera control to enable this. A sabertooth /roo combo useing an encoder is much easier to script for.


Well, wait a minute are we sure that an actuator needs feedback in order to be used with tracking? Does tracking with a servo use position feedback?

The function of tracking is to center the object being tracked. In the case of servos, commands are sent to the servos to move them in the x/y axis until an object is in the center box of the grid. The tracking does not care what position the servos are in, just that they need to move until the object is in the center of the grid. I don't think the tracking calculates the amount of steps for example, I don't think it says, "Oh - rotation servo you are at 190, move to position 83 to re-center the object in my field of view". I think works more like, "move to the left....keep going....and stop!"

So if that is how it works, then it should be possible to use tracking with a motor that does not have feedback, because you are going to want to keep moving until the object is in the center grid, then stop. This makes it "plausible" as the Myth Busters would say, but not practical.

Having said that, if you simply turn the motor on/off, fwd/rev you might get crappy jerky movements. Like Richard and Dave said, a good motor controller would be beneficial or at least a very low RPM motor with a simple H-Bridge.

Also like Richard pointed out, a 360 degree spinning DC motor would cause some issues because then you could create a neck that tracking an object until it twists it's head off. An old school method to deal with this is to use contact switches so as the motor rotates to a point where you want it stop you use the contact switch as feedback to limit the movement. A pot for feedback would work even better.

Bottom line is Richard and Dave gave very good advice, but technically I would say yes you "can" use a simple h-bridge to control a motor for tracking without feedback. Because I believe if you took the Roli base and mounted a stationary camera you could use the left/right drive function to track an object.


Having said that, if you simply turn the motor on/off, fwd/rev you might get crappy jerky movements. Like Richard and Dave said, a good motor controller would be beneficial or at least a very low RPM motor with a simple H-Bridge.
tetris unblocked
shooting games
barbie games


I'm calling SPAMer on @friv4school


Same here, damn SPAMMERS. *mad*

Anyway, thanks for the inputnJustin and Dave. Very useful addition to Richads advice. I'm trying to sort something out, low cost, for an R2-D2 style head for my E4-B4 project. I may try a 180 servo with lazy Susan bearing as I don't think the 5kg per cm continuous servos won't be strong enough, and I don't mind it not doing a full 360. Although I wouldn't mind the head doing a 360, I will have cables going though the head/body which will be slightly off centre, so it could do a 360, but any more than that will result in the inevitable pulling and stripping of cables, so can't take that risk.

Worse case though, if the 180 doesn't cut it, I do have a 12v motor/gearbox but don't really want to spend out on a Sabertooth as I've pretty much reached my spending limit on this project, although I haven't completely written off that idea. I thought about adding a servo PCB to the motor for feedback, but the servos I have are 4-7.4v with the motor being 12v, so that ideas out.

I'm a way off getting to the head stage so I've got time to plan.


@Steve G

I think you can get a "slip ring" fairly cheaply from eBay that would help you pass electricity from the base of your robot to the dome that would allow for 360* rotation.



Thanks for the info. I'll take a look. Smile