Designing a knee brace with a controller-driven locking mechanism