Friday, May 22, 2015

Random images

Gelatine for phantom


Leads and jig attached to tube for shapeset


Wire and plastic to advance plastic through bronchoscope


PTFE (clear tubing) for sheath in bronchoscope


Hook up diagram for computer end of tracker


Wires for inside flexure tip steerable needle


paper as a fixture to get wires level with center of tube, both held down during drying of epoxy


second experiment pictures






Hookup for motor amplifiers


Monday, May 18, 2015

Monday

Shape setting:

After cutting the jig, place tube in curvature, (move small part of jig up, bending tube tube as you go), then place the screws in the small part of the jig, want the tube as snug as possible in the jig. If the tube is thin, but another wire or tube inside to help give it support as it is wedged into the jig. MAKE SURE TO REMOVE THIS BEFORE SETTING.

Tie two large (stripped near connection obviously) wires on both sides (4 total), use lots of solder to attach to the nitinol tube.
Hook up power to the outside of the two, signal on the inside.

Sunday, May 17, 2015

Saturday/Sunday

Modified cannula code to work with a single tube.
Not perfect, old cannula render and other things aren't working. The problem is with the tU matrix in OneTubeCannula.cpp calculateShape function, but I don't know what it is currently.
Hacked in other collision detection, treating the cannula as a large set of "needle segments" internal to offline-planning.cpp
I also added the functionality to maximize the radius of curvature as a cost metric.


The input to online-needle needs to be transformed into tracker frame

Friday, May 15, 2015

Friday 5/15/2015

Today it's obvious that there is something wrong with the 1-tube code. So this will need to be fixed, probably with a completely new shape calculation function. Also close attention to minimum and maximum insertion values. What this does mean is that I can use this time to change the convention to a forward insertion from the origin though so that's the plan. I've hacked in a solution now but I'm going to make it better at the earliest opportunity, this weekend most likely.
--------------------------------------------------
Manual control of robot is coded.
--------------------------------------------------
[R,p]^-1 = [R', -R'*p]
-------------------------------------------------------------
Using above formula, now I'm going back and forth between the two frames, tracker and model.
-------------------------------------------------------------
That's the gelatine
--------------------------------------------------------------
Goal and trajectory points are being converted to tracker frame in online-planner.cpp
--------------------------------------------------------------
From thursday, the things that I needed to change in code:

Registration code needs to be completed.

This is basically true, except I need the model measurements of the new points. The code is in TransformationCalc.h and cpp.

The planner needs to be reconverted to use only one tube.
The insertion of the tube needs to be adapted to be a positive mm value, as queried from the robot object, because:

This needs to be done this weekend, there's going to need to be a new shape computation, because Luis' code is not working with only a single tube. During the rewrite, I can change the origin of insertion so that there is positive insertion.

Manual insertion of the ctr and needle (and coupled) needs to happen. (becomes origin for ctr insertion at some point).

This is implemented in online-needle.cpp

online-needle.cpp should capture automatically the start position from the tracker. (This also requires registration).

This now happens in online-needle.cpp

The trajectory following controller should read in the trajectory output from online-needle, or online-needle should send it directly, either way.

Going to run the controller from online-needle. It now constructs the right trajectory for that.

Orientation of concentric tube robot, alpha value needs calibrated.

Going to do this manually at beginning of experiment.
----------------------------------------------------------
1/4'' MDF For the jigs that define the shape of the nitinol tube that is going to be set.
----------------------------------------------------------
Dinner was provided this day

Thursday, May 14, 2015

Thursday 5/14/2015

