View Full Version : Discussion Diy R/c Servo
radio freak
Jan 20, 2007, 10:37 AM
Hi all,
I was wondering if It is possible to construct a servo without using any comercialy available chips ( M51660L,etc),by just using normal electronic components, like they used to before. This would solve the problem of many people who do not have easy acess to R/C parts (myself included).If DIY receivers,speed controllers,chargers,etc are possible to construct why not DIY servos? :confused:
mem
Jan 20, 2007, 12:09 PM
That brings back fond memories of the servos that I built over 30 years ago using a dozen discrete components and the NE543K chip. But with something like HS-55 servos available on the internet for less then $10, I really can’t imagine that it would be worth doing now.
If you do decide you want to for the fun if it, please do post some pictures.
andrew b
Jan 20, 2007, 01:00 PM
I built over 30 years ago using a dozen discrete components
I did that with "micron" servos too, did yours have 4 wires for "skyleader" equipment?
mem
Jan 20, 2007, 01:39 PM
I am looking at one as I type. It has three wires connected to home made .1 inch pitch connectors. I can’t remember whose RX circuit I used, but it was big and heavy compared to the stuff available today.
Skysailor
Jan 20, 2007, 02:07 PM
The reasons there are DIY receivers, speed controls, and chargers are the fact that you can make them better than the store bought units. i.e. lighter, sometimes cheaper, and sometimes with more features. DIY servos, especially the way you want to make them would be much much heavier and more costly than the ones that are being sold comercially plus I doubt that you would be able to build them with what you call normal electronic parts which I assume are from radio shack otherwise if you could order from an electronics supplier why couldn't you order from a hobby supplier? Save yourself the money and frustration and just buy your servos.
If you are able to program PIC chips there are some nifty near proportional linear actuators you could build that are close to the way servos operate except they don't have motors and don't have a feedback loop.
here's the link:
Linear actuators (http://babelfish.altavista.com/babelfish/tr?tt=url&url=http://blog.goo.ne.jp/toko0131/&lp=ja_en)
mem
Jan 20, 2007, 02:47 PM
The reasons there are DIY receivers, speed controls, and chargers are the fact that you can make them better than the store bought units. i.e. lighter, sometimes cheaper, and sometimes with more features. DIY servos, especially the way you want to make them would be much much heavier and more costly than the ones that are being sold comercially plus I doubt that you would be able to build them with what you call normal electronic parts which I assume are from radio shack otherwise if you could order from an electronics supplier why couldn't you order from a hobby supplier? Save yourself the money and frustration and just buy your servos.
If you are able to program PIC chips there are some nifty near proportional linear actuators you could build that are close to the way servos operate except they don't have motors and don't have a feedback loop.
here's the link:
Linear actuators (http://babelfish.altavista.com/babelfish/tr?tt=url&url=http://blog.goo.ne.jp/toko0131/&lp=ja_en)I had to look closely at that link to find a reference to something vaguely resembling a linear actuator. I thought “the news whose republication is delightful from this day CQ publisher reached” was a political comment on ham radio operation :) .
pmackenzie
Jan 20, 2007, 02:57 PM
There are three old non-IC servo circuits posted here (http://www.rcgroups.com/forums/showpost.php?p=6177097&postcount=1) .
The Heathkit one is kind of neat - no pot, instead it uses a tuning capacitor like old pocket transistor radios had.
Pat MacKenzie
radio freak
Jan 20, 2007, 03:04 PM
Hi, Skysailor
as I mentioned before that I am starting this particular thread for thoes who do not have easy acess to rc accessories, There is only one hobby center in my city,it is too far away from my place and if I have to buy a servo, a standard futaba S3003 would cost something around 25$ or 1,250 rupees and mini servos are even more expensive.
But I do have good access to almost all electronic parts here.For eg. I can purchase
about 150 resistors (std. 1/4W) or 500 smd resistors.(0805 size) for 1$. I am a college going student and I have to arrange to fund my hobby by my self therefore I would like to discuss a DIY servo design which should be really easy to construct for electronic gurus like you and many others.
Also I would like to know the difference between servos having three wires and thoes having four wires ,which type of receivers support servos with four wires?
pmackenzie
Jan 20, 2007, 03:12 PM
Four wire servos are probably using a centre tap from the battery. That way they don't need a bridge type of output to the motor.
Two of the three in the link I gave above work that way.
If you really want to make your own servo, I think you should consider a PIC based one. Far fewer parts.
Pat Mackenzie
andrewm1973
Jan 20, 2007, 03:20 PM
All you would need for a servo these days component wise would be a microcontroller and a H-Bridge for driving the motor.
No need for all the discreet components and making up comparators and pulse generators and failsafe logic.
A single 8 Pin IC that is the microcontroller.
Another 8pinIC for h-bridge
(or build it smaller youself at more effort from SOT2xx FETs)
Some caps for power supply
Thats it.
The Micro can read the incoming PPM signal. Driver the motor (via H-Bridge) and read the feedback pot on an analog input. You just need to write the software.
Have actually done it myself with a tiny servo I tried to build (1.6 grams for the falcons was too heavy :D). Have not finished that project to a satisfactory level yet though.
radio freak
Jan 20, 2007, 03:24 PM
Four wire servos are probably using a centre tap from the battery. That way they don't need a bridge type of output to the motor.
Two of the three in the link I gave above work that way.
If you really want to make your own servo, I think you should consider a PIC based one. Far fewer parts.
Pat Mackenzie
I am an engineering student in the field of computers, so I really don't know how to write software code for pic's,for the time being I want help from someone who can do this. I am learning quickly and will surely build and contribute my electronic designs with several DIY'ers in the near future! :D
radio freak
Jan 20, 2007, 03:30 PM
:rolleyes: All you would need for a servo these days component wise would be a microcontroller and a H-Bridge for driving the motor.
No need for all the discreet components and making up comparators and pulse generators and failsafe logic.
A single 8 Pin IC that is the microcontroller.
Another 8pinIC for h-bridge
(or build it smaller youself at more effort from SOT2xx FETs)
Some caps for power supply
Thats it.
The Micro can read the incoming PPM signal. Driver the motor (via H-Bridge) and read the feedback pot on an analog input. You just need to write the software.
Have actually done it myself with a tiny servo I tried to build (1.6 grams for the falcons was too heavy :D). Have not finished that project to a satisfactory level yet though.
It would be great If you could share your work with us on this thread(ie.if you don't intend to commercialize it :rolleyes: ), may be some one can help you improve your design.
andrewm1973
Jan 20, 2007, 03:31 PM
I can lend assistance in writing micro code.
I do however use Atmels for most my stuff not PICs
pmackenzie
Jan 20, 2007, 03:35 PM
I am an engineering student in the field of computers, so I really don't know how to write software code for pic's,for the time being I want help from someone who can do this. I am learning quickly and will surely build and contribute my electronic designs with several DIY'ers in the near future! :D
A little odd that a budding computer engineer wouldn't approach this as an embedded system application :confused: .
This would be a perfect way to apply what you have learned, or get a jump on your classmates.
Pat MacKenzie
radio freak
Jan 20, 2007, 04:13 PM
A little odd that a budding computer engineer wouldn't approach this as an embedded system application :confused: .
This would be a perfect way to apply what you have learned, or get a jump on your classmates.
Pat MacKenzie
This is just my first year and I have just learnt basics of C language(pointers,arrays,etc.).Programming pic's is not in my portion as yet but I am still making an effort to learn how it is done by downloading and reading articles over the internet.We are not taught much in college either, often students know more than the teachers themselves! ;)
Daniel7866
Jan 20, 2007, 04:27 PM
Hi,
What do you plan to use for the mechanical parts of the DIY servo? This will be the most difficult task IMHO.
Daniel
mem
Jan 20, 2007, 05:14 PM
This is just my first year and I have just learnt basics of C language(pointers,arrays,etc.).Programming pic's is not in my portion as yet but I am still making an effort to learn how it is done by downloading and reading articles over the internet.We are not taught much in college either, often students know more than the teachers themselves! ;)If you are interested in DIY RC and are learning C then you really ought to look into the PIC. There is a very good free C compiler, PICC Lite that you can download and lots of information on the internet including here that cover RC routines for the PIC.
andrewm1973
Jan 20, 2007, 06:31 PM
Not trying to start a flame war.
Though you could also look at the Atmel which has a free C compiler as well called GCC. You may have even heard of GCC elsewhere so there is no need to extol its virtues :)
The Atmel has an instruction set architecture that lends itself to C. It was in fact designed with making C code efficient in mind. The PIC architecture is an absolute pig for a C compiler and the amount of its limited resources that get chewed up doing simple things is silly.
xorcise
Jan 20, 2007, 07:30 PM
Not trying to start a flame war....
The Atmel has an instruction set architecture that lends itself to C. It was in fact designed with making C code efficient in mind. The PIC architecture is an absolute pig for a C compiler and the amount of its limited resources that get chewed up doing simple things is silly.
I would love someone to explain how the architecture lends itself to C. PIC18's claim the same.
Skysailor
Jan 20, 2007, 10:32 PM
What I learned in college:
1. College is four years of B.S.(Bull poopy) that you will hardly ever use
2. At the end you get a fancy piece of paper
3. If you're smart, you get honor cords but they sometime cost extra mine were $10
4. Drunk chicks are stupid
5. Sometimes you have to get drunk to put up with stupid people
6. Some professors are idiots. Refering to number 5, get drunk before these classes it helps(not all profs are idiots, be sober for intelligent prof's classes)
7. Don't buy books until you really need them spend your money on RC stuff and boose
8. Students with scholarships are always given special treatment, so I got screwed by the system often
9. Stupid people wasting finacial aid to flunk out tick me off as I didn't get any aid from anyone and I would have put their wasted money to good use
10. The point of college is to prove your ability to learn which is what ultimately gets you the job!
xorcise
Jan 20, 2007, 11:36 PM
What I learned in college:
10. The point of college is to prove your ability to learn which is what ultimately gets you the job!
I thought it was how to pass tests, get a degree with a C average, and then nobody cares. When was the last time you saw that diploma in your Doctor's office and asked him for his GPA?
Better yet, go to Yale and Harvard, think and talk like an hillbilly, and become President.
andrewm1973
Jan 20, 2007, 11:41 PM
xorcise,
I don't know about the PIC18C. But I can compare an Atmel to a PCI 12C, 15C or 16F.
Everytime A C compiler goes into or out of a subroutine it should push the arguments onto the stack. PICs don't have a real stack.
Everytime a subroutine is called the local variables are allocated space of the heap. These local variable will then be addressed relative to thier base address on the heap. PICs dont realy have any index addressing instructions.
PICs don't really have RAM in the same sense as Atmels. They have spaces to store information but they can't be gotten at in the memory space the same way as Atmels can get thier RAM.
PICs have one working register. You (or the C compiler) has to keep juggling things into and out of this one register. Atmels have 32 registers that are almost completly orthogonal (caveat - lower 16 registers CAN'T be used with imediate instructions).
So not only do the Atmels have more resources in them and execute more instructions per second. They also are able to use those resources and speed more effectivly.
Skysailor
Jan 20, 2007, 11:57 PM
I use PIC as a JDM programmer is ultra simple to build and plugs into a serial port which is what I am limited to on my laptop. I have only usb ports and use a RS-232 serial adaptor plugged into a usb port in order to program PICs. I don't have a usb to parrallel adaptor and all the simple avr programmers use the parrallel port, or at least the ones that I have seen. Anyone have a schematic for a simple serial port based AVR programmer?
village_idiot
Jan 20, 2007, 11:58 PM
A linear actuator servo for retracts would be cool.
andrewm1973
Jan 21, 2007, 12:00 AM
Pony Prog SI does Atmels and is RS232.
So is AVR910 and AVRISP - but they may not be considered simple.
xorcise
Jan 21, 2007, 12:27 AM
I can assume then that structured programming techniques must be what's being alluded to in the "lend itself to C architecture" comments. Certainly the 8 deep stack of the P16 is limited. P18's have a 31 deep stack which works pretty well with most structure based compilers, because it only needs to be used primarily for subroutine Calls and Interrupt saves. It is admittedly not of the depth of AVR's, although I'm not sure a 256 deep stack is necessary for microcontrollers.
Local and argument variables should not need any stack space, only shared reserved space within SRAM. That is something a good compiler can manage when building the program, and PIC's can handle well.
Also, there is indirect addressing with PIC's. It is done through the FSR, File Select Register. P16's have 1 and P18's have 3 of them. P18's also have an automatic pre- and post- increment/decrement instruction of the selected address when reading or writing to the memory space.
I don't know enough about AVR's to do a proper comparison and my comments are not intended to make my mainstay, PIC's, better than someone else's choice of AVR's. Overall, PIC's have served me very well, and all I use are structured compilers with very good results.
radio freak
Jan 21, 2007, 02:35 AM
Hi,
What do you plan to use for the mechanical parts of the DIY servo? This will be the most difficult task IMHO.
Daniel
Getting the electronics right is the tough part,I have a bunch of old dead servos that I can use for the mechanical part. Bulky servos can be made and used in boats and cars as well.With some innovative ideas several parts from cassette players(walkman's, etc.) can be used for the mechanical part.I am currently experimenting with fiberglass pcb boards.They are light and easy to fabricate as well. Something similar to a falcon servo can easily be constructed.
mem
Jan 21, 2007, 04:08 AM
If you want to combine your interest in RC with your computer science education then do take a look at implementing the servo electronics with a small embedded microcontroller.
Either the PIC (for example the 12F675) or AVR could be suitable, choice depends on how obtainable they are for you, the cost to knock together a cheap programmer, and the availability of people that can help you up the learning curve.
Ask around at your college to see what others are using. Either will help you develop your embedded programming skills and its great if you can learn useful professional skills through building things you can use to have fun.
andrewm1973
Jan 21, 2007, 07:23 AM
xorcise,
Yes. When people are talking about the AVR or they PIC18 being more "C friendly" they are talking about the "structured programming aspects" of C.
(now that you have explained that the 18C has a 32 level deep stack and indexed addressing with automatic post/pre decriment - I realise why they say it is more C friendly)
Saying
out PortB, 0b0000001 (in AVR ASM)
OR
bcf GPIO,1 (in PIC ASM)
instead of saying
Pin = 1; (in C)
the PIC 18C or AVR is going to be no better than a PIC 12C.
However C is no more use in that kind of task than ASM is anyways. You would not bother using C over ASM for trivial tasks like that.
However
Try something like
| #include <whatever.h>
|
| int power(int x, int y);
|
| main()
| {
| int answer;
|
| answer = power(2,8);
|
| }
|
| int power(int x, int y)
| {
| if (y==2) return (x*x) else return (x * power(x, y-1));
| }
And the C friendly PIC 18C and AVR will be a lot more likely to be able to manage it than the 16C, 12C.
(note I dont know if the C compiler for the PIC will allow recursion at all - but if it does then the 16C and 12C will die quickly from the above code)
And I know this is a trivial example - however recursion can be very important in some things. Writing "ZIP" type compression applications and it helps a lot. Working out exponents and factorial numbers it helps. Both of the above things I have had to do in dataloggers I made for AVRs in the past. (and unfortunatly GCC was not available for the AVR back then and I had to do it in ASM :( sigh)
mem
Jan 21, 2007, 10:47 AM
... When people are talking about the AVR or they PIC18 being more "C friendly" they are talking about the "structured programming aspects" of C....Although your point that a PIC 12 will be limited in areas such as recursion is valid, that probably will not matter to Radio Freak. It is unlikely he will exceede the stack capability if all he wants to do is monitor a potentiometer to drive a servo motor from a ppm signal.
So, respecting his desire for a simple servo driver, would you agree that he could choose either AVR or a low cost PIC. If indeed we can convince him to use a microcontroller at all.
andrewm1973
Jan 21, 2007, 03:17 PM
mem,
Most certaintly either a PIC or AVR would be suitable for this application. No argument there.
andrewm1973
Jan 22, 2007, 05:10 PM
Radio Freak,
I am about to build another batch of programmers. If you like I can send you a free AVR-ISP programmer and some ATTiny2313 or ATTiny45 CPUs. That should be enough to get yourself started :D
westfw
Jan 22, 2007, 08:15 PM
I would love someone to explain how the architecture lends itself to C. PIC18's claim the same.
User-accessible stack usable for data. register-to-register math.
Indexed addressing (pointers.) Easier 16-bit math and data movement.
It's worth pointing out that not ALL of the AVRs have all these features, and that
many a useful C program can be written without ever needing any of those
features. C compilers for PICs work just fine and are efficient enough for
most purposes, regardless of what mechanations they have to do "under the hood"
radio freak
Jan 23, 2007, 03:05 AM
Radio Freak,
I am about to build another batch of programmers. If you like I can send you a free AVR-ISP programmer and some ATTiny2313 or ATTiny45 CPUs. That should be enough to get yourself started :D
What would I do with this stuff since I know almost nothing about writing C code for pic's or avr's :o .I would appreciate If somebody could write a code for a servo for everybody to work with or modify or give some good links over the internet for studying sample C codes for simpler projects (for beginers like me).
thanks! :)
xtal
Jan 23, 2007, 05:01 AM
Try this link ....you might find something useful there..
http://www.rcgroups.com/forums/showthread.php?t=475518&highlight=12f675+servo
mem
Jan 23, 2007, 05:55 AM
In addition to the tons of PIC and AVR information you can find using google, there is a book by Mike Predko ( http://www.amazon.co.uk/123-Microcontroller-Experiments-Evil-Genius/dp/0071451420)
that provides an introduction to building various IO circuits with the PIC using free tools including the PICC lite C compiler. Have a look and see if it is in the school library.
Also, check with your classmates and teachers to see if they are using PICs or AVRs. Perhaps they have: programming tools, chips and knowledge and experience they are willing to share with you. Once you select the chipset to use and get your development environment set up and create your first simple program it will all seem much less confusing.
andrewm1973
Jan 23, 2007, 06:30 AM
Radio-Freak,
I can send you a programmer, some ATiny45s and then when you get them - I can guide you in making the servo if you like.
olmod
Jan 23, 2007, 06:37 AM
Has anyone done anything with output encoders instead of pots? there are some very small ones available i noticed a while back.
Swashhead
Jan 26, 2007, 09:42 PM
What would I do with this stuff since I know almost nothing about writing C code for pic's or avr's :o .
"Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime."
Chinese Proverb
Radio-Freak, Andrew is offering you a fishing rod. Take it.
mem
Jan 27, 2007, 01:30 AM
"Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime."
Chinese Proverb
Radio-Freak, Andrew is offering you a fishing rod. Take it.Radio-Freak, you can download documentation and full open source code for a servo that can be built using free development tools for the chipset that Andy is offering you by following this link:
http://www.rcgroups.com/forums/showthread.php?t=632519
Go for it.
Htferreira
Jan 27, 2007, 08:05 AM
Has anyone done anything with output encoders instead of pots? there are some very small ones available i noticed a while back.
Hi.
The problem with encoder, unless they are of the absolute type, which don't lose their position at power down, you must have a "home" position so that the incremental encoder can keep track of it's position after power down. Even if you memorize the actual encoder count, if you move it while the power is off it wll be lost. For this reason, machine tools who use servo motors, do a "home cycle" at power up.
Regards,
Helder Ferreira
Takao Shimizu
Jan 27, 2007, 02:40 PM
http://www.rcgroups.com/forums/showpost.php?p=4907733&postcount=1245
Takao
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.