Design of automatic discharging and sorting controller for punch press based on stm32

Publisher:科技小巨人Latest update time:2013-01-24 Source: 电子科技 Keywords:stm32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
   
As with information technology, stamping automation technology is still the same as information technology. At present, many factories still use the most primitive manual cleaning and chassis loading to remove stamping waste. Manual production lines need to be stopped for cleaning. Although automatic production lines do not stop, they are extremely unsafe during cleaning. At the same time, manual cleaning of waste and the current waste collection methods make the entire production site look messy. Waste is scattered all over the ground, the site is not clean, and manual waste removal will inevitably require shutdown operations, affecting production efficiency. In stamping operations, stamping machinery, molds, and operating methods have a great impact on safety. Realizing stamping mechanization and waste collection automation can greatly improve the utilization rate of stamping equipment and labor productivity, and ensure personal safety. However, the stamping operation has a high frequency of action, and most of them are thin plate processing, so it is technically difficult to ensure the reliability of stamping mechanization and waste collection automation. The collection of stamping waste often requires shutdown work, which not only affects production, but is also extremely unsafe. At present, the conveying devices studied at home and abroad are often only for one type of stamping product. When encountering problems such as different heights, spacing and positions of the die pads, interference with the die clamp, etc., it is very difficult to automatically remove waste from the die. This article involves the design of a stamping automatic discharge sorting controller, which has significant effects in practical applications.

1 System hardware composition
1.1 Pneumatic solenoid valve selection
   
Discharge sorting uses pneumatic technology to sort finished products and waste through compressed air in different directions. Pneumatic technology is an engineering technology that uses air compressors as power sources and compressed air as working media to transfer energy or signals. It is an automation technology that uses pneumatic components and mechanical, electrical, electronic and other parts or all of the integrated control circuit to make pneumatic components automatically act according to the set sequence or conditions according to the needs of the production process. Using pneumatic control technology to realize production process automation is an important technical means of industrial automation and a low-cost automation technology. This article uses Festo's pilot solenoid reversing valve for air pressure reversing. The pilot solenoid reversing valve is composed of a direct-acting solenoid valve and a large pneumatic reversing valve. The direct-acting solenoid valve part is also called the solenoid pilot valve. The pilot solenoid reversing valve uses the pilot air pressure output after the solenoid pilot valve coil is energized to drive the valve core of the large air-controlled reversing valve (main valve) to achieve reversing.

a.JPG


1.2 Photoelectric sensor selection
   
The position detection element uses an electrical travel switch or proximity switch. A proximity sensor is a device that has the ability to sense the proximity of an object. This article uses three diffuse reflection photoelectric sensors from Omron, which are installed at the relative positions of the cam. When a diffuse reflection photoelectric sensor detects an object, the transmitter can emit a modulated invisible infrared light. When the object passes through the light beam, the light is reflected back to the receiver by the surface of the object, and the sensor outputs a signal.
1.3 STM32 Overview
   
This article uses ST's STM32F103C8T6 as the core controller. The STM32 series is based on the ARM Cortex-M3 core designed specifically for embedded applications that require high performance, low cost, and low power consumption. First-class peripherals include 1 μs dual 12-bit ADC, 4Mb/s UART, 18Mb/s SPI, and 18MHz I/O flip speed. Low power consumption: 36mA at 72MHz (all peripherals are in working state), and drops to 2 μA in standby mode. The maximum integration includes reset circuit, low voltage detection, voltage regulator, accurate RC oscillator, etc. Standard STM32 peripherals (including a PWM timer) and high-performance 32-bit ARM Cortex-M3 CPU enable developers to integrate multiple functions such as motor control, user interface control and device interconnection functions on devices (such as home appliances, buildings or industrial automation). Other target applications include systems that require networking, data logging or USB peripheral expansion functions.
1.4 System main circuit design

b.JPG[page]

1.5 Solenoid valve drive circuit design

c.JPG


1.6 Sensor input signal conditioning circuit

d.JPG



2 Software System Design
   
This system embeds the μC/OS-III operating system on the microcontroller.
2.1 Introduction to μC/OS-III μC
    /OS-III is a portable, ROM-implantable, customizable, preemptive, real-time multi-tasking operating system kernel. It is the third-generation RTOS launched by Micrium and provides features that other RTOS do not have. For example, it supports unlimited tasks, can test the performance of tasks while they are running, and directly send semaphores or messages to tasks. The
    software development environment of this article is IAR Embedded Workbench for ARM 6.21.
