Line Tracking Microbit Cutebot Pro Not Work
Вставка
- Опубліковано 27 сер 2024
- tinyurl.com/5n...
tinyurl.com/2y... : This is the simple line tracking code.
I did calibrate the IR sensors and got the green lights that it was successful.
Still does not track the black line using the Elecfreaks tracking map.
In that code with the if else cascade I suspect the and needs to be or. One of the issues with the "fused offset value" aka error seems to be it is relatively insensitive when the robot is on the line. That is, the error is not linear with how far off the line you are. With a high enough Kp you can get it to follow a straight line very nicely. But on turns it still behaves like the classic Bang-Bang algorithm. I am using Kp of 0.02 and Kd of 0.015, much, much smaller that what is in the lesson. Anyway, it does work, just not well. I am going to experiment with my own error calculations next.
Thank you for this note, @jdonwells. It's great to have someone who knows about programming to offer helpful hints. I am not at all a coder nor programmer.
Also the values I am using are Kp = 0.02 and Kd = 0.015. Elecfreaks is recommending Kp = 0.05 and Kd = 0.06. For me those are unstable values.
Difficult to believe that this was not tested well by Elecfreaks before offering it as a lesson with the hardware bot car. I have found this also with MakeCode and Microbit for Jacdac with Kittenbot Kits hardware: Software developers do not seem to have hardware in their possession and so push out the programming and say : "It should work". Then we find, after buying the kits, they do not work as advertised.