daniel-p-sullivan / Inverted-Pendulum

An inverted pendulum project for learning about control theory.
GNU General Public License v3.0
5 stars 0 forks source link

State transition button #3

Open Xeroxsch opened 1 year ago

Xeroxsch commented 1 year ago

Could you please explain the working of the state transition button? I mean why do you need it. Is it just connected to your breadboard? I didn't see you pressing any button on breadboard in the video except one on Arduino Uno ... Could you please help me? I am following your code for mine. Also could you please tell me how to convert cpr into ppr for encoder? One of my encoder has lower resolution than the other ...so will i be able to do the control with your code?

daniel-p-sullivan commented 1 year ago

Hi Yeah the state transition button is just connected to the breadboard. When my code starts, the motor is not actuating at all, and the setpoint is not set. Pressing the state transition button does 2 things in my code:

  1. The current rotary encoder measurement is saved in the setpoint var that the system will target. So when I'm setting up the pendulum, I manually balance it upright before pressing this button.
  2. The control system will start actively working; control algos will run and the motor will be driven with their outputs.