FAQ Section: updated 1/21 by djyang@ucsd.edu Part 1: a-c) keep it brief d) Make sure your motor is not plugged into the motor driver. Measure with multi-meter e) Measure this with a multi-meter f) oops, you were supposed to take a photo of this. Luckily you will do the same thing in part 2.3. Don't forget to sand annotate the photo. g) What does slow down the motor mean? Good question, there are two interpretations: Slow the motor by applying a load. Slow the motor by reduceing the PWM going to the motorh) The disassembled rotor is located in the corner of the room next to the arbor press and scale. General Advice and Issues:
How to get Arduino to Matlab: There are two ways: .CSV (comma separated variable) and direct Copy and Paste. The latter is faster but way more janky: 1) change your print statements to add a semicolon (;) after every line:
2) Copy and Paste terminal window into matlab 3) Add a "A = [" infront of the data 4) Add a "];" at the end of the data From the Homework: Translation: for part 2.3 ONLY. Turn your motor on from rest and output to the terminal time (ms), position (counts), and encoder frequency. Provide the following plots for the first 500ms of motor startup:
Create these plots for both forwards and backwards rotation, and take a photo of the o-scope at steady state for each experiment. Now here is where things get sketchy: In lecture the professors asked you to use a backwards difference low pass filtered velocity estimate. The problem is, the loop time is just too damn fast, leading to oversampling (wikipedia). So the velocity data has a ton of discretization noise. Instead, I suggest converting the encoder frequency to angular velocity (see general advice #3), and plotting and filtering that frequency instead. To summarize, the deliverables of Part II of the assignment actually: 2.1.b) Give the max encoder speed your code can read, and a short description of the experiment and why 2.2.b.b) (lets just call this 2.2.b) Do either of the suggested methods 2.3) Just do the parts under "Translation". You should have 4 plots total, and two photos of the o-scope. Part 2.1: encoder counting for noobs a) No need to modify any code. Code 2.1 seems does this for you already. Plus, 2.1a is not even really asking a question, so how can you get it wrong? b) The purpose of this question is to show that a certain speeds, the arduino will start skipping counts and can no longer keep up with the encoder. Part 2.2: encoder counting for middle school students a) What is an interrupt? Wikipedia: link 2.2.b.a) This asks you to redo 2.1.b, except with the new interrupt code. You should find that it does not skip counts anymore 2.2.b.b) Ok, something was lost in translation here. How can you use the o-scope to measure the frequency of the program?
Part 2.3: encoder counting for pre teens a) Again, this code is provided. There is a random typo, change the println(count) to a regular Serial.print(); b) Why does the encoder frequency 4x more than the o-scope?
c) Additional stuff to turn in:
Part 3: Update Hardware Sorry we dropped the ball on this one. |
Assignments > Pre Lab 3 Encoder >