This project adopts STONE upgraded model: STWI101WT-01, 10″ 1024*600 resolution industrial serial touch screen, which can display all parameters and settings of this automated food delivery system in full screen.
The new upgraded development system is more convenient to use, and the quality is more stable and reliable. Especially the curve function is easier to display and control. Of course, the new software is still being improved and upgraded, more and more convenient functions will be developed gradually, we will see.
First of all, I would like to introduce the STONE screen I am using. the technical parameters of STWI101WT-01 are shown in Figures (1) and Figure (2). The power supply range is very wide, we choose the DC12V current 1A DC regulated power supply that can meet the requirements.
Figure (a) STWI101WT-01 technical parameters
Figure (2) Power Requirements for the STWI101WT-01
The software system embedded in this serial screen has been upgraded to make the commands easy to read and remember, in the following format.
Figure (3) Command format of the new screen system
Again, a little more on the idea of an automated feeding system.
This automated feeding demonstration system is based on the following functional concept (which can be assumed to be an indoor chicken farm).
Customizable feeding times.
Adjustable speed of the feeding conveyor belt.
Do not cast food: set on the first few and don’t cast food.
In addition, there is a sensor switch plate that automatically stays in front of the corresponding cage position. There is a thermometer to monitor the room temperature, and you can set a timer for ventilation (e.g. 15 minutes every 2 hours), and a timer for manure cleaning, etc. Of course, this demonstration system is only for the purpose of introducing, in actual use, we can add various functions as required by customers.
This project is a parameter setting and display interface for each of the three levels, where the first level interface is shown in Figure (4), and the second and third level interfaces are similar in content. The interface will display the current date and time on the upper right, and the button on the upper left will access the correction page of time and date.
The left side also shows the real time temperature of the room, and the set frequency of ventilation of the room (the parameter is adjustable in hours/per interval, and the fan is automatically activated to ventilate the room when the point is reached). The middle part shows the time of the 6 daily feeds, the feed rate, and the number of feed cages, each value can be adjusted by sliding (it’s a text_selector control with visible_num set to 1).
Below is a schematic of the conveyor belt, the bottom is the count for sensing no feeding, next to it is the button to switch the layers. Power on to start the demonstration, the set feeding time is up, the light bulb will light up at that position, and at the same time the connected conveyor belt motor will rotate to drive the conveyor belt movement, there are two speeds, will achieve fast and slow speed according to the set value. When the number of feeding cage is reached, it will stop the movement.
Also the fan will start running at regular intervals. The demo board has a limit switch for switching the feeding speed, which is actuated by the rotation of the servo. Please watch the demo video for detailed results.
Figure (4) First level parameter setting and display interface
Description
HMI and control creation instructions
Interface Download
Hardware materials and instruction testing
debugging code
1、HMI and control creation instructions
The minute selector text_selector has 6 per page, such as we want to be accurate only to 10min, OPTIONS can be set to 1:0;2:10;3:20;4:30;5:40;6:50; so that it is easy to adjust. Figure (5) is a screenshot of the properties of the min selector. In the sample, we have only made changes to the text_selector control property of ts121, for other parts of the min’s text_selector control we still use options:0-59.
This project is 3 layers and 3 pages, each page is 6 rows and 4 columns of text_selector controls, the alignment method can be used stone designer software menu bar on a variety of forms of alignment tools, see Figure (6). Use the shift key to select all controls that need to be aligned before alignment, and then click the corresponding alignment icon.
Figure (5) Property parameters of the min text selector ts121
Figure (6) Alignment Icon
Programming control name.
The bulb in front of the interface can be lit by the time of 6 casts in the interface, as shown in figure (7) for a fully lit situation.
The first layer of 6 bulbs is all IMAGE controls, named image11, image12, image13, image14, image15, and image16 from the top down.
Accordingly.
The second layer of 6 bulbs is all IMAGE controls, named image21, image22, image23, image24, image25, and image26 from the top down.
The third layer of 6 bulbs is all IMAGE controls, named image31, image32, image33, image34, image35, and image36 from the top down.
Figure (7) Naming of the light bulb image control
The six feeding parameters (hours, minutes, speed, and number of feeding cages) for each layer were named in Figure (8).
Level 1.
Hours: ts111, ts112, ts113, ts114, ts115, ts116
Minutes: ts121, ts122, ts123, ts124, ts125, ts126
Speed: ts131, ts132, ts133, ts134, ts135, ts136
Number of feeding cages: ts141, ts142, ts143, ts144, ts145, ts146
Tier 2.
Hours: ts211, ts212, ts213, ts214, ts215, ts216
Minutes: ts221, ts222, ts223, ts224, ts225, ts226
Speed: ts231, ts232, ts233, ts234, ts235, ts236
Number of feeding cages: ts241, ts242, ts243, ts244, ts245, ts246
Tier 3.
Hours: ts311, ts312, ts313, ts314, ts315, ts316
Minutes: ts321, ts322, ts323, ts324, ts325, ts326
Speed: ts331, ts332, ts333, ts334, ts335, ts336
Number of feeding cages: ts341, ts342, ts343, ts344, ts345, ts346
Figure (8) Pitching parameter text_selector control naming
Other.
There is a text_selector control for each page of indoor ventilation: ts151, ts251, ts351.
The digit clock control names on each page are: digit_clock1, digit_clock2, digit_clock3.
The inductive no-pitch count label control names for each page are label11, label21, and label31.
The temperature label control names for each page are label12, label22, and label32.
2、Interface Download
Figure (9) Back view of STWI101WT-01 serial screen
Connect the computer USB and the USB Type-A port of the STWI101WT-01 serial screen as shown in Figure (9).
By clicking on debugging — “download” under the main menu of the stone designer tool software, you can
Selecting the folder will generate a subfolder with the same name as the project (the last generated folder should be renamed before each download. Otherwise it returns an error).
Check the dip switch on the back of the STONE serial screen to the “device” position above.
Use the USB communication cable to connect directly to the computer and the display USB port, the PC will pop up the new disk folder.
Copy the /default/raw folder from the subfolder of the same name as the project you just created to the “default” folder in the display storage directory!
First, delete the “default” folder except for the image folder of the other 7 folders, the image folder may be in the case of the boot system in occupation, writing will prompt an error, a check can be seen, the image folder is the standard label images, if there are new labels and images to add, you can compare image/xx folder file after manual copy to join (if there is no new image import, image folder content of the same name can be skipped).
When Copy is complete eject the new disk, unplug the USB connection cable, and press the RESET button on the back of the STONE serial screen.
3、Hardware materials and instruction testing
Verify the commands that need to be used before programming. We use the serial assistant to check the feedback from STONE and verify the validity of the commands. This project involves 5 types of controls: button, label, text_selector, digit clock, and image.
Figure (10) shows the materials prepared for this project. There are conveyor belt, fan, motor, speed control board, induction kit, servo, MCU board,s etc. We program the human-machine interaction after wiring them and communicating with the STONE serial screen. The wiring connections will not be detailed. Please see the video recorded after completion showing the motion effect.
Figure (10) Demonstration materials for this project
Label Related:
set_text Set the text displayed by the label
Example:
Set text: (temperature display name = label22)
ST<{“cmd_code”: “set_text”, “type”: “label”, “widget”: “label22”, “text”: “23”}>ET Verify the upper screen OK
text selector related:
0x1081 text selector value is sent (int type Active posting: posted as soon as the selector is adjusted)
Data format:
value value: the last four bytes of the data section
Example: (hour selector control name = ts111, options: 0-23, current 5, when 7 is reselected)
The hexadecimal data received by the serial assistant is.
53 54 3C 10 81 00 09 74 73 31 31 31 31 00 00 00 07 3E 45 54 B4 ED OK
The screen actively gives instructions viz.
ST<0x10 0x81 0x00 0x09 ts111 0x00 0x00 0x00 0x00 0x07 >ET Current value of ts111: 0x07
Digit clock related:
set_date Sets the date and time of the digit_clock control.
Get_date Retrieve the date and time of the digit_clock control.
Example:
Set the date and time:
ST< {“cmd_code”: “set_date”, “type”: “digit_clock”, “widget”: “digit_clock”, “date”: “2022-05-27 21:30”}>ET Verify that the times of all three pages on the top screen are synchronized OK
ST< {“cmd_code”: “set_date”, “type”: “digit_clock”, “widget”: “digit_clock3”, “date”: “2022-05-28 22:30”}>ET The effect is the same, all 3 clocks are updated synchronously.
Figure (11) is given in the software instruction set.
Read the date and time:
Figure (11)
The above time and date reading commands have been planned, but are still not supported by the current hardware and software versions at hand, and the following commands serial screen currently has no feedback. Therefore the demo starts the display function automatically by the program.
Send: ST< {“cmd_code”: “get_date”, “type”: “digit_clock”, “widget”: “digit_clock1”}>ET
Image related:
set_visible Sets the visibility of the control.
Example:
Set the bulb to light up:
ST<{“cmd_code”: “set_visible”, “type”: “widget”, “widget”: “image11”, “visible”:true}>ET First page first feeding bulb lit ok
4、Debug code
Presentation notes
The 1st and 2nd gear speed of this demo conveyor belt is achieved by changing two sets of switches through the servo drive, and the indoor ventilation is demonstrated using a small DC5V fan. Indoor temperature, feeding cage count can actually use temperature sensor and position sensor, this place direct command write instead. When the power is turned on, first turn off all the bulbs display (when the time comes, then let the corresponding position of the bulb visibility set “TRUE”, indicating the working status.) Then, the RTC time is written. The RTC time of the screen is read during operation and compared with the set feeding time to decide whether to start feeding. Levels 2 and 3 are the same as the code in level 1, and are partially omitted for space reasons, not affecting the functional display.
// Auto rice
// by Frank for STONE in 2022.05.28
/*
the word of CMD:
ST<{“cmd_code”: “get_date”, “type”: “digit_clock”, “widget”: “digit_clock1”}>ET
ST<0x10 0xF0 0x00 0x22 “digit_clock1” :2021-02-26 12:31:35 >ET
53 54 3C 10 F0 00 22 22 64 69 67 69 74 5F 63 6C 6F 63 6B 31 22 3A 32 30 32 31 2D 30 32 2D 32 36 20 31 32 3A 33 31 3A 33 35 3E 45 54 30 BB
ST<{“cmd_code”: “set_visible”, “type”: “widget”, “widget”: “image11”, “visible”:true}>ET
ST<{“cmd_code”: “set_date”, “type”: “digit_clock”, “widget”: “digit_clock1”, “date”: “2022-05-28 22:30”}>ET
st<0x10 0x81 0x00 0x09 ts111 0x00 0x00 0x00 0x00 0x07 >e
53 54 3C 10 81 00 09 74 73 31 31 31 31 00 00 00 07 3E 45 54 B4 ED
ST<{“cmd_code”: “set_text”, “type”: “label”, “widget”: “label22”, “text”: “23”}>ET