Do not forget the cost of PBP.
Do not forget the cost of PBP.
Dave
Always wear safety glasses while programming.
Yes, the PBP is not freeware. But from the point of view of a middle school club or group project it is a 'one of'.
I did not anticipate the complexity of upping the speed of this car and only asking it to follow the wall. This has been a good lesson for me.
Ken
You may want to read the back cover of your manual.Yes, the PBP is not freeware. But from the point of view of a middle school club or group project it is a 'one of'.
Something like this came up before, no group license.
That is why I get kids started with some basic ASM and/or what they can do with the demo version.
Dave
Always wear safety glasses while programming.
I just read the above mentioned Software License.
I'd rather use LOGO. But that does not seem forthcoming. Hmmm...
Ken
I would contact MeLabs, maybe they will work a deal with you.
Dave
Always wear safety glasses while programming.
Of course you are correct. Classic robotics is error signal driven.
My problem with PID is my lack of confidence. I do not know the capabilities and limitations of PBP and the 16F887. I have not figured out how to debug the stuff in real time on the bench etc. I have been lazy regarding the 300+ page PIC Owners Manual. I never mastered MPLAB.
Can you point me to some simple PID code in a familiar language - C or C++ (complete with libraries) for example.
Ken
My wall following code is state machine code. I am going forward. The right facing sonar tells me a distance. I compare that to constants and to the previous measurement. Given where I am relative to a line parallel to the wall and whether I am getting closer to or farther from the wall, I steer right, left or straight.
Here's the code:
Given my limitations this seemed the easiest path to take.Code:keepgoingforward: '----Compare to right wall IF oldrangeright = rangeright THEN HPWM 1,Straight,50 ENDIF IF rangeright > outertrack THEN HPWM 1,HalfRight,50 ENDIF IF rangeright < desiredtrack AND oldrangeright < rangeright THEN HPWM 1,Straight,50 ENDIF IF rangeright > desiredtrack AND oldrangeright > rangeright THEN HPWM 1,Straight,50 ENDIF IF rangeright > desiredtrack AND oldrangeright < rangeright THEN HPWM 1,HalfRight,50 ENDIF IF rangeright < desiredtrack AND oldrangeright > rangeright THEN HPWM 1,HalfLeft,50 ENDIF GOTO main
Ken
No need to go far away from your PBP lanquage.
Have a look at Henrik's routines here http://www.picbasic.co.uk/forum/showthread.php?p=54846
It is not easy as A-B-C but also not too hard to follow. May the difficult part would be to tune the PID parameters.
Ioannis
Hmm, have a look at the videos at YouTube about line followers with and without PID control of the robot.
Behaviour of non PID is similar to your nervous car. The same robot with PID control slides smooth on the line (or in your case follow the wall in a steady distance).
Why not give it a try?
Here is the same robot with and without.
http://members.jcom.home.ne.jp/felm/ltc_p.mpg
http://members.jcom.home.ne.jp/felm/ltc_pd.mpg
Ioannis
Bookmarks