Professional Documents
Culture Documents
Embedded Systems Report
Embedded Systems 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.
Reactor level
Reactor temperature
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
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
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.
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.