Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

small servo project, I really need HELP

Status
Not open for further replies.

fakahany1

New Member
hello guys
hope you are all fine...
well i have an idea in my mind but yet not really ready so am asking for help from my fellow experts :))
i will tell you the idea abtractly:
i want to control a bunch of four servos on a vehicle or something through a joystick in my hand. the system is wired and hence i want to have the wire as thin and light as possible and this means that we need to have the number of wires going from the joystick to the bunch of servos are minimal. well in addition each two of the four servos will recieve the same command and hence we can see that generally there will be only 4 possible commands to the servos from the joystick (for each two (up and down= 2X2 =4 ))......... can you get my idea guys. i need to see what kind of circuits do i need on the joystick interface and on the servo side if i would use digital commands or so......
i need to know any feed back , help suggestions and comments on the idea, if someone really knows a site to find some similar things that would be just great.
 
The problem is that how far from your joystick to the servos. Because, if it's as short as 50cm to 10m, you can use serial communication, and you need only 2 wires to control as many servo as you wanna. If it's less than 1m, you can use I2C and it works perfectly.

In your joystick, you should use a MC to communicate with your joytick, then, you need another MC at the servo board. These two MC can communicate with each other.

In case that your distance is less than 1m, you can build a I2C communication and you need only one MC at the joystick as the master chip, and all other chips on servo board are slave.

It will work good with 2 wires only.
 
Your suggestion of four 'commands' isn't correct, servo's are analogue devices operated by varying width pulses (usually between 0.5mS and 1.5mS long). Probably the easiest way to do it would be to use the encoder and decoder chips from a radio control system - you could easily feed the signal down a couple of wires, or for that matter use the RC system itself?. Feeding two servos from one output shouldn't be a problem.

There are various more complicated ways you could do it, including uses PIC's as encoder and decoder IC's, creating your own coding scheme to feed down the wires.

Or, even simpler, if you can feed three wires rather than two, feed the servo pulses directly down the wires, with everything done at the joystick end.
 
hello guys, thanx alot for your help....
first, i am planning that the wire is very long, more than by 1 meter by far.
hence, the second point is that we need to try to keep the number of wires minimal ( would two wires help us in our system ??)
i would like it to be not really complex involving many PIC's... that is i would like it to have all the complexity in one side only , the joystick side and minimize all circuitry in the servos side.
IN SUCH CASE WHAT KIND OF CODING AND ENCODING SHALLWE USE?? or what is the logic of the communication?? :) and in this case we can use three wires instead of two in order to carry the pulse, but still can one help me grap the circuitry idea in this case
(we have total four servos and taking in mind that each two will recieve the same siganl)) : D
thanx guys, i am a bit of a biginner but you will diff. help me :)))

have a nice day ;))
 
Dear Nigel,

I built my final robot as this:

The servos will be driven by a MC, and four servos, I used 4 MC to control it. The four MC have the same program, if we want to control the servos in the same way. Actually, in my case, it was 2 servos and 1 stepper.

Then, I use one PIC to be the MASTER and the Master is connected to the PC.


The program on slave should be:

1) Receive: velocity, accelerate, and position
2) Send: the current velocity, accelerate and position of motors through reading encoders.

As I need to control a motor, I only send the suitable data to the slave, and the slave automatically control the servo. I'll not care what I'll really do with the master but as a transceiver only.

This structure make the robot work with more ease, and we don't have to compute muchie.

Therefore, if we develope this structure into this application, we can use serial communication to talk in a distance of 10m with the master chip.

That's all what we have to do.

It's fact that we have to use many MCs here, but with more MCs, we don't have to compute much, and we can do many things more, even wireless communication.
 
hello guys....
dear falleafd..
well i would like to have the solution with minimal MC and PIC and if possible we can put all the circuitry and MC on the Joystick side and almost nothing in the servo side....... I really need no perfect control, i send a command and the servo replys with current status. i dont really want it so complex. just to move according to the signal right or left....

plus i should make it clear that the length of the wire is much more than 10m and hence we have to take an assumption that the length of the wire is infinity in technical computations and hence (as far as i can guess... need clarification??!) the serial technique wont be a good solution???
 
