How useful is TBH?

So, I’ve been thinking about using TBH instead of PID for this season, but I haven’t been able to find a clear explanation of how it works, as well as the advantages/disadvantages of using it over PID. So, does anyone know about these?

Here is an excerpt from the SIGBots Wiki regarding the “Take Back Half” controller:

[TBH] is typically outperformed by a well-tuned PID control in situations like distance control for driving where the desired end output is zero, but for situations like flywheel velocity control and straight driving controllers, Take Back Half performs better. Due to TBHs single gain control, this algorithm can also work in a pinch when quick tuning is desired, such as emergency programming during or right before a competition.

It seems like it’s basically like isolating the “I” in PID and using that for error correction.

5 Likes

I see; I’ll probably use TBH for my flywheel then. Just to clarify: a TBH loop is just an I loop, or is something added to make it work better?

Not too far off.
But honestly, most of the time there is no need to use all the 3 elements of PID.

7 Likes

Just wondering if you could tell me the difference between a simple I loop and TBH? Also, do you have some advice on knowing when a certain element of PID is needed?

To the best of my knowledge the main difference between a TBH Controller and an I loop is that TBH “Takes back half”. Basically when the difference between the target and current value changes signs we average the motor power and previous motor power together and set them both equal to the result. This effectively “takes back half” of the control output and helps to reduce the rather large oscillations the controller would have otherwise.

This is an article on a TBH controller applied in the context of something non-vex (I.e. thermostat control); however, it might help you understand the general concept/logic of the controller: TBH Article

7 Likes

Think this is a very thorough explanation of PID.

The I in PID is purely a feedback controller. You can imagine it as creating some sort of a “damping” effort to bring the signal down to the target.

As for TBH, it feels like the effect is almost like combining both I and D into one controller - it sums up the differences, and yet at the same time it “feeds forward” with a default setting of halving the error.

There are people who claims that TBH is more efficient for velocity control.

Think people like @jpearman and @tabor473 will be the experts in these controllers.

12 Likes

I see, thanks for the help!

We were discussing TBH a lot back in 2015, not sure if it is even needed these days as motors have velocity control built into their firmware now. If you do try using it, make sure to run the motor in open loop mode, ie. use voltage control.

9 Likes

This is really helpful; thanks for the explanation and tip!

Everybody’s knows that TBH is useful because you can use less keyboard strokes to type out the common phrase “To be honest”.

6 Likes

I use it, it works pretty well.