Poly1 is back as PIDPoly
Hi All
Some time ago I posted a program to an encoder thread it was quite primitive. I have been off doing other things and finally am back to my Stingray. As my first attempt of the new round, here is an updated stingray program It kinda sorta implements a turtle graphics like function I call it PIDPoly
Big shoutout to Kye for his new PID object it works great out of the box.
Encoder thread with Poly1 code
http://forums.parallax.com/showthread.php?118906-Stingray-Motor-Shaft-Encoders
My Apologies to everyone trying to upload the pidpoly archive.
I have no idea why it was coming up empty but it was, and I did not notice it. At any rate, here is the spin directly, you also need PWM1C_PIDEngine from the object exchange. here's the link: http://obex.parallax.com/objects/673/
Some time ago I posted a program to an encoder thread it was quite primitive. I have been off doing other things and finally am back to my Stingray. As my first attempt of the new round, here is an updated stingray program It kinda sorta implements a turtle graphics like function I call it PIDPoly
Big shoutout to Kye for his new PID object it works great out of the box.
Encoder thread with Poly1 code
http://forums.parallax.com/showthread.php?118906-Stingray-Motor-Shaft-Encoders
My Apologies to everyone trying to upload the pidpoly archive.
I have no idea why it was coming up empty but it was, and I did not notice it. At any rate, here is the spin directly, you also need PWM1C_PIDEngine from the object exchange. here's the link: http://obex.parallax.com/objects/673/
Comments
Sorry for the inconvenience.
Thanks for working up these starter files. It has been very useful for me. I just picked up a Stingray last week and am new to Propeller, so a solid starting point project especially using the encoders would help me a bunch.
On my bot I have built a serial interface and the leds are attached to the serial to parallel chip whicc I doubt you have so there is no sense posting that module. You will just have to remove all reference to the Leds. All they do is blink the lights for some eye candy.
The other module is a PID controller by Kye and there is a link to it in the first post.
I have the QME-01 wheel encoders attached to my stingray and Kye's object relies on them for PID control on my Stingray. If you don't have the same model wheel encoders the PID will not function as written so you will have to tune the PID for your hardware which is probably something you will have to do anyway because there are always variations in the hardware.
I run my bot mostly on a short Berber carpet.
PidPoly as written makes a 5 meter forward run, then makes a right turn 1 meter square followed by a left turn 1 meter square and finally returns to the starting point and reorients itself.
I manage to get it back to within 10 - 11 inches of the starting point 40% of the time.
The failures occur because there is no speed ramping and the tail bounces on stopping and turning introducing errors. Slowing it down and ramping will make it a little better but there will always be some errors.
Enjoy
Some after thoughts:
I think it is obvious but just in case
You will also need to verify and adjust the Stingray parameters in the comments section to match your bot.
There are several good pieces on the web about tuning a PID drive just google for them.
Thanks, TRS
because you have everything you need above.