2.2 System Transplantation
    μC/OS-III can be transplanted to many processors, and the code related to the processor is implemented using a mixture of assembly and C programming. As long as the processor meets the following conditions.
    ·The processor must have an ANSI C compiler and reentrant code
    ·The processor must support interrupts
    ·Interrupts can be enabled or disabled
    ·The processor must have a hardware stack
    ·The processor has enough RAM for the μC/OS-Ⅲ system and tasks to store variables and data structures
    ·The compiler must support 32-bit data types, and some compilers should support 64-bit data types
    ·The processor has relevant instructions to save the stack pointer and processor-related registers
    This article uses the stm32f103c8t6 chip to meet the above requirements.

e.JPG


    According to the μC/OS-Ⅲ structure, only four files related to the processor need to be modified: os_cpu.h, os_cpu_a.asm, os_cpu_a.inc and os_cpu_c.co.
2.3 Application layer program architecture design
   
The software system is divided into four tasks, one task is one thread, and a semaphore is built in each task. Tasks and interrupts can communicate through semaphores. Through semaphores, each task can be packaged into a simple and clean API based on semaphores.

[page]

    App_TaskStart task: This task is responsible for initialization, key detection processing, task establishment, and semaphore establishment.
    f.JPG
    g1.jpg
    Sensor trigger event task: This task waits for the sensor input signal and then controls the solenoid valve to work.
    g.JPG

3 Conclusion
   
The punch press automatic sorting controller designed according to this solution has a high cost-effectiveness, can generate great economic benefits in the sealing ring industry, and has a high market application value.
Keywords:stm32 Reference address:Design of automatic discharging and sorting controller for punch press based on stm32

Previous article:Wireless endoscopy system solution using ARM and CPLD
Next article:STM32 Study Notes—SysTick Timer

Recommended ReadingLatest update time:2024-11-16 22:20

STM32- Cause of inexplicable reset problem when using function pointer
The program was reset inexplicably. After inspection, it was found that the following reasons were caused: an unknown space was accessed! This 1 should not be added. After the correction, there is no reset. Therefore, in programming and testing, you must pay attention to the boundary conditions.
[Microcontroller]
STM32- Cause of inexplicable reset problem when using function pointer
STM32-USART HAL library receives data of arbitrary length.
Preface: Recently, I was debugging the STM32L152 HAL library serial port to receive data of arbitrary length. I analyzed in detail the method of receiving data of arbitrary length. Hardware platform: STM32L152 Software platform: keil v5+cubeMX Function library: HAL library STM32L152 —USART STM32L152 USART HAL
[Microcontroller]
STM32: STM32 learning record 3: key input
1: IO configuration: Pull-up input mode: The difference is that when there is no input signal, the default input is high level (because There is a weak pull-up). Pull-down input mode: The difference is that when there is no input signal, the default input is low level (because there is a weak pull-down). For floating
[Microcontroller]
STM32 PWM output realizes LED light gradually turning on and off
/*  *illustrate:  *PA0:KEY1;PA1:KEY2;  *PA2:LED1;PA3:LED2;  *PA9:USART1_TX;PA10:USART1_RX  */   #include "stm32f10x.h"   #include "stm32f10x_rcc.h"   #include "stm32f10x_gpio.h"   #include "stm32f10x_tim.h"   #include "stm32f10x_pwr.h"   #include "stm32f10x_exti.h"   #include "system_stm32f10x.h"   #incl
[Microcontroller]
STM32 independent watchdog usage experience (Cortex-M3)
The calculation formula of the watchdog feeding time (watchdog overflow time) is: Tout=((4*2^prer)*rlr)/40 Tout is the watchdog overflow time (in ms), prer is the watchdog clock prescaler value (IWDG_PR value), ranging from 0 to 7, and rlr is the watchdog reload value (IWDG_RLR). void IWDG_Configuration(void) {
[Microcontroller]
STM32 IO issues
Today, the following problem occurred while debugging a board: A certain port PB5, using the reset function of a certain chip. The configuration is as follows: #define GPIO_PIN_REST GPIO_Pin_5   GPIO_InitStructure.GPIO_Pin = GPIO_PIN_REST;   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;   GPIO_Init(GPIOB, &G
[Microcontroller]
How to set up PC13, PC14, and PC15 of STM32 as common IO ports
1. Pinout Note: The latest document has deleted "only one pin can be used as output at the same time", which means that three pins can be used as output pins at the same time, and other conditions remain unchanged 2. Code void gpioc_to_io(void){     RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOC|RCC_APB2Periph_AFIO
[Microcontroller]
What does GPIOB->BSRR mean in stm32
GPIOB->BSRR = 0x01 is to raise GPIOB port 0 to a high level GPIOB- BRR = 0x01 is to reduce the GPIOB port 0 to a low level GPIOB- BSRR = 0x02 is to raise GPIOB port 1 to a high level GPIOB- BRR = 0x02 is to reduce the GPIOB port 1 to a low level GPIOB- BSRR = 0x04 is to raise GPIOB port 2 to a high level GPIOB- BRR =
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号