NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Collaborative Community of EJS => Topic started by: lookang on June 05, 2008, 10:19:22 pm



Title: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on June 05, 2008, 10:19:22 pm
Ejs open source Micrometer java applet with objects, help & zero error logic
Ejs open source Micrometer world best java applet creative commons license
Webpages of progress of Improvement of applets:
http://home.phy.ntnu.edu.tw/~lookang/EJS/ejs_group.files/weemicrometer4.app/
http://home.phy.ntnu.edu.tw/~lookang/EJS_4.1_090115/weemicrometer4internet_Simulation.html
http://home.phy.ntnu.edu.tw/~lookang/EJS_4.1_090208/weemicrometer4internet.html
Ejs open source Micrometer world best java applet creative commons license
Micrometer best java applet made in EJS open source creative commons license. by lookang.

Thanks to Prof Hwang for sharing his original source codes, his passion for sharing knowledge and guidance .
Thanks to Prof Wolfgang for implementing the codes for the thimble, it moves progressively faster in and out on click.
This work is licensed under a Creative Commons Attribution 2.5 Taiwan License.
reference:
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=567.msg1944#msg1944

cited by
http://en.wikipedia.org/wiki/Micrometer

alternative host:
http://www.compadre.org/OSP/items/detail.cfm?ID=9422


Title: Re: Micrometer
Post by: lookang on June 07, 2008, 09:13:26 am
http://www.youtube.com/v/CdNkxw4-u-Q&hl=en&fs=1&hd=1


This is an Ejs version of micrometer with
1. option for positive or negative zero error for faulty micrometer(Adjust the vertical slider up/down).
2. option for object black color to be inserted for measurement
3. option for hint to display
4. option for answer to display
5. option fine control for ratchet
6. a lock to store the value of measurement like in a real micrometer so that you can ask others to look at the reading too without having the object inside. Smiley
7. moved the object to the foreground to achieve the no over squeezed look by the spindle
8. added threads on green dial and ratchet to give it the rotating look
9. lock can be press on graphically
10. at the moment, the ratchet can be compress by extra  mm to demonstrate materials can be measured inaccuracy if over rotated by students against the anvil, which is somewhat inaccurate but i think there is educational value if the applet can over compress ? to get the correct measurement, drag on the slider for thimble
11. made black object do not overlap the micrometer, suggested by Ered
12. made hint for zero error case make clear the impact of new calculation
13. re position (lower and in screen) the hint for the 0.00 mm for even measurements like 13.77 mm
14. updated now with lock and ratchet buttons for fine control on 08 Feb 2009
15. updated now with suggestion from Ered on 10 Feb 2009
07September 2009
16  black object is blocked (simulate real life object blocking) if the micrometer jaws is too small.
17)  micrometer jaw to become smaller than the block.?
18 improved documented variables in the variable tables.  
19. drawing object redesign in EJs4.2 format
20. new rotation ratchet implemented by prof wolfgang to simulate real life action of rotation of ratchet instead of slider bar in previous versions.
11Sept 2009
21 zero error = 0.05 mm instead of e = 5 display
22 redeploy thimble slider
23 reposition the object slider to top
24 correct spelling
19Nov2009
25 added the input text field for checking of understanding by the students thx to Prof Hwang expert guidance http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1309.0
8may2011
added tips o the jaws
add ability of drag up and down on the green spindle and teal ratchet to move the micrometer to simulate almost like moving the parts like in real equipment.
20july 2011
added ability to zoom in to focus on the parts of the micrometer to look at when measuring length
made the text black to increase visibility due to editable=false is a shade of gray and not very clear
21july 2011
added correct sign fig for example 9.20 = 9.00+0.20 mm extra 0 at the back using logic and code to make 0 appear
improved 9.20 = 9.00+0.10-(-0.10) mm adding extra 0 at the right else if branch. previously it shown 9.20 = 9.0 + 0.1-(-0.1) mm

24 October 2011
added a magnify ability to draw students attention to the lines based on codes from http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2268.0 by Fu-Kwun Hwang
randomize the size of the black object each time to simulation is reset based on a request on physics front http://www.thephysicsfront.org/items/detail.cfm?ID=9422



Thanks to Prof Hwang for sharing his original source codes, his passion for sharing knowledge and guidance .
This work is licensed under a Creative Commons Attribution 2.5 Taiwan License.
reference:

reference:
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=567.msg1944#msg1944




flash movie
http://www.phy.ntnu.edu.tw/ntnujava/swf/micrometer2.swf

why in the demonstration flash, the black object is drag-able but in the applet, it is not?


reference:
http://www.phy.ntnu.edu.tw/ntnujava/swf/micrometer2.swf
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=567.msg1944#msg1944

