The EQ My Block

The EQ My Block provides an equation that controls the power of the motors. This equation determines if the robot needs to accelerate to stay upright. We are solving the inverted pendulum problem with this calculation. By the end of the EQ My Block, a new value is generated for the pwr variable block (the power variable).

A series of three Advanced Math blocks are used to calculate the value of the power variable, which in turn leads to the control of the motors. Although the Cdrv variable block affects how we control whether the robot drives forward or backwards, it is the value of the pwr variable block that sets the level of motor speed to keep the robot upright. Essentially, we are trying to determine whether the robot needs ...

Get Learning LEGO MINDSTORMS EV3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.