Difference between revisions of "Controllers"
Jump to navigation
Jump to search
(→Intro) |
|||
Line 1: | Line 1: | ||
− | + | == Intro == | |
*The control algorithms on our bicycle are separated into three cascaded controllers. The output of one controller is input to another controller. | *The control algorithms on our bicycle are separated into three cascaded controllers. The output of one controller is input to another controller. | ||
*In order from high level to low level: | *In order from high level to low level: | ||
Line 7: | Line 7: | ||
*Using cascaded controllers allows us to develop each controller semi-independently. | *Using cascaded controllers allows us to develop each controller semi-independently. | ||
− | + | ==Front Motor Controller== | |
*The front motor controller works to minimize the angle between the current steer angle (δ) and the commanded steer angle (δ<sub>c</sub>). | *The front motor controller works to minimize the angle between the current steer angle (δ) and the commanded steer angle (δ<sub>c</sub>). | ||
*Currently (Spring 2018), the front motor controller is PD (Proportional-Derivative) controller. Specifically: | *Currently (Spring 2018), the front motor controller is PD (Proportional-Derivative) controller. Specifically: | ||
Line 13: | Line 13: | ||
*total_error is converted into a direction (DIR) and a magnitude (motor_output). | *total_error is converted into a direction (DIR) and a magnitude (motor_output). | ||
− | + | ==Balance Controller== | |
*The balance controller attempts to achieve a desired lean angle (φ<sub>d</sub>) and steer angle (δ<sub>d</sub>). In navigation mode, the navigation algorithm sets φ<sub>d</sub> and δ<sub>d</sub>. | *The balance controller attempts to achieve a desired lean angle (φ<sub>d</sub>) and steer angle (δ<sub>d</sub>). In navigation mode, the navigation algorithm sets φ<sub>d</sub> and δ<sub>d</sub>. | ||
*In addition to the desired state (φ<sub>d</sub>, δ<sub>d</sub>), the balance controller takes as input current lean angle (φ), lean angle rate (φ), and steer angle (δ). The balance controller outputs a steer angle rate (δ). | *In addition to the desired state (φ<sub>d</sub>, δ<sub>d</sub>), the balance controller takes as input current lean angle (φ), lean angle rate (φ), and steer angle (δ). The balance controller outputs a steer angle rate (δ). | ||
*Currently (Spring 2018), the balance controller is the linear controller: | *Currently (Spring 2018), the balance controller is the linear controller: | ||
δ<sub>d</sub>' = k<sub>d</sub>(φ − φ<sub>d</sub>) + k<sub>2</sub>φ'+ k<sub>3</sub>(δ − δ<sub>d</sub>) | δ<sub>d</sub>' = k<sub>d</sub>(φ − φ<sub>d</sub>) + k<sub>2</sub>φ'+ k<sub>3</sub>(δ − δ<sub>d</sub>) | ||
− | + | ===Navigation Mode=== | |
*In navigation mode, φ<sub>d</sub> ≠ 0 and δ<sub>d</sub> ≠ 0. | *In navigation mode, φ<sub>d</sub> ≠ 0 and δ<sub>d</sub> ≠ 0. | ||
*Thus, the balance controller tries to minimize the three terms in above. | *Thus, the balance controller tries to minimize the three terms in above. | ||
Line 24: | Line 24: | ||
In other words, the bicycle has achieved the desired lean angle. | In other words, the bicycle has achieved the desired lean angle. | ||
*Similarly, if δ − δ<sub>d</sub> = 0, the bicycle has achieved the desired steer angle. Still, the bicycle should not wobble: φ'= 0. | *Similarly, if δ − δ<sub>d</sub> = 0, the bicycle has achieved the desired steer angle. Still, the bicycle should not wobble: φ'= 0. | ||
− | + | ===Balance Only=== | |
*For balance only, φ<sub>d</sub>=0, δ<sub>d</sub>=0. The balance controller reduces to: | *For balance only, φ<sub>d</sub>=0, δ<sub>d</sub>=0. The balance controller reduces to: | ||
δ<sub>d</sub>' = k<sub>1</sub>φ + k<sub>2</sub>φ' + k<sub>3</sub>δ | δ<sub>d</sub>' = k<sub>1</sub>φ + k<sub>2</sub>φ' + k<sub>3</sub>δ | ||
Line 33: | Line 33: | ||
*If all three of these terms equal 0, the bike is balanced. | *If all three of these terms equal 0, the bike is balanced. | ||
− | + | ==Euler Integrator== |
Revision as of 00:45, 28 March 2019
Contents
Intro
- The control algorithms on our bicycle are separated into three cascaded controllers. The output of one controller is input to another controller.
- In order from high level to low level:
- Navigation controller, which tries to follow a desired path
- Balance controller, which tries to achieve a desired lean angle (φd) and desired steer angle (δd). For straight line balance (no navigation), this controller attempts to achieve φd = 0 and δd = 0. In this position, the bicycle is balanced (upright and steered straight ahead).
- Front motor controller, which controls front wheel angle (δ).
- Using cascaded controllers allows us to develop each controller semi-independently.
Front Motor Controller
- The front motor controller works to minimize the angle between the current steer angle (δ) and the commanded steer angle (δc).
- Currently (Spring 2018), the front motor controller is PD (Proportional-Derivative) controller. Specifically:
total_error = kp(δc − δ) + kd d/dt(δc − δ).
- total_error is converted into a direction (DIR) and a magnitude (motor_output).
Balance Controller
- The balance controller attempts to achieve a desired lean angle (φd) and steer angle (δd). In navigation mode, the navigation algorithm sets φd and δd.
- In addition to the desired state (φd, δd), the balance controller takes as input current lean angle (φ), lean angle rate (φ), and steer angle (δ). The balance controller outputs a steer angle rate (δ).
- Currently (Spring 2018), the balance controller is the linear controller:
δd' = kd(φ − φd) + k2φ'+ k3(δ − δd)
- In navigation mode, φd ≠ 0 and δd ≠ 0.
- Thus, the balance controller tries to minimize the three terms in above.
- If φ − φd = 0 the current lean angle (φ) equals the desired lean angle (φd).
In other words, the bicycle has achieved the desired lean angle.
- Similarly, if δ − δd = 0, the bicycle has achieved the desired steer angle. Still, the bicycle should not wobble: φ'= 0.
Balance Only
- For balance only, φd=0, δd=0. The balance controller reduces to:
δd' = k1φ + k2φ' + k3δ
- In balance only mode, the balance controller tries to minimize the sum of the three terms above.
- The first term includes lean angle (φ): if φ = 0, the bike should be upright.
- The second term includes lean angle rate (φ'): if φ'= 0, the bike should not wobble.
- The third term includes steer angle (δ): if δ = 0, the bike should be steered straight ahead.
- If all three of these terms equal 0, the bike is balanced.