Real-time LED monitoring
Serial interface module
Uploading test result to online database
Kapsul PCB board
Message on command line
Part of Arduino control code
Part of command line code
Part of ESP8266 code
ESE 519-Kapsul PCB Testing Project Group 16 Ziheng Wang and Zhongyuan Lu
Project Summary: We built a hardware circuit and wrote corresponding functions and command lines to test the hardware function on Kapsul’s PCB board. Our system will finish all the functional test automatically by a logical sequence of communication between Kapsul’s PCB and Arduino control board without any laptop interface. The test will make the simulations and call relative functions of tachometer, PWM generator, User Interface system and other hardware. Test result can be output both by LED real-time response, PCB command line message and uploading to online database by WIFI module.
Baseline Goal: Our original baseline goal is listed below: (1) Testing that the correct voltage appears at certain nodes on the PCB. This test is mainly about the input and out put of the compressor, including COMP_CNTRL and COMP_FB, which corresponds to tests 3 and 8.b in Kapsul’s testing specs doc. This test will entail powering the Kapsul circuit, applying a load to the circuit, and measuring the voltage at several points on the circuit to compare against expected values. (2) Testing that certain GPIO pins on their microcontroller are sending and receiving the correct signals. This test is mainly about the input of tachometer and the output of PWM generator, including FAN1_TACH，FAN2_TACH, FAN1_PWM and FAN2_PWM, which corresponds to tests 4.c-f in Kapsul’s testing specs doc.
Before the baseline demo, our group put a lot of efforts to read through the codes and documents of Kapsul’s products. We figure out the operating and calling logic of each functional parts on PCB board, clarify the variables and functions together with the FREE RTOS system. After reading through those codes and have some basis understanding, we build our own test command in the command line utility. For our base line, tachometer input, PWM output and LED interface are tested by sequence in test command. (Details in software efforts) We do not put the test of compressor in our baseline because it will not be driven without a real motor connected. If we give it a simulative input, only an operating voltage is expected, which is relatively useless.
- Reach Goals: According to the advice from professor, the two group working on Kapsul’s PCB test (our group and Group 2) will work together and share their achievement to make a more complete PCB test system for the reach goals. After the discussion of two group, the reach goals are listed below:
(1). Develop a user-friendly and more detailed test sequence a. Realize continuous PWM test b. Solve conflict command lines c. Create commands which are not realized d. Add more tests into the test sequence(UI & Compressor) (2). Realize the mutual communication between Arduino and Kapsul board (3). Use WIFI function of ESP32 Dev module to save the MAC addresses (4). Hardware Design a. Design an assembly device which can be plugged into the Kapsul board (5). Remove the laptop from the testing and have a UI to initiate the testing (6). Report the test results on an online database
For our group, with the technique support of initializing command line by Arduino from Group 2, we build a more user friendly and more complete test sequence system by the mutual communication between Arduino and PCB board without any laptop interface. Besides the hardware test of tachometer, PWM generator and LED ring, we also add new test functions to verify the wellness of button UI interface and WIFI access point scanning. To use our PCB test system, the only things needed is put the PCB on the board with wire connection and turn it on. Then the system will automatically initial the test sequence and go through them one by one. The testing result will shows by the LED for real-time monitoring and messages will also be printed on the command line (if serial ports connected). After all the tests of one PCB are finished, those parameters will be prepared for the WIFI upload to the online database. And when the next PCB board is connected, it will automatically start a new test sequence. This test process is quite user friendly and is convenience to those who may even know the operating logic of this PCB board.
- Problem Identification and understanding: (1). Research on the Kapsul’s source code For our project, we are working something out based on a complete air conditioner product from Kapsul. We can imagine that their source code will be very lengthy and complicate. Reading through and figure the function of hundreds of documents and thousands of variables will be a great challenge. For those time-consuming and frustrating source code, hopefully, there are sound documentations and weekly meetings with Kapsul’s CTO, Don, which helps us solve large amount of questions.
(2). Mutual communication To build an independent testing system, undoubtedly we need to realize the mutual communication between Arduino and PCB board. Unfortunately, as a complete product, there are no extra communication ports designed besides TX/RX. However, those ports are already occupied by the command line initialization. To solve this problem, we make full use of tachometer input and PWM out put ports. Besides their original functions, those ports will also be used as message carrier in the mutual communication. We write corresponding codes to realize the recognizing and synchronizing function by different output signals.
- Overall system architecture: Our system is designed to use Arduino as the main controller together with other hardware modules to build the PCB test system. The JTAGICE3 programmer and Serial Port module are used to programming and interfacing with Kapsul’s PCB. ESP8266 WIFI module are used to upload test result to online database. To realize the mutual communication of Arduino and PCB board and automatically test, correct time series should be considered. In that case, we both programming to Arduino and PCB to realize their own functions and mutual interface.
By turning on the PCB board, the system will automatically initial the test sequence and go through all the functional test. The testing result will shows by the LED for real-time monitoring and messages will also be printed on the command line. After all the tests of one PCB are finished, those parameters will be prepared for the WIFI upload to the online database. New test sequence starts when the next PCB board is connected.
- Hardware effort: In this project, we use Arduino as the main controller together with other hardware modules to build the PCB test system. The instruction and how we use each hardware part is shown below: (1). Kapsul’s PCB board
(3). JTAGICE3 programmer
(4). Serial Interface board & WiFi Module
- Software effort: The software efforts of this project can be divided into 4 parts:
(1). Understanding the operating logic of source code Clarify the functions in the Kapsul’s source code is necessary, for we need to make the functional test to each hardware. The operating logic and calling method of each part are key points to test whether it can work separately and correctly. We figure out how the controller interface with tachometer, compressor, LED ring, button, temperature and humidity sensor, WIFI module and other configurations and interfaces. For example, the close-loop feedback control between the tachometer and PWM output is shown below. The tachometer read the revolution of the fan by the pulse signal it generated and calculate its RPM. In different mode, the system is supposed to have a specific target speed of the fan. To generate a feedback control signal, the controller output PWM signal with changing duty cycle (increase duty cycle when current speed less than target speed, vice versa.). Receiving the feedback PWM signal, the fans will correspondingly change its speed, so the reading of tachometer will also change. By repeating those processes, the working speed of fans will be kept in a dynamic balance. Now the fan is under control.
(2). Create test sequence and modify source code
To get the working condition of each hardware, we add new command to create the test sequence. First, we will test the function of tachometer and PWM output, according to the input pulse, the PWM generator will output signal with specific duty cycle. This test will be repeated three times with different input and output. If all the input and output signals meet our expectation, it proves that tachometer can read correct pulse numbers and the PWM generator can output corresponding signals. The UI interfacing with LED ring and button is tested followed. Specific “canvas” of LED ring is called and blinking with RGB color to verify each one can correctly on and off. Then the sequence will wait until get the response of button. If it is pressed, test passed and otherwise it will fail with no response in specified time period. WIFI module will be also tested by entering access point scanning mode, if it can correctly setup its SSID and IP address, and can successfully detect multiple surrounding available APs, the WIFI function is verified. To access all the hardware parameters and functions, we also need make large amount of modification in the .c and .h files of each hardware. Deep understanding of each file is necessary.
(3). Function realization on Arduino
We programming on Arduino to input and output communication signal with PCB and realize another part of test sequence. First, Arduino will check the condition of PCB under this test and will initializing test sequence on command line if it is ready. According to PWM signals received, pulse signals will be send back as responses by Arduino. Then for each part of hardware test, Arduino will continuously receive the test result and make sure there is no time confliction in test process by mutual communication. After one test sequence is finished, all the test result will be send to another Arduino board which is prepared for WIFI uploading. Once another PCB is connected and turned on, programming will start over new test sequence.\
(4). Data transmission to online database
We wrote a piece of code to send testing results to the online database via AT command line and TCP protocol. There will be four testing results and an Arduino board will read all those outputs and send them into the ThingSpeak online Database. There are four channels which are corresponding to four different tests. All those data could be extracted in CVS form. The WiFi data transmission could cause some data loss so we wrote a test for all the AT command line. As long as one of the AT commands fails, we will redo the AT command which will make sure the data will not lose.
- System evaluation: Our system has basically three ways to perform the test results:
(1). Real-time LED monitoring When the test running , the LED lights on the board will show us which step is running now and whether each part can work correctly.
There are five LEDs in our test system. The yellow LED will on when the test sequence start and shows us the test is in process. The following four green light correspondingly indicate the test result of four hardware parts: tachometer input and PWM output, LED ring, button interface and WIFI module. The first green LED will blink for each group of tachometer and PWM signal test (three groups in total). This LED will be continuously on if all three parts is passed. Other three LEDs will on in turn after LED ring, button interface and WIFI module tests are pass.
(2). Message on command line Even though our test system can work independently without laptop, the result can be printed on the command line if serial ports is connected.
(3). Uploading test result to online database
Test result for each PCB can be uploaded to online database.
Awesomeness: The popular PCB tests today in product industry are using nail beds to access all the test point. Because there is different layout for every PCB board, special fixture is needed. Designing a PCB testing nail bed takes millions of dollars and maybe more than 1 month, which is a huge cost for a company. By using our PCB test system, Kapsul can test the function of hardware on board without using any probes to access test point. Even though it may not realize all the functions of nail bed test, it will provide a much more convenience substitution for Kapsul to generally detect some hardware problems.
Contributions: For our group we work together and simultaneously have clear divisions. Ziheng Wang finish the mainly hardware and software design of the automatic test sequence, including test command on Kapsul PCB command line,functional test of each hardware, testing logic on Arduino PCB control board and mutual communication between Arduino and PCB. Zhongyuan Lu finish the saving and uploading testing result by WIFI module, including uploading the testing result from the Arduino control board to online database.
Video, github: Github: https://github.com/ZihengWang-1/ESE519-GROUP16