Case 07 Shaking Head
Introduction
This course aims to teach students how to precisely control the tilt angle of the XGO Rider through programming. We will explain in depth how to send commands to adjust the left and right tilt angles of the robot and obtain attitude angle data in real time, which is essential for maintaining the dynamic balance of the robot.
Teaching Objectives
Learn the programming commands for adjusting the tilt angle of the XGO Rider.
Learn the programming commands for reading the attitude angle of the XGO Rider.
Teaching Preparation
Before starting teaching, please make sure you have prepared the following necessary materials:
micro:bit V2 | |
---|---|
XGO-Rider | |
USB Cable | |
PC |
These materials will provide you with a complete experience and ensure that you can smoothly carry out subsequent operations and learning. If you are ready for the above, we can proceed to the next step.
After turning on the XGO Rider, in order to keep the fuselage balanced, it needs to move back and forth slightly. Please do not place the XGO Rider on the edge of the table or in a dangerous place to avoid damage.
Teaching process
Course introduction
In modern robotics, precise posture control is the key to achieving complex movements and maintaining stability. This course will take you to learn how to adjust the left and right tilt angles of its fuselage through programming. You will master sending specific commands to control the robot's posture, and how to obtain and interpret posture angle data, which is essential for the robot to maintain balance on various terrains.
Exploration activities
- What is the tilt angle range of the XGO Rider fuselage?
- What is the maximum range of the XGO Rider body tilt angle?
- What attitude angle data does the XGO Rider have?
Start programming
Add the XGO Rider software library
1. Enter "makecode.microbit.org" and click New Project.
2. Enter the project name in the pop-up window and click Create.
3. Click Extension in the code drawer, enter XGO Rider in the search box on the pop-up interface and click the search icon. Click it after the XGO Rider software library is displayed.
Sample Program
Reference Program Link: https://makecode.microbit.org/_8ghXsJWTtEv4
Because XGO Rider has forward and backward movement in the performance mode, please place XGO Rider on a spacious flat ground.
Download Program
1. Use a USB cable to connect PC and micro:bit V2.
2. After the connection is successful, a drive letter named MICROBIT will be recognized on the computer.
3. Click in the lower left corner and select Connect Device.
4. Click。
5. Click。
6. Select BBC micro:bit CMSIS-DAP in the pop-up window, and then select Connect. At this point, our micro:bit has been successfully connected.
7. Click Download Program.
Teamwork and Presentation
Students are divided into groups to jointly complete the programming of the XGO Rider fuselage tilt and attitude angle reading.
Students are encouraged to cooperate, communicate and share experiences with each other.
Each group has the opportunity to show their programmed XGO Rider to other groups and demonstrate.
Expected results:
Summary and Reflection
Review the course content and remind students what knowledge and skills they have mastered?
Guide students to discuss the problems and difficulties they encountered during the production process and how to solve these problems.
Guide students to think and discuss together how to determine the XGO Rider fuselage tilt limit angle.
Expand knowledge
In robots, attitude control is a key technology to ensure that the robot can walk and perform actions stably. Roll, Pitch and Yaw are the three basic angles that describe the rotation of robots or any objects in three-dimensional space. They are often used in aerospace, robotics, navigation and virtual reality. Here is a detailed explanation of each term:
- Roll:
- Roll is the rotation of an object around its own X-axis. In bipedal robots, this usually refers to the degree to which the robot's body tilts relative to the horizontal plane. For example, if the robot's upper body tilts to the left or right, its roll angle will change.
- Pitch:
- Pitch is the rotation of an object around its own Y-axis. In bipedal robots, pitch usually describes the forward and backward tilt of the robot's body. If the robot tilts its head forward or leans back, its pitch angle will change.
- Yaw:
- Yaw is the rotation of an object around its own Z-axis. In bipedal robots, yaw describes the left-right rotation of the robot's body. If the robot turns its body left or right, its yaw angle will change accordingly.
Control of these angles is critical to the balance and movement of bipedal robots. By precisely controlling these angles, the robot can adapt to different terrains, avoid falling, and perform complex movements. In practical applications, these angles are typically measured by sensors (such as a six-axis inertial measurement unit (IMU)) and adjusted by control algorithms to ensure the robot's stability and flexibility.