how to make it drag-able?
i am puzzled too because it is already set to drag-able TRUE

source code
download the *.jar for using the applet on standalone without internet connection.


Title: Re: Micrometer
Post by: Fu-Kwun Hwang on June 07, 2008, 11:17:17 am
Because you set the control point of that object to "SOUTH_WEST".
So you can only drag it from "SOUTH_WEST" control point.

If you set it to default "middle center", then the control point will be at the center.
If you want to be able to drag it within the whole region. Set sensitivity to 0.


Title: Re: Micrometer
Post by: lookang on June 08, 2008, 10:01:29 pm
Original Source code by Fu-Kwun Hwang http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=567.msg2364#msg2364 Derived work by Wee Loo Kang under creative commons http://creativecommons.org/licenses/by/2.5/tw/deed.en
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=683.0
Micrometer Ejs open source creative commons license world best java applet 
Micrometers use the principle of a screw to amplify small distances that are too small to measure directly into large rotations of the screw that are big enough to read from a scale. The accuracy of a micrometer derives from the accuracy of the thread form that is at its heart. The basic operating principles of a micrometer are as follows:
The amount of rotation of an accurately made screw can be directly and precisely correlated to a certain amount of axial movement (and vice-versa), through the constant known as the screw's lead. A screw's lead is the distance it moves forward axially with one complete turn (360°). (In most threads [that is, in all single-start threads], lead and pitch refer to essentially the same concept.)
With an appropriate lead and major diameter of the screw, a given amount of axial movement will be amplified in the resulting circumferential movement.
The micrometer has most functional physical parts of a real micrometer.
Frame (Orange)
The C-shaped body that holds the anvil and barrel in constant relation to each other. It is thick because it needs to minimize expansion, and contraction, which would distort the measurement. The frame is heavy and consequently has a high thermal mass, to prevent substantial heating up by the holding hand/fingers. has a text 0.01 mm for smallest division of instrument has a text 2 rounds = 100 = 1.00 mm to allow association to actual micrometer
Anvil (Gray)
The shiny part that the spindle moves toward, and that the sample rests against.
Sleeve / barrel / stock (Yellow)
The stationary round part with the linear scale on it. Sometimes vernier markings.
Lock nut / lock-ring / thimble lock (Blue)
The knurled part (or lever) that one can tighten to hold the spindle stationary, such as when momentarily holding a measurement.
Screw
(not seen) The heart of the micrometer It is inside the barrel.
Spindle (Dark Green)
The shiny cylindrical part that the thimble causes to move toward the anvil.
Thimble (Green)
The part that one's thumb turns. Graduated markings.
Ratchet (Teal)
(not shown ) Device on end of handle that limits applied pressure by slipping at a calibrated torque.
This applet has an object (Black)
with slider on left top to control the y-motion of the object into the anvil and spindle (jaws), the graphics also allows drag action.
with slider on left bottom to control the x-size of the object into the anvil and spindle (jaws).
On the left bottom slider is the zero error control to allow of exploring with if the micrometer has either +0.15 mm (max) or -0.15mm (min) zero error. The are check boxes:
hint: guide lines and arrows to indicate the region of interest plus the accompanying rationale for the answer.
answer: shows the measurement d = ??? mm
lock: allows simulating of the lock function in real micrometer which disable changes to the position of the spindle then by the measurement is unchangeable.
On the bottom there is a green slider to control the position of the spindle, drag on any part of the view also drags the spindle.
There is 2 buttons left and right fine control to allow for single incremental change of the measurement, to allow learners to sense the rotation simulation of the spindle with the many lines to simulate the coarse pattern to increase friction between fingers and on the thimble and ratchet.
The reset button restores learning environment to default setting.












You are free:
to Share — to copy, distribute and transmit the work
to Remix — to adapt the work

Under the following conditions:
Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Attribute this work:
What does "Attribute this work" mean?
The page you came from contained embedded licensing metadata, including how the creator wishes to be attributed for re-use. You can use the HTML here to cite the work. Doing so will also include metadata on your page so that others can find the original work as well.
 
For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.
Any of the above conditions can be waived if you get permission from the copyright holder.
Nothing in this license impairs or restricts the author's moral rights.

Previously
Because you set the control point of that object to "SOUTH_WEST".
So you can only drag it from "SOUTH_WEST" control point.

If you set it to default "middle center", then the control point will be at the center.
If you want to be able to drag it within the whole region. Set sensitivity to 0.


nice info !!! updated it . thanks!!


Title: Re: Micrometer best java applet made in EJS open source creative commons license
Post by: lookang on January 19, 2009, 01:06:29 pm
as strange as it sounds, the EJS4.1 Jan 2009 does not compile this file weemicrometer4internet.xml  properly.