i would like it to be not really complex involving many PIC's... that is i would like it to have all the complexity in one side only , the joystick side and minimize all circuitry in the servos side.
IN SUCH CASE WHAT KIND OF CODING AND ENCODING SHALLWE USE?? or what is the logic of the communication?? and in this case we can use three wires instead of two in order to carry the pulse, but still can one help me grap the circuitry idea in this case
(we have total four servos and taking in mind that each two will recieve the same siganl)) : D
thanx guys, i am a bit of a biginner but you will diff. help me ))

The fact that, you can easily build one side pcb for this application. Because

1) With each servo (or 2 or 3 or 4) you need only 1 PICs to drive it. And this PIC will works as a slave chip. And the pcb of this scheme will be simple enough to build on one side board.

2) Imagine that, you have 4 PICs (or less) to control 4 motors. Then you add another PIC to send controling data to each 4 PICs above.

Then, at the joystick, you add another PICs to communicate with the joystick. As result, you have to add 2 more PICs than you intended to do.

And this two PICs have a simple tasks is that transceiver. As you use serial communication between two PICs, you have to use only 2 wire to do so.

3) Don't worry about your board. Take care of the drivers you would build to control the 4 motors. In each 4 PICs I mentioned above, you have to write the full program to control one servo. And the program need the parameters to control the velocity or positions or acceleration.... to run the motors.

4) The PIC connected to joystick will work as a decoder, it change the positions of joysticks into control parameters to send to the 4 PICs



joystick <-> PIC (works as a decoder) ----serial----- PIC <-> Your drivers (I will use 4 PICs in your case).
 
fakahany1 said:
hello guys....
dear falleafd..
well i would like to have the solution with minimal MC and PIC and if possible we can put all the circuitry and MC on the Joystick side and almost nothing in the servo side....... I really need no perfect control, i send a command and the servo replys with current status. i dont really want it so complex. just to move according to the signal right or left....

I think we may be at cross purposes here?, you keep mentioning servo's, and I've presumed you mean radio control style servo's - is this so, or are you building your own servo's?. It makes a great deal of difference, radio control servo's are fully independent - you provide it a simple variable width pulse, and it does everything it's self - there's no reply given, the servo simply moves to the location which the width of the pulse tells it to.

plus i should make it clear that the length of the wire is much more than 10m and hence we have to take an assumption that the length of the wire is infinity in technical computations and hence (as far as i can guess... need clarification??!) the serial technique wont be a good solution???

I would suggest using radio control, the radio gear and servo's are easily and cheaply available, you don't need any wires at all, and it will work at a considerable distance - and it's a ready built solution. It's no good suggesting you want 'infinite' cable length, you need to specify a maximum distance - which needs to be practical, specifying far longer than you need will probably increase costs considerably.

Perhaps you might like to explain better what you are trying to do, we may be able to make further suggestions.
 
Yes, Nigel is right. For a 10m distance control, you should use RF remote control. I'm just stupid that trying answer your question but don't care about real world application.

However, if faka is a beginner, and he cannot build RF control, he may use serial communication here. But I think, in spite of using serial here, you buy a RF control and use it. The more expensive you pay, the better control you will get. As Nigel suggested, you should buy a 4 channel RF control.

And you know, in helicopers applications, they use 6 channel RF control to drive the helicoper. And it work very very very good. Of course, they also use servo motors.

Well, it's nice that, I saw a circuit of helicoper, it's only as small as your finger. It includes a receiver, and controllers using 2 x 16F84SO... It works so good.
 
clarification

hello guys...
well i guess we need to clear some ideas here, i might have not expressed the idea well the first time.

I need to make a system of two sides: side one is just a simple joystick connect to side 2 with a long wire (propably 500 meters or moreeee) side 2 is a combination of 4 servos (normal servos we use in RC planes) used to control something like a pillar or a post with some sort of signs that i will control with the joystick to point in different directions. each two servos will move in the same direction, that is recieve the same signal.
both falleafd and Nigel (thanx guys) have suggested to use some sort of RF system, well it is easy and nice idea , but the problem is that i might recieve interference from other surroundings i live beside an airport by the way, thats a point PLUS i am taking into consideration that my system the side 2 of it possibly will be destroyed or be damaged due to its job nature, so i cannot afford each time to install a reciever each time i have a damage, so i tend to just use as little circuitry and stuff in side 2 and have most of my circuits and things on the joystick side....

