A robotic arm is controlled by several stepper motors.
Stepper motor (or step motor)is a brushless DC electric motor that divides a full rotation (360degree) into a number of equal steps (10 degree/step in this case).The motor's position can then be commanded to move and hold at oneof these steps without any feedback sensor (an open-loopcontroller). This motor usually has 4 wires. To move a motor, thefollowing bit patterns should be applied to these 4 wires.
Clockwise rotation: 1100à 0110à 0011à 1001 and these 4 patternsrepeated again such as à 1100à 0110....
Counter clockwise rotation: 1100à 1001à 0011à 0110à and these 4patterns repeated again such as 1100à 1001….
Each input pattern (for example 1100) moves motor 10 degree.Assume the first four bits (least Significant bits) of register R2are connected to one these motors.
Write a program in LC-3 assembly language, to do thefollowing:
If you type “1†motor moves 120 degree clockwise (sending 12patterns) and then 90 degree counter clockwise (sending 9patterns). If you type “2†motor moves 50 degree counter clockwise(sending 5 patterns).
Depends on what number you enter; the console should display allthe related patterns sending to the motor.