mePed Forum FAQ

Questions and answers from the mePed.io community forum archive

FAQ › Remote control & IR

My mePed walks forward and stops, and sometimes ignores turn commands. Why?

Short answer: Comment out the ultrasonic distance call (distance = get_distance(INCH);) in the starter sketch. IR interference causes the repeated commands.

Original thread: “Moves forward, stops, moves forward, stops” in Troubleshooting

Question · itinstructor · Feb 2017
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.
Answer · spiercemePed team · Feb 2017
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
Answer · itinstructor · Feb 2017
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?

← Back to all questions