Ultra Conflicts with Servos

erco

Senior Member
I had hoped to use an HC-SR04 ultrasonic sensor with my latest educational 08M2 robot, but the CR servos go nuts when I use the ULTRA command or even ye olde High/Pulsin trick. Must be a conflict in there somewhere, so I'll plan to use a Sharp IR sensor instead.

I'm using the SERVO command. Have not tried bit banging pulses out. That's a possible workaround, but this project is for beginners and I'm trying to show simple programs which demonstrate how PICAXE BASIC does all the heavy lifting.

Any thoughts, Technical?
 

hippy

Technical Support
Staff member
The ULTRA command has to block while waiting for a response so that can interfere with servo control pulses just as any blocking interaction can.

Using a bit-banged servo control loop should avoid the problems of timing.
 

erco

Senior Member
The ULTRA command has to block while waiting for a response so that can interfere with servo control pulses just as any blocking interaction can.
Thanks for your lightning reply, hippy. I waited less for your response than the ULTRA command normally does.
 

oracacle

Senior Member
just a thought, unless there is a reason for the constant signal (ie holding load) could you just not servo servopos, pin, off.

I haven't used servos in a long, long time. and never used servopos command
 
Top