Page 1 of 1
Moves forward, stops, moves forward, stops
Posted: Sun Feb 12, 2017 4:17 pm
by itinstructor
My mePed 2.0 moves forward, stops, moves forward, stops. Turns, and backing up seems to work fine.
I have experimented with the calibration, thinking a servo was reaching its limit. The IR seems to be receiving the signal regularly.
I am using Panasonic eneloop batteries which put out about 5.25 volts.
I started out using the default program from the website.
On another note, I am still learning Arduino C, so more commenting of the code and what it does would help.
Re: Moves forward, stops, moves forward, stops
Posted: Sun Feb 12, 2017 4:43 pm
by itinstructor
A little more experimenting. After a bit, it doesn't matter what button on the IR remote I press, it still goes forward. Sometimes it will go for a bit and be just fine, then it acts up again. It seems to have a mind of its own.
Normal control operation is restored when I turn it off and on again. However, moving forward is still erratic.
Re: Moves forward, stops, moves forward, stops
Posted: Mon Feb 13, 2017 8:35 pm
by spierce
Hi itinstructor,
Try commenting out the line that says: distance = get_distance(INCH);
I'm guessing that the routine for grabbing the distance from the ultrasonic range finder is causing the delay in the walking loop. Also, the USRF isn't being used in the starter program.
Also, the IR sensor will have a have a hard time understanding the information sent from the IR remote when in bright fluorescent lighting or direct sun light. The way we have the mePed programmed, if the Arduino doesn't recognize the IR Remote command sent, it will repeat the last command that it did actually recognize. Therefore, if the last valid command it recognized was walk forward and then you pressed turn left and it walked forward again, that means that it saw some command come through but there were too many stray IR light waves from the sun or other light source that produces IR light for it to be able to understand what was being sent.
Please let me know if you have any other questions. I'm currently out of town for the week and only have access to the internet in the evenings.
Thanks,
Scott Pierce
Re: Moves forward, stops, moves forward, stops
Posted: Mon Feb 13, 2017 9:59 pm
by itinstructor
Taking out the Ultrasonic Sensor line helped.
I don't think it is too much light, I am doing this in my kitchen. I have other robots that run by IR without any trouble.
If I pause between sending a new IR command, it works better, but still isn't consistent. Sometimes it just won't change direction until I wait several seconds. If I pause at least 5 seconds between changing commands, it seems to work better.
It turns toward the right while walking ahead, I have changed the trim to the left, but it doesn't seem to help. The legs on the left get very close together. Any suggestions?