In our case, talking about TwoWheels or Ballbot it's important to know what power our engines need to maintain your robot, or conversely, from the power output should know the maximum slope that can scale.
Usually this activity takes place through specific design tools for engineering, such as Matlab or Simulink, but in this case I decided to make the simulation using Microsoft Excel, especially the ease of programming and the opportunity this presents, and that in any computer MSOffice is this tool available.
Needless to say, is a tool MsExcel general purpose computing, where its main strength is the ability to update results in real time, providing instant visual outcome. This is one of the reasons why it is also useful for simulation, allowing us to perform real-time optimization by adjusting the settings manually and have the result immediately.
It is noteworthy that this project does not require programming skills, as the resolution of differential equations can be performed on a spreadsheet directly, by implementing a method RungeKutta 4 th (RK4) order (the same as using Matlab or Simulink surreptitiously), but with the advantage of introducing external signals such as noise or pulse during the resolution of the same, since we have access to one row at a resolution of RK4.
Other Projects: click here.
I leave to your disposal the algorithm used in this example: Download: NXTBallbotSimulacion.xls.