PRACTICE PROBLEMS: Mechatronics Exam – programming Portion
Exam- Programming Portion 2 hr. time limit. Choose one of the following problems and create a mechatronic
system using your lab kit (prototype hardware setup and code). Be ready to demonstrate your product at the end
of the exam.
PLEASE submit this page with a circle on your programming rank and a circle on the problem you are
choosing, also submit a photo of your project and your program listing as an assignment on ilearn (ideally
in 1 submission).
Rank your programming / MCU skill as:
Skill Level
Beginner (no prior C programming course)
Factor
105
Your possible grade is factor * value.
Graduate Credit, please add start/stop switch to each program
Intermediate
102.5
Advanced
100
Easier option: (Joystick LCD, 2 LEDs)
Use one axis of the joystick (up down) to display a range of values on the LCD screen (format as- y
axis: #). Have the values start at -100 (all the way down) and increase to positive 100 (all the way up).
When the joystick reading is greater than + 50, turn on a green LED, when it is less than -50, turn on a
red LED.
mid-level option (Joystick, RC servo, stepper, L293, LCD)
Use the joystick as an input and RC servo as x axis output, stepper motor as y axis output. Have the
center position of the joystick correspond to the center position of the RC servo and stepper motor. As
you move the joystick x axis, have the RC servo move to a position that is proportional to the joystick
position. (if you move and hold the joystick partway along the +x, the RC servo should move and hold a
position partway between 0 and 90 degrees, proportional to the joystick motion.) As you move the
joystick y axis, have the stepper motor move to a position that is proportional to the joystick y position.
Attach tape as a flag to each of the motors to show their rotation. Display the current x and y position on
the LCD as the program is running.
(potentiometer, DC motor, L293)
Use a potentiometer as an input and PM DC motor as an output. Have the motor turn off at a middle
position, rotate CW at increasing speeds when turning pot CW and similarly rotate CCW at increasing
speeds when turning the pot CCW. Speed should be proportional to the amount of rotation on the pot.
(Stepper motor, L293)
Using a stepper motor with small string on the shaft (or other arrangement), perform a point to point
move using LSPB. Have the motor start at one position at rest, move to a second position and come to a
stop. Have constant acceleration portions last for 20% of the motion. Use the RTI capability for full
credit.
1