Experimented with physical needle tracking trajectories. Is working, almost had a disaster where the robot would try to insert meters rather than millimeters. This is a lesson to always be careful about the units. In the future, refactor to make that more robust.
------------------------------------------------------------------
Discussed experimental details with Phil, Art, Bob. Going to start with one tube, but will fabricate two. Environmental registration will happen by tracking the position of three known points attached to bronchial tree model. Going to experiment initially with planar tube model.
------------------------------------------------------------------
Things that need done for this first experiment:
Registration code needs to be completed.
The planner needs to be reconverted to use only one tube.
The insertion of the tube needs to be adapted to be a positive mm value, as queried from the robot object, because:
Manual insertion of the ctr and needle (and coupled) needs to happen. (becomes origin for ctr insertion at some point).
online-needle.cpp should capture automatically the start position from the tracker. (This also requires registration).
The trajectory following controller should read in the trajectory output from online-needle, or online-needle should send it directly, either way.
Orientation of concentric tube robot, alpha value needs calibrated.
------------------------------------------------------------------
LUNCH WAS PROVIDED TO ME THIS DAY
------------------------------------------------------------------
Started working on this three point to three point registration, using the orthogonal procrustes problem solution. It doesn't work yet though, that's a thing that needs to happen soon. About to skype with Ron.
------------------------------------------------------------------
Ron would like me to perform one experiment, enough so that I am confident in being able to perform the subsequent experiments.
Then, gather skills.
Needle-making skills, nitinol tube shape-setting skills, phantom gel and environment skills.
Also, ask about an eta on the mechanical model.
Make sure before leaving that I know how to setup the robot with the second tube and use it with the second tube, but for now, one tube is a good idea.
-----------------------------------------------------------------
Registration code is working now, with manually entered values. Need to automate the capture of the three new points.
-----------------------------------------------------------------
online-needle.cpp now does automatically capture the start position from the tracker, but it hasn't been registered to the model's frame.
-----------------------------------------------------------------
online-needle.cpp now gathers the three points from the tracker frame, but is not yet computing the transformation (because I don't have 3 corresponding points in the model frame)

Wednesday, May 13, 2015

Wednesday 5/13/15

----------------------------------------------
Time stamped data collection happening, controller prints out to file every cycle.
----------------------------------------------
piano wire comes from McMaster, steel piano wire.

First feed nitinol tube through bronchoscope from distal to proximal. Use plastic guide (made of ptfe light wall tubing), advance them together around bend.

Then solder tracker (in needle) to piano wire which was pre run through the nitinol tube. (use flux)

Feed tracker and needle through sheath and collet.

Solder tracker wires to receiving end of tracker, the convention is:

6DOF     WIRE
green       yellow
gray         purple

white        white
gray          blue

Always check the plastic sheath is on before driving needle, or it will buckle and die.

Run model -> stop model -> turn on robot -> run model
-----------------------------------------------
Ran first needle single goal controller tries:
Straight single nitinol tube (ctr) with needle both through the bronchoscope into phantom gel.
Modifying insertional velocity constant and rotational velocity constant (lambdas in paper) seems to affect curvature values. We have theorized that fast insertion and slow rotation allow the flexure tip to spend more time flexed, allowing for higher curvatures. There also seems to be problems with tracker accuracy, the problem may be that the goal is captured from a single tracker reading, which may have error, next step is to average a short window of time for the goal position from multiple tracker positions. Data is saved in firstNeedleAttempts directory. Coming soon, trajectory following.
------------------------------------------------
Made a class that generates a dummy straight trajectory. List of tuples (time, point).

Also wrote the trajectory following code. Seems to be working EXCEPT the timer is like cpu time or something rather than true time. Fixing this next.
-------------------------------------------------
Fixed the timer, needed cpu_times.wall rather than .system or .user.

Tuesday, May 12, 2015

Tuesday 5/12/15

Installed correct boost version on Windows machine for tracker code. It is based on Visual Studio Version, from table at:
https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History
boost at:
http://sourceforge.net/projects/boost/files/boost-binaries/1.58.0/

linker, additional library directories <path/to/boost/directory>/lib<architecture>
C/C++ ->additional include directories </path/to/boost> which should be like boost_1_58_0 and contains folder 'boost'
C/C++ ->use precompiled headers to no

Tracker server working now.
----------------------------------------------
Wrote TrackerReceiver class,
has multithreaded tracking data collection. Mutices and Threads.
----------------------------------------------
Modified Tracker VS project to send data for two trackers simultaneously.
Index into m_dtHandleInformation[nHandle], nHandle is 10 and 11 for now, unintuitive.
Hard coded in the 14 float udp packet size, could be more elegant.
----------------------------------------------
Implemented PositionCapture class which captures the position of the goal from a probe.
----------------------------------------------
Coded sliding mode controller in Controller class. Only tracks to a point, not doing trajectory following yet. Next step is controller in tissue, then trajectory following.
----------------------------------------------
Deconstruction of everything cleaned up, robot returns itself to start configuration.
----------------------------------------------
Tomorrow with Phil and Art, needle in phantom, discussion on what is needed for concentric tubes and motion planning experiments.
Need to write data collection code, maybe have controller write out data every cycle for now?