Aller au contenu


marcus

Inscrit(e) (le) 07 juil. 2021
Déconnecté Dernière activité avril 04 2022 02:52
-----

Sujets que j'ai initiés

STONE TFT LCD Module STM32 Service Robot Motion Status Monitoring

04 avril 2022 - 02:46

Introduction Of Service Robot

 

Fundamentals Of Service Robot

As a kind of semi-autonomous or fully self-help robot, service robots are able to perform useful service work for human beings, such as carrying, cleaning, and rescue. As service robots gradually enter the social life of people, they are now widely used in public places such as exhibition halls, restaurants, and hotels, which have a profound impact on improving the quality of human life and the service industry.
Usually, service robots are equipped with high-precision LIDAR, voice acquisition module, motion module, display screen, wireless connection module, and other major equipment. The robot uses LIDAR to build a high-precision indoor map, a voice module to receive voice commands, a motion module to move the robot to the target location, and a wireless module to receive remote commands from the controller to achieve remote intelligent control.
The movement process of the service robot needs to go through functions such as map construction, path planning, speed planning, and roadblock avoidance, as shown in the figure below.

 

In this paper, a mobile robot demo is built, using an omnidirectional mobile chassis, so that the robot can complete steering, translation, and other actions in a small range.
Remote monitoring module: stm32F407 + wifi mode + STONE STVC043WT-01 display
Robot Host control center: stm32F707 expansion board (ported freer to the system)
Motion control module: stm32f407 + motor driver
Voice acquisition module: Xunfei Six Pulse Voice Array
Lidar: Silan Technology LPR Lidar
Mobile Chassis: ROTACASTER 125mm *3

 

Here we take a single-story scenario of a high-end office building as an example. The robot needs to serve the office workers in the building at regular intervals, and the task requires the robot to sense the environment and its own motion state through intrinsic or extrinsic sensors and perform collision-free motion from the robot’s current location to the target location according to the principles of optimal time, shortest path, or lowest energy consumption.
To perform this task successfully, the floor environment is first scanned by using LIDAR to construct an indoor map and indicating the location of the task point with coordinates:

 

As the robot is performing its task, the operator cannot know the real-time status of the robot and give commands in time.
In order to enable the controller to remotely access the robot status and give control commands from the control center, I used the STM32F407 mainboard to interact with the robot through an external network card and the stone STVC043WT-01 display for UI design in the demo to improve the efficiency of the operator’s use, the schematic diagram of the design is as follows:

 

This article will focus on how to use the stone STVC043WT-01 to design a UI to display the status of the service robot in real-time. Before working on the stone display, we need to write a simple test demo to ensure that the remote control module receives the robot’s current status (robot ID, destination, x/y/z motor speed, coordinates of robot’s current position, etc.) over the wireless network in a timely manner.
The following figure shows the robot state data generated when the robot is rotating at the origin, from the data it is clear that the x, y, and z motor speeds should be consistent when the robot is in rotation:

 

The Procedure Of Stone STVC043WT-01 Display

Stone provides a set of display design tools that are easy to use, and we can complete the development of display demos in a very short time through the company’s STV series displays. Therefore, the Stone STVC043WT-01 display was chosen to monitor the status of the remote machine in real-time. The development of the display is divided into three main steps:
1. Design the display UI
2. Develop the corresponding embedded host program, mainly designing the UART communication
Debugging of the display and the embedded host.

UI Design 1. Create A New Project

First, download the latest version of the TOOL-2019 tool from the stone official website.
According to the display parameters, create the corresponding project, here is the example of STVC043WT-01. (480*272).
Select File -> New, set the project screen pixels to 480*272:

 

2. Insert Images And Design UI

Right-click project file -> add to insert a picture drawn with other tools, note that the size of the picture must be consistent with the display, the size of the pictures used in this article are 480×272.

 

 

Set the jump link in the current state of the home page:

 

Then we use the stone tool to add a challenge link to the home page at the return button: Toolbar -> Hardware parameter configuration0, insert a window at the return button and modify the name definition and page switch to enable it to jump to the home page via the return button.

 

Insert the text variable in Robot ID and Destination, and insert the data variable in Motor speed and current location, as shown in the figure below.  It should be noted that a Variable memory address represents the address where data or text is stored, and word Length represents the maximum length of displayable bytes.

 

3. Compile And Download

After completing the above steps, check the screen configuration, make sure the baud rate is 115200 and the command handler is 0xA5 0x5A. After the check is completed, click the compile option and download the file to the display.

 

 

4. Debug

When the system starts, the display shows the Home Page, which contains six options. The system will establish a wireless connection between the remote console and the robot when we click on the connect option; conversely, the disconnect will disconnect the wireless connection. The show map option will display a map of the indoor environment which is created by the robot; the clear state option will initialize the system and send a command to interrupt the robot’s task execution to make it return to the starting point; the current state option displays and changes the robot’s state; and the return origin option will prompt the robot to return to the starting point.

 

