Help with "PID Following Propeller Bot"
parts-man73
Posts: 830
I've set up my BoeBot with a Propeller Proto Board, and I've got something neat to show the class when I get the code working.
I'm trying to modify the code for "PID Following Propeller Bot" that I found in this thread
http://forums.parallax.com/showthread.php?p=635059
Here is a snippet of code that I changed to reflect my hardware setup
I changed the Propeller pins that the IR LEDs and Detectors are connected to. I've been trying to determine....is this the only area of the code that needs to be modified to reflect those changes? Right now, the right side servo operates as expected, I can hold an object in front of that detector, and the servo will slow, stop or back up depending on the distance at which the object is held. The left side servo just motors ahead, regardless if an object is present or not.
My hardware is set up as follows.
Left LED - P4 Left detector - P5 Right LED - P2 Right Detector - P3
If the code is right, I have to double check my hardware, but it all appears to be connected correctly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio
PropNIC - Add ethernet ability to your Propeller!
SD card Adapter
I'm trying to modify the code for "PID Following Propeller Bot" that I found in this thread
http://forums.parallax.com/showthread.php?p=635059
Here is a snippet of code that I changed to reflect my hardware setup
'Configure IR detectors. ir[noparse][[/noparse]L].init(4, 5) ' IR LED to P4, detector to P5. ir[noparse][[/noparse]R].init(2, 3) ' IR LED to P2, detector to P3.
I changed the Propeller pins that the IR LEDs and Detectors are connected to. I've been trying to determine....is this the only area of the code that needs to be modified to reflect those changes? Right now, the right side servo operates as expected, I can hold an object in front of that detector, and the servo will slow, stop or back up depending on the distance at which the object is held. The left side servo just motors ahead, regardless if an object is present or not.
My hardware is set up as follows.
Left LED - P4 Left detector - P5 Right LED - P2 Right Detector - P3
If the code is right, I have to double check my hardware, but it all appears to be connected correctly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio
PropNIC - Add ethernet ability to your Propeller!
SD card Adapter
Comments
Does that side also continue to run without the program being loaded?
if you had to change the pins for your ir components, did you also make changes to your servo pins(could be it's referencing a wrong pin with the servo signal.)
Now that I've had some sleep, I thought of something to try. I''ll have to do this after work tonight. I'll hook up TV or VGA to debug, and just run a IR detection routine, to verify that each LED/Detector set is working correctly. I could even use alternate side LED and detector (left LED and right detector for example) to narrow down a hardware issue to which component is not working.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio
PropNIC - Add ethernet ability to your Propeller!
SD card Adapter