Mechatronics
Documentation for ME 405 labs
Lab0x03

Lab 0x03: Pushing the Right Buttons

In this lab we characterize the rising edge response of the user button on the Nucleo. The user interfaces with the Nucleo from a frontend terminal which prompts the user to press 'G' to start data collection. The user must then press and release the button and the analog response is recorded and sent back to the frontend. Note that a jumper must be placed between pin C13 and A0 as pin C13 does not have an Analog-to-Digital converter. The response is then analyzed and plotted by the frontend, the time constant reported, and data stored in a .CSV file.

Although I was initially planning on using an interrupt-based method for signalling when the Nucleo should begin and end data collection, this proved to be far too slow and the data had a poor and unpredictable resolution. Now I am using a 'bucket collection' technique where the ADC is sampled into a bucket, checked for a response, and resampled until a response if found.

Note that this program makes use of an environment variable 'ST_LINK' to determine what port to perform serial communication on.

Below is one of the highest-fidelity runs of data collected. On average the time constant was around 0.5ms. This is slightly larger than the 0.48ms that would be predicted by RC analysis, however it is within 2% which is comparable to the error in resistor and capacitor ratings. Additionally there is a consistently delayed response at the front of each rising edge, indicating that there are additional poles in the system and it is not simply a PT1 response, as assumed by the RC simplification.

The data file for this run can be accessed in the data folder in the source code.

Author
Tyler Olson
Date
May 6, 2021