Author Topic: Modding HS-311 Servo (centering with MCU) Question  (Read 2557 times)

0 Members and 1 Guest are viewing this topic.

Offline jp1390Topic starter

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Modding HS-311 Servo (centering with MCU) Question
« on: August 31, 2010, 03:38:22 PM »
Hi, so I just got all my parts in and I'm ready to get working on these servos but I have no idea how to center the servo.

It just says hook it up to your ATMEGA MCU then send a 1500us pulse to get it to the zero position, but how the heck do I do that? I bought the AVRISP2 Programmer and have AVR Studio 4.0 installed. I have a breadboard to use for connections but I have no clue how to write a program to tell this servo to center -> what all the connections that need to be made for the MCU/Programmer/Servo.

Can someone help me out?

Thank you,
JP

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: Modding HS-311 Servo (centering with MCU) Question
« Reply #1 on: August 31, 2010, 05:25:12 PM »
Skip the servo centering part until you finished making the electronics. Yeah the $50 tutorial is a little wacky like that  ;D

Offline jp1390Topic starter

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Re: Modding HS-311 Servo (centering with MCU) Question
« Reply #2 on: September 05, 2010, 09:37:58 PM »
Okay, now I finished the electronics (soldering the last bits was a pain... but w/e) and I would like to finally mod these servos.

I am using the 9V battery combo with the 4xAA battery holder. I set up the circuit the exact same way as the .pdf schematic found in this .zip file posted in the tutorial: http://www.societyofrobots.com/robotforum/index.php?action=dlattach;topic=3292.0;attach=1304

1) 9V (+) connected to 5V regulator lead (farthest from microcontroller)
2) 9V (-) connected to 5V regulator middle lead
3) 4xAA battery holder (+) servobus
4) 4xAA battery holder (-) grounding wires

So I plugged in my first servo into the servo bus (black,red,yellow; black being the farthest from MCU), and plugged in my AVRISPmk2 into its header location (red stripe closest to ceramic capacitor). I opened up AVR Studio 4.0, clicked on the AVR black IC icon, went to the FLASH .hex programing option, found the centering .hex file given in the servo modding tutorial, and then hit program.

The result was that everything read "OK!" on the programmer. Both green lights were on the programmer, but no servo movement. So I checked out some readings with my voltmeter. I accidentally shorted the transistors middle lead and the 9V (+) connected lead for a short second and noticed that the servo moved. So, I kept on trying to short it and the smaller light on the programmer would occasionally go red or green depending on if the leads were shorted. If I held them shorted for more than a second it would usually just briefly move, but no continous rotation. So, right now I am absolutely lost with what to fix or look for. Any ideas?

Sorry for the long post but after spending ages soldering, I was hoping this would work out :(

Thank you,
JP

Offline jp1390Topic starter

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Re: Modding HS-311 Servo (centering with MCU) Question
« Reply #3 on: September 06, 2010, 10:26:53 AM »
If someone could help me with what voltages I should be expecting in key areas?

The servo bus is at 5V, and the sensor bus is at around 4.5V. The 9V battery was red hot and was giving off around 7V to the 5V regulator, but I am still confused as to why the servo only jumped when I shorted the two regulator leads... :(
« Last Edit: September 06, 2010, 11:01:17 AM by jp1390 »

Offline jp1390Topic starter

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Re: Modding HS-311 Servo (centering with MCU) Question
« Reply #4 on: September 06, 2010, 01:05:20 PM »
So, after looking at the .pdf, I think I had the regulator backwards (not 100% sure), but I re-soldered it and the same crap happens. I'm getting now 5V at the servobus and 4.94V at the sensor bus.

Can anyone please help? Any suggestions, anything...?

Offline jp1390Topic starter

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Re: Modding HS-311 Servo (centering with MCU) Question
« Reply #5 on: September 06, 2010, 01:40:33 PM »
Here is what my circuit looks like, sorry for the quality:

Top


Bottom


The red and black wires on the right side are for the 4xAA battery holder. The 9V battery connects to the bottom right hand small red wire and middle ground wire beside that.

Any suggestions?
« Last Edit: September 06, 2010, 01:43:53 PM by jp1390 »

 


Get Your Ad Here