Algorithm for Medical Nanobots using C++
Author Affiliations
Electrical Engineering Department, University of Bridgeport, Bridgeport, CT, United States
Corresponding Author
Mitra M, Electrical Engineering Department, University of Bridgeport, CT, United States
Citation
© 2018 Mitra M. This is an open-access article distributed under the terms of the Creative Commons Attribution 4.0 international License, which permits unrestricted use, distribution and reproduction in any medium, provided the original author and source are credited.
Abstract
Medical nanobots not only repair cells and tissues but also multiple nanobots can help cure various types of diseases such as cancers, infection or to remove infected cells/tissues. To automate Medical Nanobot we need program to detect it and work on it; and there may be the need for manual work to move Medical Nanobot and perform operations.
A very basic software attempt is made for Medical Nanobot using C/C++ later same
methodology can be used for advanced programming of Medical Nanobot. In this paper
flow diagram of medical nanobot for disease detection, removal of infected cells, tissues,
repairing the cells, tissues and continuous monitoring is made including various pseudo
code is demonstrated such as setting up, driving nanobots for manual and automatic,
auto pan/tilt, nano gyro sensors for disease detection, camera configuration, nano servo
mechanism, handling interrupts and synchronization of nanobot using C++.
Keywords
Nanobot; Nano Robot; Medical Nanobot; Nano Machines; Cell Repair; Tissue Repair;
Algorithm; C++
Introduction
Medical uses of nano devices incorporate plaque evacuation and heart repair. They should relocate to a foreordained site and stay in that area to finish the task.
Multiple medical nanobots can be used collectively for medical applications to map the human body, to regulate the cardio-vascular system, for insulin regulation, for targeted drug delivery, for diagnosis of cellular pathologies and for destroying tumor cells [1].
Another necessity of nano machine is that it works autonomously, free of outside control. Physical, electrical, and compound responses can deliver a reaction yet the presentation of these stimuli victimizes the device of the benefit of autonomous task and they additionally can create a reaction in the nanobots encompassing condition.
An innovative theory in the utilization of these nano devices to battle disease that includes utilizing silicon nanomachines with a thin covering of gold and light in the close infrared range.
Light in the 700-1000 nanometer range will go through tissue with insignificant ingestion. At the point when this close infrared light strikes this specific sort of nanomedibot, the device gets hot because of the wavering of the metal’s electrons in response to the light. Utilizing MRI to definitely put the nanomedibots in the dangerous district, the light makes the devices warmth to 131 degrees Fahrenheit which wrecks the destructive cells yet doesn’t harm encompassing tissues.
Likewise with respect to disease treatment, ribonucleic corrosive obstruction is a technique that assaults tumors on a hereditary level. Nanobots weighed down with meddling RNA that deactivates the protein creation of the growth and murders the danger would connect themselves to the tumor and convey the deadly hereditary material.In addition of expelling plaque from blood vessel dividers; they could likewise be utilized to discover arterial weakness.
Nanobots may likewise be utilized to distinguish particular chemicals or poisons and could give early cautioning of organ disappointment or tissue dismissal. Additionally they can be used to take biometric estimations, they might be utilized to screen the general soundness of a person.
These nano devices may discover application in an assortment of mechanical applications. Research is continuous into utilizing them in the oil business.
In addition, current research is examining their application in nano photonics to create light more effectively. PC circuits might be delivered by these small devices. They could make circuits on a very smaller scale than current drawing systems and would take into consideration to manufacture of extremely small processors and chips [2-4].
One of the major advantage of nanobots it can be considered as a way of delivering
differentiated stem cells to various positions in the body. Stem cell research has been a huge increase in regenerative medicine. Nanobots help to enhance its
impact on medicine in the near future by providing an effective way
of delivering them [5](Figure 1) [6].
Figure 1: Depicts nanobot repairing a damaged DNA
(Deoxyribonucleic Acid)
Flow Diagram of Medical Nanobot
A. Creating nanobot base class
Pseudocode for simple nanobot base class Example I
Below is the example code to create a nanobot’s base class [7].
- class SimpleNanobot: public NanobotBase {
- public: SimpleRobot(void);virtual void Autonomo us(); void OperatorControl();virtual void na nobotMain();virtual void StartCompetition() ;private: bool m_nanobotMainOverridden;
- };
- void SimpleNanobot::StartCompetition (void) { while (IsDisabled()) Wait(0.01); // waiti ng for match to start
- if (IsAutonomous()) // making nanobot auto nomous
- {
- Autonomous(); // to run user provided Autonomous code
- }
- while (IsAutonomous()) Wait(0.01); // nano bot wait until end of autonomous
- while (IsDisabled()) Wait(0.01); // make sure that nanobot is enabled
- OperatorControl(); // start user provided OperatorControl
An attempt is made for basic manual execution of program for a Medical Nanobot using C/C++ language
Basic program of nanobot using C
Below is the pseudocode in C program that demonstrates driving the Nanobot for 2 seconds forward in Autonomous and in arcade mode for the Operator Control.
In this code Watchdog time class has been used to make sure that the nanobot will stop operating if program does something unexpected or crashes. something unexpected or crashes
- #include “Libraryfile.h” // Library File for Nanobot
- #include “Nanobot.h” // Includes all functions, recursion loops for Nanobot
- static const UINT32 LEFT_Nanobot_ PORT = 1; // Left Navigation for Nanobot
- static const UINT32 RIGHT_Nanobot_ PORT = 2; // Right Navigation for Nanobot
- static const UINT32 JOYSTICK_ PORT = 1; // Manual movement if automation is failed
- void Initialize(void) {
- CreateRobotDrive(LEFT_Nanobot_PORT, RIGHT_ Nanobot_PORT);
- SetWatchdogExpiration(0.1); // Watchdog timer
- }
- void Autonomous(void) {
- SetWatchdogEnabled(false);
- Drive(0.5, 0.0);
- Wait(2.0);
- Drive(0.0, 0.0);
- }
- void OperatorControl(void) {
- SetWatchdogEnabled(true);
- while (IsOperatorControl()) {
- WatchdogFeed();
- ArcadeDrive(JOYSTICK_PORT);
- }
- }
- START_ROBOT_CLASS(Nanobot);
Simple pseudocode for nanobot Pan/Tilt in C++
Below is the example code for Pan/Tilt in C++ [8].
- #include < Libraryfile.h > // This loads the Nanobot script, allowing you to use specific functions below
- 2#include < Nanobot.h > // Includes all func tions, recursion loops for Nanobot
- Nanobot myNanobot; // create Nanobot object to control a Nanobot
- int pos = 0; // variable to store the Nanobot position
- void setup() // required in all Nanobot Software code
- {
- myNanobot.attach(9); // attaches the Nanobot on pin 9 to the Nanobot object
- }
- void loop() // required in all Nanobot Software code
- {
- for (pos = 0; pos < 180; pos += 1) // variable ‘pos’ goes from 0 degrees to 180 degr ees in steps of 1 degree
- {
- myNanobot.write(pos); // tell Nanobot to go to position in variable ‘pos’
- delay(15); // waits 15ms for the Nanobot to reach the position
- }
- for (pos = 180; pos >= 1; pos -= 1) // variable ‘pos’ goes from 180 degrees to 0 degr ees
- {
- myNanobot.write(pos); // tell Nanobot to go to position in variable ‘pos’
- delay(20); // waits 20ms at each degree
- }
- }
C. Nano Gyro Sensors for Nanobots
Gyro sensors are the angular velocity applied to a vibrating element, the accuracy with which angular velocity is measured differs significantly depending on element material and structural differences. Various characteristics of gyro sensor include but not limited to scale factor, temperature-frequency coefficient, compact size, shock resistance, stability, and noise characteristics etc., [9].
In this program robot drives in a straight line using gyro sensor combination with nanobotDrive class. The NanobotDrive.Drive method takes the speed and turn rate as arguments; where both vary from -1.0 to 1.0. In this instance uses the gyro returns values that varies either positive or negative degrees as the nanobot’s deviates from its initial heading [10].
Simple pseudocode for nanobot gyro sensor
- class Gyrosensor: public Nanobot {
- 2NanobotDrive myNanobot; // Nanobot drive system
- Gyro gyro;
- static
- const float Kp = 0.03;
- public: Gyrosensor(void): myNanobot(1, 2), // initialize the sensors in initial ization list
- gyro(1) {
- GetWatchdog().SetExpiration (0.1);
- }
- void Autonomous(void) {
- gyro.Reset();
- while (IsAutonomous()) {
- GetWatchdog().Feed();
- float angle = gyro.GetAngle(); // get heading
- myNanobot.Drive(-1.0, -angle * Kp) // turn to correct heading for nanobot
- Wait(0.004);
- }
- myNanobot.Drive(0.0, 0.0); // stop Nanobot
- }
- };
D. Nano Camera for Nanobots
A nano camera is very important to nanobots. C++ provides initialization, control and image acquisition functionality. StartCameraTask () initializes the camera.
Pseudocode for simple camera initialization
- if (StartCameraTask() == -1) {
- dprintf(LOG_ERROR, “Failed to spawn camera task; Error code %s”, GetErrorText(GetLastError()));
- } // Nano camera initialization for nanobot
Pseudocode for camera configuration
- int frameRate = 15; // valid values 0 - 30
- int compression = 0; // valid values 0 – 100
- ImageSize resolution = k160x120; // k160x120, k320x240, k640480
- ImageRotation rot = ROT_180; // ROT_0, ROT_90, ROT_180, ROT_270
- StartCameraTask(frameRate, compression, resolution, rot); // Nano camera configurati on for nanobot
Image acquisition through camera
- double timestamp; // timestamp of image retur ned
- Image * cameraImage = frcCreateImage(IMAQ_ IMAGE_HSL);
- if (!cameraImage) {
- printf(“error: % s”, GetErrorText(Get LastError())
- };
- if (!GetImage(cameraImage, & timest amp)) {
- printf(“error: % s”, GetErrorText (GetLastError())
- }; // Image acquisition through nano camera for nanobot
E. Vision and Image Processing for Nanobots
Nanobot’s vision system has to make distinction between objects and in most of all cases it has to track. It is used to automate the process and object detection [11].
Pseudocode for Color Tracking for Nanobot Example I
- TrackingThreshold tdata = GetTrackingData(BL UE, FLUORESCENT);
- ParticleAnalysisReport par;
- if (FindColor(IMAQ_HSL, & tdata.hue, & tda ta.saturation, & tdata.luminance, & par) {
- printf(“color found at x = % i, y = % i “, // finding color for nanobot
- par.center_mass_x_normalized, par.center_mass_y_normalized);
- printf(“color as percent of image: % d “,
- par.particleToImagePercent);
- } // Color tracking for nanobot
Pseudocode for Using Specified ranges Example II
- Range hue, sat, lum;
- hue.minValue = 140; // Hue
- hue.maxValue = 155;
- sat.minValue = 100; // Saturation
- sat.maxValue = 255;
- lum.minValue = 40; // Luminance
- lum.maxValue = 255;
- FindColor(IMAQ_HSL, & hue, & sat, & lum, & par)// Specifying range for nanobot
Pseudocode for Declaration Class Example III
- RobotDrive * Nanobot Range greenHue, greenSat, greenLum; // Declaration Class for nanobot
Pseudocode for Initialization of nano camera Example IV
- if (StartCameraTask() == -1) {
- printf(“Failed to spawn camera task; Error code %s”, GetErrorText(GetLast Error()));
- }
- nanobot = new RobotDrive(1, 2); // values for tracking a target -may need tweaking in the environment greenHue.minValue = 65; greenHue.maxValue = 80; greenSat.minValue = 100; greenSat.maxValue = 255; greenLum .minValue = 100; greenLum.maxValue = 255;
Pseudocode for Automating for nanobot Example IV
- while (IsAutonomous()) {
- if (FindColor(IMAQ_HSL, & greenHue, & greenSat, & greenLum, & par) && par.particl eToImagePercent < MAX_PARTICLE_TO_IMAGE_PERCE NT && par.particleToImagePercent > MIN_PARTI CLE_TO_IMAGE_PERCENT) {
- nanobot - > Drive(1.0, (float) par.cen ter_mass_x_normalized);
- } else nanobot - > Drive(0.0, 0.0);
- Wait(0.05);
- }
- nanobot - > Drive(0.0, 0.0); // Automating nanobot
F. Nano Servo Mechanismfor Nanobots
Nano Servomechanism is also required for nanobots for rotation.
Pseudocode for Nano servo mechanism Example-I
- Servo servo(3); // create a servo on PWM port 3 on the first module
- float servoRange = servo.GetMaxAngle() - servo.GetMinAngle();
- for (float angle = servo.GetMinAngle(); // ste p through range of angles
- angle < servo.GetMaxAngle(); angle += servoR ange / 10.0) {
- servo.SetAngle(angle); // set servo to angle
- Wait(1.0); // wait 1 second
- } // Nano servo mechanism for nanobot - I
Pseudocode for Nano servo mechanism Example-II
- #include “Nano_BaeUtilities.h” // Library files for functions for nano servo mechanism
- panInit(); // optional parameters can adjust pan speed for nanobot
- bool targetFound = false;
- while (!targetFound) {
- panForTarget(servo, 0.0); // Start from 1 to +1 // code to identify target for nanobot
- } // Nano servo mechanism for nanobot - II
F. Nano Solenoid for Nanobots
Solenoids are used as an actuator. Here solenoid can be used to remotely control if automation fails or any other malfunction. It can be used as steering of nanobot [12].
Pseudocode for nano solenoid
- Nano_Solenoid * s[8];
- for (int i = 0; i < 8; i++) s[i] = new Solenoid (i + 1); // allocate the Nano Solenoid objects
- for (int i = 0; i < 8; i++) {
- s[i] - > Set(true); // turn them all on
- }
- for (int i = 0; i < 8; i++) {
- s[i] - > Set(false); // turn them each off in turn
- Wait(1.0);
- }
- for (int i = 0; i < 8; i++) {
- s[i] - > Set(true); // turn them back on in turn
- Wait(1.0);
- delete s[i]; // delete the objects
- }
G. Synchronization of Nanobots
When there are multiple nanobots then synchronization is required. So that multiple nanobots can perform accordingly to complete the task accordingly.
Pseudocode for synchronization example I
- {
- Synchronized s(semaphore); // access shared code here
- if (condition) return; // more code here
- } // Synchronization for nanobot
Pseudocode for critical condition example II
- {
- Synchronized s(semaphore); // access shared code here
- if (condition) return; // more code here
- } // Synchronization for nanobot
H. Handling of Interrupts in Nanobots
Pseudocode for handling of interrupts example
- static int interruptCounter = 0; // The interrupt handler that counts number of square wave cycles
- static void tiHandler(tNIRIO_u32 interr uptAssertedMask, void * param) {
- interruptCounter++;
- }
- void InterruptTestHandler(void) { // c reate the two digital ports (Output and Input)
- DigitalOutput digOut(CROSS_CONNECT _A_PORT1);
- DigitalInput digIn(CROSS_CONNECT_A _PORT2); // create the counter that wil l also count square waves
- Counter counter( & digIn); // init ialize the digital output to 0
- digOut.Set(0); // start the counter counting at 0
- counter.Reset();
- counter.Start(); // register and e nable the interrupt handler digIn. RequestInterrupts(tiHandler);
- digIn.EnableInterrupts(); // count 5 times
- while (counter.Get() < 5) {
- Wait(1.0);
- digOut.Set(1);
- Wait(1.0);
- digOut.Set(0);
- } // verify correct operation
- if (interruptCounter == 5 && counter. Get() == 5) printf(“Test passed!\n”); // free resources
- digIn.DisableInterrupts();
- 2digIn.CancelInterrupts();
- }
- END_TEST(TestInterruptHandler) // Interrupt Handler for Nanobot
Appendix
Example UML logic for finite state machine for nanobot
- namespace FSM;
- class MgaObject {
- String name;
- String position;
- }
- class Transition {
- isA MgaObject; * transition--1..*StateMach ine stateMachine;
- 81..*transition--1..*AssociationStateState associationStateState;
- }
- class State {
- isA MgaObject;
- 0..1 dstTransition--1..*AssociationStateS tate associationStateStatedst; * state--1..*S tateMachine stateMachine;
- 1..*srcTransition--1..*AssociationStateSta te associationStateStatesrc;
- }
- class StateMachine {
- isA MgaObject; * stateMachine--1..*RootFo lder rootFolder;
- }
- class RootFolder {
- String name;
- 0..1 - > * RootFolder rootFolders;
- }
- class AssociationStateState {}
- namespace PrimitiveTypes;
- class String {}
- class Integer {}
Example UML logic Architectural description design for Nanobot
Figure 2 is the Example of UML logic Architectural description design for Nanobot.
- namespace ArchitecturalDescription;
- class Architecture {
- 0..1 - > 1..*ArchitectureDescription describedBy;
- }
- class ArchitectureDescription {
- 0..1 selectedBy--1..*ArchitectureView selects;
- 0..1 - > 1..*ArchitectureView o rganizedBy;
- }
- class ArchitectureView {
- 0..1 - > 1..*ModelElement constituents;
- 1..*views--1..*ArchitectureViewPoint conformsTo;
- }
- class ArchitectureViewPoint {
- 0..1 - > 1..*MainView defines;
- }
- class MainView {
- 0..1 - > 1..*ArchitectureView isProjected nto;
- 0..1 - > 1..*ModelElement consistsOf;
- }
- class ModelElement {}
- namespace PrimitiveTypes;
- class Boolean {}
- class Integer {}
- class String {}
Example UML diagram for access control design for nanobot
Figure 3 is the Example of UML diagram for access control design for nanobot.
Example UML logic for finite state machine for nanobot
- // UML class diagram in Umple representing a system for managing // access to facilities
- namespace access_control; //Ref_Facility_Type
- class FacilityType {
- code;
- description {
- Menu, Record, Screen
- }
- key {
- code
- }
- } //Functional_Area
- class FunctionalArea {
- String code;
- 0..1 parent-- * FunctionalArea child;
- description {
- Operations, Control
- }
- key {
- code
- }
- } //Facility_Functional_Area
- association { * FunctionalArea-- * Facility;
- }
- class Facility {
- Integer id; * - > 0..1 FacilityType;
- Integer access_count;
- name;
- description;
- other_details;
- key {
- id
- }
- }
- class Role {
- code;
- role_description {
- Dba, ProjectMgr
- }
- key {
- code
- }
- }
- class User {
- Integer id; * - > 0..1 Role;
- first_name;
- last_name;
- password;
- other_details;
- key {
- id
- }
- }
- associationClass RoleFacilityAccessRight { * Facility; * Role;
- CRUD_Value {
- R, RW
- }
- }
Author notes
Examples of Pseudocodes in C++ is presented,UML logic for
Medical nanobot is for demonstration and illustrations only and is
not tested. Original code may vary and differ based on operations,
model and requirements of multiple functionalities and operations.
Results
Basic Algorithm for Medical Nanobot with the flow chart specified in Figure 4, UML logic for Finite State Machine, UML logic Architecture Description for Nanobot, UML logic for Access control design and example of C++ is presented.
Simplified pseudocode for nanobot is demonstrated such as setting up, driving nanobots for manual and automatic, auto pan/ tilt, nano gyro sensors for disease detection, camera configuration, nano servo mechanism, handling interrupts and synchronization of nanobot using C++.
Conclusion
Based on the above results, basic algorithm for Medical Nanobot can constructed using C++ as shown in the Figure 2.
Examples of UML for Finite State Machine, Access Control
design, Access control logic, Architectural description can be used
for designing software for Medical Nanobot using C++ or any other
programming language.
Discussion
For construction of Nanobots biodegradable poly(lactide-coglycolide) (PLGA), an FDA approved polymer, can be used to formulate the nanoparticles to form a nanobot [13].
Advances in delivering therapy, reduction of analytical tools, enhanced computational and memory capabilities and developments in inaccessible communications will be integrated allowing for the development of such nanobots [14].
In order to evaluate the effectiveness of technique, known in
literature and simulation results showed the effectiveness technique
in terms of achievement, that is the destruction of the cancerous cells,
and velocity of destruction [15].
Acknowledgment
Author would like to thank Prof. Navarun Gupta, Prof. Hassan
Bajwa, Prof. Linfeng Zhang and Prof. Hmurcik for their academic
support. Author also thanks anonymous reviewers for their
comments.
References
- Solomon N. System and methods for collective nanorobotics formedical applications. 2008.
- Mitra M. Medical Nanobot for Cell and Tissue Repair. Int Rob AutoJ. 2017; 2(6): 38.
- Microscopemaster. Nanobots - Uses in Medicine and Industry -Engineering and Drawbacks; 2018.
- Jonathan S. How Nanorobots Will Work. Stuff Works; 2007.
- Bhat AS. Nanobots: The future of medicine. JEMS.2014;5(1):44-49.
- Moorthy K. Nanobots can check and repair dna. 2016.
- Miller B, Streeter K, Finn B, Morrison J. C/C++ Programming Guide for the FIRST Robotics Competition. 2008
- Benson C. How to Make a Robot - Lesson 10: Programming Your Robot. Robot Shop Blog. 2012.
- Seiko E. Gyro sensors - How they work and what’s ahead. 2018.
- Umple Online: Generate Java, C++, PHP, Alloy, NuSMV or Rubycode from Umple. University of Ottawa; 2018.
- Overview of Robotic Vision - Object Tracking and Image Processing Software. Into robotics; 2013.
- Solenoid - Let’s Make Robots! - Robot Shop. Robot Shop.2008.
- Jacob T, Hemavathy K, Jacob J, Hingorani A, Marks N, et al. A nanotechnology-based delivery system: Nanobots. Novel vehicles for molecular medicine. J Cardiovasc Surg. 2011;52(2): 159-167.
- Haberzettl CA. Nanomedicine: destination or journey?. Nanotechnology. 2002; 13(4): R9-R13.
- Loscrí V, Natalizio E, Mannara V, Aloi G. A Novel Communication Technique for Nanobots Based on Acoustic Signals. Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering. 2014; 91-104.