Any idea how to fix this?

words missing, slider control gone, do you know what is going on :)


Title: Re: Micrometer best java applet made in EJS open source creative commons license
Post by: Fu-Kwun Hwang on January 19, 2009, 03:28:20 pm
Please upload latest ejs weemicrometer4internet.xml.


Title: Re: Micrometer best java applet made in EJS open source creative commons license
Post by: lookang on January 19, 2009, 04:21:29 pm
thanks!  ;D


Title: There is a bug in your code.
Post by: Fu-Kwun Hwang on January 19, 2009, 06:07:19 pm
It took me a lot of time to find the bug in your code.
You add a view element textset  labeled as  "TextSetYtxty"
You set the number of element to tc, but tc=0 in your code.
So EJS can not find any text element when it try to initialize the code.

It will work find if you change it's value to 5. (# of element for TextSetYtxty)

It is always difficult to find a bug in the code.
It is even more difficult to find a bug in the code written by others.

Normally, when I have a code working. I will save the file.
I will modify the code to another name before I do any modification.
If there is any new error which I can not solve, I can switch back to original file.
Or I can check the difference betwen two files to find out the error.



Title: Re: There is a bug in your tc=0 in my initialization code.
Post by: lookang on January 19, 2009, 09:12:42 pm
You add a view element textset  labeled as  "TextSetYtxty"
You set the number of element to tc, but tc=0 in your code.
So EJS can not find any text element when it try to initialize the code.

but the strange thing is it used to work in EJS 4.0 ?? (i need to check), i have been updating this board with my latest xml
are you refering to tc=0 in my initialization code.?

It will work find if you change it's value to 5. (# of element for TextSetYtxty)

i change tc = 1 it also worked, any idea why?
is tc a text counter ?

It is always difficult to find a bug in the code.
It is even more difficult to find a bug in the code written by others.
Normally, when I have a code working. I will save the file.
I will modify the code to another name before I do any modification.
If there is any new error which I can not solve, I can switch back to original file.
Or I can check the difference betwen two files to find out the error.

i know what you mean, i have being follow that way to have many versions in case i need to go back to early versions.

thanks for the debug :)


Title: Re: Micrometer best java applet made in EJS open source creative commons license
Post by: Fu-Kwun Hwang on January 19, 2009, 09:46:46 pm
It will work as long as tc>0 and tc<6
But it can not be 0. It specify how many textset elements to be displayed!


Title: Re: Micrometer best java applet made in EJS open source creative commons license
Post by: lookang on February 07, 2009, 03:56:18 pm
thanks!

this is not in google but it is very nice because of the nice picture.
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=502.0 (http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=683.0;attach=703;image)



some other google search results from "Micrometer java applet"

http://members.shaw.ca/ron.blond/Micrometer.APPLET/(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=683.0;attach=656;image)

possible improvements: add a rachet at the back for finer movement of the thimble
http://www.vjc.moe.edu.sg/fasttrack/physics/macrometer_ya_v6.htm(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=683.0;attach=658;image)
possible improvements: add a lock nut to disable rotation the micrometer for showing answer without distortion the reading
possible improvements: add a clear indication that 2 rounds of the thimble equivalent to 1.00 mm = 100 reading markings moved
nice picture
http://www.technologystudent.com/images3/microm1.gif
http://www.technologystudent.com/equip1/microm1.htm
(http://www.technologystudent.com/images3/microm1.gif)

again the post is the 4th top search result for google on "Micrometer java applet" !!(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=683.0;attach=331;image)

another good micrometer made in flash by http://www.stefanelli.eng.br/ a creative commons licensee too
http://www.stefanelli.eng.br/webpage/en-aka-micrometer-caliper-outside-millimetre-thousandth.html



Title: Re: Micrometer best java applet made in EJS open source creative commons license
Post by: Ered on February 09, 2009, 06:46:10 pm
Hi, i came across this applet which i heard from lookang.

In general, it's a great applet which closely simulates a real vernier caliber, with the lock and the zero error in place.

However, i note that when the black box is fully dragged down, it overlaps the vernier caliber. Perhaps a correction can be done such that the maximum displacement is not as much when the black bar on the left is fully dragged down. And also i think that a hint & answer for zero error can be done so as to increase awareness of its existence and how it affects the actual reading.

Nevertheless i find this is a great applet! Thanks for the effort!


Title: Re: Micrometer best java applet made in EJS open source creative commons license
Post by: lookang on February 09, 2009, 06:57:23 pm
Hi, i came across this applet which i heard from lookang.

In general, it's a great applet which closely simulates a real vernier caliber, with the lock and the zero error in place.

However, i note that when the black box is fully dragged down, it overlaps the vernier caliber. Perhaps a correction can be done such that the maximum displacement is not as much when the black bar on the left is fully dragged down.

appreciate your feedback! agreed!




And also i think that a hint & answer for zero error can be done so as to increase awareness of its existence and how it affects the actual reading.

i  agree with you totally on this!

Nevertheless i find this is a great applet! Thanks for the effort!
i  agree with you totally on this!

Will improve it ASAP :) thx Ered


