Question: using a raspberry pi and server motor. python 3.7 6.6 Task 1 1. Open 'stepper.py', modify halfstep seq in order to create the proper coil



6.6 Task 1 1. Open 'stepper.py', modify halfstep seq in order to create the proper coil energizing sequence for the stepper motor to fully rotate once in Half-step mode. (Hint: you will need to use all of the 8 lines given in stepper.py). Refer to the background section of the stepper motor if you are unsure how to do this. 2. Once properly modified the motor should rotate a one full revolution. If the motor is simply vibrating or turning erratically, the firing se- quence was improperly created. 6.7 Task 2 In our first lecture of Module 2, you saw a project video video link on culearn) where an automated cocktail maker, the glass moved to different taps one by one to pour the drinks and after reaching the final tap, it came back to its initial position. Imagine that your stepper motor is connected to such a machine and one full revolution is required to move the glass to the final tap. To operate it properly, you have been given the following requirements: 1. The stepper motor must turn so that it moves the glass to two equally spaced taps 2. The glass must stop at each tap for 5 seconds, then move onto the next tap 3. After reaching the final tap, it should come back to its initial position by rotating in the opposite direction 4. Once back at its initial position the LCD should display the message Finished. Enjoy" It is recommended that you start with the code that you completed in Task 1 and modify it to accomplish Task 2. import RPi GPIO as GPIO import time #Setup the Rasppi to use the numbering on the board GPIO.setmode (GPIO.BCM) controlPins [21, 20, 12, 16] Setup the outputs Pins to control the stepper GPIO.setup(controlPins[0), GPIO.OUT) GPIO.setup(controlPins[1], GPIO.OUT) GPIO.setup(controlPins[2], GPIO.OUT) GPIO.setup(controlPins(3), GPIO.OUT) # The following matrix should contain the coil energizing sequence for coils A. B. A. and B halfstepSequence = ( [0,0,0,0], [0,0,0,0) [0,0,0,0). [0,0,0,0). [0,0,0,0) [0,0,0,0], [0,0,0,0) [0,0,0,0) 1 #We will now go one full rotation notice you can see the bins turn ON through the LEDS 2.7.3 /usr/bin/python3) Using a raspberry pi and server motor. It is in python 3.7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
