#5 Basic Self-balancing towards Torque (part 1 - fixing previous model)
- Aurel

- Feb 20, 2022
- 2 min read
Updated: Apr 6, 2022
From the previous entry on the blog where I wasn't sure about why the robot was moving in one direction after achieving self balancing, there were a few options for which I think that was not working as I expected.
1) The orientation of the environment was not set according to the conventions (not probable);
2) Controller input/output might have something wrong (for example summing sign should have + - conventional, but it has - + to make it work, potential cause of issue);
3) Something else which is not taken into consideration.
Here I try to solve that issue and even if I only have lateral forces being applied, it still needs to balance itself correctly.
Just as a reminder, this is how the robot is CURRENTLY moving (1/8x speed):
The fact that it was balancing after the PID was tuned was great, but it should not continue to move in a direction.
Option 1), trying to re-orient the robot into the world, and changing from a vertical axis of X, to a vertical axis of Z, nothing has changed and the robot did not have any movement improvement.
I have moved and tried to solve the option 2), and check and change the PID values and make sure also that the outputs of the converters (PS-simulink and simulink-PS) were outputting the desired units, but yet again, it was not improving anything.
After many tries to check what could be improved and what not, I have remembered that to start the simulation I was giving a small force impulse at the top of the Plate3 (top plate) just to behave like a small disturbance, but I realised that it was always being applied. So for that reason, after trials and errors and checking the graphs, that particular force was shifting the setpoint by a small amount.

Making trial-error I had to correct the vertical setpoint of the robot to match an opposite force after an X amount of time, and obtained a perfectly self-balancing basic robot correcting the previous problem which I encountered, making this a milestone accomplishment as it was self-balancing, not in a realistic way (applying torque) but in actual concept.
This was the result:
By making the setpoint "-4 Deg" it was compensating perfectly. Also if I wanted to remove that force from the subsystem, I could simply create an impulse setpoint directly in the "Step" block by giving it an "Initial value" of any number for the disturbance (in DEG) and then the "Final value" would be the overriding value for the desired final setpoint (in DEG). The change in time would be dictated by the "Step time" which sets when the "Initial value" gets applied after starting the simulation, and also after how long the "Final value" must override it.

For next:
I am planning to move towards using torque as decided after meeting with my supervisors.
The robot is not balancing in a realistic way, it should rotate the wheels by having torque rather than lateral force balancing it and not allowing any other type of kinematics. Currently the whole robot (chassis+wheels) is allowed to only move back-forward, and the chassis rotate around the wheels, but the wheels aren't able to move up-down nor change direction, which is far from reality.



Comments