Unusual servo movement in "start here" robot

robot004.bas (1132Bytes)

Around a year ago I completed my version of the Start Here robot (with an SRF05) and have recently repaired it a bit (one of the motors wasn't working properly.) However, the servo now moves around a bit whilst my robot moves and sometimes even turns round fully to the left and just shakes. After playing around a bit, I figured out that the shaking only occurred when the output from the SRF05 was < 270 (about 45cm). If there is anything at a distance less than that, the servo begins to shake and move to one side (usually the left), but if there is nothing in its way, the servo stays in the middle.

Is there any reason why it should do this, and is there any way to stop it?

Thanks

I had the same problem. Make
I had the same problem. Make sure you are not connecting the servo to the same pin the SRF05 is connected to.

Code…

The only thing funny I saw was on line 22. It should be a goto not a gosub.You’ve also got an extra total halt on line 38. Bad news is that I don’t think these have anything to do with your problem. Your code is pretty straight forward and I don’t think there are any issues. I would say hardware. Dunno. Sorry I can’t be more help.

Hmmmm… I have similar

Hmmmm… I have similar wierd problem with my 28x2 LV mC… And I just thought of one thing: Try to use servo command everywhere instead servo and then servopos… Let us know if it worked…

noise ?

Perhaps it’s noise from the SRF05 I/O lines. Do your SRF05 wires run close to the servo input? The SRF05 works with pulses that might mess with the servo.

The servo is connected to

The servo is connected to pin 0 on the project board, and one of the SRF05 pins is going to pin 6. I don’t really know which pin the other goes to, but I don’t think it’s to pin 0. Sorry if that wasn’t what you meant, I’m still fairly new to this.

That was what I had in

That was what I had in originally, but after some research I found that that can stop this problem, but didn’t in my case. I’ll switch it back and try again though.

The wires do run quite close

The wires do run quite close together (this was my first robot and I’m quite new to electronics so my wiring was a bit messy.) I’ll try separating them and seeing if that makes a difference.