Title: Re: Micrometer best java applet made in EJS open source creative commons license
Post by: lookang on February 10, 2009, 02:07:36 am
check it out Ered! thanks!


Title: Re: Ejs open source Micrometer world best java applet creative commons license
Post by: lookang on September 03, 2009, 11:17:00 am
Remade the internal drawing elements to be newer Ejs 4.2 types. also group the drawing elements into logical groups structure for ease of open source sharing. Thanks to Prof wolfgang to encouraging these changes for review into posting in OSP http://www.compadre.org/OSP/

Some bugs i encountered when cut,copy and pasting the drawing elements, sometimes the drawing elements will "drop" to the end of the tree structure and the Ejs panel will warn of some errors.

to overcome this bug, i quit Ejs and restart it , open another instance of Ejs and open a copy of the old codes and repaste into the newer xml.

 


Title: Re: Ejs open source Micrometer world best java applet creative commons license
Post by: lookang on September 22, 2009, 09:29:45 pm
A youtube video made to spread the educational imperative of learning by doing & exploring sense making physics.



Music is audio swapped by Youtube in built service. cool  Grin I am assuming Youtube asked for permission already to use the music for youtube users.

I believe this is applicable to me.
  * * Tell me. I may not get it, I'm sure to forget it.
  * * Show me. I may get it, I'll remember it for a little while.
  * * Have me do it. I'll understand it, it may stick for awhile.

A good youtube


Title: Re: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on November 19, 2009, 02:13:32 pm
19Nov2009
25 added the input text field for checking of understanding by the students thx to Prof Hwang expert guidance http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1309.0

Another level of interaction for advancing learning made possible by amazing Web 2.0 collaboration between Prof Hwang n lookang ;D

The new improved java applet is always on the top post.
Enjoy!


Title: Re: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on May 08, 2011, 01:15:52 am
8may2011
added tips o the jaws
add ability of drag up and down on the green spindle and teal ratchet to move the micrometer to simulate almost like moving the parts like in real equipment.

enjoy!


Title: Re: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on July 20, 2011, 02:45:14 pm
20july 2011
added ability to zoom in to focus on the parts of the micrometer to look at when measuring length
made the text black to increase visibility due to editable=false is a shade of gray and not very clear


Title: Re: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on July 21, 2011, 03:34:02 pm
21july 2011
added correct sign fig for example 9.20 = 9.00+0.20 mm extra 0 at the back using logic and code to make 0 appear
improved 9.20 = 9.00+0.10-(-0.10) mm adding extra 0 at the right else if branch. previously it shown 9.20 = 9.0 + 0.1-(-0.1) mm.

Research and development at its best! teacher lead development with researcher's support!

enjoy!


Title: Re: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on October 24, 2011, 10:42:57 pm
24 October 2011

added a magnify ability to draw students attention to the lines based on codes from http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2268.0 by Fu-Kwun Hwang
randomize the size of the black object each time to simulation is reset based on a request on physics front http://www.thephysicsfront.org/items/detail.cfm?ID=9422

enjoy!


Title: Re: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on January 20, 2012, 09:56:23 am
20 January 2012
fixed a bug associated with zero error in the hint.
integerd =(int)((id+error)/100.); // integer ( 840.0/100) = 8.0 // bug fixed for accounting with zero error 20January2012
decimald =(-(integerd)*100+(id+error))/100.;
l_integerd = double2String(integerd,1.)+"0 mm";

enjoy!

a collaboration lesson here https://sites.google.com/site/lookang/002-micrometer
attached the source in-case something goes wrong, anyone can continue to improve it :)


Title: Re: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on June 14, 2012, 09:14:57 am
slightly edited to make both vernier caliper and micrometer share similar interface.

added auto for auto scale true


Title: Re: Ejs open source Micrometer java applet with objects, help & zero error logic
Post by: lookang on December 11, 2012, 11:40:49 am
changes.
added mm to the text for users who might try to key in 42.7mm, instead user should only key in the values 42.7.

enjoy!
also mirror here
http://dl.dropbox.com/u/44365627/lookangEJSworkspace/export/ejs_Micrometer02.jar

optimize the screen view for full screen.