07. Design of automatic goldfish feeding robot based on GD32E231
[Copy link]
This post was last edited by a student of Media Studies on 2019-5-26 19:36 Design of an automatic goldfish feeding robot based on GD32E231 Work submission 1. Project Background When you are away from home for a long time, the goldfish at home will go hungry. Therefore, in order to prevent the goldfish from going hungry when the owner is not at home, an automatic feeding robot is designed based on a 4-DOF robotic arm and GD32E231. GD32E231 controls the robotic arm by generating PWM. At the same time, it takes fish food from a fixed place and puts it into the fish tank according to the preset time. Through multiple manual training, the robotic arm can automatically calculate the feeding position according to the manual training data. At the same time, some auxiliary functions can be added, such as obtaining the internal temperature of GD32E231 and the light conditions around the fish tank through the serial port or the onboard ADC plus a photoresistor. When it is dark, you can turn on lighting equipment such as desk lamps. The system uses the following functions of GD32E231: 1. UART high-performance asynchronous communication interface 2. GPIO general input and output interface 5. Timer0 timer triggers DMA transfer 7. Timer2 starts four-channel PWM to connect the robotic arm 8. External interrupt ETI 9. ADC internal analog-to-digital conversion From the actual test results and the specific operation of the modules used in the project promotion process, the GD32E231 processor has powerful timer function. Timer 2 can output 4-channel PWM, and the ADC function is also very practical, which can be used for ordinary robot applications. This project is based on the GD32E231arm processor produced by GigaDevice. As the main control processor of "Design of Automatic Goldfish Feeding Robot Based on GD32E231", it is responsible for reading light data, comparing timing time, and executing automatic or manual feeding tasks. Figure 2.1 Architecture diagram of automatic goldfish feeding robot based on GD32E231 2.1 Hardware design The hardware design adopts Arduino adapter board, and the power supply adopts 5V3A power supply + computer USB-serial port power supply. The specific hardware circuit is as follows: Figure 2.2 Partial hardware connection diagram 2.2Software design The software design is mainly implemented around the driver of ov5640. The program implementation principle diagram is as follows Figure2.3Program framework diagram The program flow chart is as follows: Code reference:EEWORLD Forum_Work submission attachment, Code project path: Auto_Feed_Robot\auto_feed_robot\Projects\auto_feed_robot\MDK-ARM\ Some functions: [code]void adc_rcu_config(void); void adc_gpio_config(void); void adc_dma_config(void); void adc_timer_config(void); void adc_config(void); void display_adc_value(void); void rtc_setup(void); void rtc_show_time(void); void rtc_pre_config(void); void rtc_comp_time(void); void led_config(void); void led_flash(int times); void exti_config(void); void gpio_config (void); void pwm_timer_clock_enable(void); void pwm_timer_config(uint32_t timer); void control_motor(uint8_t motor_tag, uint32_t pulse); void auto_feed_fish(void); color=#9932cc] 3. Project completion status [font =宋体] The project lasted 30 days (April 27, 2019) From 2017 to May 26, 2019, the project completed all the expected contents and additionally expanded the photosensitive sensor and serial port display functions. Figure3.1[ b]Actual picture [align=left ]The main functions implemented are: 1. Timer 0 triggers ADC and transfers data through DMA =#0000ff]2. Timer 2 is configured with four-channel PWM to control the robot arm 3. Through manual training, a better grasping Take position and release position 4. Through continuous attempts, we overcame the problem that the peak power of the power supply could not meet the rapid adjustment of the robot arm. Through smooth adjustment, we achieved control of the robot arm. 5. Success Implement the RTC module. Through the RTC module, the feeding can be started at a scheduled time. The number of feedings can be set each time. The default is 3 times. You can set how many times to feed each day and when to feed. 6. The serial port displays system information, which is convenient for debugging and manual interaction. , Project Summary and Outlook [ /size] 4.1 Project Summary [/ size] (1) The project realizes the control of the robotic arm and can grab fish food for feeding. [/align ] (2) The project realizes the collection of the light conditions of the fish tank, which is used to turn the light on or off, etc. The project uses LED4 to simulate the realization. (3) At the same time , added commonly used serial port modules for easy expansion and interaction. 4.2 Future Optimization Build a web server to remotely control the robotic arm. 4.3 Forum posting situation[/color ] [GD32E231 DIY Contest] 02. Why can’t the PWM duty cycle be changed in the external interrupt service function? (Source:Electronic Engineering World - Forum) [GD32E231 DIY Contest] 03. Ignoring the op amp settings will lead to incorrect PB1 output voltage (Source: Electronic Engineering World - Forum) [GD32E231 DIY Contest] 04. The difficult assembly process of the robotic arm (Source: Electronic Engineering World - Forum) [GD32E231 DIY Contest] 05. Automatic fish feeding robot PWM chapter (Source: Electronic Engineering World - Forum) [GD32E231 DIY Competition] 06. Automatic fish feeding robot ADC/DMA/TIMER0/serial port chapter (Source: Electronic Engineering World - Forum) 07. Design of automatic feeding robot for goldfish based on GD32E231 (Source: Electronic Engineering World - Forum) V. Acknowledgments Thanks to the forum for its continued support, thanks to GD company for providing development boards and samples, and thanks to all the forum friends for their help. Let us support domestic products, work hard, and forge ahead!
|