evive has two inbuilt motor control units with which you can control motors with a current limit of 1A each. It uses an SN754410NE Quad H-Bridge IC to control two DC Motors.
If you look at the SN754410NE chip, you will notice a u-shaped notch at one end. This helps you identify pin 1.
Pin 4, 5, 12, 13 are connected to ground.
Pin 16 is connected to 5V and pin 8 is connected to power voltage which can vary from 4.5V to 30V.
1A and 2A are connected to Arduino Mega Digital pin 28 and 29 respectively and 3A and 4A to digital pin 30 and 31. Depending on the states of the pins, the motor state is determined:
Pin 30Pin 31State
LOWLOWMotor is free
LOWHIGHMotor rotates in one direction
HIGHLOWMotor rotates in another direction
Motor is stalled
PWM:The outputs are provided from 1Y and 2Y (for motor 1) and 3Y and 4Y (for motor 2). This output is amplified voltage which is determined by enable pin (1 for motor 1 and 9 for motor 2). Hence if the VCC is 12V then to generate 6V output, one has to provide 2.5 V to enable pin. This is done using PWM (Pulse Width Modulation).
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off.
The duration of “on time” is called the pulse width. To get varying analog values, you change or modulate, that pulse width. If you repeat this on-off pattern fast enough, the result is as if the signal is a steady voltage between 0 and 5v controlling the speed of the motor.
Generally, Arduino’s PWM frequency is about 500Hz. In Arduino IDE, we use PWM concept through analogWrite() function. We give a value ranging on a scale of 0 – 255, such that analogWrite(255) requests a 100% duty cycle (always on), and analogWrite(127) is a 50% duty cycle (on half the time) for example.
In evive, the PWM pin for motor 1 is connected to digital pin 44 and for motor 2 it is connected to digital pin 45.
The power voltage can be provided to the motor drive IC through variable voltage or source voltage, using a jumper. So if you want to change the power voltage, then you connect to the VVR side (left one) else VVS (right).
You can control or test your motors through evive menu based system. You have to just navigate into control, select motor and then select which motor output you want to use (Motor 1, Motor 2 or both Motor 1 and Motor 2).
Using inbuilt potentiometers, you can control the PWM of the motors and use slide switches you can control the state of the motor (CW, CCW or free state).
If you don’t know how to use a library then you can visit here to learn more.
Using these library functions, you can control your motors easily. Here is a sample code to illustrate how to use the motor library: