Saturday, December 12, 2020

joji

Goodbye.

Friday, December 9, 2011

Medical Ring Design








Recently I have started working at a custom jewelry design company. This project is for a client that has issues with a joint on her left hand. The original device was given to her by her physician. However I was approached by my employer to redesign the device because the client wanted to mask her device as jewelry. The lower two images are the original device and the top three are the ones I have designed. The entire project was scripted using grasshopper for rhino and rhino gold for ring sizing.

Thursday, February 17, 2011

Phenomenology Project

This was a project for the phenomenology research center at Southern Illinois University Carbondale. The objective was to design a bookshelf that responded to the space and individuals that occupy the space at any given time. The forms where derived through the studies of magnetic attraction, based on time. the primary tools that where used are MAYA, Real flow, Rhino, and grasshopper.









Sunday, February 6, 2011

Arduino Servo Control

A sketch to drive an arbitrary number of stepper motors and control each one of them independently with potentiometers. It should be able to drive one motor for each available analog input. The sketch uses no libraries, the motors are driven by PWM signals.


// Many Servos no libraries by using arrays, sketch by Fp-2010.
// Change next three to match number of servos, servo pins and pot pins.
const int totalServos=2; // used in the 'for' loops below
const int theServos[]={7,8}; // pins connected to servos
const int thePots[]={4,3}; // pins connected to pots

const int refreshServo=20; // 20mS servo refresh cycle
long servoSpeed[20]; // stores potentiometer values
long pulseWidths[20]; // stores pulseWidths for each servo
long prevPulse[20]; // keeps track of last pulse

void setup(){
     for (int i=0; i < totalServos; i++) { // for every servo
     pinMode(theServos[i],OUTPUT); // declare servo pins as outputs
     pinMode(thePots[i], INPUT); } // declare pot pins as inputs
}

void loop(){
    for (int i=0; i < totalServos; i++) { // for every servo
      servoSpeed[i] = analogRead(thePots[i]); // set speed to pot value
        doServo(theServos[i],servoSpeed[i]);   // move servo
     }
}

void doServo(int thisPin, long pulseWidth){
    pulseWidths[thisPin] = map(pulseWidth,0,1023,560,2310); // map pot input to pulse width range
    if (millis() - prevPulse[thisPin] >= refreshServo){
    prevPulse[thisPin] = millis();
    digitalWrite(thisPin,HIGH);
    delayMicroseconds(pulseWidths[thisPin]);
    digitalWrite(thisPin,LOW); }
}

Wednesday, November 10, 2010

Servos modified for continuous rotation


My new uC project required a continuous rotation motor, knowing that a servo motor can be modified to allow it to rotate continuously, I performed the modification on a 9g servo.
Servos are cool because you can tell them to rotate to a specific angle (between 0 and 180 degrees), a modified servo doesn't know what angle it is, but it can rotate in either direction without limits.
The mod:
Inside a servo there are two things that need to be changed in order to make it spin all around: a mechanical stop on the gears, and a potentiometer that tells the servo where in the rotation it is.
The mechanical stop is removed by filing or cutting it away from the gear.
The pot needs to be disconnected from the circuit board, and replaced by two fixed resistors of equal value which add up to approximately the original pot's value. My pot was 5k so I used 2.2k smd resistors.
Once everything is put back together the result is a continuous rotation servo gear motor that can easily addressed by Arduino's sofware servo library, your projects are now free to move.
Links:
http://4volt.com/Blog/archive/2009/04/18/modifying-micro-servos-for-continuous-rotation.aspx
http://www.acroname.com/robotics/info/ideas/continuous/continuous.html
Fp2010.

Thursday, March 18, 2010

3d animation: circular hatch mechanism

A circular hatch opening and closing. The animation uses constraints to get the motion of the leaves. The exploded view is animated into an assembled view where pieces come together into the functioning system. It illustrates very clearly the shapes of the components involved and their interactions. Blender 3d used for modeling, animating and rendering.


Monday, March 15, 2010

Applescript to process multiple video files with ffmpeg

This code is an Applescript intended to be used along with folder actions to batch convert files dropped in a folder using ffmpeg.
Background: Muxed video files are problematic when edited and the mpeg codec is also not easy in a Mac. Some Sony cameras record muxed mpg video, which requires processing every file in order to further work with them, doing this manually can be boring and take forever.
The following program demuxes and changes codec to h264, maintaining the file creation date. Without alteration, it will only be useful if working with files created on a DSCW100, to convert other files, changes need to be made to the ffmpeg shell command parameters. It handles spaces in filenames but folders should be kept without spaces or code will again need to be changed.
The program is separated in useful functions including extracting path, filename, extension; change creation date, convert scientific notation to text string. Provided without any warranty, use at your own risk.

(*

Convert MPG files in a folder to h264 using ffmpeg (ffmpegx).

March 2010 Fp www.designeddrawnmade.blogspot.com

Requires ffmpegX to exist in /Applications/ffmpegX_0.0.9y/ffmpegX.app

Derived from Apple sample code, etc.

*)


