This is the main file for Lab 3, it contains a program that runs two motor tasks which includes closed loop control for each motor.
More...
|
def | main.task_motor1 (duty_cycle=0) |
| Task which runs the motor, encoder, and controller drivers to control the duty cycle for motor 1. More...
|
|
def | main.task_motor2 (duty_cycle=0) |
| Task which runs the motor, encoder, and controller drivers to control the duty cycle for motor 2. More...
|
|
def | main.input_task () |
| Task which runs the non-blocking input object quickly to ensure that keypresses are handled not long after they've occurred.
|
|
def | main.task_user (state=S0_CALIB) |
| Task which includes multiple states that guide the user through the use of the pen plotter system. More...
|
|
|
| main.S0_CALIB = const(0) |
| State 0 of the user interface task.
|
|
| main.S1_HELP = const(1) |
| State 1 of the user interface task.
|
|
| main.S2_WAIT_FOR_CHAR = const(2) |
| State 2 of the user interface task.
|
|
| main.S3_READ = const(3) |
| State 3 of the user interface task.
|
|
| main.S4_PLOT = const(4) |
| State 4 of the user interface task.
|
|
| main.nb_in = NB_Input (USB_VCP(), echo=True) |
| Variable representing the input to the serial port.
|
|
| main.encoder_drv1 = encoder_agena_chiu.EncoderDriver(pyb.Pin.cpu.B6, pyb.Pin.cpu.B7, 4) |
| A variable that creates a encoder driver for encoder 1.
|
|
| main.encoder_drv2 = encoder_agena_chiu.EncoderDriver(pyb.Pin.cpu.C6, pyb.Pin.cpu.C7, 8) |
| A variable that creates a encoder driver for encoder 2.
|
|
| main.motor_drv1 = motor_agena_chiu.MotorDriver(pyb.Pin.cpu.A10, pyb.Pin.cpu.B4, pyb.Pin.cpu.B5, 3) |
| A variable that creates a motor driver for motor 1.
|
|
| main.motor_drv2 = motor_agena_chiu.MotorDriver(pyb.Pin.cpu.C1, pyb.Pin.cpu.A0, pyb.Pin.cpu.A1, 5) |
| A variable that creates a motor driver for motor 2.
|
|
| main.controller_1 = controller_agena_chiu.ControllerDriver(0, 0) |
| A variable that creates a controller driver for motor 1.
|
|
| main.controller_2 = controller_agena_chiu.ControllerDriver(0, 0) |
| A variable that creates a controller driver for motor 2.
|
|
| main.hpgl = hpgl_agena_chiu.hpglDriver() |
| A variable that creates a hpgl driver to read the hpgl file.
|
|
| main.move_flag1 = task_share.Share('B', name = 'Movement Flag 1') |
| A shared variable that indicates that motor 1 arrived at the desired position.
|
|
| main.move_flag2 = task_share.Share('B', name = 'Movement Flag 2') |
| A shared variable that indicates that motor 2 arrived at the desired position.
|
|
| main.sol = pyb.Pin(pyb.Pin.cpu.B3, pyb.Pin.OUT_PP) |
|
| main.task1 |
|
| main.task2 |
|
| main.in_task |
|
| main.task_user |
|
This is the main file for Lab 3, it contains a program that runs two motor tasks which includes closed loop control for each motor.
The code was adapted from Dr. Ridgely's basic task example.
- Author
- Corey Agena
-
Luisa Chiu
- Date
- 2-9-2022