Kommentar: Einfügen von HTML im Kommentar: Link einfügen: <a href="LINKURL" target="_blank">LINKTITEL</a> Bild einfügen: <img src="BILDURL"> Text formatieren: <b>fetter Text</b> <i>kursiver Text</i> <u>unterstrichener Text</u> Kombinationen sind auch möglich z.B.: <b><i>fetter & kursiver Text</i></b> C Quellcode formatieren: <code>Quellcode</code> BASIC Quellcode formatieren: <basic>Quellcode</basic> (Innerhalb eines Quellcodeabschnitts ist kein html möglich.) Wichtig: Bitte mache Zeilenumbrüche, bevor Du am rechten Rand des Eingabefeldes ankommst ! -> I > Hi all, > > The procedure GO_TURN() from the library PRO-BOT128_Lib.cbas contains a bug. > The assignment > drive_cnt=drive_cnt+((ODO_LEFT+ODO_RIGHT)/2) > uses an integer division which takes the FLOOR value of (ODO_LEFT+ODO_RIGHT)/2. > The result is that wheel encoder ticks are missed because e.g. (5+4)/2 = 4.5 which is rounded down > to 4 by the integer division. Thus in this case 10% of the encoder ticks is missed and the bot moves > 10% farther than it should. > With small values of ODO_LEFT and ODO_RIGHT, that is with low speeds of the bot, the error can be > dramatically larger. (1+0)/2 = 0.5 which is rounded down to 0 by the integer division. In this case 100% > of the encoder ticks is missed and the bot will move on for ever. > > I wrote an alternative code for GO_TURN() which is much more accurate and can make bends too, but > which also requires a different SYSTEM_CNT(). Let me know if you are interested. > > Regards, > Pepe