Extracting Transfer Function of DC Motor
Hardware Setup
The motor has 6 wires, from the data sheet it can be found that 2 wires are for motor power and ground, 2 for the encoder sensor power and ground and 2 wires are the output from the encoder. Motor has a built in quadrature encoder, and gives out pulses as signal.
The integrated quadrature encoder that provides a resolution of 16 counts per revolution of the motor shaft, which corresponds to 1440 counts per revolution of the gearbox’s output shaft.
This means that for every 1440 pulses we have one revolution. To read the sensor we need a micro controller, and the micro controller also allows us to control the motor. I used an Arduino Mega. Uno's will work too without any problems, I had one lying around so decided to use it.
We also need a motor controller because obviously you don't power up the motor directly from Arduino !
List of Materials
Arduino
DC Geared Motor w/Encoder
Motor Driver L298N
12 Volt DC Power Supply
The diagram above does not refer to the actual setup. But it shows that external power is supplied to the motor. Also the power and ground wire of motor is connected to the motor driver while others are connected to the micro controller
For our setup
Motor
Hall Sensor A Vout = 2
Hall Sensor B Vout = 3
Motor Driver
Motor dir1PinA = 8
Motor dir2PinA = 9
Motor speedPinA = 10 // Needs to be a PWM pin to be able to control motor speed
Number refers to the pin number on Arduino
Comments
Post a Comment