How to write the PID controller for the self balancing robot?


#1

The instructions on https://openlab.makeblock.com/topic/5729b96b591c0ad43a4764b2
are very good but there is no hint how to code the PID controller for the robot!

There is written
You can download the source code of the project from https://github.com/Makeblock-official/Makeblock-Libraries/tree/master/makeblock/example/Firmware_for_MegaPi

This link is invalid. Maybe


is the correct?

I have connected to the serial port, have upgraded the firmware.
But how does the “self balancing robot” know that he has to use this code? If I switch on the board it does nothing.


#2

Sorry, we are not updating anything in the openlab website and some of the links may not be working. Sorry for any inconvenience caused.
And you are right, the one you posted is correct firmware for MegaPi (10 forms). In the Makeblock app, when you choose the correct form, then it will perform the corresponding codes. Once power on the self-balancing robot, go to Makeblock App and select “self-balancing robot”. If it still makes nothing, use mBlock 3 (PC software) and do reset default program.
It is also important to make sure enough power, correct assemble.


#3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.