RC Robot Project
Assembling the Kit
Notice the red & black wires
Left Side Back = Red on top
Left Side Front = Black on top
Right Side Back = Black on top
Right Side Front = Red on top
2
Something like this ...
3
Front
Back
The Raspberry Pi
4
The L298N H-bridge (motor controller)
5
Left
Right
Connect the Raspberry Pi to the L298N
6
Use the wires like this
Ground the Raspberry Pi to the L298N
7
Use the wires like this
Something like this ...
8
Mount the battery packs
9
A look inside
10
Python Tutorial
11
What’s next?
12
Gamepad Code (on your laptop)
13
Gamepad Code
14
Gamepad Code
15
Outputting to the NetworkTable
16
Outputting to the NetworkTable
17
Outputting to the NetworkTable
18
Outputting to the NetworkTable
19
Outputting to the NetworkTable
Here, the axis 1 is the left joystick up and down, while the axis 3 is the right joystick up and down.
20
Outputting to the NetworkTable
Variable “i” should be the button number while variable “button” will always be 1 when pressed.
21
Networktable in OutlineViewer
22
Motor Controller (L298N) code
23
Setup the Raspberry Pi
24
Motor Controller (L298N) code
25
Try Different Drive Mode
26
Add an Encoder
27
Correcting Bad Pulses
28
https://androminarobot.blogspot.com/2016/07/en-este-tutorial-mostramos-como-usar-el.html
Encoder Wiring
29
You don’t have to use the wire colors in the photos - use what you have
Encoder Wiring
30
Encoder - Python
31
Encoder - Python
32
TPI = ticks per inch
TPR = ticks per revolution = 20 (# slots on our encoder wheel)
C = circumference = 2𝝿r
𝝿 = 3.14159
r = wheel radius = 1.25 (wheel diameter is 2.5 inches)
TPI = TPR/C
TPI = 20/(2*3.14159*1.25)
TPI = 20/7.853975
TPI = 2.55
Encoder - Python
33
Implementing PID
34
Add an Ultrasonic Range Finder
35
HC-SR04
36
HC-SR04 Wiring
37
HC-SR04 Wiring
38
You don’t have to use the wire colors in the photos - use what you have
HC-SR04 - Java
39
HC-SR04 - Python
40
HC-SR04 - Python
41
HC-SR04 - Python
42
Vision
43
Vision: Tools & software setup on rPi
44
Vision: Tools & software setup on Laptop
45
Vision: Python code to use camera
46
Vision: Object Detection
47
48
End