Build a Custom Serv...
 
Notifications
Clear all

Build a Custom Servo Motor with a DC Motor

13 Posts
4 Users
5 Likes
1,555 Views
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1052
Topic starter  

Today I’ll convert a DC motor into a custom servo motor using a Seeeduino XIAO. Plus, we’ll learn about using PID controllers. This is a special project that I’m working on with Jeremy Fielding.

Servo motors are used in many hobby and experimenter applications. From radio-controlled aircraft to robot dogs, these motors are used whenever you need to be able to precisely position a motor shaft.

But most hobby servos are small devices, and even “large” hobby servos are not really all that large, and can only supply a limited amount of torque. Plus, larger servos generally mean a larger price tag.

Another limitation for some designs is that hobby servo motors are usually limited to either 180 or 270 degrees of rotation.

So why not build one ourselves? After all, internally, a servo motor is simply a DC motor with a control and feedback circuit. And you can buy, or salvage, a large DC motor for a lot less than the cost of a big servo motor.

Today, I’ll show you how to convert a DC gear motor into a custom servo motor. One that can rotate exactly to suit your requirements.

I’m doing this in tandem with Jeremy Fielding, a YouTuber with incredible mechanical and design skills. Jeremy is building a “self-driving go-kart”, and for his steering system he will need a big servo motor that can spin a full two turns (720 degrees).

I’ve come up with a design that uses a Seeeduino XIAO and a 10-turn potentiometer. While I’m driving a fairly powerful motor driver, you can substitute a smaller, and less expensive one if you don’t require the big motor Jeremy requires in his design.

Incidentally, a potentiometer isn't the only method of sensing shaft position, it's just the cheapest (and probably most common) method. The article accompanying this video has a few other sensor types that can be used, and we'll be looking at those in future videos and articles.

Here is the table of contents for today's video:

00:00 - Introduction
03:17 - Custom Servo Design
06:39 - Servo Test Setup
09:20 - Controller Design with Seeeduino XIAO
14:17 - Input Test Code & Demo
19:47 - Endpoint Test Code & Demo
22:57 - PID Controllers
28:58 - PID-based Servo Controller Code & Demo
39:19 - Conclusion

Jeremy’s “self-driving go-kart” is a project that is being built in tandem with my 6-wheel rover, so you’ll be seeing more collaborations in the near future.

Make sure you check out Jeremy’s video as well!

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Quote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
 

@dronebot-workshop

My Cytron MD25HV arrived and included a card that read "CAUTION! Using DC Power Supply only may DAMAGE the driver  *Use Battery Instead"  And on the back of the card was the statement "For More Information, Please Refer to Product User's Manual"  I have been unable to locate this product manual on the Cytron site.  Anyone have a clue what this warning may be trying to tell me?

SteveG


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1052
Topic starter  
Posted by: @codecage

I have been unable to locate this product manual on the Cytron site. 

Hi Steve - This is the manual I have been using, from the RobotShop site

I don't see anything in this PDF about only using a battery, and I agree, it's a rather strange requirement. 

The only thing that comes to mind is perhaps they were speaking about a constant-current power supply, or some other particular situation like that. Or they may be thinking about using an under-powered bench supply that can't deliver peak current when called upon.

Or it might be that some bench supplies have current limiting, whereas a LiPo could produce a huge amount of current briefly if required.

Otherwise, I can't see why bench supply would cause any problem, assuming it had the current capability to drive the motor under maximum load. 

Posted by: @codecage

My Cytron MD25HV arrived and included a card that read "CAUTION! Using DC Power Supply only may DAMAGE the driver  *Use Battery Instead" 

I don't recall receiving such a card with my driver, although it's entirely possible that it did and didn't read it.

So far, I haven't destroyed mine, and I'm just using my bench supply. Seems to work pretty well, but of course I've only really run it for demonstration purposes. But I have run other Cytron drivers for long periods using a bench supply and never gave it a second thought.

😎

Bill

 

 

 

 

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
 

@dronebot-workshop 

Thanks Bill, I'll proceed with caution and let everyone know if the smoke escapes!

SteveG


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1052
Topic starter  
Posted by: @codecage

I'll proceed with caution and let everyone know if the smoke escapes!

It would be great if you could get a video of that!

🤩 😎 

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
 

@dronebot-workshop 

Which one, proceeding with caution or letting the smoke out?  I'm keeping my fingers crossed that the smoke stays contained.

SteveG


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@codecage 

Surely it's obvious which one would attract the more viewers 🙂

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
 

@will 

No doubt, but I'm sure hoping to disappoint most everyone! 😎  

 

SteveG


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 

@codecage 

Disappointed, but understanding 🙂

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1052
Topic starter  
Posted by: @codecage

Which one, proceeding with caution or letting the smoke out?

Posted by: @will

Surely it's obvious which one would attract the more viewers 🙂

Yes, I'm thinking that it might be fun to do a "bloopers" video, and it would be a lot better if the bloopers were done in someone else's workshop!

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
huckOhio and Will reacted
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
 

@dronebot-workshop & @will

You guys are killing me! 😆 

Bill you have the best cameras to catch smoke.

SteveG


   
ReplyQuote
Melbul
(@melbul)
Member
Joined: 3 years ago
Posts: 43
 

@codecage

Screenshot attached of warning in the cytron MDD10A rev.2 manual

Screenshot (8)

hope this helps!

Mel.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1018
 

@melbul, @dronebot-workshop

That's even more confusing!

SteveG


   
ReplyQuote