Team:SJTU-BioX-Shanghai/Project/Software

From 2013.igem.org

(Difference between revisions)
(Programme)
(Programme)
 
(4 intermediate revisions not shown)
Line 6: Line 6:
<!----------------------------------------------------从这里开始写wiki--------------------------------->
<!----------------------------------------------------从这里开始写wiki--------------------------------->
=Start Point=
=Start Point=
-
[[image:Black_box.png|220px|right]]
+
[[image:13SJTU_BB_lumpng.png|220px|right]]
-
For the sack of encapsulating the project in a '''BLACK BOX''', we write a user-friendly interface as the '''Start Point'''. The software provide the orignal inputs for the whole modification system which affect the outputs of a metabolic circle or system. In our project, biological tools and hardwares are encapsulated into a '''BLACK BOX''', which makes users only concern about inputs. The inputs can be generated from '''modelling data, emppirical hypothesis''' and many other ways. Once the values have been transferred to '''The Box''', you can walk away and wait for the results. Such design embodies the superiority of engineering: '''hommization, serviceability and productibility. '''
+
For the sack of encapsulating the project in a '''BLACK BOX''', we writed a user-friendly interface as the '''Start Point'''. The software provides the orignal inputs for the whole modification system which affects the outputs of a metabolic circle or system. In our project, biological tools and hardwares are encapsulated into a '''BLACK BOX''', which makes users only concern about inputs. The inputs can be generated from '''modelling data, emppirical hypothesis''' and many other ways. Once the values have been transferred to '''The Box''', you can just walk away and wait for the results. Such design embodies the superiority of engineering: '''hommization, serviceability and productibility. '''
----
----
[[image:13SJTU_usb-com.png|310px|left]]
[[image:13SJTU_usb-com.png|310px|left]]
=How to Start=
=How to Start=
-
First of all, you must have a PC to run the software. Also, a '''USB-COM line''' is needed, because we use serial port as our communication port. In fact, USB should be in our first place for its universality in most place, but Drivers should be written to apply USB port, which is nearly impossible for us to finish it. In addition, serial ports are widely used in '''PC-MCU communication''' for its easy operation.  
+
First of all, you must have a PC to run the software. Also, a '''USB-COM line''' is needed, because we use serial ports as our communication port. In fact, USB should be in our first place for its universality in most place, but Drivers should be written to apply USB port, which is nearly impossible for us to finish it. In addition, serial ports are widely used in '''PC-MCU communication''' for its easy operation.  
After linking PC with devices, set the serial port as '''one of COM1 to COM5'''. Then, open the programme and wait for inputs.  
After linking PC with devices, set the serial port as '''one of COM1 to COM5'''. Then, open the programme and wait for inputs.  
Line 19: Line 19:
=Programme=
=Programme=
[[image:13SJTU_UI.jpg|340px|right]]
[[image:13SJTU_UI.jpg|340px|right]]
-
When the UI interface has been launched, there are eight blank and two button on the window. The eight blanks can be filled  by number from 0 to 255, which corresponding to '''0x00 to 0xff in HEX'''. Every LED has '''256''' kinds of light intensity, which provide enough choose for adjust expression of gene.
+
When the UI interface has been launched, there are eight blanks and two buttons on the window. The eight blanks can be filled  by number from 0 to 255, which corresponding to '''0x00 to 0xff in HEX'''. Each LED can radiate '''256''' kinds of light intensity, which provides enough choices for adjusting expression of genes.
-
Then push the send button, the data will be transferred to devices though the '''USB-COM line'''. Once the '''MCU(Microprogrammed Control Unit)''' recieves the data, it transfrom the value in '''HEX to voltage''' on each output port, which decide the light intensity of each LED.
+
Then push the send button, the data will be transferred to devices though the '''USB-COM line'''. Once the '''MCU(Microprogrammed Control Unit)''' recieves the data, it transfroms the value in '''HEX to voltage''' on each output port, which decides the light intensity of each LED.
-
There is a '''perfect linear relationship''' between value in UI and light intensity with LEDs, the result is show in [https://2013.igem.org/Team:SJTU-BioX-Shanghai/Results/Test/Luminous_System#Linear_Relation '''result parts''']
+
There is a '''perfect linear relationship''' between value in UI and light intensity with LEDs, the result is shown in [https://2013.igem.org/Team:SJTU-BioX-Shanghai/Results/Test/Luminous_System#Linear_Relation '''result parts''']
         private void button1_Click(object sender, EventArgs e) //Push the send button
         private void button1_Click(object sender, EventArgs e) //Push the send button
Line 46: Line 46:
===What is in MCU===
===What is in MCU===
-
MCU part is a special part in our project, we want hide it from users. But for the persuasion of the whole project, we will expain the details.[http://igem.bio-x.cn/wiki/Team:SJTU-BioX-Shanghai/Project/Luminous_device/Device#The_Heart-MCU '''see also device''']
+
MCU part is a special part in our project, and we want to hide it from users. But for the persuasion of the whole project, we will expain the details.[https://2013.igem.org/Team:SJTU-BioX-Shanghai/Project/Luminous_device/Device#The_Heart-MCU '''see also device''']
[[image:13SJTU_MCU.jpg|600px|right]]
[[image:13SJTU_MCU.jpg|600px|right]]
-
MCU use '''PWM(Pulse-width modulation)''' theory to control the light intensity of each LED. The main advantage of PWM is that power loss in the switching devices is very low. When a switch is off there is practically no current, and when it is on, there is almost no voltage drop across the switch. Power loss, being the product of voltage and current, is thus in both cases close to zero. PWM also works well with digital controls, which, because of their on/off nature, can easily set the needed duty cycle.
+
MCU uses '''PWM(Pulse-width modulation)''' theory to control the light intensity of each LED. The main advantage of PWM is that power loss in the switching devices is very low. When a switch is off there is practically no current; and when it is on, there is almost no voltage drop across the switch. Power loss, being the product of voltage and current, is thus in both cases close to zero. PWM also works well with digital controls, which, because of their on/off nature, can easily set the needed duty cycle.
'''PWM signal consists of two parts:'''
'''PWM signal consists of two parts:'''

Latest revision as of 02:52, 29 October 2013

Start Point

13SJTU BB lumpng.png

For the sack of encapsulating the project in a BLACK BOX, we writed a user-friendly interface as the Start Point. The software provides the orignal inputs for the whole modification system which affects the outputs of a metabolic circle or system. In our project, biological tools and hardwares are encapsulated into a BLACK BOX, which makes users only concern about inputs. The inputs can be generated from modelling data, emppirical hypothesis and many other ways. Once the values have been transferred to The Box, you can just walk away and wait for the results. Such design embodies the superiority of engineering: hommization, serviceability and productibility.


13SJTU usb-com.png

How to Start

First of all, you must have a PC to run the software. Also, a USB-COM line is needed, because we use serial ports as our communication port. In fact, USB should be in our first place for its universality in most place, but Drivers should be written to apply USB port, which is nearly impossible for us to finish it. In addition, serial ports are widely used in PC-MCU communication for its easy operation.

After linking PC with devices, set the serial port as one of COM1 to COM5. Then, open the programme and wait for inputs.


Programme

13SJTU UI.jpg

When the UI interface has been launched, there are eight blanks and two buttons on the window. The eight blanks can be filled by number from 0 to 255, which corresponding to 0x00 to 0xff in HEX. Each LED can radiate 256 kinds of light intensity, which provides enough choices for adjusting expression of genes.

Then push the send button, the data will be transferred to devices though the USB-COM line. Once the MCU(Microprogrammed Control Unit) recieves the data, it transfroms the value in HEX to voltage on each output port, which decides the light intensity of each LED.

There is a perfect linear relationship between value in UI and light intensity with LEDs, the result is shown in result parts

       private void button1_Click(object sender, EventArgs e) //Push the send button
       {
           if (!IsConnect) //Is there any connect?
           {
               MessageBox.Show("Please choose a COM port!");
           }
           byte[] cmd1 = new byte[4]; //Set a temporary array
           try
           {
               cmd1[0] = 0xf0; cmd1[1] = 0x00; //Start signal and light number(here is 0)
               cmd1[2] = Convert.ToByte(numericUpDown1.Value); //Get the light intensity value
               cmd1[3] = 0xff; //End signal
               PortSend(cmd1); //Send data
           }
           catch (System.Exception ex) //Is there any error?
           {
               MessageBox.Show(ex.ToString());
           }

What is in MCU

MCU part is a special part in our project, and we want to hide it from users. But for the persuasion of the whole project, we will expain the details.see also device

13SJTU MCU.jpg

MCU uses PWM(Pulse-width modulation) theory to control the light intensity of each LED. The main advantage of PWM is that power loss in the switching devices is very low. When a switch is off there is practically no current; and when it is on, there is almost no voltage drop across the switch. Power loss, being the product of voltage and current, is thus in both cases close to zero. PWM also works well with digital controls, which, because of their on/off nature, can easily set the needed duty cycle.

PWM signal consists of two parts:

Period

Time of each pulse.

5Hz signal has periods of 1/5 second = 0.2 second.

Duty cycle

The percentage of period the PWM signal is On or high.

A period of 0.2 second and 10%

duty cycle = 0.10 * 0.2 second = 0.02 seconds.

If the signal has a low voltage of 0 and a high voltage of 10 volts, a 50% duty cycle produces an average of 5 volts, a 10% duty cycle produces an average of 1 volt.


LED under PWM control

Msp43017.png