Tom.DeVito 3.10.2011

Arduino – SOMO interfacing:

  • Hooked up the SOMO with a 220uf capacitor on the power supply going to ground and put one 2.2k resistor between the arduino pin and the SOMO pin for each of the serial wires.
  • First memory card(PNY) was not compatible.  Needed to get a sandisk 2gb uSD.
  • At first i had the speaker hooked up directly to the SOMO.  This produced good sound but had far less range with only 7 steps.  Once I knew this was working I put the output wire through our amplifier.
  • The piezoelectric speaker that i had from my computer motherboard is really only designed for tones so it might be blown.
  • Eventually I am going to have the i2c resistor controlled through the arduino instead of the FTDI chip we are using.  I am not sure how often this will happen but there was a conflict with the com ports.
  • Spent a good amount of time trying to find the best speaker for the job.  Eventually I found these: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=668-1206-1-ND
  • 13mmx13mmx4mm is a good size for fingertips and we probably embed them into the surface of the next prototype(if that is not insanely hard to do).  They get up to 85db which is about the same as someone singing loudly so that should be good.  Not sure how much it resonates, but we can probably increase that through mounting techniques.
  • Tomorrow, I will start working on the rcs system code to prepare it to work with our original prototype so we can test this method.  A lot of its already written, just have to add the SOMO commands and fix the parts that I couldn’t test before.  We can probably use our big cone speaker while we wait for the fingertip sized ones.

Tom.DeVito 3.9.2011

Aurdino – SOMO 14D interfacing:

  • Serial communication is a bit more difficult then I thought it would be because the SOMO does not follow any standard protocol.  Instead you have to time the clock cycles and data timings manually.  Luckily someone has translated the 4D Systems sample code to work with the arduino:  http://forum.sparkfun.com/viewtopic.php?f=14&t=21388
  • The code doesn’t do exactly what I want but the main important part is the sendData(int) function:
  1. void sendData(int ThisSong)  //it says this song but it can be any 16 bit command
  2. {
  3. int TheSong = ThisSong;
  4. int ClockCounter=0;
  5. int ClockCycle=15;//0x0f;
  6. digitalWrite(pinClock,HIGH); // Hold (idle) for 300msec to prepare data start
  7. delay(300);
  8. digitalWrite(pinClock,LOW); //Hold for 2msec to signal data start
  9. delay(2); //2msec delay
  10. while(ClockCounter <= ClockCycle)
  11. { digitalWrite(pinClock,LOW);
  12. if (TheSong & 0x8000)
  13. {digitalWrite(pinData,HIGH);
  14. }
  15. else
  16. {digitalWrite(pinData,LOW)
  17. }
  18. TheSong = TheSong << 1;
  19. delayMicroseconds(200); //Clock cycle period is 200 uSec – LOW
  20. digitalWrite(pinClock,HIGH);
  21. ClockCounter++;
  22. delayMicroseconds(200); //Clock cycle period is 200 uSec – HIGH
  23. }
  24. digitalWrite(pinData,LOW);
  25. digitalWrite(pinClock,HIGH); // Place clock high to signal end of data
  26. }
  • Considering there may be a time I will not have the code given to me, its best to explain whats going on here so that I know how to do this with just data sheet timings.
  1. Lines 3-5 set up are pretty basic.  Declare a counter, declare a maximum, pass the parameter into the function.
  2. Lines 6-7 set the clock to high for 300ms to ensure a data reset between consecutive commands
  3. Lines 8-9 a two ms low tells the SOMO that the data stream will begin.
  4. lines 10-23 is the while loop.  16 cycles for the 16 bits of data
  5. line 11 sets the clock to low between bits.  The first run its already low so it doesn’t really matter but it doesn’t hurt to set it to low again
  6. lines 12-17 was really confusing to me at first.   I am used to only using Boolean operations within if statements.  & is a bit wise function comparison function.  Instead of checking the whole thing to see if its the same it checks each bit and only produces a 1 when both are 1 and 1.  Every other combination produces a 0.  So by comparing the command to 1000000000000000(0x8000) you will only get a non-zero value(true) if the leftmost bit is a 1.  If its true it sends a high and false sends a low.
  7. line 18 bit shifts left to test the next leftmost bit during the next cycle
  8. lines 19-22 I am not sure why this has a 400us delay.  The total cycle period is supposed to be 200us,  high should be 100us, and low should be 100us.  I guess as long as its consistent and under 1ms it will work.  The two delays are in place to ensure the clock cycle takes at least 400us(it should be 200us).
  9. lines 24-25 are just used to set the idle state.  A high on the clock line lasting more then 2ms stops that data transmission.  The data line doesn’t have to be set low during idle but why not.
  • The 300ms delay(+20ms processing after command is received) between commands is a bit long.  Our amplifiers are much quicker(100ns per pulse cycle*steps) so this shouldn’t hurt response time too much except on initial contact.  I believe when you send the command for select track and it will auto play but if you have to do two commands to do this that would be over a half second delay…  I can probably minimize this by having a delta t function which measures the time between commands and delays the difference if its under 300ms.