property done_foldername : "Done"

property extension_list : {"mpeg", "mpg", "MPG", "MPEG"}


on adding folder items to this_folder after receiving these_items

tell application "Finder"

if not (exists folder done_foldername of this_folder) then

make new folder at this_folder with properties {name:done_foldername}

end if

end tell

try

repeat with i from 1 to number of items in these_items

set this_item to item i of these_items

set ff_Path to "/Applications/ffmpegX_0.0.9y/ffmpegX.app//Contents/Resources/" as string

set this_item_posix to the POSIX path of this_item

set pathOnly to path_only(this_item_posix)

set name_wExt to remove_path(this_item_posix)

set nameOnly to remove_extension(name_wExt)

set file_extension to get_extension(this_item)

set temp_filename to pathOnly & "Done/" & nameOnly

set temp_filename to quoted form of temp_filename

set this_item_posix_q to quoted form of this_item_posix

if file_extension is not in the extension_list then

do shell script "cp " & this_item_posix_q & " " & pathOnly & "Done/"

set finalfile to pathOnly & "Done/" & name_wExt

change_dates(this_item, finalfile)

do shell script "rm " & this_item_posix_q

else

-- display dialog "variables" & return & return & pathOnly & return & nameOnly & return & file_extension & return & temp_filename & return & name_wExt

do shell script ff_Path & "ffmpeg -i " & this_item_posix_q & " -an -f yuv4mpegpipe - | " & ff_Path & "x264 -v --no-cabac -b 0 --qpmin 22 --qpmax 51 -B 5100 --me hex --threads 2 --level 13 --fps 30000/1001 -o " & temp_filename & ".ff.video.mp4 - 640x480 "

do shell script ff_Path & "ffmpeg -i " & temp_filename & ".ff.video.mp4 -i " & this_item_posix_q & " -y -vn -f mp4 -acodec aac -ab 128 -ar 44100 -ac 2 -map 1.0:0.0 " & temp_filename & ".ff.audio.mp4 "

do shell script ff_Path & "mp4box -add " & temp_filename & ".ff.video.mp4 -add " & temp_filename & ".ff.audio.mp4 -new " & temp_filename & ".ff.mp4"

do shell script "rm " & temp_filename & ".ff.video.mp4 && rm " & temp_filename & ".ff.audio.mp4"

set finalfile to pathOnly & "Done/" & nameOnly & ".ff.mp4"

change_dates(this_item, finalfile)

end if

end repeat

end try

end adding folder items to


on get_extension(this_item)

tell application "Finder" to set file_extension to the name extension of this_item

end get_extension


on remove_path(this_name)

repeat while this_name contains "/"

set x to the offset of "/" in this_name

set this_name to (text (x + 1) thru -1 of this_name)

end repeat

return this_name

end remove_path


on path_only(this_name)

if this_name contains "/" then

set this_name to (the reverse of every character of this_name) as string

set x to the offset of "/" in this_name

set this_name to (text (x) thru -1 of this_name)

set this_name to (the reverse of every character of this_name) as string

end if

return this_name

end path_only


on remove_extension(this_name)

if this_name contains "." then

set this_name to (the reverse of every character of this_name) as string

set x to the offset of "." in this_name

set this_name to (text (x + 1) thru -1 of this_name)

set this_name to (the reverse of every character of this_name) as string

end if

return this_name

end remove_extension


on change_dates(oldfile, file_)

tell application "Finder" to set old_date to the creation date of file oldfile

set {year:y, month:m, day:d, hours:hh, minutes:mm} to (old_date)

set old_date to y * 100000000 + m * 1000000 + d * 10000 + hh * 100 + mm

set old_date_string to remove_scientific(old_date)

set file_ to POSIX path of file_

do shell script "touch -t " & old_date_string & " " & quoted form of file_

end change_dates


on remove_scientific(this_number)

set this_number to this_number as string

if this_number contains "E" then

set this_number to (the reverse of every character of this_number) as string

set x to the offset of "E" in this_number

set this_number to (text (x + 1) thru -1 of this_number)

set this_number to (the reverse of every character of this_number) as string

end if

if this_number contains "." then

set this_number to (the reverse of every character of this_number) as string

set y to the offset of "." in this_number

set timepartA to (text (y + 1) thru -1 of this_number)

set this_number to (the reverse of every character of this_number) as string

set z to the offset of "." in this_number

set timepartB to (text (z + 1) thru -1 of this_number)

end if

set new_number to timepartA & timepartB

return new_number

end remove_scientific



links:
http://www.macosxhints.com/article.php?story=20060703160750583
http://www.macosxautomation.com/applescript/sbrt/sbrt-02.html
http://devdaily.com/blog/post/mac-os-x/applescript-concatenate-strings
http://www.gregwalsh.com/articles/applescript_flv.htm
http://www.macosxautomation.com/applescript/resources.html