User Tools

Site Tools


tiger_programmable_logic_card

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tiger_programmable_logic_card [2019/05/13 23:50]
jon [Clock]
tiger_programmable_logic_card [2019/06/20 18:10] (current)
jon [Available Presets]
Line 177: Line 177:
 | 35      | BNC3 source from cell 11                                                 | -             | BNC3         | 3.23+                                                                        | output clock on BNC3                                                   | | 35      | BNC3 source from cell 11                                                 | -             | BNC3         | 3.23+                                                                        | output clock on BNC3                                                   |
 | 36      | cell 10 set to reflect cell 8                                            | 10            | -            | 3.27+                                                                        | use shutter logic without micro-mirror TTL1 signal ​                    | | 36      | cell 10 set to reflect cell 8                                            | 10            | -            | 3.27+                                                                        | use shutter logic without micro-mirror TTL1 signal ​                    |
 +| 37      | BNC1 selected, turned on by cell 10                                      | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: laser #1 selected ​                                    |
 +| 38      | BNC2 selected, turned on by cell 10                                      | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: laser #2 selected ​                                    |
 +| 39      | BNC3 selected, turned on by cell 10                                      | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: laser #3 selected ​                                    |
 +| 40      | BNC4 selected, turned on by cell 10                                      | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: laser #4 selected ​                                    |
 +| 41      | BNC5 selected, turned on by cell 10                                      | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: laser #5 selected ​                                    |
 +| 42      | BNC6 selected, turned on by cell 10                                      | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: laser #6 selected ​                                    |
 +| 43      | BNC7 selected, turned on by cell 10                                      | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: laser #7 selected ​                                    |
 +| 44      | BNC2 and BNC4 selected, turned on by cell 10                             | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: lasers #2 and #4 selected ​                            |
 +| 45      | BNC3 and BNC5 selected, turned on by cell 10                             | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: lasers #3 and #5 selected ​                            |
 +| 46      | BNC4 and BNC6 selected, turned on by cell 10                             | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: lasers #4 and #6 selected ​                            |
 +| 47      | BNC5 and BNC7 selected, turned on by cell 10                             | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: lasers #4 and #6 selected ​                            |
 +| 48      | BNC1 and BNC3 and BNC5 selected, turned on by cell 10                    | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: lasers #1 and #3 and #5 selected ​                     |
 +| 49      | BNC2 and BNC4 and BNC6 selected, turned on by cell 10                    | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: lasers #2 and #4 and #6 selected ​                     |
 +| 50      | BNC1-7 all turned off                                                    | -             | BNC1-7 ​      | 3.29+                                                                        | 7 channel laser: all lasers off                                        |
 +| 51      | BNC1-8 sourced from cells 17-24 (requires 24-cell build) ​                | -             | BNC1-8 ​      | 3.29+                                                                        | 7 channel laser: no laser selected ​                                    |
 ==== Accessing outputs over serial ==== ==== Accessing outputs over serial ====
  
Line 232: Line 247:
 ==== Clock ==== ==== Clock ====
  
-To create a free-running clock with user-selectable period and duty cycle you can combine two non-retriggerable one-shot cells. ​ The first cell's trigger is connected to logic high, but because it is non-retriggerable it will simply trigger itself whenever it has, thus outputting a pulse once per delay period. ​ That pulse triggers a second one-shot which generates the clock output whose duration sets the time the output signal is high (i.e. the duty cycle is the ratio of the one-shot duration with the delay period).+To create a free-running clock with user-selectable period and duty cycle you can combine two non-retriggerable one-shot cells. ​ The first cell's trigger is connected to logic high, but because it is non-retriggerable it will simply trigger itself whenever it has, thus outputting a pulse once per delay period. ​ That pulse triggers a second one-shot which generates the clock output whose duration sets the time the output signal is high (i.e. the duty cycle is the ratio of the one-shot duration with the delay period).  From the 4kHz internal clock it is possible to generate up to 2kHz clock by this means.
  
---> Script: clock signal on BNC1 output #+--> Script: clock signal on BNC3 output #
 <code java> <code java>
 // generate a clock signal based on the internal 4kHz clock, e.g. for triggering a camera // generate a clock signal based on the internal 4kHz clock, e.g. for triggering a camera
-// currently hard-codes using cells 1 and 2 and BNC output #1+// currently hard-codes using cells 1 and 2 and BNC output #3
  
 // variables to be edited by user // variables to be edited by user
-double clockFrequencyHz = 100.0;  // clock frequency in Hertz+double clockFrequencyHz = 100;  // clock frequency in Hertz
 double clockDutyCycle = 0.5;     // should be between 0 and 1 exclusive double clockDutyCycle = 0.5;     // should be between 0 and 1 exclusive
  