however if you still see that there are cheap RF modules or reciever we might take it still as an option. in both cases i need to know how technically we can use serial communication?????
i have some sort of a primative idea in mind you expert guys can tell me how much it is feasable.
what if we use 3 wires. one wire will carry the signal(with the appropriate length according the the angle of movement or.....) the other two wires can be used as addresses specifiers. that is if you have:

a signal in 1st wire + a signal in the 2nd wire = servo 1 & 3 move right
a signal in 1st wire + no signal in the 2nd wire = servo 1 & 3 move left
no signal in 1st wire + a signal in the 2nd wire = servo 2 & 4 move right
no signal in 1st wire + no signal in the 2nd wire = servo 2 & 4 move left

this primitave way of encodeing i guess it wont cost us alot to make a decoder in the servo side right ???
i need your comment on this fellows.
thanks alot and hope i made the idea clearer :)
have a nice day : ))))
 
Re: clarification

fakahany1 said:
a signal in 1st wire + a signal in the 2nd wire = servo 1 & 3 move right
a signal in 1st wire + no signal in the 2nd wire = servo 1 & 3 move left
no signal in 1st wire + a signal in the 2nd wire = servo 2 & 4 move right
no signal in 1st wire + no signal in the 2nd wire = servo 2 & 4 move left

this primitave way of encodeing i guess it wont cost us alot to make a decoder in the servo side right ???
i need your comment on this fellows.
thanks alot and hope i made the idea clearer :)
have a nice day : ))))

You still don't seem to understand how servos work - as I've said before, they require a variable width pulse of between 0.5mS to 1.5mS, the position the servo takes up is based on that pulse width. A width of 0.5mS moves the servo to one end, and a width of 1.5mS moves it to the other, obviously a width of 1mS places it in the middle. This action is completely analogue, so the servo can be positioned anywhere in it's range.

Your 'encoding' scheme doesn't provide any pulses, so wouldn't do anything!.

Servo's have a three wire connection, ground, +ve, and input - assuming the supply is available locally at the servo end (and sending power down 500m of cable probably is best avoided), you only need to provide a ground connection (common to all four servo's) and an input wire for each pair of paralleled servo's - this gives a total requirement of three wires.

It would probably be a good idea to use a screened cable, where the screen can be the ground connection, with two wires inside.

I've no idea how well the servo pulses would travel down 500m of cable, you may have to amplify them to overcome the cable capacitance.

If that won't work, some kind of serial scheme involving a PIC at each end could be used - keeping to a slow speed should allow it to carry 500m, or you could use a simple modem system and send audio tones down the wire.
 
i just wanted to say that the four servos will have for example a common ground and onborad power supply. OK?
how ever the signal will come in one of the three wires from the joystick curcuit.. now we have the power and the signal now we need somethin to tell us which servo will work and to which direction. i suiggested that we have a new circuit that will know which servos to work from the addresses on the other two wires and it will act upon it be give the siggnal on the third wire to the servos responsible after decoding the incoming address on the othe rtwo wires.
sorry for my ignorance but i hope you will be able to help me more.
thanx Nigel
 
fakahany1 said:
i just wanted to say that the four servos will have for example a common ground and onborad power supply. OK?
how ever the signal will come in one of the three wires from the joystick curcuit.. now we have the power and the signal now we need somethin to tell us which servo will work and to which direction. i suiggested that we have a new circuit that will know which servos to work from the addresses on the other two wires and it will act upon it be give the siggnal on the third wire to the servos responsible after decoding the incoming address on the othe rtwo wires.
sorry for my ignorance but i hope you will be able to help me more.
thanx Nigel

Here's a quick diagram of how to connect the servo's, there no addressing or anything, just two variable width pulses (a pair of sample pulses are included on the diagram), one for each pair of servo's. You could use 555 timers to generate the pulses from the joysticks, there are plenty of radio control servo tester designs on the net.
 

Attachments

  • servo.GIF
    servo.GIF
    6.8 KB · Views: 2,306
