Sparki has a crook in it's neck

It seems to me that there are two distinctly different issues being raised in this thread.

  1. What does running the Roborealm sketch do to the servo operation?
  2. What are the appropriate endpoints for the rotation without running Roborealm?

The second issue seems to have been resolved. But the first issue is the one that started this thread and the one I’m most interested in resolving, since it seems to have messed up my Sparki as well as others. I ran the code above (the one without an offset from the EEPROM) and the servo did what it’s supposed to. But when I then ran the basic servo sketch, I’m back to the abnormal servo behavior of only looking left (straining to go further) and then center. How do I change the offset that was apparently messed up by Roborealm?

I’d suggest to manually download & install the Sparki.h & Sparki.cpp files from the github.

That will break roborealm, as they used a much older version to make their build. I’d suggest waiting for our roborealm sketch release later this week.

The code you posted bypasses this routine in “sparki.cpp”:

[quote] if( EEPROM.read(0) > 127) {
servo_deg_offset = -256+EEPROM.read(0);
}
else{
servo_deg_offset = EEPROM.read(0);
}[/quote]

I do not use Roborealm and without the 85/85 adjustment, I get the same results whether I used your code or not. This makes me think that EEPROM.read(0) is always equal to “0” and “servo_deg_offset” is also “0” and does not provide any angle correction.

[quote=“ortsac”]The code you posted bypasses this routine in “sparki.cpp”:

[quote] if( EEPROM.read(0) > 127) {
servo_deg_offset = -256+EEPROM.read(0);
}
else{
servo_deg_offset = EEPROM.read(0);
}[/quote]

I do not use Roborealm and without the 85/85 adjustment, I get the same results whether I used your code or not. This makes me think that EEPROM.read(0) is always equal to “0” and “servo_deg_offset” is also “0” and does not provide any angle correction.[/quote]

I wrote a sketch that would show the contents of EEPROM.read(0) and mine is set to 127. I think that is consistent with my Sparki’s center position being ~130. I had tried RoboRealm and do believe the problem started after a RoboRealm session. Perhaps they write to the EEPROM at the same address?

I also tried placing this line of code

after the code you quoted in Sparki.cpp, effectively bypassing the EEPROM value, and now my Sparki operates normally.

I’m tempted to write 0 back into the EEPROM but I’m chicken.

So, I decided to revisit this little guy after a (good deal of) time and I noticed that I still have this issue with Sparki’s servo neck. Of course, I’ve re-installed SparkiDuino and so I have new libraries, etc., but I still have the same problem with the servo motor. It zeros properly and will turn right, but it will not turn left at all (instead, it emits a rapidly repeating clicking sound).

I remember that many of us had this problem after attempting to use the RoboRealm software, and so my question is this: did anyone ever find a working solution to this problem, or is this a hardware issue?

TIA,

Paul

EDIT: The libraries, etc. in my sig are incorrect. I’m using the new 1.0.5.5 download on a new Win7x64 setup.

Any luck with the non-library? (we’re at 1.0.6.1 with that).

If not, contact help@arcbotis.com and we’ll get you a new servo and see if that helps.