Select the current state to check the current robot state. When the robot is at the starting point, the display shows the initial value of the robot state:

 

After setting the robot’s target, the robot starts its task, at which time the display will show the robot’s ID, destination, speed, and coordinates in real-time, as shown in the figure below, where the robot rotates at coordinates (174,269):

 

Select the return option and the display will return to the Home page.
Check that whether the UART data sent from the remote console to the display matches the screen display:

A5 5A 0b 82 01 20 53 48 2D 4B 4C 2D 30 31 //Robot ID: SH-KL_01
A5 5A 09 82 01 9B 6F 66 66 69 63 65      //Destination: office
A5 5A 05 82 01 14 0f 09  //motor x speed 3849 r/min
A5 5A 05 82 01 18 0f 09  //motor y speed 3849 r/min
A5 5A 05 82 01 1a 0f 09  //motor z speed 3849 r/min
A5 5A 05 82 01 1c 00 ae  //coordinate-axis X :174
A5 5A 05 82 01 1e 01 0d  //coordinate-axis X :269

5. Part of the code sharing

Serial_debug.CPP:

#include
#include "serial_debug.h"
using namespace std;
int debug_wait() {
#if DEBUG
cout << "press any key to contine" << endl;
getchar();
#endif
return 0;
}
bool creat_serial(HANDLE &hComm,string strPort) {
//Second, for the serial port number greater than 9 (for example, COM12), the serial port name in the CreateFile() function should be written "\. \COM12"。
// hComm = CreateFile(TEXT("com6"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
hComm = CreateFile(strPort.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hComm == INVALID_HANDLE_VALUE) {
cout << "Fail to open Serial Port.!!!" << endl;
debug_wait();
return FALSE;
}
else {
cout << "Success to open Serial Port. " << endl;
debug_wait();
return TRUE;
}
}
bool close_serial(HANDLE &hComm) {
CloseHandle(hComm);
return TRUE;
}
bool set_serial(HANDLE &hComm)
{
DCB dcb;
GetCommState(hComm, &dcb);
dcb.BaudRate = CBR_115200;
dcb.ByteSize = 8;
dcb.StopBits = ONESTOPBIT;
SetCommState(hComm, &dcb);
return TRUE;
}
bool WriteSerial(char* btData, ULONG ulSize, HANDLE hSerial)
{
DWORD dwNumBytes, dwRet;
dwRet = WriteFile(hSerial, //Handle
btData, //Data buffer
ulSize, //Buffer size
&dwNumBytes, //written bytes
NULL); //don't support
return (dwRet != 0);
};
int serial_process()
{
HANDLE hComm;
string portname = "com6";
bool ret = FALSE;
string buff = "serial opened";
char c[20]="";//A5 5A 03 81 00 01
// strcpy_s(c, buff.c_str());
ret=creat_serial(hComm, portname);
if (!ret)
return 0;
set_serial(hComm);
if (!WriteSerial(c, 7, hComm))//Send data hello to com1
printf("ERROR!!");
wait_for_end();// pending until uart is not need.
close_serial(hComm);
return 0;
}


STONE Display Screen + STM32 MCU + Relay Module to Control Smart Home

28 mars 2022 - 02:38

This project shows how to use the STONE display screen, STM32 MCU, relay module. The aim of the project is to be able to control home appliances through the STONE display as a human-computer interface.

Consumables Used In The Project

The display adopts an 8-inch  display screen and an 8-inch intelligent STONE display screen industrial display module

STONE STVI080WT-01 TFT LCD Module

The STONE STVI080WT-01 intelligent TFT LCD module with the Cortex-M4 32-bit CPU can be controlled by Any MCU via the UART port via a simple Hex instruction.
STONE provides software engineers with easy and visual Settings for a variety of graphical user interface features such as text, numbers, curves, image switching, keyboard, progress bar, slider, dial, clock and touch buttons, data storage, USB download, video & audio.
Engineers can easily adopt STONE display screen color user interfaces and touch functions on a variety of industrial devices, and much less development time and cost.

Easy to use:

  1. Design a beautiful set of “graphical user interfaces” and use our toolbox software to set up various application functions on the GUI.
  2. Connect the customer MCU directly through RS232, RS485, or TTL level, plug, and play.
  3. Compile the MCU program and control the STONE display screen module through 4 simple Hex instructions.

STONE TFT LCD Module STM32 Service Robot Motion Status Monitoring

28 mars 2022 - 02:35

Introduction Of Service Robot

 

Fundamentals Of Service Robot

