Luisa Chiu Portfolio
LabFF_task_motor.Task_Motor Class Reference

Motor task that creates variables for motor driver functions and parameters. More...

Public Member Functions

def __init__ (self, period_motor, motor_obj, motor_drv, L, balance_flag, state_vect_x, state_vect_y, disable_flag, closedloop)
 Constructs a motor task. More...
 
def run (self)
 Runs one iteration of the FSM.
 
def transition_to (self, new_state)
 Transitions the FSM to a new state. More...
 

Public Attributes

 motor_obj
 The motor object that calls motors 1 or 2. More...
 
 motor_drv
 The motor driver object that calls DRV8847. More...
 
 L
 Variable used to define actuation level. More...
 
 balance_flag
 A boolean flag used to start balancing the platform and/or ball. More...
 
 disable_flag
 A boolean flag used to disable motors. More...
 
 state_vect_x
 A shared list used to define state vector x. More...
 
 state_vect_y
 A shared list used to define state vector y. More...
 
 period_motor
 The frequency of the task. More...
 
 state
 Initializes starting state to be state 2. More...
 
 runs
 Sets the number of runs to 0. More...
 
 closedloop
 The controller object that refers to closedloop.py. More...
 

Detailed Description

Motor task that creates variables for motor driver functions and parameters.

Implements a finite state machine for the motor driver

Constructor & Destructor Documentation

◆ __init__()

def LabFF_task_motor.Task_Motor.__init__ (   self,
  period_motor,
  motor_obj,
  motor_drv,
  L,
  balance_flag,
  state_vect_x,
  state_vect_y,
  disable_flag,
  closedloop 
)

Constructs a motor task.

The motor task is implemented as a finite state machine.

Parameters
periodThe period, in microseconds, between runs of the task
motor_objThe motor object that calls motors 1 or 2
motor_drvThe motor driver object that calls DRV8847
enable_flagA boolean flag used to enable a corresponding motor
step_flagA boolean flag used to start step response
LVariable used to define actuation level

Member Function Documentation

◆ transition_to()

def LabFF_task_motor.Task_Motor.transition_to (   self,
  new_state 
)

Transitions the FSM to a new state.

A function that transitions the FSM to a new state

Parameters
new_stateThe state to transition to

Member Data Documentation

◆ balance_flag

LabFF_task_motor.Task_Motor.balance_flag

A boolean flag used to start balancing the platform and/or ball.

Works with the motor task and user interface to implement closed-loop control that balances the platform and ball

◆ closedloop

LabFF_task_motor.Task_Motor.closedloop

The controller object that refers to closedloop.py.

Creates the controller object used to perform closed loop speed control of the motors

◆ disable_flag

LabFF_task_motor.Task_Motor.disable_flag

A boolean flag used to disable motors.

Works with the motor task and user interface to halt motor movement

◆ L

LabFF_task_motor.Task_Motor.L

Variable used to define actuation level.

This value is calculated using gain, measured angular velocity, and reference angular velocity

◆ motor_drv

LabFF_task_motor.Task_Motor.motor_drv

The motor driver object that calls DRV8847.

This motor driver was defined in the main.py file

◆ motor_obj

LabFF_task_motor.Task_Motor.motor_obj

The motor object that calls motors 1 or 2.

Motors 1 or 2 were defined in the main.py file

◆ period_motor

LabFF_task_motor.Task_Motor.period_motor

The frequency of the task.

Defines variable that specifies timer frequency

◆ runs

LabFF_task_motor.Task_Motor.runs

Sets the number of runs to 0.

Defines a variable to keep track of runs

◆ state

LabFF_task_motor.Task_Motor.state

Initializes starting state to be state 2.

Motors begin in the stop state

◆ state_vect_x

LabFF_task_motor.Task_Motor.state_vect_x

A shared list used to define state vector x.

Contains variables for x position, theta y, x velocity, and angular velocity (theta y dot)

◆ state_vect_y

LabFF_task_motor.Task_Motor.state_vect_y

A shared list used to define state vector y.

Contains variables for y position, theta x, y velocity, and angular velocity (theta x dot)


The documentation for this class was generated from the following file: