📜 ⬆️ ⬇️

Arduino in production *

From school age I was always interested in the design of plants and factories. Now I very much regret that there were so few school excursions to operating industrial enterprises. Therefore, in order to take some time in the evenings and broaden my horizons, I decided to build my own factory.

The factory will be a toy, something like a layout. And on this model I will be able to try my hand at developing control algorithms for various technological processes. Someone is building models of railways, and I will build a model of a small factory.

On Habré, there have already been many great posts in which the authors talk about the design and programming of robots based on the Arduino microprocessor-based platform. Basically, these are articles about mobile robots on a wheeled or tracked chassis, autonomous or remotely controlled. There is almost nothing about industrial use. In this regard, I offer my "five kopecks" in the form of a description of the process of designing and programming a small automated system that is controlled by Arduino.
')

* - not the present.

Transport it


What should our factory start with? Smart people say that the correct logistics in production determines the success of the entire enterprise.
“High-performance work of any modern enterprise is impossible without properly organized and working means of moving goods - lifting and transporting machines. By the principle of operation, these machines are divided into two groups: batch and continuous machines. The first includes cranes, etc., and the second includes conveyors of various types. ”

So, the first automatic machine of our factory is a simple belt conveyor that will be used to transport piece goods.

01. Samples of goods that will move along the conveyor.


Design


The conveyor is assembled from parts of the designer fischertechnik. The tape drives the motor M1. The control system is based on the Arduino UNO controller. Power supply of all electronics from BP to 9V.

02. Conveyor assembled.


To power the engine, an expansion board DFRobot Motor Shield with power keys is used. The control signals for these keys come from the pins of the Arduino controller with the PWM function. In my case, only one channel of the two existing on this board is used.

03. Scheme drawn using fritzing.

Algorithm


To begin with, I implemented a simple manual control of the pipeline. On the control panel there are 3 buttons - S1, S2 and S3. Button S1 switches on the movement of the belt in one direction, button S2 in the other direction, and the button S3 stops the conveyor.

04. The control panel with buttons.


Here's what I got (sketch for Arduino UNO, version IDE 1.0):
/* Conveyor control system */ //   int S1Pin = 8; int S2Pin = 9; int S3Pin = 10; //   int M1PWMPin = 5; int M1DIRPin = 4; //   int motorSlowSpeed = 50; int motorNormSpeed = 130; int motroFastSpeed = 255; //   int motorFwd = LOW; int motorRev = HIGH; int S1,S2,S3 = 0; //   int M1PWM = 0; //   1 int M1DIR = 0; //    1 int State = 0; void M1Fwd() { M1PWM = motorNormSpeed; M1DIR = motorFwd; } void M1Rev() { M1PWM = motorNormSpeed; M1DIR = motorRev; } void M1Stop() { M1PWM = 0; } void readInputs() { S1 = digitalRead(S1Pin); S2 = digitalRead(S2Pin); S3 = digitalRead(S3Pin); } void writeOutputs() { analogWrite(M1PWMPin, M1PWM); digitalWrite(M1DIRPin, M1DIR); } void setup() { //   4  5  pinMode(M1PWMPin, OUTPUT); pinMode(M1DIRPin, OUTPUT); //   8,9  10    pullup pinMode(S1Pin, INPUT); // set pin to input digitalWrite(S1Pin, HIGH); // turn on pullup resistors pinMode(S2Pin, INPUT); digitalWrite(S2Pin, HIGH); pinMode(S3Pin, INPUT); digitalWrite(S3Pin, HIGH); Serial.begin(57600); } void loop() { readInputs(); if (S1 == LOW) { M1Rev(); } if (S2 == LOW) { M1Fwd(); } if (S3 == HIGH) { M1Stop(); } writeOutputs(); Serial.println(State, DEC); } 


05. The assembly process.


Moving on


At the next stage, I will have to equip the conveyor with sensors that will enable the movement of the belt only if there are loads to move.

Source: https://habr.com/ru/post/134526/


All Articles