This action might not be possible to undo. Are you sure you want to continue?
A PROJECT ON
MODBUS BASED DISTRIBUTED CONTROL SYSTEM
BY PUJARI SUJAY TOPHKHANE SAURABH KUMTHEKAR AVADHOOT
Under Guidance of Prof. Mrs. M. P. Atre
Technical Assistance W.A.K.E.
Project Category INHOUSE PROJECT
This is to certify that following students have satisfactorily completed their project titled ‘MODBUS BASED DISTRIBUTED CONTROL SYSTEM’, towards the fulfillment of Bachelor’s Degree in Electronics & Telecommunication Engineering.
Kumthekar Avadhoot D. Pujari Sujay G. Tophkhane Saurabh S.
B-3073034 B-3073046 B-3073086
Prof. Mrs. M. P. Atre. Project Guide
Prof. N. P. Deshpande Head, Dept of E & TC
Firstly, we would like to express our sincere thanks to our Internal Guide Prof. Mrs. M.P. Atre whose guidance, supervision, patience and support has been instrumental in the successful completion of this project.
We would also like to thank our Project Coordinator, Prof. Mr. P. G. Shete, our Head of the department, Prof. Mr. N. P. Deshpande and Prof. R. G. Kaduskar for supporting the project and extending their help and co-operation.
We would like to thank ‘W.A.K.E.’ foundation and our classmates for their timely help and unconditional support. Without them, lot of our problems would have been left unsolved. Last but not the least; we would like to extend our appreciation to the nonteaching staff who are always eager to help us by providing us with the necessary equipments.
Pujari Sujay Girish. Kumthekar Avadhoot Dattatraya Tophkhane Saurabh Sanjay.
9. 3. 1 2. 5. 6. LIST OF FIGURES LIST OF TABLES SYNOPSIS LITERATURE SURVEY INTRODUCTION SYSTEM SPECIFICATION BLOCK DIAGRAM BLOCKWISE DESIGN DESIGN APPROACH 1)SERVER 2)RS485 IMPLEMENTATION 3)SCADA SYSTEM 6 7 8 9 10 12 14 15 16 8. 10. I II 1.NO TITLE PAGE NO. 13. 11.TABLE OF CONTENT: SR. 7. 4. 2. HARDWARE DESIGN SOFTWARE DESIGN APPLICATION TESTING FUTURE SCOPE BIBLIOGRAPHY 4 19 29 48 50 54 55 .
1 to 6. 16.1 Figure8.. Figure5.15 DCS system flow chart…………………………………………….14. 15.4 LIST OF FIGURES Block diagram DCS……………………………………………………..….1 .……20 5 Figure7.1 Figure 6.……16 power supply design……………………………………………….14 Internal Block diagram of all modules……………………………. APPENDIX CIRCUIT DIAGRAM DATA SHEETS 56 62 69 I.
.…….59 Module C…………………………………………………………………..3 Figure8.....56 Modbus Frame………………………………………………………….24 Driver circuit for Buzzer………………………………………..………....25 Signal conditioning circuit……………………………………………….59 CRC calculations………………………………………………………..…….48 Modbus protocol &ISO model comparison…………………….65 Module D………………………………………………………………….3 Figure15.4 RTU frame………………………………………………………………..45 Application block diag…………………………………………….5 Figure15.2 Figure9.8 RS485 biasing circuit……………………………………………….1 Figure9.58 4 wire Topology for RS485……………………………………………..………….44 Primary table………………………………………………….3 Figure14.2 Figure8....…….to….1 Figure15.………36 ………….5 Table14.2 Figure15.31 Address allotment of Module A……………………………………….2 Table9.30 Modbus Transaction diagram…………………………….Figure8.4 Figure14.43 Address allotment of Module B…….9 Figure10. LIST OF TABLES Table9.…….2 Figure14.1 Table9.…..42 Figure9.1 Figure14..1 System supported functions……………………………………………30 Exception code………………………………………………………….3 To 9.………………………………….57 6 ....58 Address rule…………………………………………………………….64 Module A…………………………………………………………………....3 Table9..27 Network layer……………………………………………………..66 II.4 Figure9.63 Module B…………………………………………………………………..….4 Table9..1 Figure14.43 Address allotment of Module C………………………………………..………37 Flowcharts of various functions …………………………….
Table15.1 Components & Bill…………………………………………………. Programming Language: Embedded C..61 1.60. SYNOPSIS Modbus based Distributed control System (DCS) • • • • • • Domain: Industrial process automation. Hardware Platform: 8-bit microcontroller. Parameter monitoring SCADA 7 .. Application layer protocol: Modbus Protocol (A de-facto Industrial Application layer protocol).SPI. Physical Layer Interface: RS-232. RS-485.
for that we referred Application Note[AN002] from www. we started from Physical layer which tells about topology. www. 8 . we referred following Web resources: 1. www. On receiving a Modbus command from the PC based software / Control system with specified formatted protocol will send the read value as a Modbus response. LITERATURE SURVEY To get basic knowledge about “Modbus protocol”.com. A 24V to 5V DC/DC Converter is used to power up the system . 2.com.System will continuously monitor the temperature and stores the value in its internal memory. According to alarm Trigger Pt.modicon.wikipedia.com 3. A temperature can be set through the PC based software which can send indication over Modbus at some other remote place.google.[Mazi] and [JanS] . www. After getting used to with protocol. Control over all 3 modules from module D or Master is over MODBUS-RS485.com 2.MODICON. Setting Buzzer & Led’s will indicate.
which is 8-bit controller from AVR family. have to be monitored and controlled. but at the same time physical parameter like temperature. Ref: Manual: doc2510. & [SLLA272B] from www. pressure. air flow etc. INTRODUCTION Name of project: Our project is named as “Modus based Distributed Control System”. Moving further towards upper layers. Our system is a RS-232/ RS485 based temperature transmitter can read the surrounding temperature.[AN736].com. [AN003] 3. send this data over Modbus protocol to the PC based software or a PLC control system which controls it. Software tools used: IDE: AVRSTUDIO4. we decided to implement system modules using Atmega32 controller. which is RTU .maxim. It is basically a model which just demonstrates system Need of project: In industries there are certain processes where human intervention is not possible due to harsh environmental conditions and criticality of application.AN from www. doc1019. we referred: Application note [AN723]. To study this we referred [DhanG]. While working on UART again [JanS] was useful. Downloader: FreeIsp. Compiler: WINAVR.com.For RS232 www. To Implement Application layer with device profile Ref: Application Note [AN001].[AN2020] from For RS485 we referred: Application note[AN1063].com Power supply design concepts were found from [Boye]. Remote monitoring and controlling is must in such cases.TI.maxim. A distributed control system (DCS) in which the controller elements are not central in location (like the brain) but are distributed throughout the system with each component sub-system controlled by one or more controllers 9 .
They all will communicate using Modbus protocol over RS-485. Master-> pc : module D.supervisory control and data acquisition systems Module-A 10 Module B: Generic module Module C: Alarm & process status indicator . . Slaves->Module A: Temp module • • • Module-D Is PC based Modbus Master running SCADA . to monitor and control distributed equipment. Why MODBUS? 1)It is openly published and royalty-free 2)Relatively easy industrial network to deploy 3)It moves raw bits or words without placing many restrictions on vendors Basic idea & approach: we are going to develop distributed control system Which consist of 4 modules->master taking service from 3 slaves (Servers).DCS is a very broad term used in a variety of industries.
Module-C This module consists of two parts 1) To indicate exceeding of trigger point temperature . SYSTEM SPECIFICATION Power I/P: 230 v ac.1˚C 2)Module B: Generic Analog I/P Module Variable I/p: Display: 0 to 5v simulating any physical quantity 16x2 Character Display Communication port: Modbus over RS485 (TWI). Module-B Generic module is universal sensing device. At particular trigger point of temperature set by master alarm module will come in picture. 2) For the purpose of controlling part 3LED’s are provided to show different works or functions. 50Hz 1)Module A: Intelligent Temperature Sensor Module Temp Range: Display: Communication port: Resolution : 0 to 100˚C 16x2 Character Display Modbus over RS485 (TWI). 4. User also has to feed data read in the form of 0-5v and conversion factor.System will continuously monitor the temperature and stores the value in its internal memory. 11 . 0.
2k Data Bits: 7. 8 Parity: N. 38. 19. 9600. E Stop bits: 1(for E). 2 12 .4k.2k.Resolution: 10bit 3)Module C:Alarm & process status indicator Communication port: Modbus over RS485 (TWI) Two Alarm Signals: Visuals: 3 LEDs . Audio: Buzzer . and 115. 0.6k. 4) RS232-Rs485 Converter 2 communication port: RS232/RS485 RS 485-2 wire configuration Calculated Termination Resistance 5) Module D: PC Based mini SCADA System VB/Turbo c Based Front End s/w Communication: Modbus Master over RS 232 Data Logging Facility Alarm Trigger Pt Setting Monitoring Parameter 6) UART: Baud Rate Supported (bps):4800. 57.
0 / VC++. 8-bit microcontroller.(ATMega32) Embedded C. RS-485.Flow Control: None • • • • • • • Domain: Hardware Platform: Programming Language: Application layer protocol: Physical Layer Interface: Data Link Layer Interface: Parameter monitoring Software using (PC based Mini SCADA system) : Industrial process automation. 5. Modbus Protocol RS-232. BLOCK DIAGRAM LT1 RS PC (SCADA SYSTEM) 232 485 RS Generic Device D: MODBUS Master B: MODBUS Slave Temperatur e Module Alarm and process status A: MODBUS Slav 13 . UART VB 6.
C: MODBUS Slave LT2 Fig 5.1 2) MODULE B : Generic device A TTL Controller ADC 0 to 5V analog I/p TTL to 485 B Fig 6. BLOCKWISE DESIGN 1) MODULE A: Temp Module A TTL to 485 TTL Controller ADC TEMPRATURE SENSOR B Fig 6.1 6.2 3) MODULE C: Alarm and Process status indicator A TTL to 485 TTL Controller 14 Led’s & Buzzer .
4 B 7. DESIGN APPROACH 15 .B Fig 6.3 4) MODULE D: PC based mini SCADA system A PC Serial port RS232 RS232 232 TTL TTL to 485 To TTL Fig 6.
1 DCS system Flowchart -> SLAVE BOOTING PROCESS MASTER BOOTING POLL FOR SLAVE DEVICES SET CONDITION FOR ALARM START MONITORING THE PROCESS YES SET ALARM OR LED’S CHECK FOR CONDITIO NO System is broadly divided in 3 parts 1) SERVER 2) RS485 implementation 3) SCADA system 1) SERVER 16 .Fig 7.
Hardware approach : These are modules A.B&C In which common requirement s are • • 8-bit microcontroller->AVR ATMEGA32 selected Power supply ->230v to 9v conversion. Logical approach: 17 . Module a) 1) Sensor selection according to resolution and range->LM35 2) Signal condition circuit3) LCD interface Module b) To make it user friendly. For the purpose of testing of various interfaces like 1) Ttl-Rs232 2) Downloading section 3) Display unit 4) ADC interface & many more A unique Development board built around ATmega32 Is required. Menu driven->tactile switches & LCD Device protection circuitry Module c) Hooter and led indicator.
Module b) module will show 2 modes on display 1) Program mode User can select parameter to be sensed & its convergent factor 2) Run mode Run mode is common for all modules or server It just means server waiting for command from client & eager to respond. 2) RS-485 implementation 1) For level conversion needed for slaves -> RS485 –TTl Transceivers (for slaves) 2) For level conversion needed for master -> RS232-RS485 -> A) RS232 to TTL and TTl to RS485 transceiver B) RS232 to RS485 transceiver 3) Termination resistance selection-> 3) SCADA system 1) Modbus Master- slave driver implementation Programming language-visual basic 2) Graphics User Interface
8. HARDWARE DESIGN
POWER SUPPLY DESIGN
1N 4007 2 1
U 2 L M 7 8 0 5 C /T O IN G N D O U T
0 .1 u F
0 .3 3 u F
Fig 8.1 As shown in above diagram; Bridge rectifier: I/P=24V. It is commonly used circuit for large amount of DC power. At one time two diodes conduct simultaneously. We are using 1N4007 diodes. Voltage drop=0.7*2=1.4V So O/P of bridge rectifier is 24-1.4=22.6V.
Filters: A circuit that removes ripples from a rectifier output without affecting DC voltage is known as filter. We are going to use capacitor filter. We will assume ripple factor as 5%. We know; Ripple factor= r=Vr(rms)/Vdc. =Idc/4*31/2*f*C*Vdc =1/4*31/2*f*C*RL Substituting values; 20
Wide input range: 7-35V 2. Then i/p of IC 7805 . Output capacitor is generally not used but it improves the transient of Regulator. 1. C=2200uF (standard). IC7805: From datasheet we have.33 C = 1732uF. We know Power dissipation =(Vin-Vout)*Io.05= 1/ 4*31/2*f*C*33. Vdc=22. PD=2W. 2. Capacitor Cin filters out effects of stray inductance of input wire.Output voltage : 5V regulated. Need of capacitor: 1.33ohm So we have 0.05 =1/ 4*31/2*f*C*RL Now we have for our modules.6v (I/P range for ic 7-35V) Capacitors Cin and Co are used at input and output side of IC…. Power dissipation consideration: We know from datasheet IC has max.0. 21 . Idc=150mA RL=5/150mA=33.. Max current capacity:1A 3.
64W Since we have more PD we NEED heat sink… We are going to use general 25x50 mm Heat Sink which dissipates power up to 3 watts.6V For max.6V So in our case PD will be PD=17. 2) Controller selection (ATMega32) • • • 8-bit Microcontroller Advanced RISC Architecture Large amount of In-System Self-programmable Flash program memory 22 .2W PD we need Vin-Vout=2W/0.We have Io=150mA and Vin to 7805=22.5 =4V But we have Vin-Vout =17.6*150mA PD =2.
Software tools like compiler.• • • • • • • At least 1K Bytes EEPROM Inbuilt 8-channel 10-bit ADC Programmable Serial USART Baud Rate achievable 115Kbps @ Fosc=3.6864MHz With 0% error Sophisticated IDE. library Free downloading circuit and software Availability of prototype board 23 .
24 . so RS485 can have at max 32 nodes.mV between A and B data line. In our case we are going to use 3 slaves and 1 master. So we have 4 RS485 Nodes. Fig 8. Each RS 485 node has load impedance of 12K.2 As we know that using modbus we can connect up to 32 devises. so for such 4 nodes in parallel give load of 3k.
3 For 5V supply.4mA Now to calculate bias resistance value we have. Since buzzer draws about 1.4mA=5V/(2R+(120||3K||120)) 2R+59=5V/3. So to maintain this voltage the bias current required to flow through load is given by Bias current=200mV/(120||3K||120) Bias current =3. 3.. So 25 .4mA 2R+59=1470 2R=1411 R=705 ohm.Minimum requirement of voltage between terminals A and B=200mV. Value used=700 ohm 4) Transistor driver circuit for buzzer 5 V 4 0 0 o h m L S 1 1 2 B U Z Z E R R 2 5V 4 7 K o h m 2 1 B C 5 4 7 3 Fig 8.5 mA we will consider Ic as 10mA.
Vce=1V. So. 1.90uA. Applying KVL to B-E. 5)SIGNAL CONDITIONING 26 . Applying KVL to C-E.90uA R2=47.Ic =10mA. 2. So we have R1=400ohm and R2=47.3047Kohm. From datasheet. we have VIN=Ib*R2+Vbe 5=Ib*R2+0. Ib=10mA/110 Ib =90.3047kohm.3=Ib*R2 4. For Ib we know. Hfe(min)=110. Ib=Ic/Hfe(min).3/90.3=90.7 4. Vcc=Ic*R1+Vce 5=10mA*R1+1 R1=400 ohm. From datasheet of BC547 we have.90uA*R2 R2=4.
5 =3. We will use 10K pot as Rf.33=1+Rf/1K Rf=2.Fig 8. Required gain: Vo/Vin: =5/1. Gain: 1+Rf/Ri. So we have Ri=1K and Rf=10K(variable)… Now for offset nulling technique as shown in figure… We are going to use LM358 so Vcc=5V and from datasheet of that opamp we got value of input offset voltage as 7mV(max)…. We will use Ri=1K… then we have 3. 27 ..4 For non inverting amplifier .333.33K.
.2Kohm(this is variable one) We can adjust this variable Ra till the output reaches to zero…. 28 . then we have Rc=20ohm Rb=1400*20 =28Kohm Take Rmax=Rb/10 so Rmax=2800 As we know Rmax=Ra/4 Ra/4=2800 Ra=11.V=Vcc=5V Vios=(Rc/Rb)V 7mV= (Rc/Rb)5 Rb=1400Rc Choose Rc as 20 ohm..
9. SOFTWARE DESIGN Device Profile Modbus Application layer UART RS-485 29 .
We support following Functins: Primary Table Discrete Input Coil Object type Single bit Single bit Access Type Read Only Function Reference Supported 1x 0x2 0x1 0x5 0x4 0x3 0x6 0x10 Read/Write 0x Input Register Holding Register 16 bit word 16 bit word Read Only 3x Read/Write 4x Table 9.1 Exception Codes Code Name 30 Meaning .Network layer Fig 9.1 As per our system consider.
Start 31 . If a Poll Program Complete command was issued. but a long duration of time will be required to do so.2 Algorithms Main for Module A : 1. 03 ILLEGAL DATA VALUE 04 SLAVE DEVICE FAILURE 05 ACKNOWLEDGE Table 9. A value contained in the query data field is not an allowable value for the slave. The master can next issue a Poll Program Complete message to determine if processing is completed. The slave has accepted the request and is processing it. this code indicates that no program function preceded it. The data address received in the query is not an allowable address for the slave. This response is returned to prevent a timeout error from occurring in the master.01 ILLEGAL FUNCTION 02 ILLEGAL DATA ADDRESS The function code received in the query is not an allowable action for the slave. An unrecoverable error occurred while the slave was attempting to perform the requested action.
Initialize all variable. Set Global Interrupt Enable pin high. Set Global Interrupt Enable pin high. Start 2. Loop 10. 4. Check sampling rate and log data into eeprom using internal ADC 11. Initialize all Ports. 9. 7. 8. Go to step 9 Main for Module B: 1. 3. Init Timer0. Initialize ADC. Loop 10. 9. 5. Initialize ADC.2. Initialize all Ports.1 Start and 1 Stop bit. 6.no Parity. 3. Initialize UART for Baud rate 9600. Enable USART_RXC Interrupt. Initialize UART for Baud rate 9600. Initialize all variable. no Parity. Check sampling rate and log data into eeprom using internal ADC 32 . 7. 6. 4. Init Timer0. 8. Enable USART_RXC Interrupt. 1 Start and 1 Stop bit. 5.
Initialize all variable. count = count +1 7.5msec 8. 8. 5. Start 2.1 Start and 1 Stop bit. Loop 9. set interrupt enable ISR-Transmission COMPLETE 1. Go to step 9 ISR-RECIEVED COMPLETE 1. Enable USART_RXC Interrupt.no Parity. Set Global Interrupt Enable pin high. 6. 7. clear interrupt enable 2. Go to step 9 Main for Module C 1. 3. received byte[count] = received byte 6. Init Timer0. Initialize all Ports. Initialize UART for Baud rate 9600. initialize timer for 10usec 4. enable timer interrupt 5. disable USTART complete 3. 4. set delay count for 3. Clear interrupt enable 33 .11.
then no of bytes received = count else go to step 7 6. then go to step4 else go to step 6 34 . if count=0. if delay count2=0 then delay counter OFF else delay count 2=delay count2 . 3. Send interrupts enable flag. 8. Preset counter. Clear interrupt enable 2. if first received byte  = slave id a) Call updateQue() b) Enable USART transmission complete interrupt c) Transmit Que d) Current = 1 7. Current = 0 2.1 4. if delay count!=0. UpdateQue 1. Que(0) = slave id 3. ISR-Timer0 1. Set interrupt enable. If Current= Byte to send then go to step 3 Else transmit que[current++].go ot step 4. Disable transmit complete interrupt TIMER 0 interrupt enable 4. If login.1 Go to step 7 5.2. then delay count= delay count . if delay counter ON go to step 3 3.
return STATE DIAGRAMs UpdateQue() Whenever Responding to any query wile updating Queue of Response frame it may be Exception or Normal Response. if exception a) Que(1) = 80Hex + received byte  b) Que(2) = Exception code c) byte to send=3 d) return 6.4. if password wrong a) send exception 4 b) return 7. Que(1) = received byte  8. Check if exception 5. 35 . serve functions 9.
2 : Modbus Transaction diagram. Function 1 ENTR MB Server receives mb_req_pdu 36 NO Function code Starting ExceptionCode=04 Address & Quantity of Registers Server ExceptionCode=02 0x0001≤quantity of Registers ≤ Sends mb_rsp YES Request MB Exit processing ExceptionCode=01 NO YES YES MB Server Sends mb_exception_rsp OK ExceptionCode=03 NO 0x007D .Figure 9.
NO YES ReadDiscreteOutp Figure 9.3 : Read Coil state diagram Function 2 ENTR MB Server receives mb_req_pdu 37 NO Function code Starting ExceptionCode=04 Address & Quantity of Registers ExceptionCode=01 Server ExceptionCode=02 0x0001≤quantity of Registers ≤ Sends mb_rsp YES Request MB Exit processing NO YES YES MB Server Sends mb_exception_rsp OK ExceptionCode=03 NO 0x007D .
YES NO Read Discrete Inputs Figure 9.4 : Read Discrete Inputs state diagram Function 3 ENTR MB Server receives mb_req_pdu NO ExceptionCode=01 Function code 38 YES 0x0001≤quantity of Registers ≤ Starting ExceptionCode=04 Address & Quantity of Registers Server ExceptionCode=02 0x007D Request MB Exit processingSends mb_rsp YES NO YES YES MB Server Sends mb_exception_rsp OK ExceptionCode=03 NO .
5 : Read Holding Register state diagram Function 4 39 .NO ReadMultipleRegister Figure 9.
6 Function 5 40 YES .Fig 9.
7 : Write Single Output state diagram Function 6 41 .ENTR MB Server receives mb_req_pdu NO ExceptionCode=01 Function code YES NO 0x0001≤quantity of Registers ≤ 0x007D ExceptionCode=03 YES NO ExceptionCode=02 Starting Address & Quantity of Registers OK YES Request processing NO ExceptionCode=01 WriteSingleOutput YES MB Server Sends mb_rsp MB Server Sends mb_exception_rsp Exit Figure 9.
n.8 : Write Single Register state diagram Data address allotment Module A : s. Task 1 Enter passwod Data model Holding Register 42 Access R/W Start address 400020 Ending address 400024 .ENTR MB Server receives mb_req_pdu NO ExceptionCode=01 Function code YES NO ExceptionCode=03 0x0001≤quantity of Registers ≤ 0x007D YES Starting Address & Quantity of Registers OK NO ExceptionCode=02 YES Request processing NO ExceptionCode=04 WriteSingleRegister YES MB Server Sends mb_rsp MB Server Sends mb_exception_rsp Exit Figure 9.
valid loggs 8 Access nth log 9 Choose unit Module B : s. valid loggs 8 Access nth log 9 Read unit 10 Scaling Factor Data model Holding Register Input Coil Output coil Input Register Holding Register Access R/W R/O R/W R/O R/W Start address 410020 110001 010010 310001 410100 410100 410101 410102 010001 310002 311000 313002 312000 Ending address 410024 410102 Output coil Input Register Input Register Input Register Input Register Table 9.n.4 R/W R/O R/O R/O R/O 314999 Module C: s.2 Login Status 3 Logoff 4 Current data 5 Sample rate Hour Minute Seconds Retrieve logged 6 data 7 No. Task Data model Holding Register Input Coil Start Access address R/W R/O 43 420020 120001 Ending address 40024 1 Enter passwod 2 Login Status . 1 2 3 4 Task Enter passwod Login Status Logoff Current data Input Coil Output coil Input Register Holding Register R/O R/W R/O R/W 100001 000010 300001 400100 400100 400101 400102 000001 300002 301000 400002 400102 Output coil Input Register Input Register Holding Register Table 9.n.3 R/W R/O R/O R/w 304999 5 Sample rate Hour Minute Seconds Retrieve logged 6 data 7 No.
UART: UBRR Settings for 3. Ref:Page166 Table 69 AtMega32 datasheet . Fclk = 3.8K =100uSec.3 Logoff 4 Buzzer 5 LEDs Output coil R/W Output coil R/W Output coil R/W Table 9.6864MHz crystal.6864MHz/8=460. Delay count for Time Out: MODBUS Message RTU Framing A MODBUS message is placed by the transmitting device into a frame that has a known beginning and ending point. Resultant clock source after multiplier = Fcrystal/8.8KHz. TCNT0 = 210. 44 . Resultant time=(256-TCNT0)/Fclk =46/460. This allows devices that receive a new frame to begin at the start of the message. and to know when the message is completed.5 20001 20020 20100 20102 Calculations: Timer 0 interrupt for 100uS: TCCR0 = 0x02.4K baud rate.for 0% error up to 230. Partial messages must be detected and errors must be set as a result.
5 msec with help of 100usec Interrupt popping out . In the following sections. message frames are separated by a silent interval of at least 3. In 9600 Baud rate each bit takes 1/9600 seconds to transmit.In RTU mode.5mSec. Which is time taken for transmitting 1 char so for 3. Fig 9.we require 3.5 char time taken will be=10*3. about 9600 baud rate. For 3.5.5m/100u=35 as Delay count. For whole frame (Normal)= 1 start+1 stop+8 data bits=10bits=> So require 10*1/9600 seconds.5 character times.9 Specifically. So .5/9600=3. SCADA Design: 45 . this time interval is called t3.
While designing there are many free SCADA’s available to use with MODBUS like-> Modscan32. Logoff. wrong password.6 (Master) & very useful Docklight. At the last. SimplyModbus6.3. First of all we tried with Docklight Wrong Id. 46 .SCADA usually starts with login process and after that continuously monitor for expected information. password ….
Else ask for password. 3. if login then continuously monitor for current reading. Unless right one is not entered. In Back End. it will monitor for trigger point and take accordingly action. 10. 2. Check login status.Expected GUI ( Font end) under VB2008 Algorithm followed-> 1. Select device from user. APPLICATIONS 47 . Generate slave ID accordingly.
one stationary and one pushed towards the other. electricity. having reciprocating weights in the thousands of pounds. press forges work slowly by applying continuous pressure or force. as compared to drop-hammer forging. which compresses the part. Press forging is variation of drop-hammer forging.html 48 . During the process. is its ability to deform the complete work piece MODBUS Pc based SCADA 2 3 2 4 8 5 Generic Device Temperatur e Module Pressure sensor & Conditioning Over RS485 Vin (condition: 0v<Vin<5v) Conversion Factor Process status GND Fig 10. the material is slowly condensed into a shape by increasing pressure. These hammers are large. industrial forging is done either with presses or with hammers powered by compressed air.1 Press Forging Beryllium Copper Billet: http://www.com/index. hydraulics or steam. The main advantage of press forging.• • • • process control Factory floor automation Manufacturing process Industrial process automation Industrial process automation: Press Forging Press forging Forging is one of the oldest known metalworking processes In modern times.freedomalloysusa. There are two dies. Press forging is an operation characterized by the process of deformation which consists of a lot of heating and cooling. Unlike drop-hammer forging.
It should be noted that production input billet casting is the beginning point of the manufacturing process which eventually yields the various wrought forms of beryllium copper. C82500 BeCu Cast Electronic Component Beryllium copper application: Beryllium copper strip alloys have historically been specified in electronic connector applications in an impressive array of telecommunications. computer.TESTING: Communication 49 . 11. Undersea fiber optic cable repeater housings and their associated components have been specified in beryllium copper for many years. high strength. Beryllium copper rod is utilized to produce certain machined connector designs and beryllium copper casting alloys are specified for intricate miniature investment cast connectors. for an extended service life measured in decades. These beryllium copper housing assemblies (wrought and cast components) must perform flawlessly. in the harsh deep water marine environment of the world’s oceans. beryllium copper’s special combination of corrosion resistance. and durability characteristics match the severe operational requirements. Obviously. and automotive electronics applications.
1.*For all serial communication purpose DOCKLIGHT Ver. RS232 Driver Implementation: • Circuit tested on bread board and following PCB is also tested.6 s/w used. • Serial Communication with pc 1)First part.100 bytes Sent from Microcontroller and successfully received on PC 50 . echo of transmitted pattern obtained on PC 2)Second part. RXD & TXD pin shorted.
51 . Implemented on breadboard and tested .RS485 Driver Implementation: • Circuit Design & PCB: Circuit tested on bread board and following PCB is also tested. • Serial Communication with pc as full duplex Both PCB’s from Fig are used. so that 100 bytes sent from controller received on PC Driver circuitry for Buzzer Circuit designed resistances values were found out.verified on multisim . • Serial Communication with pc as half duplex Using 2nd PCB in Fig Transmission lines are shorted so as to get back echo on PC. one for Master side and another for slave side.Where buzzer Load impedance found out equal to 5kohm.
While implementing Timer on timer0 using 2 LED’s connected to 2 pin and implementing toggling algorithem timer of 100usec was verified. SCADA testing: 52 . For that LM35 and its signal conditioning circuit is used.3k R2 R3 47k BC547BP Q1 390 Temperature sensing: LM35 Using internal ADC of controller temperature is observed on PC.XMM1 VCC 5V XMM2 R1 4.
SCADA tested using Modscan32. 12.exe a freeware SCADA.FUTURE SCOPE 53 .
• We have implemented only 6 functions.• We have used 4 wire interface for implementing RS485 . • There are two types of modes of MODBUS one is RTU and other is ASKII. Instead of that we can make use of 2 wire interface. We can implement ASKII mode also. But for that we have to define directional logic which is necessary for that system interface. can be upgraded to fully functional DCS. we have implemented RTU mode. • For fully fledged system we have to consider effect of “Grounding and Isolation” 54 .
2nd Edition. BIBLOGRAPHY BOOKS [Boye] Electronic Devices and Circuit Theory. Gadre [Dhan] APPLICATION NOTES *Modicon.02 Modicon Modbus Protocol Reference Guide PI–MBUS–300 Rev.com [AN001] [AN002] [AN003] MODBUS APPLICATION PROTOCOL SPECIFICATION V1. Ltd. Jan Axleson Programming and customizing the AVR microcontroller-Dhananjay V. 8th Edition. Muhammad Mazidi Pearson Education [JanS] Serial Port Complete Penram International Pvt.13.1b MODBUS over Serial LineSpecification and Implementation Guide V1. Prentice Hall India [Mazi] The 8051 Microcontroller and Embedded Systems 2nd Edition.Robert Boylestad. J *Texas Instruments [SLLA272B] The RS-485 Design Guide February 2008–Revised May 2008 *Maxim-IC [AN1063] [AN736] Microcontroller Recognizes Addresses in RS-485 Systems RS-485 (EIA/TIA-485) Differential Data Transmission System Basics *Analog Devices [AN960] RS-485/RS-422 Circuit Implementation Guide by Hein Marais 55 .
the most Significant byte is sent first. APPENDIX MODBUS @ The following figure gives a general representation of MODBUS serial communication stack compared to the 7 layers of the OSI model with respect to our system. • 56 .. Fig 14. This means that when a numerical quantity larger than a single byte is transmitted. MODBUS data model MODBUS bases its data model on a series of tables that have distinguishing characteristics.1 Application layer • Data Encoding MODBUS uses a ‘big-Endean’ representation for addresses and data items.14.
1 Data link layer: 1) MODBUS frame description The MODBUS protocol defined a simple protocol data unit (PDU) independent of the underlying communication layers.The four primary tables are: Primary table Object type Type of access ReadWrite Comments coils Single bit This type of data can be alterable by an application program This type of data can be provided by an I/O system Input registers 16-bit word Read-Only Holding registers Discrete Input 16-bit word ReadWrite Single bit Read-Only This type of data can be alterable by an application program This type of data can be provided by an I/O system Table 14. The mapping of MODBUS protocol on specific buses or network can introduce some additional fields on the application data unit (ADU). General MODBUS frame: ADU ADDITIONAL ADDRESSES FUNCTION CODE DATA ERROR CHECK 57 .
It determines how information is packed into the message fields and decoded. (128 – 255 reserved for exception responses). It defines the bit contents of message fields transmitted serially on the line.3 3) The two serial Transmission Modes Two different serial transmission modes are defined: The RTU mode and the ASCII mode.PDU for serial line communication = 253 bytes Server address (1 byte) .PDU Fig 14.2 The function code 1 byte. Max size: RS485 ADU = 256 bytes. CRC (2 bytes) 2) MODBUS addressing rules: Fig 14. The transmission mode (and serial port parameters) must be the same for all devices on a MODBUS Serial Line. 58 .
General 4 wire topology. Fig 14.4 59 .
5 Table 15.CRC CALCULATIONS Fig 14.1: COMPONENT LIST AND BILL SR NO 1 2 COMPONENT IC 7805 IC ATMEGA32 ICMAX232 ICMAX485 ICLM35 SPECIFICATIONS 5V regulator 40-pin DIP 16-pin-DIP 8-pin DIP TEMPERATURE 60 QTY 3 3 1 8 1 COST 18 435 25 320 40 (Rs) .
25watts 680ohm0.1k precesion 1000uF.25watt 15 Kohm 0.25 0.25V.25watts 20ohm0. electrolytic 0. electrolytic 61 2 3 3 8 1 6 1 3 2 16 12 2 1 2 4 1 4 4 1 2 1 1 4 10 2 20 6 12 8 9 12 1 24 2 16 3 0.25V.25watts 47Kohm0.5 1 0.22pF ceramic 2200uF.SENSOR ICLM324 3 IC base Quad OpAmp 16 pin dip 40 pin dip 8 pin dip 4 Relamet connector 6 pin 2 pin 5 6 7 8 9 Transistor Toggle switch Zener diode Diode Resistors BC547 SPDT 5.01 uF. Variable Pot Capacitors 10k.5 0.25watts 10.25 8 6 2 4 10 .electrolytic 100 uF.7 kohm 0.25watts 402ohm0.25 1 1 0.25watt 4.25 watts 120ohm0.1 V 1N4007 1K ohm 0.25watt 10 kohm 0. 11.electrolytic 10uF 25V.
14 15 16 Bur strips 2 pin push button LEDs PCB Serial cable 40 pin 3 1 18 2 10 3mm 10 Plug socket DB9 1 75 17. 13. 18. DB 9 socket Crystal casing BUZZER Female 3. 20.12.6864Mhz 2 1 20 15 3V-24V TOTAL 1 21 15. CIRCUIT DIAGRAM 62 . 19.
8 K LED 1 .8 K LS1 b u zzer 1 2 3 4 5 6 7 8 9 10 11 Y 1 C R Y S TA L R x D _ in T x D _ in 12 13 14 15 16 17 C 1 18 19 20 21 U 1 P P P P P P P P B B B B B B B B 0 1 2 3 4 5 6 7 /XC K 0 /T 0 P /T 1 P /IN T 2 /A IN 0 P /O C 0 /A IN 1 P P /S S P /M O S I P /M IS O P /S C K A A A A A A A A 0 1 2 3 4 5 6 7 /A /A /A /A /A /A /A /A D D D D D D D D C C C C C C C C 0 1 2 3 4 5 6 7 40 39 38 37 36 35 34 33 32 31 30 1 .1 u F LED LED LED bu zze r R 2 2 47 Kohm 5V 1 BC 547 3 C 3 0 .8 K 1 .MODULE C 5V 1 .8 K LED LED 5V C 3 0 .1 u F R O A B 1 6 7 R x D _ in A R x _ in B R x _ in 0-5V 63 .8 K 400 ohm 1 2 BU ZZER 1 .1 u F R ESET VC C G N D XTA L2 XTA L1 P D 0 /R x D P D 1 /T x D P D 2 /IN T 0 P D 3 /IN T 1 P P P P D D D D 4 5 6 7 /O C 1 B /O C 1 A /IC P 1 /O C 2 D IP 4 0 A re f G N D AVC C 22pF C 2 P C 7 /T O S C 2 P C 6 /T O S C 1 P C 5 /TC I PC 4TD O P C 3 /T M S P C 2 /T C K P C 1 /S D A P C 0 /S C L 29 28 27 26 25 24 23 22 5V C 3 0 .8 K 1 .1 u F U 3 T x D _ in 4 2 3 8 D I R E D E +VC C M A X485 JP1 A T x _ in B T x _ in A R x _ in B R x _ in 1 2 3 4 4 H EAD ER R O A B 1 6 7 A T x _ in B T x _ in 22pF U 4 4 2 3 8 D I R E D E +VC C M A X485 5v C 3 0 .
Fig 15.1 u F R ESET VC C G N D XTA L2 XTA L1 P D 0 /R x D P D 1 /Tx D P D 2 /IN T 0 P D 3 /IN T 1 P P P P D D D D 4 5 6 7 /O C 1 B /O C 1 A /IC P 1 /O C 2 D IP 4 0 A re f G N D AVC C 32 31 30 C 1 C R Y S TAL 22pF P C 7 /T O S C 2 P C 6 /T O S C 1 P C 5 /TC I PC 4TD O P C 3 /TM S P C 2 /TC K P C 1 /S D A P C 0 /S C L 2 2 2 2 2 2 9 8 7 6 5 4 5V T x D _ in 4 2 3 8 5V U 6 D I R E D E M A X485 R O A B 1 6 7 C 3 0 .1 u F 5V R _ in 2 1 C 3 C 2 22pF 0 .1 u F 8 U 6 D I R E D E M A X485 R O A B 1 6 7 +VC C 64 .1 MODULE B 5V 5V 5V R 1 C 3 0 .1 u F 8 U 3A 1 LM 358 4 C 1 U 1 1 2 3 4 5V 5 6 7 8 R _ in 9 10 11 Y 1 R x D _ in T x D _ in 12 13 14 15 16 17 1 1 2 2 8 9 0 1 P P P P P P P P B B B B B B B B 0 1 2 3 4 5 6 7 /XC K 0 /T0 P /T1 P /IN T 2 /A IN 0 P /O C 0 /A IN 1 P P /S S P /M O S I P /M IS O P /S C K A A A A A A A A 0 1 2 3 4 5 6 7 /A /A /A /A /A /A /A /A D D D D D D D D C C C C C C C C 0 1 2 3 4 5 6 7 4 3 3 3 3 3 3 3 0 9 8 7 6 5 4 3 2 1 5K ohm R 1 + 3 2 1K ohm R c 2 R a 3 JP1 C 3 0 .1 u F +VC C 23 22 4 2 3 C 3 0 .0 1 u F A T x _ in B T x _ in A R x _ in B R x _ in 1 2 3 4 A T x _ in B T x _ in R x D _ in A R x _ in B R x _ in 1 5V 3 R b C 3 0 .
1 u F 2 VO U T U 4 VS+ 1 5V 5V R 1 C 3 0 .1 u F 8 D I R E D E +VC C M A X485 R O A B 1 6 7 U 6 D I R E D E +VC C M A X485 R O A B 1 6 7 C 3 0 .0 1 u F A T x _ in B T x _ in A R x _ in B R x _ in 1 2 3 4 A T x _ in B T x _ in R x D _ in A R x _ in B R x _ in 3 5V 5V P C 7 /T O S C 2 P C 6 /T O S C 1 P C 5 /TC I PC 4TD O P C 3 /TM S P C 2 /TC K P C 1 /S D A P C 0 /S C L 2 2 2 2 2 2 9 8 7 6 5 4 T x D _ in 4 2 3 8 5V U 6 4 2 3 C 3 0 .1 u F C 3 0 .1 u F R _ in 2 U 1 1 2 3 4 5V 5 6 7 8 R _ in 9 10 11 Y 1 R x D _ in T x D _ in 12 13 14 15 16 17 1 1 2 2 8 9 0 1 P P P P P P P P B B B B B B B B 0 1 2 3 4 5 6 7 /XC K 0 /T0 P /T1 P /IN T 2 /A IN 0 P /O C 0 /A IN 1 P P /S S P /M O S I P /M IS O P /S C K A A A A A A A A 0 1 2 3 4 5 6 7 /A /A /A /A /A /A /A /A D D D D D D D D C C C C C C C C 0 1 2 3 4 5 6 7 1 C 3 C 2 22pF 0 .1 u F R ESET VC C G N D XTA L2 XTA L1 P D 0 /R x D P D 1 /Tx D P D 2 /IN T 0 P D 3 /IN T 1 P P P P D D D D 4 5 6 7 /O C 1 B /O C 1 A /IC P 1 /O C 2 D IP 4 0 A re f G N D AVC C 32 31 30 C 1 22pF C R Y S TAL 23 22 65 .Fig 15.2 MODULE A 5V 0 .1 u F 8 U 3A 1 LM 358 C 1 4 L M 3 5 /T O + 3 2 1K ohm R c 2 R a 4 3 3 3 3 3 3 3 0 9 8 7 6 5 4 3 R 3 R b 5V 1 JP1 C 3 0 .
3 Master: Module D 9 9 5 5 4 4 8 3 3 8 7 2 2 7 6 1 1 R xD TxD _out R xD _out 8 4 2 3 705 U 7 D I R E D E +VC C R 2 M A X 4 8 5 /S O R xD _out TxD 1 0 m ic r o F 1 3 4 5 2 6 13 8 11 10 U 2 R 1 IN R 2 IN T 1 IN T 2 IN C C C C V V + 12+ 2+ U 8 4 2 3 8 5V D I R E D E +VC C M A X 4 8 5 /S O VC C 705 R O A B 1 6 7 TxD A R x _ in 120 R 1 R 2 T1 T2 O O O O U U U U T T T T 12 9 14 7 JP2 R xD TxD _out 5V A R x _ in B R x _ in A T x _ in B T x _ in 1 2 3 4 4 H EAD ER R O A B 1 6 7 A T x _ in 120 B T x _ in 6 VC C 5V 1 0 m ic r o F 705 1 0 m ic r o F M A X232 1 0 m ic r o F B R x _ in RS485 to RS232 conversion on master side(PC) 66 .Fig 15.
Fig 15.4 67 .
Layout of basic Prototype board 68 .
DATA SHEETS 70 .16.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.