ELECTRICAL design
Line Sensing
For the first prototype, the navigation system was designed entirely using tape sensing. The design relied on using OPB704 Reflective Object Sensors which consists of an IR LED and photo transistor. The LED emits infrared light which is reflected with varying intensities depending on the reflectance of the object the light is incident upon. A white object reflects most of the incident light while a dark object absorbs most of the incident light. The phototransistor converts the reflected light back into current and therefore provides a means to distinguish between the white laminate board space and black lines.
Although the line sensing circuit was easy to build, navigation with line sensors was quite slow and difficult to use for exiting the safe space, so the team decided to use distance sensing for navigation.
Although the line sensing circuit was easy to build, navigation with line sensors was quite slow and difficult to use for exiting the safe space, so the team decided to use distance sensing for navigation.
Distance Sensing
.Gwen the Robot relied solely on distance sensing for the final checkoff since our checkoff strategy depended on navigating very quickly from the safe space to the shooting location and back to the safe space to reload.
The distance from the wall or game board boundaries were read using two ultrasonic ranging modules (HC-SR04). Both sensors were powered from the 5V power rails while the trig (Trigger Pulse Input) and echo (Echo Pulse Output) pins were connected to digital pins of an Arduino Uno. To measure the distance from any object, the NewPing library is used to send a short pulse from an Arduino digital pin to the Trigger Pulse Input which triggers the emission of ultrasound waves. The ultrasound waves are reflected by the object and the time taken for the waves to return is converted to a distance. We used a timer to pulse and read a single ultrasonic sensor at a time so there would not be conflicting signals.
Since, the minimum measuring distance of the range sensors was observed as 3cm, the team mounted the sensors 3 centimeters inwards from the outer circular edge of Gwen the Robot. This helped ensure that the sensors never read values below the minimum capable distance
The distance from the wall or game board boundaries were read using two ultrasonic ranging modules (HC-SR04). Both sensors were powered from the 5V power rails while the trig (Trigger Pulse Input) and echo (Echo Pulse Output) pins were connected to digital pins of an Arduino Uno. To measure the distance from any object, the NewPing library is used to send a short pulse from an Arduino digital pin to the Trigger Pulse Input which triggers the emission of ultrasound waves. The ultrasound waves are reflected by the object and the time taken for the waves to return is converted to a distance. We used a timer to pulse and read a single ultrasonic sensor at a time so there would not be conflicting signals.
Since, the minimum measuring distance of the range sensors was observed as 3cm, the team mounted the sensors 3 centimeters inwards from the outer circular edge of Gwen the Robot. This helped ensure that the sensors never read values below the minimum capable distance
Drive System Control
To control the drive motors, we used the L298N motor driver which is rated for up to 35 V and 2 A per bridge, which is sufficient for our drive system. Motor speed is controlled by the Arduino via PWM signals to the two L298N Enable pins, while direction is controlled by setting the state of the four L298N Input pins. Notably, since this motor driver package allows access to the four individual input pins, we were able to use fast braking that effectively shorts the motor by setting the corresponding input pins for a motor to the same state while the enable was high. This offered distinct advantages in our driving and navigation.
Problems faced in drive system control
1.) Coasting stop
Using the L293 module, the input pins of the motor driver are hidden from the user, so the only way to stop the motors is to allow them to coast to a stop using friction and back emf. This led to Gwen's momentum causing variations in navigation precision, which could not be reliably compensated for in the code.
Resolution: Switching to the L298N gave us access to the four individual motor driver input pins at the cost of additional Arduino pins
Problems faced in drive system control
1.) Coasting stop
Using the L293 module, the input pins of the motor driver are hidden from the user, so the only way to stop the motors is to allow them to coast to a stop using friction and back emf. This led to Gwen's momentum causing variations in navigation precision, which could not be reliably compensated for in the code.
Resolution: Switching to the L298N gave us access to the four individual motor driver input pins at the cost of additional Arduino pins
Shooter Control
The flywheel mechanism was designed as an open-loop speed control system in which a PWM input voltage determined the output speed of the DC motor. The DC motor was controlled using DS3658 low side driver with an input supply voltage of 10V.
Problems faced in shooter system control
1.) Noise generated by flywheel motor operation
When the flywheel motor was running, we noticed that the rest of our circuits became very noisy and that the flywheel speed was not as consistent as it should be. We determined that the PWM setting of the flywheel led to large noise signals in the power supply lines.
Resolution: We attached large capacitors across the power lines and the flywheel motor, and purchased a second power supply and voltage regulator for the shooter.
2.) Imprecise flywheel speeds lead to inconsistent shots
This flywheel mechanism was inconsistent in launching the Alternative Facts because there was no feedback to ensure that the output speed from the DC motor was indeed the desired speed set by the user.
Resolution: Currently not implemented. In the future, a closed-loop feedback with a PI control can be used to ensure that the output speed (measured using an encoder) is equal to the desired speed
Problems faced in shooter system control
1.) Noise generated by flywheel motor operation
When the flywheel motor was running, we noticed that the rest of our circuits became very noisy and that the flywheel speed was not as consistent as it should be. We determined that the PWM setting of the flywheel led to large noise signals in the power supply lines.
Resolution: We attached large capacitors across the power lines and the flywheel motor, and purchased a second power supply and voltage regulator for the shooter.
2.) Imprecise flywheel speeds lead to inconsistent shots
This flywheel mechanism was inconsistent in launching the Alternative Facts because there was no feedback to ensure that the output speed from the DC motor was indeed the desired speed set by the user.
Resolution: Currently not implemented. In the future, a closed-loop feedback with a PI control can be used to ensure that the output speed (measured using an encoder) is equal to the desired speed
Stepper Control
The ball feeder mechanism consists of a stepper motor that feeds alternative facts into the flywheel by rotating a circular plate holding 12 balls. The stepper motor was controlled using a Polulu driver DRV8825. The stepper motor was initially controlled using the Pulse library functions which use Timer 2 but conflicted with the PWM signals for pins used to control the left and right motors. The stepper motor was then finally controlled by manually sending pulses to the step pin. The stepper motor was controlled in 1/32 step mode by pulling the MO,M1, and M2 pins high (5V) to enable.
Problems faced in stepper control
1.) Noise in stepper motor wires
Although resolving many of our other circuitry problems led to a better stepper behavior, the stepper was still jittery in its operation. We realized that bundling the long stepper wires and taping them under a platform was creating large amounts of noise.
Resolution: Chop the stepper wires to a shorter length.
Problems faced in stepper control
1.) Noise in stepper motor wires
Although resolving many of our other circuitry problems led to a better stepper behavior, the stepper was still jittery in its operation. We realized that bundling the long stepper wires and taping them under a platform was creating large amounts of noise.
Resolution: Chop the stepper wires to a shorter length.
Servo Circuit
The servo motor is powered by the 5V power supply and controlled via Arduino digital pin using the Servo library functions. The circuitry is trivial and can be found in the main circuit diagram below.
Problems faced in servo control
1.) Servo wires too close to power lines
During operation, the servo was having a difficult time holding its position and had a lot of jitter. Further, the servo was failing to reach the same nominal position consistently. We realized that the noise from the power lines when the flywheel was running lay very close to the servo wires on the underside of the platform.
Resolution: Separate the power and servo lines by running them on opposite sides of the robot.
Problems faced in servo control
1.) Servo wires too close to power lines
During operation, the servo was having a difficult time holding its position and had a lot of jitter. Further, the servo was failing to reach the same nominal position consistently. We realized that the noise from the power lines when the flywheel was running lay very close to the servo wires on the underside of the platform.
Resolution: Separate the power and servo lines by running them on opposite sides of the robot.
Power Delivery
The team designed two main power rails to supply power to the circuit elements as all circuit components were powered by either a 5V power supply or 10V power supply. The two 7.2 V batteries were connected in series to supply 14.4V. These batteries were connected in series with a 1A fuse to prevent excessive current from damaging circuit elements. The 14.4V power line was regulated using a digital display voltage regulator to 10 V for the 10 volts main power rail and the 10V was regulated to 5V for the 5 volts main power rail. The digital display voltage regulator helped to indicate the battery level and the amount of current drawn. An emergency shutoff switch was also connected between the 10V regulator and 10V power rail to turn allow a manual turn off Gwen the Robot. An additional 10 V supply was added later for the shooter flywheel to use by itself.
Detailed Circuit Setup
Arduino
Pins |
|
Digital Pins |
Analog Pins |
0 |
A0 --->
Input Pin 4 (Right Motor) |
1 |
A1 --->
Stepper Direction Pin |
2 --->
Input Pin 1 (Left Motor) |
A2 |
3 --->
Enable Pin 1 (Left Motor) |
A3 --->
Debug Led |
4 --->
Echo Pin 1 (Right Ultrasensor) |
A4 |
5 --->
Stepper Input Pin |
A5 |
6 --->
Shooter Motor Input |
|
7 --->
Trigger Pin 1(Right Ultrasensor) |
|
8 --->
Echo Pin 0 (Left Ultrasensor) |
|
9 --->
Servo Input |
|
10
--->Input Pin 2 (Left Motor) |
|
11---> Enable
Pin 2 (Right Motor) |
|
12 --->
Input Pin 3 (Right Motor) |
|
13 --->
Trigger Pin 0 (Left Ultrasensor) |