HSERVO Problems

Atom PRO: HSERVO is not working. This is a continuation of the problem report in the IDE v8.0.1.3 bug thread.

I am getting a continuous reset when HSERVO code is active.

Code is below:

[code]TRUE con 1
FALSE con 0

’ Control for serial output

debugoutput var bit

’ Begin BRAT Configuration

’ Servo Configuration
RightHipV con P0
RightHipVOffs con 0

RightKnee con P1
RightKneeOffs con 0

RightAnkle con P2
RightAnkleOffs con 0

LeftHipV con P4
LeftHipVOffs con 0

LeftKnee con P5
LeftKneeOffs con 0

LeftAnkle con P6
LeftAnkleOffs con 0

’ We need two servo groups (P0 - P7)
HSERVO_GROUPS con 2

’ Joint move speed

’ Variables
MoveSpd var byte ’ Joint move speed

RightHipVPos var word

RightKneePos var word

RightAnklePos var word

LeftHipVPos var word

LeftKneePos var word

LeftAnklePos var word

’ End BRAT Configuration
debugoutput = TRUE ’ Turns on(1)/off(0) serial output to console (serout)


if debugoutput then
serout S_OUT, I9600, “I am now active”, 13]
endif

'*************************************** TESTING CODE *****************************************************
enablehservo ’ Turn on HSERVO

RightHipVPos = 0

RightKneePos = 0

RightAnklePos = 0

LeftHipVPos = 0

LeftKneePos = 0

LeftAnklePos = 0

MoveSpd = 63
hservo [RightHipV\RightHipVPos + RightHipVOffs\MoveSpd, RightKnee\RightKneePos + RightKneeOffs\MoveSpd, RightAnkle\RightAnklePos + RightAnkleOffs\MoveSpd, LeftHipV\LeftHipVPos + LeftHipVOffs\MoveSpd, LeftKnee\LeftKneePos + LeftKneeOffs\MoveSpd, LeftAnkle\LeftAnklePos + LeftAnkleOffs\MoveSpd]

while 1
pause 500
wend
'*************************************** TESTING CODE *****************************************************[/code]

8-Dale

Dale,

did you try setting the MoveSpd = 0?

I tried that. Same results. Everything is fine until I activate HSERVO and then the Atom PRO just keeps resetting.

8-Dale

Ok, since I was playing with the Brat, I reconfigured it to temporarily have the servos at P0-P5 and switched the defines back to how you had them recompiled it and it ran fine. Then I set
HSERVO_GROUPS con 2

As you had it and it did not reboot (or at least I did not get the message telling me it rebooted…) However the servos were acting really noisy. So I changed it to a 3 and the servos acted better.

So try speed = 0 and groups > 2 If it still reboots I think I would double check to make sure battery is OK, VS is going to the two groups with servos…

Kurt

I only have a single battery connected to the bot board now - 6.0V 1600 mAH. That should be more than enough to run everything on this BRAT.

I also tried the speed = 0 with HSERVO_GROUPS=2 and 3.

Same results.

Everything works fine if I remove the HSERVO code and have other code running, so I do not suspect the battery.

8-Dale

That is the same battery I am using. Not sure what to tell you as I think mine is now configured the same way as yours.

Another WAG is maybe a bad servo. You might try unplugging all of the servos and running the code and see if it still reboots. If not then try adding them one at a time until it reboots. I assume you have the right jumpers set to pass the VS to the servos and not the +5V.

Kurt

I can remove the HSERVO code, and my Atom PRO does not reset at all, with all servos connected.

To me, this says there is a problem with HSERVO.

I did change my servo connections to be P1 - P3 (Right side) and P5 - P7 (Left side) to allow for the hip rotation upgrade I want to do.

I have the Vl=Vs jumper installed because I only have a single battery supply. Vs is jumpered for groups 0 and 1 where I have the servos connected, but I don’t know if this makes a difference with a single battery.

8-Dale

No it doesn’t. Taking the Hservo command out also disables the servos, which could be the cause of your resets if you have a battery or cable problem… Think about it. :wink: Remove the servos and repeat the test. This is the only way to determine of the servos are causing your reset problems…

Probably, but I am the type who likes to issolate the problem. There could be an internal problem with a servo that shorts out, which causes the processor to reboot. There are two easy ways to find out. Remove the servos (not sure if you can just remove the VS jumpers from the two groups what that would do). Or you might try temporarily changing the code to use SERVO or MSERVO in your loop and see if it still reboots… Just a thought

I think it still makes a big difference. With it in the VS jumper state, the voltage from the battery (in this case 6V) is passed to the servos. If the +5V is selected you are using the power going through the voltage regulator which is limited.

Good Luck

You are right. There could be something wrong with a servo connection or something else with a servo that could cause problems like this.

I am going to do what kurte suggested as soon as I replace some broken battery terminals. I wish the bot board had battery terminals like the Sabertooth controllers have.

8-Dale

I have tested Dales code here and do not see the problem. I have requested he send me the Bot Board and Atom Pro so we can test it here. For now, except for an initialization that needs to be done before doing speed controlled moves, which is pretty much normal, there does not seem to be a problem with Hservo.

Sent today. :slight_smile:

8-Dale

Not sure why the forum troubleshooting failed, but the board arrived with all of the I/O jumpers set to VL, so it’s no surprize the Atom went into full time reset city whenever a servo command was used. An idle analog servo, in this case the 475, will draw only ~10mA or so. So even 6 of them is well within the Bot Boards’s 5vdc regulators capability. However once they are holding position the current easily can be twenty times this. But it’s the initial inrush of current that kills the regulator, and subsequently resets the Atom chip. So I have James replacing the VS terminal, and we will ship this soldier back into action ASAP.