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.

non futaba servo problem

Status
Not open for further replies.

HakBot

New Member
Hello,

I've purchased a usb microcontroller from **broken link removed**. Its based around the pic18f4550 chip. Ive got some code that allows the user to control a servo from the pc side. The interface then creates a pwm signal to move the servos. Everything is working correctly except that the interface will not work with anything other than Futaba servos. They either do not work or they cause the board to disconnect from the pc. Ive heard that some servos will send out a voltage spike that could be causing the board to shutdown. Do all brands of servos use pwm for control? Anyone have any ideas about what is going on? Thanks!

Phil
 
check your wiring. the clue is your statement: "cause the board to disconnect from the pc". most rc servos use a 3 wire connection, power, gnd and the pwm signal but may not use exactly the same order.

if you can drive futaba servos, you should be able to drive others, assuming you get the wiring connections correct.
 
The servos are wired correctly. Ive tried 3 different brands of servo. Futaba, JR, and Hitec. The futaba will work correctly. The JR will work for a few seconds and then out of the blue quit and cause the board to disconnect. The Hitec will just not function but does not disconnect the board.
 
more info helps. "disconnect" doesn't mean much to me. do you mean your PC can't communicate with the PIC? that could be anything.

the board is USB powered, are you drawing servo power from the board? You probably will need to power the servos via a seperate power supply. USB has a current limit of 500 mA and your servos may well be exceeding that. I've seen a similar problem with servos that shared a common power source with a PIC (though not USB powered). the servos pulled the voltage down and caused the micro to reset.
 
philba:

"more info helps. "disconnect" doesn't mean much to me. do you mean your PC can't communicate with the PIC? that could be anything."

Sometimes the pc side c++ app will report the device as disconnected. WriteFile will cause the program to quit. After some poking around it seems its returning GetLastError() codes of 1167 and sometimes 31. Meaning:

31 ERROR_GEN_FAILURE
A device attached to the system is not functioning.

1167 ERROR_DEVICE_NOT_CONNECTED
The device is not connected.

"the board is USB powered, are you drawing servo power from the board? You probably will need to power the servos via a seperate power supply. USB has a current limit of 500 mA and your servos may well be exceeding that. I've seen a similar problem with servos that shared a common power source with a PIC (though not USB powered). the servos pulled the voltage down and caused the micro to reset."

The board I have allows me to connect an external power source from 7-15v. I have tried running the servos under usb power only and an external source and the results from above were the same.
 
It's not completely clear whether you powered just the servos or the board and the servos from an external supply. the schematic on that site doesn't show the power circuit but from your description, I think you still have the servos and the board on the same power.

There are lots of examples of controlling servos from microcontrollers. no diodes or anything else, just a straight connection to the servo. here's an example, they use 2 supplies, one for the controller board and a different one for the servos. https://www.electro-tech-online.com/custompdfs/2006/07/Controller_SCH.pdf
 
Hi,

Servo by definition is "Closed Loop", so its all about feedback. What servos are you trying to run? Some servos rely on encoders, serial coders, resolvers, sync pulses, etc.

Could it be a feedback issue?

Also, different servos have different specs - It would depend on how close you are to the specs.

I have seen different types of servos get very hot when run on a same drive. I don't understand the difference in signals with all amps, but fanuc for example...... You might be able to run an aM30/3000 on one amp, but you could burn up an a30/3000.

If you are not using feedback, You can still run a servo with an Inverter (AC Drive - Just you cant always test feedback)

I hacked an inverter (tore out the Bus, and built a variable Bus, and wired it back into the inverter). This allowed me to run virtually any servo motor (too a degree). The trick was to start with 0 volts on bus and 0 speed. Gradually, i increased both to make the motor run smoothly and speed up. If I increased too much on speed or Bus voltage, the motor would chatter.

In Short, I think your problem is either feedback (if you are using it), or PWM.

Dos the motor do anything at all? Does it chatter?
 
philba:

I will try running the servo from a different power source tonight and just plug the pwm wire into the mcu. I will let you know the results.

NeonKnight:

I have 3 different brands that ive been testing with, a futaba, JR, and Hitec. The futaba runs fine, no problems. The JR will run as it is supposed to for a random amount of time and then it will stop and I will get the error messages from above. Most of the time the servo will go for about 15 seconds before it causes the board to disconnect. The Hitec servo will immidately cause the error codes to return. It will not even work for a few seconds. I dont know what the specs are for the servos but I was under the impression that they all used the same pwm signal from 1-2ms with a 20ms duty cycle, is this not true?
 
I could not get the servo to operate under an external power source. I connected a 5v source to the pos and neg lines of the servo and left the pwm wire connected to the board. My power source was good, verified with a voltmeter.
 
HakBot said:
I could not get the servo to operate under an external power source. I connected a 5v source to the pos and neg lines of the servo and left the pwm wire connected to the board. My power source was good, verified with a voltmeter.

I think that you need to connect the grounds of both power supplies together...

Rick
 
rockin_rick said:
I think that you need to connect the grounds of both power supplies together...

Rick


I dont mean to hijack this thread with a dumb question, but this is something I have been wondering about. Is is *always* okay to have a common ground between two power supplies?? Another example of this would be a PIC and an H-bridge.
 
the dude of dudes said:
I dont mean to hijack this thread with a dumb question, but this is something I have been wondering about. Is is *always* okay to have a common ground between two power supplies?? Another example of this would be a PIC and an H-bridge.

It's not *always* OK, but in the vast majority of cases it's not only OK, it's ESSENTIAL.
 
Ive got a better understanding of the code and I think its working pretty good now. Thing is, the JR servo will still not behave like it should. Hitec and futaba are ok when connected thru the boards power and even an external source with a common ground. When the JR servo is using usb power it will disconnect the board. When under external power it will still jump around but does not cause the board to disconnect.
 
HakBot said:
Ive got a better understanding of the code and I think its working pretty good now. Thing is, the JR servo will still not behave like it should. Hitec and futaba are ok when connected thru the boards power and even an external source with a common ground. When the JR servo is using usb power it will disconnect the board. When under external power it will still jump around but does not cause the board to disconnect.

Probably taking too much current?, USB is only able to supply a fairly small amount - what are you using for external power?.
 
nigel,

The power source I was using is a Recoton universal ac adapter. Basically a power adapter with adjustable output voltage.

Here is a pic:
**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top