PING Sensor - Unwanted Movement
NathanLabott
Posts: 6
in Accessories
Hello I am currently running on the original ActivityBot #32500 programming in C. I am running the test code to see if the ping sensor works with Test Ping.c. However, when the power switch is in mode 2, the left servo jerks according to the distance. If the power switch is in mode 1, it doesn't move and spits out correct ping distances. The problem is in mode 2. If my hand gets closer, the left servo only, jerks backwards and vice versa. Why is the bot moving when nowhere in the code does it say to move, or why is it only the left servo that jerks. The product was purchased in in 2016 so I don't think it's an external encoder issue.
The calibration program ran successfully when I first assembled the bot, and I re-ran it just now and was again successful. I have placed in fresh batteries. I read that the relative location (space above or space below) of the servo could affect the external encoders, but that it was mitigated in 2013 (not solved?). Could the space be large enough to make it move, even when it's not supposed to?
Any help or suggestions would be great.
The calibration program ran successfully when I first assembled the bot, and I re-ran it just now and was again successful. I have placed in fresh batteries. I read that the relative location (space above or space below) of the servo could affect the external encoders, but that it was mitigated in 2013 (not solved?). Could the space be large enough to make it move, even when it's not supposed to?
Any help or suggestions would be great.
Comments
This code does nothing with the movement of the motors. The motor however are not turned on by the code so they are left with no signal going to them and should not move. If they do move it maybe some random noise that the motor is seeing. For the test program you should only be putting the switch in position 1 as position 2 powers these motors on with no signal.
Mike
Since the pin sensor uses PWM pulses to show distance we need to rule out random noise.
add the following two lines of code to the example:
here is the code for the ping sensor that you are using above:
Mike
I added the two lines of code as you indicated, and the bots left servo still just keeps jerking forward or backwards relative to my hand in front of the ping. Any other ideas you have?
Mike
So for example I do this all the time. I have my default program download to eprom and then I build some test code and use the Run with Terminal to just load the new code into memory. If I don't like the code I reboot the unit and the default code from eprom is reload. The code I just tested is gone. When I have some new stable code I use the Load EEPROM and run button.
Mike
Thats the link for the video. And yes AwesomeCronk, that's exactly what it does you can see it in the above video.
I have been using the Load EEPROM and Run button as well.
Awesome! Glad you got it working!
Mike