well this diagram kinds of explains more and in other word is almost perfect. however i still have a question, now...... i want to move the servo this much to the right, how the signal would look like??? and now i want to move the same servo that much to the left, now how would the signal ook like now ???
and if i will depend on the length of the signal to trigger up the servo, what kind of logic will be ised in the servo side, if any ????
thanx alot Mr. Nigel
 
Will it lost the data on the so long wire Nigel? The distance is about 500m, and I don't believe that the signal can come your control board.

As you give 5V or 25V at the joystick, the signal will lost in a distance of 10m to 15m. As we will see that the voltage at COM port is about 25 to -25V and we cannot connect 2 PC as they are as far as 15m from each other.

So, if use you RS232, you can send it as far as 10 - 15m, and at each end of 15m, you put an ampli to strengthen the signal.....

Yeah, transmition in a distance of 500m, but don't use anything else to amplify is quite new to meeh. And as you want the realtime control and a good signal to control the servo, you should try my solution. Because your problem is not how to connect to the servo with a limit number of wires but the transmision.

And if you don't mind, pls tell meeh your solution, because it's interesting.
 
fakahany1 said:
well this diagram kinds of explains more and in other word is almost perfect. however i still have a question, now...... i want to move the servo this much to the right, how the signal would look like??? and now i want to move the same servo that much to the left, now how would the signal ook like now ???

The width of the pulses sets the position of the servo's, you simply vary the width, and the servo moves accordingly.

and if i will depend on the length of the signal to trigger up the servo, what kind of logic will be ised in the servo side, if any ????
thanx alot Mr. Nigel

I've no idea what you would need to do for 500m of wire, you would need to experiment to see what happens - as a minimum I would expect to have to feed a fair amount of power into the cable to try and overcome capacitance and losses. It might not be possible at all, and a more complicated scheme could be needed.

But regardless, the circuit above is how the servo's should be connected, and shows the signals they require.
 
falleafd said:
Will it lost the data on the so long wire Nigel? The distance is about 500m, and I don't believe that the signal can come your control board.

As you give 5V or 25V at the joystick, the signal will lost in a distance of 10m to 15m. As we will see that the voltage at COM port is about 25 to -25V and we cannot connect 2 PC as they are as far as 15m from each other.

So, if use you RS232, you can send it as far as 10 - 15m, and at each end of 15m, you put an ampli to strengthen the signal.....

Yeah, transmition in a distance of 500m, but don't use anything else to amplify is quite new to meeh. And as you want the realtime control and a good signal to control the servo, you should try my solution. Because your problem is not how to connect to the servo with a limit number of wires but the transmision.

And if you don't mind, pls tell meeh your solution, because it's interesting.

Hi falleafd,

I wasn't suggesting it was a complete solution, merely a starting point for experimention - the first thing you would need to find out is how far it would work over, obviously one factor that would affect this is the source impedance of the pulse generators. You could add amplifiers to increase their capacity, and you could also add buffers at the receiving end.

As for RS232, the distance available is inversely proportional to the speed (to some extent) - I see no problem working a great deal further than 10-15m at the kind of speeds require for working a pair of servo's (1200 baud would be more than fast enough). For that matter, how about 20mA current loop?, isn't that more reliable over longer distances.

My very first suggestion was to use a standard radio control transmitter and receiver, although now we know the range is 500m, it's probably a bit too far (apart from any interference problems). I also suggested using the encoder/decoder chips from the radio control system to send the signals down a pair of wires.

How about using a standard radio control transmitter and receiver, but removing the aerials and connecting them via 500m of coax cable?.
 
wants help

hi.
i also really intrested in your project , since i also decided to built small robo some what simillar to your project.
so i request you to send me all information regarding with this project.
i hope you will help me.
thanking you.
 
It's true that we may transmit upto more than 15m with serial communication from PIC, but it's risk to signal. It's oki if we can use upto 20m or 30m..

But in this case, I suggest to use serial with amplified circuit at each end of 15 or 20 or 30m. With a small circuit but it's about 10 - 30 circuit betwen the wires. Well, terrible... I myself cannot imagine what I suggested, but if you have to build wire connection, I think it's a good way.

Yes, as Nigel said, RF is better.

I have no more ideas. It's very difficult to transmit so far as 500m with signal from PIC or other MCs.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top