As a kind of semi-autonomous or fully self-help robot, service robots are able to perform useful service work for human beings, such as carrying, cleaning, and rescue. As service robots gradually enter the social life of people, they are now widely used in public places such as exhibition halls, restaurants, and hotels, which have a profound impact on improving the quality of human life and the service industry.
Usually, service robots are equipped with high-precision LIDAR, voice acquisition module, motion module, display screen, wireless connection module, and other major equipment. The robot uses LIDAR to build a high-precision indoor map, a voice module to receive voice commands, a motion module to move the robot to the target location, and a wireless module to receive remote commands from the controller to achieve remote intelligent control.
The movement process of the service robot needs to go through functions such as map construction, path planning, speed planning, and roadblock avoidance, as shown in the figure below.

In this paper, a mobile robot demo is built, using an omnidirectional mobile chassis, so that the robot can complete steering, translation, and other actions in a small range.
Remote monitoring module: stm32F407 + wifi mode + STONE STVC043WT-01 display
Robot Host control center: stm32F707 expansion board (ported freer to the system)
Motion control module: stm32f407 + motor driver
Voice acquisition module: Xunfei Six Pulse Voice Array
Lidar: Silan Technology LPR Lidar
Mobile Chassis: ROTACASTER 125mm *3

Here we take a single-story scenario of a high-end office building as an example. The robot needs to serve the office workers in the building at regular intervals, and the task requires the robot to sense the environment and its own motion state through intrinsic or extrinsic sensors and perform collision-free motion from the robot’s current location to the target location according to the principles of optimal time, shortest path, or lowest energy consumption.
To perform this task successfully, the floor environment is first scanned by using LIDAR to construct an indoor map and indicating the location of the task point with coordinates:

As the robot is performing its task, the operator cannot know the real-time status of the robot and give commands in time.
In order to enable the controller to remotely access the robot status and give control commands from the control center, I used the STM32F407 mainboard to interact with the robot through an external network card and the stone STVC043WT-01 display for UI design in the demo to improve the efficiency of the operator’s use, the schematic diagram of the design is as follows:

This article will focus on how to use the stone STVC043WT-01 to design a UI to display the status of the service robot in real-time. Before working on the stone display, we need to write a simple test demo to ensure that the remote control module receives the robot’s current status (robot ID, destination, x/y/z motor speed, coordinates of robot’s current position, etc.) over the wireless network in a timely manner.
The following figure shows the robot state data generated when the robot is rotating at the origin, from the data it is clear that the x, y, and z motor speeds should be consistent when the robot is in rotation:

The Procedure Of Stone STVC043WT-01 Display

Stone provides a set of display design tools that are easy to use, and we can complete the development of display demos in a very short time through the company’s STV series displays. Therefore, the Stone STVC043WT-01 display was chosen to monitor the status of the remote machine in real-time. The development of the display is divided into three main steps:
1. Design the display UI
2. Develop the corresponding embedded host program, mainly designing the UART communication
Debugging of the display and the embedded host.

UI Design 1. Create A New Project

First, download the latest version of the TOOL-2019 tool from the stone official website.
According to the display parameters, create the corresponding project, here is the example of STVC043WT-01. (480*272).
Select File -> New, set the project screen pixels to 480*272:

2. Insert Images And Design UI

Right-click project file -> add to insert a picture drawn with other tools, note that the size of the picture must be consistent with the display, the size of the pictures used in this article are 480×272.

Then we use the stone tool to add a challenge link to the home page at the return button: Toolbar -> Hardware parameter configuration0, insert a window at the return button and modify the name definition and page switch to enable it to jump to the home page via the return button.

Insert the text variable in Robot ID and Destination, and insert the data variable in Motor speed and current location, as shown in the figure below.  It should be noted that a Variable memory address represents the address where data or text is stored, and word Length represents the maximum length of displayable bytes.

3. Compile And Download

After completing the above steps, check the screen configuration, make sure the baud rate is 115200 and the command handler is 0xA5 0x5A. After the check is completed, click the compile option and download the file to the display.

4. Debug

When the system starts, the display shows the Home Page, which contains six options. The system will establish a wireless connection between the remote console and the robot when we click on the connect option; conversely, the disconnect will disconnect the wireless connection. The show map option will display a map of the indoor environment which is created by the robot; the clear state option will initialize the system and send a command to interrupt the robot’s task execution to make it return to the starting point; the current state option displays and changes the robot’s state; and the return origin option will prompt the robot to return to the starting point.

Select the current state to check the current robot state. When the robot is at the starting point, the display shows the initial value of the robot state:

After setting the robot’s target, the robot starts its task, at which time the display will show the robot’s ID, destination, speed, and coordinates in real-time, as shown in the figure below, where the robot rotates at coordinates (174,269):

elect the return option and the display will return to the Home page.
Check that whether the UART data sent from the remote console to the display matches the screen display:

