Robotics is the next disruptor which is obvious, electronics, data science and hardware knowledge is very important to make a mark in this field. Robots ranging from small printing machines to huge arm movements are very precise which has been possible by introducing a new generation of motors known as STEP Motor or STEPPING Motor and popularly known as STEPPER Motor.
Unipolar drivers, always energize the phases in the same way. One lead, the “common” lead, will always be negative. The other lead will always be positive. Unipolar drivers can be implemented with simple transistor circuitry. The disadvantage is that there is less available torque because only half of the coils can be energized at a time.
Bipolar drivers use H-bridge circuitry to actually reverse the current flow through the phases. By energizing the phases with alternating the polarity, all the coils can be put to work turning the motor.
The python script for actuating this Stepper Motor is written with the help of GPIO.BOARD. The code is given in the GitHub page of robosense.in and you can get the raw format there.
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) pins = [7,11,13,15] for pin in pins: GPIO.setup(pin, GPIO.OUT) GPIO.output(pin, 0) halfstep_seq = [ [1,0,0,0], [1,1,0,0], [0,1,0,0], [0,1,1,0], [0,0,1,0], [0,0,1,1], [0,0,0,1], [1,0,0,1] ] for i in range(512): for halfstep in range(8): for pin in range(4): GPIO.output(pins[pin], halfstep_seq[halfstep][pin]) time.sleep(0.001) GPIO.cleanup()