#robotics Logs

May 15 2018

#robotics Calendar

12:05 AM AchiestDragon: its for a vlfo for a synth , ie a 100hz to .01hz cycle time , so cant get away digital even if i used 16bit the steps would be noticable on the waveform
12:12 AM rue_mohr: yup
12:12 AM rue_mohr: ok
12:12 AM rue_mohr: so I have 12 binary codes to remap
12:12 AM rue_mohr: 0000000
12:12 AM rue_mohr: 1000100
12:12 AM rue_mohr: 0100100
12:12 AM rue_mohr: 0010100
12:12 AM rue_mohr: 0001100
12:12 AM rue_mohr: 1000010
12:12 AM rue_mohr: 0100010
12:12 AM rue_mohr: 0010010
12:12 AM rue_mohr: 0001010
12:12 AM rue_mohr: 1000001
12:12 AM rue_mohr: 0100001
12:12 AM rue_mohr: 0010001
12:12 AM rue_mohr: 0001001
12:12 AM rue_mohr: whats a good way of remapping those to 0-11
12:12 AM rue_mohr: er 0-13
12:12 AM rue_mohr: I want to avoid a 128 byte lookup table
12:12 AM rue_mohr: I wonder if I can do a temporally reversed cart/horse inversion technique
12:13 AM rue_mohr: brains a little low on juice
12:13 AM rue_mohr: given I knew what the answer was
12:13 AM rue_mohr: I could easily us a 16 byte table to look up the question
12:14 AM rue_mohr: damnit, drawing a blank
12:17 AM AchiestDragon: there was a one chip solution for that use a 74188
12:24 AM rue_mohr: maybe your right, treat it likea dual 4 bit priority encoder
12:25 AM rue_mohr: I still want to try to do it backwards
12:25 AM AchiestDragon: the last 3 000 , 100 , 010 , 001 call bits c,d,e a = c or e , b = d or e , 4 diodes to make the or gates for that , encodes the last 3 bits for you
12:25 AM AchiestDragon: and gives you a 00 , 01, 10 ,11 binary out
12:27 AM rue_mohr: kinda 00 dosn't help
12:27 AM rue_mohr: I dont think
12:28 AM rue_mohr: hmm
12:28 AM AchiestDragon: 00 is no key pressed so yea you still need that
12:29 AM rue_mohr: but I cant take 0000 0001 0010 0100 1000 and turn it into a 2 bit code
12:30 AM rue_mohr: but if I could, I could scratch a lot of cicuit
12:30 AM rue_mohr: ...
12:31 AM rue_mohr: ooo hmmm
12:32 AM rue_mohr: ooo hmmm
12:32 AM rue_mohr: so, I have 4columns and 3 rows
12:32 AM rue_mohr: so row codes can be 1, 2, 3
12:33 AM rue_mohr: where its always a non-zero value
12:33 AM rue_mohr: and column codes can be 0, 1, 2, 3
12:33 AM AchiestDragon: 7 dioes for the 4 bit to 3 bit encoder with the 4 diods for the 3 bit to 2 reducing it to 5 bits
12:34 AM rue_mohr: 8 didoes total, but
12:35 AM rue_mohr: turn this on its side...
12:37 AM AchiestDragon: if you use a quad 2 input nor gate and 4 to 6 diodes you may get away with encoding that down to 4 bits ,
12:39 AM rue_mohr: no I need to shift the data 3 times
12:40 AM rue_mohr: almost there
12:40 AM rue_mohr: 2 times, 3 ors
12:47 AM rue_mohr: their 2 input tho
12:54 AM rue_mohr: A = K | (K << 1)
12:55 AM rue_mohr: A |= K | (K << 2)
12:55 AM rue_mohr: or use
12:56 AM rue_mohr: A = K | (K<<1)
12:56 AM rue_mohr: A = K | (K>>1)
12:56 AM rue_mohr: er |= on last
01:03 AM rue_mohr: return( ( (K & 0x01) | (K>>1)) | ( (K<<1) |(K>>1)) );
01:03 AM AchiestDragon: inputs in order a,b,c,d,e,f,g outputs w,x,y,z w =(a or c) and (e,f or g) , x =( b or d) and (e f or g) , y = g or e , z = g or f
01:03 AM rue_mohr: 0 -> 0
01:03 AM rue_mohr: 1 -> 3
01:03 AM rue_mohr: 2 -> 1
01:03 AM rue_mohr: 4 -> 2
01:03 AM rue_mohr: so close
01:05 AM AchiestDragon: 11 diodes and 2* 2input and gates
01:05 AM rue_mohr: I can do it in 8 diodes tho
01:09 AM rue_mohr: oh huh
01:09 AM rue_mohr: ok I'm going with what I have there
01:09 AM rue_mohr: the binary ends up in the wrong places
01:09 AM rue_mohr: test this ...
01:21 AM rue_mohr: one of the things this did reveal, is that I only need 6 bits, so if I did use a lut, its only 64 entries
01:21 AM rue_mohr: is 64 bytes worth more or less than...
01:21 AM rue_mohr: tmp = ( ( (K & 0x01) | (K<<1)) | ( (K<<1) |(K>>1)) );
01:21 AM rue_mohr:
01:21 AM rue_mohr: return ((tmp & 0x03) | ((tmp & 0x30) >> 2));
01:21 AM rue_mohr: * not working quite right yet
01:22 AM rue_mohr: or, 8 diodes
01:22 AM rue_mohr: I think the instructions are the most expensive
01:23 AM rue_mohr: its gonna eat up more than 64 bytes just for the instructions
01:23 AM rue_mohr: the table is not particularily heavy...
01:25 AM rue_mohr: and the diodes can be a 10 pin SIP, or a 16 pin dip
01:25 AM AchiestDragon: just rechecked correction to my solution is inputs in order a,b,c,d,e,f,g outputs w,x,y,z w =(c) and (e,f or g) , x =( b or d) , y = g or e , z = g or f , 9 diodes and one and gate
01:25 AM rue_mohr: thats circuit realestate tho
01:26 AM AchiestDragon: oh
01:27 AM rue_mohr: so I wonder whats generally worth less?
01:27 AM rue_mohr: kinda comes down to a 64 byte table or a few diodes
01:27 AM AchiestDragon: just rechecked correction to my solution is inputs in order a,b,c,d,e,f,g outputs w,x,y,z w =(a or c) , x =( b or d) , y = g or e , z = g or f , 8 diodes yea
01:28 AM rue_mohr: I suppose the table is worth less than diodes,
01:28 AM rue_mohr: the diodes might be a fraction of a cent ea, and take up about 0.3"x0.1" board space
01:29 AM rue_mohr: hmmm
01:30 AM rue_mohr: so a whole keyboard decoder COULD be 7 resistors, 3 transistors, and 8 diodes
01:30 AM rue_mohr: 3x4 keyboard
01:31 AM rue_mohr: pretty good for scanning/decoding a 12 button keyboard
01:31 AM AchiestDragon: output coding 0000 , 0010 , 1010, 0110 , 1110, 0001 , 1001, 0101 , 1101 , 0011, 1011 , 0111 , 1111 so 1000 , 0100 , 1100 are not used
01:31 AM rue_mohr: with 0000 being 'no key'
01:31 AM AchiestDragon: yea
01:32 AM rue_mohr: how are your other projects going?
01:33 AM AchiestDragon: robots doing ok but wating for parts , so been doing synth bits , trying to use parts i already have have
01:38 AM AchiestDragon: my sons birthday next month so have to stop spending on bits so i can afford his bday present
01:38 AM rue_mohr: !!
01:39 AM AchiestDragon: so projects like https://drive.google.com/file/d/1lmv5Xr7miYGzqFo7sHi7Q1gKRru8MFz1/view?usp=sharing
01:41 AM AchiestDragon: the "NOS AMP" i nick named it as its NOS as in all new old stock bits , well other than had to order new tube bases as i ran out of b9a's
01:42 AM rue_mohr: you really are insane
01:42 AM rue_mohr: :)
01:42 AM AchiestDragon: it helps sometimes
01:43 AM rue_mohr: hmm
01:44 AM rue_mohr: calc "(ResultBase=16) 64"
01:44 AM rue_mohr: (ResultBase=16) 64 -->> 0x10
01:44 AM rue_mohr: 6 bits
01:44 AM rue_mohr: wtf doesn't add up here
01:45 AM rue_mohr: 0x10 is 5 bits
01:45 AM rue_mohr: zippo:/files/programming/c/tests# calc "0b00111111"
01:45 AM rue_mohr: 0b00111111 -->> 63
01:46 AM rue_mohr: ack, my calculator program is playing up on me
01:47 AM rue_mohr: zippo:/files/programming/c/tests# calc "63 (ResultBase=16)"
01:47 AM rue_mohr: 63 (ResultBase=16) -->> 0x3F
01:47 AM rue_mohr: better
01:47 AM rue_mohr: dont get that error tho
01:56 AM rue_mohr: hahah
01:56 AM rue_mohr: I have no code to paste this into
01:56 AM rue_mohr: uint8_t KLUT = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00,
01:56 AM rue_mohr: 0x05, 0x06, 0x07, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
01:56 AM rue_mohr: 0x09, 0x0A, 0x0B, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
01:56 AM rue_mohr: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
01:57 AM rue_mohr: I suppose if the default were 0x0F, it could be a keybaord error
02:00 AM rue_mohr: ok
02:00 AM rue_mohr: uint8_t KLUT = {
02:00 AM rue_mohr: 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x01, 0x02, 0x03, 0x0F, 0x04, 0x0F, 0x0F, 0x0F,
02:00 AM rue_mohr: 0x05, 0x06, 0x07, 0x0F, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
02:00 AM rue_mohr: 0x09, 0x0A, 0x0B, 0x0F, 0x0C, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
02:00 AM rue_mohr: 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F };
02:00 AM rue_mohr: so then you can distinguish an error from there being no key pressed
02:10 AM AchiestDragon: with the 8 diode encoder and the unused codes isnt it just input as lower nibble to a word and subtract 4 if reult is negative then its an error ,
02:10 AM rue_mohr: ok, the FSM for the lock has 5 states, 12 input events, and 1 output event...
02:10 AM rue_mohr: not even that, 0 IS no key
02:10 AM rue_mohr: every keycode HAS TO have atleast 1 bit set
02:11 AM rue_mohr: due t the nature of the circuit
02:11 AM rue_mohr: there is no column 0, just 1, 2, 3
02:11 AM rue_mohr: but there are rows 0, 1, 2, 3
02:11 AM rue_mohr: a row AND a column always get triggered
02:11 AM rue_mohr: togethor
02:12 AM rue_mohr: so, if you get a column without a row, you know its row 0
02:12 AM AchiestDragon: input subtract 3 , if negative then error if zero then no key
02:12 AM rue_mohr: and there is no column 0
02:13 AM rue_mohr: so, 4 bits, 2 for row, 2 for column, you know if you read a 0 that there is no key
02:13 AM rue_mohr: or, skip the diodes and soldering, use up 64 bytes of memory, which arguably, could be 24
02:13 AM rue_mohr: or less
02:14 AM rue_mohr: 37 min
02:14 AM rue_mohr: or subtract off the first 8 and do a little more logic, so 29 min
02:15 AM rue_mohr: I dont think the computation is worth the memory tho
02:15 AM rue_mohr: the diodes could be fit into a soic 14, if one had the technology
02:16 AM rue_mohr: wait, is there a dual 4 input priority encoder?
02:16 AM rue_mohr: ttl?
02:16 AM AchiestDragon: depends if your tight on memory space or not ,
02:16 AM rue_mohr: I'm getting bad, I used to know everythign
02:16 AM rue_mohr: yea, and I'm not
02:16 AM rue_mohr: the lookup table is ok with me, like I say, 64 bytes is a little heavy, but not tooo bad
02:17 AM AchiestDragon: and the encoder if your short of i/o pins
02:19 AM rue_mohr: good point
02:19 AM rue_mohr: technically, with the diodes, I can do a bsic kepad lock on a t13
02:20 AM rue_mohr: 4 bits for the pad, and 1 bit out for the lock
05:43 AM Jak_o_Shadows: Also, I had an idea the other day: those kitchen scale sensors - the long ones, not the flat ones - use them as part of the leg joints in the quadrapod
05:43 AM Jak_o_Shadows: OR maybe the spine - either way, i'm sure you'd get SOME useful information out of it
05:51 AM SpeedEvil: 'not the flat ones'?
05:51 AM SpeedEvil: Strain guages are commonly used.
05:52 AM SpeedEvil: https://www.aliexpress.com/wholesale?spm=2114.search0104.13.2.1ea46afa5AdjDC&initiative_id=SC_20180515031622&SearchText=strain+gauge
05:52 AM SpeedEvil: Either as whole canned units, or as stick-on sensors
05:52 AM SpeedEvil: To a moderate fraction, motor current can do the same thing
06:04 AM Jak_o_Shadows: But yeah, buying whole units is definitely the plan, individual units is a complexity I don't really want at the moment.
03:55 PM Tom_itx is now known as Tom_L
11:13 PM rue_shop4: AchiestDragon, 8 diodes, or 4 transistors
11:13 PM rue_shop4: (bipolar)
11:17 PM rue_mohr: trying to find a nice little diode array on ali
11:17 PM rue_mohr: hey, hows the printer?
11:18 PM rue_mohr: where are you at?
11:18 PM zhanx: over here
11:18 PM rue_mohr: your not here then, that would be a shock
11:19 PM zhanx: it would
11:26 PM rue_mohr: AchiestDragon, led matrixes cost less than diode arrays! ;)
11:29 PM rue_mohr: do you think the right leds can reliably be blown open to program it to decode the keyboard?
11:34 PM rue_mohr: I suppose an RGB led is a 3 input or gate