mBot Ranger and LineFollowerArray with delayed response


Recently I started building a competition robot, an mBot Ranger with the LineFollowerArray, but I ran into some problems…

The array can detect a range of scenarios, as seen on my screenshot. The thing is, there is a quite noticeable delay between the sensor detecting that the robot is a bit off track and the EncoderMotor actually slowing down. So much so its getting frustrating trying to get to robot to stay on track.

Any help on how to figure this out ?


Use Arduino mode.


Great answer. But not really.

As seen on the code, the top block is Auriga Program, so of course I’m using Arduino mode to upload the code to the robot, in addition to an more than capable power supply.

If you’re talking about using the Arduino IDE to write the code, have you been trough a similar problem ? Is writing the code and uploading direct trough the Arduino IDE is better/produce faster results ? If thats the case, why so ? And have you ever used the LineFollowerArray? Had the same problem ? Menaged to solve it ?


I’m talking about Edit > Arduino mode. If you were in it, you would see Arduino code and a few buttons, including “Upload to Arduino” on the right half of your screen.


I think you didnt get it.

The problem is not uploading the code to the AurigaBoard. Cant see what difference would make you seeing the arduino mode layout, as I said before, I’m uploading the code trough arduino mode.

But hey, here you go, ArduinoMode. Hope this can help you in some way.


Now, in the top right corner, click “Upload to Arduino” while the Ranger is connected.


Please read the entirety of my topic before posting useless replys.

Thank you.


Hello Leonardof131,
I think this might be caused by the encoder driver default codes contains “delay code”.
If we get external encoder motor driver, connect motor to the external encoder motor driver, and use external encoder motor driver blocks instead of on board encoder driver blocks of Auriga, this issue should be avoided.
If there is no external encoder motor driver, you can try to open the program in Arduino IDE, then find all delay codes, like below, delete them, then upload the codes in Arduino IDE:


Hello support! Thanks for shedding some light on this problem! Sadly, I dont have an external encoder motor driver.

If I were to go about deleting delay code com the Arduino IDE, Should I delete the interrupts highlighted in the code below ? Because I did that and the motor just ran forward at full speed, ignoring any rpm reading or sensor value.

If its any help, I uploaded an smaller sample of my code in Arduino here: http://s000.tinyupload.com/index.php?file_id=00385977406230930647


Hi leonardo,
Have you tried below block?
Please also save your code for me and I will have a test.


Hi leonardo,
Have you tried below block?
Please also save your code for me and I will have a test.


Hello support! Just tried with that block and had the same issue, if not a longer period of time between the sensor detecting the line and the motor actually changing the speed.

Please note that when using the regular LineFollower module, not the array, this problem does not occour. Both motors ajust their speed instantly when using a regular LineFollower module.

Some more info:
Mblock version: 3.4.12
Download link to the code: https://drive.google.com/file/d/1vcfE55FrC13OGRPbmd6ITQ0Ws7BB3iLN/view?usp=sharing


Any news from @tech_support?


I did reply via email as you also sent us email.


@argomj You are dense as well, my friend.

As for future reference as other people may have the same problem:
For some reason, the interrupt functions of the encoder motors conflict with the LineFollowerArray (either using the extension or by arduino code), leading to dalayed response. The same goes with servo+array combo.
There’s no aparent solution to this, as stated by @tech_support, LineFollowerArray is no longer supported by makeblock.

The only workaround this is using the Power motor block.



Hi @leonardof131, I was facing with this issue, too. Right now I have deleted delay codes as @tech_support stated, for now it works but unfortunately, it just moves with fixed(maximum) rpm meaning that even if I write a code to assign rpm to some values, it doesn’t see those values and moves at max speed. What do you think @tech_support?


Hi Eshgin, Sorry for the issue caused.
Now please try below block:

Instead of these two blocks:

The latter two blocks will cause issue when working with the melinefollowerarray. Currently there is no better solution for this problem. I am keep forwarding and if there is more feedback on the same issue, they may try to find a way to fix it.


Dear @tech_support, I have already used this blocks but the problem still remains the same


Hello @Eshgin! Sadly we both have the same issue. At the time of writing, makeblock dosent support the LineFollowerArray. This can change if we get more people having the same problem, they might issue a hotfix.

But I’ll add my two cents on the matter:

The interrupt function used to read the encoder values of the motor may break the reading of the LineFollowerArray, since it uses the the millis() function for the timeoutflag.

Take my explanation with a grain of salt, since I dont know shit about Arduino programming.


Hi @leonardof131, I think someone has achieved to use encoder motor with the line follower array (Please, see a video). Therefore, I think Makeblock @tech_support can help us to solve this issue.

Here is a code, that person used. I think it will be great if @tech_support tries to explain the code and we can modify it for our own purposes.