Tutorial
Table Of Contents
- 1. Premise
- 2. Raspberry Pi System Installation and Developmen
- 3 Log In to The Raspberry Pi and Install The App
- 4 Assembly and Precautions
- 5 Controlling Robot via WEB App
- 6 Common Problems and Solutions(Q&A)
- 7 Set The Program to Start Automatically
- 8 Remote Operation of Raspberry Pi Via MobaXterm
- 9 How to Control WS2812 RGB LED
- 10 How to Control The Servo
- 11 How to Control DC Motor
- 12 Ultrasonic Module
- 13 Line Tracking
- 14 Make A Police Light or Breathing Light
- 15 Real-Time Video Transmission
- 16 Automatic Obstacle Avoidance
- 17 Why OpenCV Uses Multi-threading to Process Vide
- 18 OpenCV Learn to Use OpenCV
- 19 Using OpenCV to Realize Color Recognition and T
- 20 Machine Line Tracking Based on OpenCV
- 21 Create A WiFi Hotspot on The Raspberry Pi
- 22 Install GUI Dependent Item under Window
- 23 How to Use GUI
- 24 Control The WS2812 LED via GUI
- 25 Real-time Video Transmission Based on OpenCV
- 26 Use OpenCV to Process Video Frames on The PC
- 27 Enable UART
- 28 Control Your AWR with An Android Device
- Conclusion
55
●The servo doesn't return to the central position when connected to the driver board.
In general, the Raspberry Pi will auto run `webServer.py` when booting, and `webServer.py` will run and control
the servo ports to send a signal of rotating to the central position. When assembling the servo, you can connect it to any
servo port anytime. After connecting the servo to the port, the gears will rotate to the central position; assemble the
rocker arm to the servo, disconnect the servo from the port, and insert more servos to repeat rocker arm assembly (all
servos will be in the central position).
When the servo is powered on, try moving the rocker arm. If it can't be moved, it indicates the program for the
servo works; otherwise there's error for the servo program. Run the line `[RobotName]/initPosServos.py` (replace
`[RobotName]` with the folder name of your robot's program) to make the servo rotate to the central position.
When booting (it may take 30-50s), it takes a while for the Raspberry Pi to control PCA9685 to set signal of all
servo ports for central position rotating.
●no cv2 error occurs when I manually run `server.py` or `webServer.py`.
OpenCV is not installed correctly. Type in the command sudo pip3 install opencv-contrib-python in the Raspberry
Pi to manually install OpenCV.
●When using a computer to copy ssh and wpa_supplicant.conf to the SD card, it prompts that there is no
SD card
If this happens, unplug the card reader and connect it to the computer.
●SSH can't connect, error WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
Enter the following in the command line and press Enter
ssh-keygen -R Add the Raspberry Pi's IP address
For example:
ssh-keygen -R 192.168.3.157
Then you can SSH to the Raspberry Pi again
●Raspberry Pi automatically restarts after booting / restart the robot once it starts to move
If your robot automatically restarts after powering on, or disconnects and restarts when the robot starts to move
after normal power on, it is likely because your power supply does not output enough current, and the robot will
automatically run the program when it starts Put all the servos in the neutral position, the voltage drop caused by this
process causes the Raspberry Pi to restart.
We have tested that when using 7.4V power supply, the peak current of the robot is about 3.75A, so you need to
use support 4A output battery.
●The direction of servo movement is incorrect
Due to the different batches of servos, when the same angle change trend is given to the servos, the actual
direction of motion of the servos may be opposite. We have set an interface to adjust the direction of the servos in the
program. You need to open RPIservo.py, Find the array sc_direction in ServoCtrl. If the direction of the servo of port 3 is
reversed, change the fourth 1 to -1.
(The serial number of the array starts from zero, so port 3 corresponds to the fourth 1).
If the servo direction of port 3 is not correct:
Before modification:
self.sc_direction = [1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1]
After modification (the serial number of the array starts from zero, so port 3 corresponds to the fourth 1):
self.sc_direction = [1,1,1,-1, 1,1,1,1, 1,1,1,1, 1,1,1,1]