ece4160

Lab 5: Motors and Open Loop Control

Prelab

I connected the motor drivers, Artemis, and battery as detailed in the diagram below.

Picture4

The motors and the Artemis are powered by separate batteries, with the motors’ battery having a higher capacity (850mAh) than the Artemis’ battery (650mAh), because the motors require more power than the Artemis does.

Lab Tasks

I connected the power supply and oscilloscope to one motor driver, as seen below. I chose to set the power supply to 3.7V because that is the voltage the battery is rated at.

Picture1

I then ran the following code on the Artemis send the motor driver PWM signals.

The oscilloscope waveform confirmed that I could regulate the power on the motor driver output.

Picture2

After replacing the control PCB with my motor driver, I was able to run the motor in both directions, as seen in the following video, using the code below.

Wheels

I repeated this process for the second motor driver and got the same results.

Next, I powered both motor drivers using the 850mAh battery and was able to control both wheels as expected.

Wheels

This was achieved using the following code.

The picture below shows the car chassis with all of the components installed. I later secured the wires down further.

Picture3

By testing out increasingly lower PWM values, I found that the lower limit in PWM value for which the robot moved forward and made turns on the ground was 40. While trying to make the car drive in a straight line, I found that I needed to implement a calibration factor of x1.25 to the PWM value of the left motor.

In the video below, the car moves in a fairly straight line, following the line in the tiles, for about 7 feet.

Straight

This was achieved using the following code.

Finally, I was able to demonstrate open loop control, as seen below, using the following code.

Open Loop