Line 258: Line 273:
 int addrEdge = 128; int addrEdge = 128;
 double ticsPerSecond = 4000.0; double ticsPerSecond = 4000.0;
-int addrOutputBNC1 ​33+int addrOutputBNC3 ​35
-int addrOneShotClk ​= 1; +int addrDelayNRT ​= 1; 
-int addrOneShotOut ​= 2;+int addrOneShot ​= 2;
  
 // figure out the cycle period and high period in terms of PLC "​tics"​ (4kHz) // figure out the cycle period and high period in terms of PLC "​tics"​ (4kHz)
-int clockPeriodTics = (int) (ticsPerSecond/​clockFrequencyHz + 0.5) - 1; +int clockPeriodTics = (int) (ticsPerSecond/​clockFrequencyHz + 0.5)
-int clockHighTics = (int) (clockPeriodTics * clockDutyCycle) ​+ 1;+print("​have " + (clockPeriodTics-1) + " (+1) tics in one-shot for actual frequency of " + ticsPerSecond/​(clockPeriodTics))
 +int clockHighTics = (int) (clockPeriodTics * clockDutyCycle);​
  
 // turn off updates to speed communication // turn off updates to speed communication
Line 270: Line 286:
 mmc.setProperty(plcName,​ propUpdates,​ valNo); mmc.setProperty(plcName,​ propUpdates,​ valNo);
  
-// do programming of one-shot cells +// do programming of one-shot ​and delay cells 
-mmc.setProperty(plcName,​ propPosition, ​addrOneShotClk);+mmc.setProperty(plcName,​ propPosition, ​addrDelayNRT);
 mmc.setProperty(plcName,​ propCellType,​ valOneShotNRT);​ mmc.setProperty(plcName,​ propCellType,​ valOneShotNRT);​
-mmc.setProperty(plcName,​ propCellConfig,​ clockPeriodTics);​+mmc.setProperty(plcName,​ propCellConfig, ​(clockPeriodTics-1));
 mmc.setProperty(plcName,​ propCellInput1,​ addrInvert + addrEdge); ​ // trigger cell as fast as we can, but NRT prevents re-triggering when active mmc.setProperty(plcName,​ propCellInput1,​ addrInvert + addrEdge); ​ // trigger cell as fast as we can, but NRT prevents re-triggering when active
 mmc.setProperty(plcName,​ propCellInput2,​ addrInvert + addrEdge); ​ // clock on every tic mmc.setProperty(plcName,​ propCellInput2,​ addrInvert + addrEdge); ​ // clock on every tic
  
-mmc.setProperty(plcName,​ propPosition, ​addrOneShotOut);+mmc.setProperty(plcName,​ propPosition, ​addrOneShot);
 mmc.setProperty(plcName,​ propCellType,​ valOneShotNRT);​ mmc.setProperty(plcName,​ propCellType,​ valOneShotNRT);​
 mmc.setProperty(plcName,​ propCellConfig,​ clockHighTics);​ mmc.setProperty(plcName,​ propCellConfig,​ clockHighTics);​
-mmc.setProperty(plcName,​ propCellInput1, ​addrOneShotClk);  // trigger cell as fast as we can, but NRT prevents re-triggering when active+mmc.setProperty(plcName,​ propCellInput1, ​addrDelayNRT);  // trigger cell as fast as we can, but NRT prevents re-triggering when active
 mmc.setProperty(plcName,​ propCellInput2,​ addrInvert + addrEdge); ​ // clock on every tic mmc.setProperty(plcName,​ propCellInput2,​ addrInvert + addrEdge); ​ // clock on every tic
  
 // connect to BNC output // connect to BNC output
-mmc.setProperty(plcName,​ propPosition, ​addrOutputBNC1); +mmc.setProperty(plcName,​ propPosition, ​addrOutputBNC3); 
-mmc.setProperty(plcName,​ propCellConfig, ​addrOneShotOut);+mmc.setProperty(plcName,​ propCellConfig, ​addrOneShot);
  
 // restore updates // restore updates
 mmc.setProperty(plcName,​ propUpdates,​ valUpdatesOriginal);​ mmc.setProperty(plcName,​ propUpdates,​ valUpdatesOriginal);​
 +
 +
  
  
Address: 29391 W Enid Rd. Eugene, OR 97402, USA | Phone: +1 (541) 461-8181
tiger_programmable_logic_card.1557791444.txt.gz · Last modified: 2019/05/13 23:50 by jon