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. | |
User interface script for data collection and reception from Nucleo.
This is the main script the user will use while simultaneously running encoder and UI backend task files on the Nucleo. This script will read the data that the Nucleo sends us, clean it up, plot time vs. value, then write all the data to empty dataCollection.csv or user can easily change to write to their desired file.
Source code files and related ones:
mainW3.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab5.2/mainW3.py
encoderDriverW3.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab5.2/encoderDriverW3.py
motorDriverW3.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab5.2/motorDriverW3.py
controllerDriverW3.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab5.2/controllerDriverW3.py
controllerTaskW3.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab5.2/controllerTaskW3.py
UITaskW3.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab5.2/UITaskW3.py
userInterfaceFrontW3.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab5.2/userInterfaceFrontW3.py
shareW3.py https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/LabWork/Lab5.2/shareW3.py
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
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.
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.
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.
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.
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.
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.
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.
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.