ME 305 Website by Cole Sheedy
userInterfaceFrontW3.py File Reference

User interface script for data collection and reception from Nucleo. More...

Functions

def userInterfaceFrontW3.gCallback (key)
 Callback function for the 'g' key release. More...
 
def userInterfaceFrontW3.sCallback (key)
 Callback function for the 's' key press. More...
 
def userInterfaceFrontW3.pCallback (key)
 Callback function for the 'p' key press. More...
 
def userInterfaceFrontW3.dCallback (key)
 Callback function for the 'd' key press. More...
 
def userInterfaceFrontW3.zCallback (key)
 Callback function for the 'z' key press. More...
 
def userInterfaceFrontW3.aCallback (key)
 Callback function for the 'a' key press. More...
 
def userInterfaceFrontW3.kCallback (key)
 Callback function for the 'k' key press. More...
 
def userInterfaceFrontW3.fCallback (key)
 Callback function for the 'f' key press. More...
 
def userInterfaceFrontW3.oCallback (key)
 Callback function for the 'o' key press. More...
 

Variables

 userInterfaceFrontW3.last_key = None
 Keeping track of last key actuated.
 
int userInterfaceFrontW3.n = 0
 Counting variable.
 
list userInterfaceFrontW3.dataSet = []
 Housing for data before it is cleaned.
 
 userInterfaceFrontW3.actualTime = array('f', [])
 Actual time data that is read in through serial.
 
 userInterfaceFrontW3.position = array('f', [])
 Position values that are read in through serial.
 
 userInterfaceFrontW3.omega = array('f', [])
 Omega values that are read in through serial.
 
 userInterfaceFrontW3.Kp = array('f', [])
 Kp values that are read in through serial.
 
 userInterfaceFrontW3.desOmega = array('f', [])
 Desired Omega values that are read in through serial.
 
 userInterfaceFrontW3.ser = serial.Serial(port='COM9',baudrate=115273,timeout=.25)
 Serial object to communicate through VCP port.
 
 userInterfaceFrontW3.gCallback
 
 userInterfaceFrontW3.sCallback
 
 userInterfaceFrontW3.pCallback
 
 userInterfaceFrontW3.dCallback
 
 userInterfaceFrontW3.zCallback
 
 userInterfaceFrontW3.aCallback
 
 userInterfaceFrontW3.kCallback
 
 userInterfaceFrontW3.fCallback
 
 userInterfaceFrontW3.oCallback
 
 userInterfaceFrontW3.value = ser.readline().decode()
 Individual line read from Nucleo which would contain a variety of entries.
 
 userInterfaceFrontW3.POSITIONVALUE = value
 Position value recieved from Nucleo.
 
 userInterfaceFrontW3.DELTAVALUE = value
 Delta value recieved from Nucleo.
 
 userInterfaceFrontW3.ZEROTEXT = value
 Message saying the encoder has been zeroed.
 
 userInterfaceFrontW3.KPVALUE = value
 Kp value recieved from Nucleo.
 
 userInterfaceFrontW3.TIMEDELTA = value
 Time delta value recieved from Nucleo.
 
 userInterfaceFrontW3.OMEGA = value
 Omega value recieved from Nucleo.
 
 userInterfaceFrontW3.newline
 Assists in writing new line to .csv.
 
 userInterfaceFrontW3.writer = csv.writer(csvfile)
 CSV writer object that can use .writerow to write into my CSV file.
 

Detailed Description

Function Documentation

◆ aCallback()

def userInterfaceFrontW3.aCallback (   key)

Callback function for the 'a' key press.

If user presses the 'a' key down, the keyboard function will be enabled. We will use this callback function to send the letter 'a' and then send a Kp value for tuning. This can only be done before motor starts. If done after the default Kp will be 0.5

◆ dCallback()

def userInterfaceFrontW3.dCallback (   key)

Callback function for the 'd' key press.

If user presses the 'd' key down, the keyboard function will be enabled. We will use this callback function to send the letter 'd' to the Nucleo to print the corrected delta value of the encoder.

◆ fCallback()

def userInterfaceFrontW3.fCallback (   key)

Callback function for the 'f' key press.

If user presses the 'f' key down, the keyboard function will be enabled. We will use this callback function to send the letter 'f' to the Nucleo to retrieve the most recent time delta.

◆ gCallback()

def userInterfaceFrontW3.gCallback (   key)

Callback function for the 'g' key release.

If user presses the 'g' key down, the keyboard function will be enabled. We will use this callback function to send the letter 'g' to the Nucleo to start data collection when the user decides to.

◆ kCallback()

def userInterfaceFrontW3.kCallback (   key)

Callback function for the 'k' key press.

If user presses the 'k' key down, the keyboard function will be enabled. We will use this callback function to send the letter 'k' to the Nucleo to retrieve the current Kp value.

◆ oCallback()

def userInterfaceFrontW3.oCallback (   key)

Callback function for the 'o' key press.

If user presses the 'o' key down, the keyboard function will be enabled. We will use this callback function to send the letter 'o' to the Nucleo to retrieve the most recent omega value.

◆ pCallback()

def userInterfaceFrontW3.pCallback (   key)

Callback function for the 'p' key press.

If user presses the 'p' key down, the keyboard function will be enabled. We will use this callback function to send the letter '' to the Nucleo to print the position of the encoder.

◆ sCallback()

def userInterfaceFrontW3.sCallback (   key)

Callback function for the 's' key press.

If user presses the 's' key down, the keyboard function will be enabled. We will use this callback function to send the letter 's' to the Nucleo to start data collection when the user decides to.

◆ zCallback()

def userInterfaceFrontW3.zCallback (   key)

Callback function for the 'z' key press.

If user presses the 'z' key down, the keyboard function will be enabled. We will use this callback function to send the letter 'z' to the Nucleo to zero the position of the encoder.