5. (20 pts) An automated drill press requires the DC motor driving the bit to rotate as prescribed by the velocity profi
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
5. (20 pts) An automated drill press requires the DC motor driving the bit to rotate as prescribed by the velocity profi
5. (20 pts) An automated drill press requires the DC motor driving the bit to rotate as prescribed by the velocity profile specified in the below figure. The load torque generated from the interaction of the bit with the wood is constant and equal to Load Torque in the graph. • The motor is powered by a 14 volt battery. You can assume that you have access to the function my_motor0(int duty), which accepts an integer representing the duty cycle as a 10 bit digital number. Velocity[rpms] 1000 0 Angular velocity [rpm] 5 1000 Load Torque V = 1 volt 10 Torque V = 3 volts V=9 volts 15 Time[s] Write the necessary code to achieve this velocity profile within the provided real time interrupt code. You must comment your code.
// You don't need to implement the PWM function or the setup. unsigned int ticks = 0; ISR(TIMER1_COMPA_vect) /* timer compare interrupt service routine*/{ ticks++; // ADD YOUR CODE HERE (recall that you can call the function my_motor0() with the required duty) }