Phil 3.9.11

7:30 – 5:30 VISIBILITY

  • Sent Christine some screenshots of my setup for RemoteObjectTestbed
  • Server meetings this afternoon – looks like the goal is to have the server up and ready for us to load things on it by the end of April
  • Clean up some of the R code and make a correlation widget that accesses a VISIBILITY table.

Tom.DeVito 3.8.2011

Arduino – SOMO interfacing:

  • Was originally going to communicate with the SOMO 14D by using the push-button operations using the digital outs of the arduino because it only has one serial port.  There were a few problems with this approach.
  1. Takes many digital outputs to control one SOMO
  2. Cannot easily switch between tracks which are not right next to each other
  3. Hard to control active-low switches without the use of a gate
  • The solution is of course to use serial.  But one port is not enough for even a 2 finger prototype.  Lucky there is a way to make the other digital ports act like serial ports using the SoftwareSerial library.  An example of how this can be done is found here:  http://arduino.cc/en/Tutorial/SimpleSoftwareSerial
  • Was not sure if the regulated 3.3 volt port on the arduino would work for the SOMO.  Found out it puts out 50ma and the SOMO’s peak consumption is 45ma.  This should work for one but we will probably need a 3.3v voltage regulator for any others.  Sparkfun(http://www.sparkfun.com/products/526) sells them so we can get them when we get the other SOMOs.  The ones sparkfun sells can output up to 800ma so one would be all we need to power all the SOMOs.  I think a decoupling capacitor on the power input protects the circuit from receiving too many amps.  The wiki article was a bit confusing on this matter.  I will read it a bit more in depth and ask Clift if I can’t figure it out.
  • An interesting article on unregulated power supplies: http://www.sparkfun.com/tutorials/103
  • Formatted uSD to have 16-bit fat file system.  Also changed some music files to .ad4 and copied them to the uSD.
  • Should be ready to wire up the SOMO tomorrow.  The SOMO data sheet is poorly organized which has held me back a little bit.  I do not want to fry the thing out of carelessness.  Hopefully our memory card works, its not on the definitely doesn’t work list so that is good.

MISC:

  • You can now scan to email with the printer.  The e-mail portion wasn’t working before because they changed the server after we moved here.  Now instead of using mail.fgm.com:25 we use spam.fgm.com:25.  This is the only easy way to scan documents for Windows 7 machines which do not have the HP Solution center software yet.

Mike 3.8.2011

Thanks for Phil’s suggestion, it should be easy to demo using a jetty instance run from a CD.  For now all the data services return hard-coded values so a database connection won’t be needed yet.  I should probably still test putting this on a CD and logging in to a guest account with minimal privileges and see if it works.

  • Got the log-in screen and remote service working for the WebDesk application.
  • Created a module project containing the SCT Report demo and loaded it in to WebDesk
  • Ran in to an issue with the AdvancedDataGrids in the reports, some of their required parts were not being loaded, got around it by including an invisible AdvancedDataGrid in WebDesk to be sure all required classes are loaded
  • Got the hardcoded Quad chart working in the webdesk

Next will be getting the commenting stuff to work.

Dong Shin 03.08.2011

  • PPM
    • Added dynamic button control updates to RequestEmailTextHBox so that the buttons get updated based on the projects selected
    • fixed a bug exporting projects out of FY range
    • fixed a bug filename not getting from description

Tom.DeVito 3-7-2011

Notes on programming the Arduino:

  • Main program consists of setup() to initialize and loop() for continuous operation.
  • Pins are set to input by default.  This is good for reading digital sensors but has really low current(ex photocells).  In order to change it to output mode, call pinMode(pin#, OUTPUT)
  • digitalWrite(pin#, setting) allows you to set the pin HIGH or LOW.   This can output or sink 40 ma.
  • Analogue inputs can be used as digital outputs in output mode.    In input mode, the pull up resistor can be activated by setting the pin high.  All analogue pins numbers are prefixed with ‘a’.
  • It may be good to put short delays between analogue sensor reads to lower the electrical noise.
  • Power width modulation is a way mimic an analogue output by digital means.  The pins capable of this seem to be marked.  This can be done using analogueWrite(value)
  • There are 3 types of memory on the arduino, 16kb(with 2kb used for bootloader) Flash, 1024 bytes of SRAM, and 512 bytes of EEPROM.  The main program resides in the flash memory while active variables are stored in the SRAM.  The EEPROM memory is non-volatile and can be used to hold states between power downs.
  • One way to save memory is to use #define for constants.  Using this instead of declaring variables, save memory by replacing all instances of the constant on compile for it doesn’t have to sit in memory.  You can also store constants in the program memory using the PROGMEM keyword.
  • Libraries: http://arduino.cc/en/Reference/Libraries

Phil 3.8.11

7:00 – 7:00pm VISIBILITY

  • Walked through the new version of PPM with Christie, she thinks it’s fine, and will check with Trish. I’ll follow up at 3:00, when I have my meeting with Kris U.
  • Working from home this morning, waiting for my microwave.
  • Looks like the reason for the slowness of the RServe response was that the HashMap that I had the RConnection object wasn’t static. Odd, since the remote object appears to be persistent…
  • I have a new microwave!
  • R really hates windows paths – you have to make sure to replace all the instances of ” with ‘/’ or you kill R.
  • Got all the pieces working. Calculations, plots, the works. Need to do some clean up and commenting, and then make widgets!

Mike 3.7.2011

Back to working the visualization part in order to get something to show the customer.

  • Working on figuring out how to run something inside without hosting it on a server
    • Should be able to open a swf/html file from a CD as long as it doesn’t require any outside services except maybe loading xml files locally
    • Hard coded some methods to fill a local data cache with data for the report viewer
  • Figure we need some of the basic stuff even if it isn’t wired:
    • Users and a login screen
    • Ability to comment on things in reports
    • Have a log in screen working and connecting to a remoteobject, need to figure out how to turn the remoting on/off at run-time (some kind of demo mode)

Dong Shin 03.07.2011

  • PPM
    • revised Project Export to show distinct FY data with appropriation, FT name, FT number, Activity Amount
    • reworked the Export queries to retrieve valid data – invalid data retrieved…..
    • disabled status changes for non-selected projects in data request
    • added Export to Request Form

Phil 3.7.11

7:00 –  5:00 VISIBILITY

  • Somehow I lost last Friday’s entry.
    • Walked through the PPM app with Trich, Christie and Leah. There were some problems with how the spreadsheet was getting assembled, but they liked the message organizer.
    • Went over the changes with Dong. He finished up on Friday, and we’re testing today
    • Having very slow response from R when the remote object is running in the server. Odd, because response was immediate when the app was running in java directly. Have to poke at that.
  • Testing Dong’s update
  • Install this morning?
  • I may or may not be leaving this morning. I’m getting a range installed, but the delivery of the range may have been canceled.
  • Added RFlexServer and RFlexClient to SVN
  • Deployed the new PPM but items that had dollar figures did not post while items that did not have dollar figured *did* post. Talked to Dong about this,  and added the bug to the PPM list.
  • Got RFlexServer and RFlexClient running on my home box. Started working on why responses are so slow. THey are not, if R is not being called. Going to try making the reference static.
  • Got a new version of PPM from Dong and deployed it. It seems to be working, in that spreadsheets seem to have the appropriate numbers in them :-). I’m going to talk to Christine and Trish tomorrow.
  • Set up a meeting with Kris U. tomorrow at 3:00

Christine 03.05.2011

  • Spent time getting MySQL synced up with Eclipse and getting Ingest Manager working
    • Reinstalled MySQL on mac (major messup. Not sure what went on there). Got it working with Eclipse and did a few tests to be perfectly sure all was working
    • Began working on Ingest Manager — syncing it up with the J2EE projects (RemoteObjectTestbed — it was easier to stick with Phils naming convention). Was able to get it up, but not running. I’m thinking this has to do with the Java packages that need to be created (the ones that should coincide with what’s called in the remote-config.xml file).
    • Currently working creating the Java packages.