Help

So I’ve been trying to get my new brat assembled and walking. Got it together and am having difficulty getting the offset program to work correctly since I can’t seem to get the servos into their mid positions. I ran the center servo sample from the assembly guide and it seemed to have put all of the servos at the end of their rotations instead of in the mid position. This is the program I used to put the servos in the mid position according to tutorial:

enablehservo
start:
hservo [0\0\0]
end

I have hs-645mg servos. Bot Board II with Basic Atom Pro 28.
I’ve tried numerous things to get the servos in the correct mid position so I can do something with the bot. Can someone help please?
Thanks.

Read through this tutorial it might help
lynxmotion.com/images/html/build111.htm
the servo horn might need to be rotated to center

Thanks but that wouldn’t help at this point. If I found the mid position and the holes were not aligned properly then this would be helpful.

A couple of things. Phil is correct that if you are trying to find the center point and you get to the end of the allowed adjustments in the servo offset program, then you need to undo the screw holding the servo horn to the servo, lift it up and move it one click (15 degrees) in the appropriate direction…

As for your program, I am not 100% sure what the end statement does with the HSERVO subsystem. If it were me, I would try:

    hservo[0\0\0]
loop:
    goto loop

The end statement may work fine, but if I were having problems, I would try changing it like I mentioned.

Kurt

Thank you both for the advice. I’ll give it a shot. Just seems odd to me since nothing is connected to the horn when I try to center it and there are no stops on the horn to keep the servo from rotating. Just so you know, I’m not trying to be difficult, just to understand.

As for the program I got it from here lynxmotion.com/images/html/build046.htm which includes the end tag in the program. Was just trying to use the tutorials from the BRAT assembly guides page to ensure I understood everything that needed to be done to get the servos to the correct positions.

Will let you know how it goes. Thanks. E

I’ve read through this a few times…

An image of your wiring and power would be helpful.

You say running the program moves the servos to “their end of rotation” is that to say they have moved their output shafts to the mechanical stop inside the servo, so it can rotate one way but not the other? If so is it CW or CCW? Can you move them by hand, or do they resist with great force?

Yes what you said is accurate. The servo will not turn one way but will turn the other way. I’m including the picture of the wiring so you can review. Looking down at the horn while turning it moves CCW. I appreciate any help you can offer. Thanks. E

When everything is running can you move the servos by hand, or do they resist with great force?

You know the Atom comes with a program already installed that makes the IO pins cycle on and off. The frequency is not right for controlling servos, but in fact the servos tent to move weekly in one direction until the stop is reached. The speaker will also click. The servos can be moved by hand but will return to the stop if released.

Are you sure you have successfully programmed the Atom?

Are you clicking Program or Debug?

When I first applied power to the controller the servos were not connected but the led’s did cycle and the speaker made a tone so it seemed to be working and the power LED remains solid.
When power is applied the servo’s will resist when I try to move them.
I click program in the development studio to push the code onto the controller if that’s what you mean by your question of clicking program or debug.
Can I post a video on this board? Maybe I can take a video of one of the servos completely removed from the robot and connected to the controller showing you what it does when I execute the centering program. That might be the most beneficial way. What do you think?

This board will host images, but not video. You can put it on youtube and link it here. There is even a youtube format tag for this. Yes more information is always good. Are you sure the 6vdc battery is fully charged?

The battery was fully charged when I started the centering process but I doubt it is now. I’ll recharge to make sure that’s not an issue. If that doesn’t work i’ll see if I can get a video posted. Thanks. E

OK so fully charged the battery. Pulled a servo off of the brat and tried to center the servo again. Used these lines:
enablehservo
hservo [P0\0]
to try to find the mid position. The servo rotates clockwise until it hits the mechanical stop in the servo. I then manually rotated the servo close to center and tried to adjust the position argument of the command to see if that would make a difference, I used 11000 and -11000 and both get the same result. Servo always rotates clockwise until it hits the mechanical stop and seems to “bounce”. Doesn’t matter what pin or servo I get the same result. Went and rechecked the configuration of the board and it is setup correctly. I am really frustrated at the moment. The only thing that comes to mind is either the board or the controller may be defective. Any thoughts? Thanks.

So hold off on suggestions for the moment. Just remembered I had a BS2 stamp and a board for the stamp so I should be able to narrow down the issue between the servo, board and controller. Will let you know once I do some testing with the different components and combinations. Haven’t messed with the BS2 stuff in so long forgot I had it. Will let you all know.
Thanks. E

Hservo does not like it when a program ends and will not act properly. For instance, this code will reproduce the results you describe:

enablehservo hservo [p0/0]
whereas this will work properly:

[code]enablehservo
hservo [p0/0]

loop
goto loop[/code]

I wondered that as well… Someone should probably notify Nathan of Basic Micro (acidtech) and maybe update the code in the tutorial: lynxmotion.com/images/html/build046.htm

Kurt

Updated the code.

That was exactly the issue with the centering. Thank you for pointing that out. I was able to get the servos centered and run the centering program. I appreciate the help everyone.