A5 5A 0b 82 01 20 53 48 2D 4B 4C 2D 30 31 //Robot ID: SH-KL_01
A5 5A 09 82 01 9B 6F 66 66 69 63 65      //Destination: office
A5 5A 05 82 01 14 0f 09  //motor x speed 3849 r/min
A5 5A 05 82 01 18 0f 09  //motor y speed 3849 r/min
A5 5A 05 82 01 1a 0f 09  //motor z speed 3849 r/min
A5 5A 05 82 01 1c 00 ae  //coordinate-axis X :174
A5 5A 05 82 01 1e 01 0d  //coordinate-axis X :269

 


La section de données dépasse l'espace disponible sur la carte

29 septembre 2021 - 09:13

Je suis en train de faire un petit jeu récemment et je veux utiliser Arduino uno pour le faire. Mon code se compile sans problème, mais lorsque je le télécharge, j'obtiens une erreur comme celle montrée dans l'image, est-ce parce que j'ai trop de variables définies ?
Est-ce que c'est parce que j'ai trop de variables définies ? Quelqu'un peut-il me dire comment le corriger ?
 
Arduino:1.8.12 (Windows 10), Development board: "Arduino Uno"

The project uses 6336 bytes, which occupies (19%) of the program storage space. The maximum is 32256 bytes. data section exceeds available space in board

Global variables used 3046 bytes, (148%) of dynamic memory, leaving -998 bytes for local variables. The maximum is 2048 bytes.
There is not enough memory; visit the following URL to follow the instructions to reduce memory usage.
http://www.arduino.cc/en/Guide/Troubleshooting#size
Error while compiling for development board Arduino Uno.

Turn on in File -> Preferences
"Show detailed output during compilation" option
This report will contain more information.

 


fauteuil de massage basé sur ESP32 et LCD

29 septembre 2021 - 09:09

Aperçu du projet
 
Il s'agit d'une application de fauteuil de massage domestique. Lorsque l'écran série LCD est mis sous tension, une interface de démarrage apparaît. Après un court séjour, il sautera à une interface spécifique. Cette interface est utilisée pour régler l'heure actuelle. Lors du réglage, un clavier s'affiche. Après le réglage, cliquez sur OK pour accéder à l'interface de sélection du mode de massage. Ici, j'ai défini trois modes : massage de la tête, massage du dos et mode complet. Dans le mode, l'intensité du massage peut être réglée, les vitesses haute, moyenne et basse peuvent être réglées, et la lumière LED correspondante sera utilisée pour l'indication de l'intensité ; les temps de massage peuvent également être réglés, après avoir atteint le nombre défini, il s'arrêtera automatiquement ; dans le modèle complet, la tête et le dos seront massés en même temps, et il peut être éteint quand il n'est pas nécessaire. Ces actions se font par l'intermédiaire de l'écran tactile STONE à port série pour réaliser la transmission des commandes.
 
Modules requis pour le projet
 
ESP32
③ Module et commande de moteur pas à pas ;
④ Module de matrice de LED ;

 

Conception de l'interface utilisateur graphique

 

Fichier joint  c-12-STONE-Touch-Screen-ESP32-for-massage-chair(1).jpg   49,42 Ko   22 téléchargement(s)

 

schéma de connexion

 

Fichier joint  c-5-Control-WS2812B_RGB-lamp-by-STONE-display-module(23).jpg   142,48 Ko   21 téléchargement(s)

 

partie du code

//HEAD

uint8_t   HeadGearHigh[9]       = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x0E, 0x01, 0x00, 0x03};

uint8_t   HeadGearMiddle[9]     = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x0E, 0x01, 0x00, 0x02};

uint8_t   HeadGearLow[9]        = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x0E, 0x01, 0x00, 0x01};

 

uint8_t   HeadTiming[9]         = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x11, 0x01, 0x00, 0x09};

 

uint8_t   HeadModeStart[9]    = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x19, 0x01, 0x41, 0x61};

uint8_t   HeadModeStop[9]     = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x24, 0x01, 0x46, 0x66};

 

//BACK

uint8_t   BackGearHigh[9]       = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x1A, 0x01, 0x00, 0x01};

uint8_t   BackGearMiddle[9]     = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x1A, 0x01, 0x00, 0x02};

uint8_t   BackGearLow[9]      = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x1A, 0x01, 0x00, 0x03};

 

uint8_t   BackModeStart[9]      = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x0C, 0x01, 0x42, 0x62};

uint8_t   BackModeStop[9]     = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x0D, 0x01, 0x43, 0x63};

 

//Integrated

uint8_t   IntegratedModeStart[9]= {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x0F, 0x01, 0x44, 0x64};

uint8_t   IntegratedModeStop[9] = {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x1F, 0x01, 0x45, 0x65};

démonstration vidéo