The aim of this project was to create a low cost robotic system that could be used as an example of control and electronic engineering in an education environment
After choosing an Arduino Uno microcontroller. The 1st stage was to run some of the basic test programs included in the Arduino software. This confirmed the board was operational and also allowed the measurement of certain outputs that I needed to run the external components.
The most important output from the board is the pulse width modulation. This feature as shown below can be used to create an analoug output from the digital board. This signal can be used to control the speed of the drive motors explained later.
These graphs were created using a basic test program which set the pwm output to range from 0 to 100% in steps of 25%. this shows how the signal has a specific time period which is then broken down into an on time and off time. the percentage described represents the period the signal is on or in this case at 5 volts.
The code for this test program and all the other programming I have done on this board will be available soon.
The motors used in this project were EMG30 motors. These motors are common DC type motors designed to run at 12 volts. The PWM signal from the microcontroller board can be used to drive these motors as the motor speed is proportional to the voltage supplied.
The main problem is the controller cannot supply high enough currents to the motor directly and needs an interface unit. To achieve this a driver board was created using simply transistors as switches to control to power to the motor. the PWM signal controls the switch so that the longer the signal is at high the longer the switch is open and the motor receives current. Due to the high switching rate and the inductance properties of the motor it appears to the motor as a constant voltage rather than a series of pulses. The addition of some logic circuitry to control the transistors gives the circuit below.
The motors include 2 Hal effect encoders built in to allow position and direction measurement. As can be seen in the picture there is a circular magnet attached to the motor shaft, this rotates past the two sensors. When the output of the sensor is connected with a pull-up resistor to the supply the output below can be captured
this appears as a digital signal with a large dc offset and a small amplitude. Although digital it is not directly connectable to the digital inputs on the controller and needs to be converted into a true digital signal ranging from 0V to 5V. this is achieved by the addition of a comparator circuit
As can be seen this circuit compares the encoder signal to a reference voltage signal. From investigation of the encoder signal voltages the reference voltage is set to half way between the max and the minimum voltages. So when the encoder signal is above the reference voltage the comparator output is high at 5V and when the encoder signal drops below the reference level the output goes to 0V. Giving a suitable input signal for the controller board
The electronics and the motors were built onto a simple chassis unit consisting of:
The next step is the software design for this project next >>
