Uncontrollable servo

Let me introduce 1st… I’m a biological based student before (my dream)… but now I’m a final year electrical student (not from US) :cry: … but I don’t like electrical (I got no choice-given by government-because our government here always unfair) :cry: … so I had a very extremely super poor and lack knowledge on electrical… actually I’m just trying to clarify that this all was only for educational purposes…

I had chosen to make a hexapod as my final year project (but I cannot just use the phoenix I had bought from lynxmotion and submit it because this lynxmotion’s phoenix was too perfect which unable for a student to create something like this perfect)… as for submitting the task… I need to create my own (low grade-more lousy-simple-more stupid) servo controller board (for same parameter as phoenix but I cannot use the SSC-32 from lynxmotion which is too perfect)… at the same time… I had already bought whole set of phoenix from lynxmotion…

so now… im currently using the Atmega168 microcontroller(program inside remained) from SSC-32 for my own servo controller board… I had tried to construct my circuit for only one leg first… the problem is why my servos especially the femur and tibia parts go crazy?? I mean both of it keep go to the max angle and keep vibrate after applied power… and it was totally Uncontrolled even i press button on ps2 controller… but the processor LED blinking(means processor good).

I have blank idea for now… Please help… I had tried study a lot… but still can’t get it… please help… i just wanna settle my task… as simple as that…
below was my circuit diagram… thanks

Incorrect pulse timing to a servo can make it turn all the way in one direction.

If it were me, I would double/triple check that all of my connections were working. Not sure how you are hooking this up? Breadboard? WireWrap?..
Then I would also print out the schematic of the SSC-32 and my own drawing and make sure I have accounted for everything. Have I grounded everything that needs grounding. Do I have proper jumpers or wiring to choose the appropriate baud rate…

Then I would probably hook up some test equipment to see what signals I was generating. Do you have access to a test lab that has equipment like a Oscilloscope or logic analyzer? These have saved me more than once!

Kurt

thanks for ur suggestion… i will try it out… thanks… i construct this using breadboard… i had check my connection a lot of times… n i will keep try it again n again… :slight_smile: :slight_smile: ehm… actually can i really use the 15Mhz crystal??? instead of 14.7456Mhz crystal ??? any mistake for my connection??? thanks :slight_smile: :slight_smile:

thanks… may i ask for some stupid question?? sorry… actually i haven’t access to any test lab… but… after u told me… i think i will go for a test lab… but… can u give me some clue actually on how can i apply the oscilloscope to test my circuit?? what result i should expect??? sorry… i had no good constructive idea on how can i apply this… and i know i shouldn’t ask this kind of question…

You might try connecting at a baud rate of 9600 to see if that works. Otherwise you probably need the proper crystal, or possibly use other servo control chips that use internal timing.

Sorry I am not the best one for electrical stuff… The last time I tried designing circuits was a long time ago…

Can you use the 15mhz crystal? The simple answer is I don’t know. I believe this was discussed some in a different thread. From my quick look at your circuit, I think you are hard wiring it to do communications at 38400. My quick calculations says that with this crystal, it will actually be communicating at something like 39062, which is off by a little under 2% which assuming that is what is generated may work… Also in the best case your servo pulses will be off. For example a requested 1500us pulse will generate something like a 1525us pulse.

Update: Test lab stuff

Logic Analyzer: Is great for this type of stuff as it captures the digital state of a number of connections. You hook up a test probe to each digital signal you are interested in as well as a ground pin. When you do a capture, it grabs the data and allows you to analyze it. So in your case you could hook up a probe to each of the servo pins and see what the pulse widths are that are actually generated.

Oscilloscope: Like above but except just telling you that a signal is High or Low it will show you the actual voltage. Again you can capture this data and see the widths of the signals. In addition to this, you can use this to help analyze Analog circuits.

An example of using an Oscilloscope is shown in this article that talks about interfacing a PS2 controller: curiousinventor.com/guides/ps2

Kurt

One might look at using a “sound card O-scope”. I downloaded one a long time back, but I was clueless as to setting up the program to measure what I wanted, and also as to how best to make a probe for it.

Hi… i had tried with baud rate 9600… the servos not move at all… :slight_smile: :slight_smile:
thanks

oh ya… forget to ask that…
1)im currently using firmware 2-04GP_BETA2.abl…
2)and the circuit is without EEPROM 24LC256…
these two parameters won’t effect and not the reason for uncontrollable servo right???

Neither the firmware nor the lack of the EEPROM will affect the servo operation.

some baudrates come out closer then others. You might try all baudrates available.

Alan KM6VV

Hi… if im not mistaken… not the external EEPROM only for storage of sequence created by SEQ ???
means in my circuit i need to include external EEPROM to solve this problem??? :slight_smile: :slight_smile: thanks

If you want to store sequences, use the appropriate firmware and install the EEPROM.

Alan KM6VV

nono… i don’t wanna store any sequences… i don’t wanna use any EEPROM… i just want the servos to be controllable…

If it were me, I would start off simple to eliminate issues.
For example: Is your communications set up properly. That is can your processor talk to the Atmega168 on the semi SSC-32?
Assuming you have bidirectional communications setup, I would issue a VER command and see if the results come back that look right.

Something like: (Note, I typed this in on the fly so may not compile or run properly, but…)

cSSC_OUT  	con P11		;Output pin for (SSC32 RX) on BotBoard (Yellow)
cSSC_IN    	con P10		;Input pin for (SSC32 TX) on BotBoard (Blue)
cSSC_BAUD 	con i38400		;SSC32 BAUD rate

abBuff		var byte(80)	; buffer to read stuff into

	serout cSSC_OUT, cSSC_BAUD,"VER",13]
	serin cSSC_IN, cSSC_BAUD,[str abBuff\80\13]	; read in up to 80 characters terminate on cr - may want timeout
	serout  s_out, i9600, "SSC Version: ", str abBuff\80\13, 13] ; print out on debug terminal

If this works then you know that the Atmega is up and running and communications is working properly

Kurt

After comm is working, I’d try code to do simple servo move commands.

Alan KM6VV

i tried add a MAX232 IC to connect to PC using RS232… i tried open the lynxTerm… i type in VER… and it come out with weird words… and when i click the REG… it come out with error can’t find SSC-32 card…

Sounds like you needed to take care of that first. When you said you added the Max232, I assume you added all of the support stuff as well. If I remember correctly the Max232 takes 5 capactitors… You could have also tested the communications without it by using program on your micro-controller. But assuming this is wired in properly and you did not get ver back properly, it sounds like you may still have wiring issues…

For example on your circuit you don’t have the EEPROM, which is not necessary unless you are doing sequences, BUT you also don’t have the pull-up resistors in place. So not sure what the Atmega code may or may not do as SCL/SDA or floating…