You are on page 1of 7

Embedded Systems Practical Report

Group 4

Scenario A

Jack Collings
Daniel Pot
Charlie Dey
Harvey Walker
Nicole McConnell
Introduction

The purpose of the experiment was to write code for a chemical batch reactor system that’s
comprising a heated mixing vessel with input lines and then finally a delivery line for the
finished product. The code will be used to make the following actions completed in a certain
order and within a certain time.

This is laid out to be completed in a certain format so that the process carries out in a very
particular way this is to ensure it is carried out in the correct steps.
The coding will need very certain lines to make sure it works correctly, and it will be needed
and tested on the rabbit board, to ensure it runs smoothly.
This assignment is carried out in a group and certain people were assigned to code the
chemical batch reactor and some wrote the report.

Dynamic C is a good place for coding, this is because it is easy to use and is very easy to
navigate, also when using the rabbit board is easy to stream the coding from the program to
the rabbit board, this means the simplicity of the program gives it the advantage on other
things and other coding platforms, for people who have not got experience in coding will
feel a lot more comfortable within this program.

The Rabbit BL2000 is good for streaming the coding to, this creates a simulation for any kind
of process, or any kind of process. For example, you will be able to test run the chemical
batch reactor with interaction so you can make sure the coding is correct, this means instead
of having to use it in an actual situation you can complete the simulation without anything
being at risk.

List of specific inputs and outputs


These are the lists of specific inputs and outputs needed within the coding, these certain
lines of coding that will then be used on the rabbit BL2000 board, when the coding is being
carried out all of these will be needed to ensure it works correctly.
When the coding is writing out if these certain inputs and outputs are correctly writing out
the chemical batch reactor should work fine.
Also, these are the potentiometers that will simulate the analogue inputs.

Analogue inputs (2):

 Reactor level

 Reactor temperature

Digital inputs (2):

 Start cycle button

 Emergency stop button

Digital outputs (5)

 Component A input valve (V1)

 Component B input valve (V2)

 Product delivery valve (V3)

 Heater on/off

 Mixer on/off

The potentiometers on adc4 and adc5 will simulate each of the analogue inputs, switches
IN7 and IN4 will simulate the digital inputs and LEDs 0-4 will simulate the digital outputs.

For example, a 100% input value on adc4 (a value of maybe around 950) could represent,
say, 100 ̊C, switch IN7 could represent the emergency stop button and the state of LED 0
could be valve 1 open (on) or valve 1 closed (off).

Note that the emergency stop being initiated MUST override the normal operating
procedure so use cooperative multitasking (co-statements etc.)
These are sourced from within the assignment brief

Diagrams and flowcharts

This is the final code that was completed using the DynamicC software and was proven to
work on a rabbit board.
Flow chart for the program

IN7 On - Start

IN6 On?
Yes
No

LED 0 on

RV1=25%
No
Yes

LED 0 off

LED 4 on

LED 1 on

LED 4 off

RV1=75%
LED 2 off
No
Yes Yes

LED 1 off
No
RV2=70%

LED 3 on

YesRV2=70% No LED 3 off


LED 2 on
Description of the operation

the operation will be carried out in a certain process first of all you will wait for the start
cycle button to be pressed, this will cause the coding to start and for the operation to be
carried out. Next it will add the component A until the level inside the vessel reaches 25%,
then when it reaches to 25% it will stop adding the component, this stops automatically so it
does not have to much of the certain component within it. Next component B will be added
until the level reaches 75% then it will stop adding the component automatically this is to
stop overflow and the mixing level is accurate, so no issues are caused. After it has all be
added then the heating of the mixture will start, this only starts after it is all at the correct
level. When the temperature of the mixture reaches 70*c the reaction will be completed,
then the heating is then finished it will be turned off to stop it from being heated to the
point where it is not needed then the valve will open this is so the product can be delivered.
When the vessel is empty, this will cause the mixer to turn off and close the valve of delivery
this is to ensure on the next process it is ready. Then after all this is completed ready for the
next batch cycle.

Cooperative multitasking, also referred to as non-pre-emptive multitasking, is a style of


computer multitasking in which the operating system never initiates a context switch from a
running process to another process. This is used within the coding to ensure it all runs
correctly and stops it from over lapping the coding.
Conclusions

In conclusion to the experiment and tests carried out we believe the coding program used
dynamic C is a very effective tool for simulating processes, it works very well in cooperation
with the rabbit board. The process we wrote out for the chemical batch reactor on dynamic
C worked extremely effectively with the rabbit board with minimal bugs or issues cropping
up.

The only issue that occurred when programming the board was trying to get the emergency
stop feature and the tank emptying feature working without bugging significantly and overall
breaking the program through error codes, confusing the program to act unexpectedly like
opening valves that it shouldn’t be opening or crashing the dynamic C software. Because of
this it was forced to be omitted from the final program. The simulation of the process that
was completed ran correctly without having any flaws on the rabbit board, this shows that
the coding worked well with the rabbit board. The coding used worked correctly and exactly
how we predicted. It was able to carry out the correct process and do the correct actions
that were set out by the brief and pre planned in the flow chart with minimal issues.

At the start he rabbit board took a few times to restart and to cooperate with the coding
program as it failed to communicate with the software a few times, but when we managed
to get it to connect it worked fine without having to restart it at all. Although it did crash a
few times this was more down to bugs in the coding and less so a particular fault in the
board, this can be omitted because of the flawless operation displayed on the final code.

You might also like