Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Splode
Jun 18, 2013

put some clothes on you little freak

Foxfire_ posted:

For very bottom end knock offs, check/fix them before you plug them in though. There was awhile about a year ago where some of the $50 858D knock-offs had an unfortunate problem of connecting the chassis to either the hot or neutral AC line.

Yikes

Adbot
ADBOT LOVES YOU

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I tried repairing one while it was plugged in but off, figuring the switch would cut off live in the heater element at least


lol

GnarlyCharlie4u
Sep 23, 2007

I have an unhealthy obsession with motorcycles.

Proof

Splode posted:

Agreed, and a cheap hot air station will be adequate for years and years

Depending on the station I would disagree.
I've melted 2 of the cheap Chinese hot air + soldering stations like you find on Amazon.
The fans poo poo the bed and you have about 4 seconds to turn it off and blow cold air on it before it just completely melts through the lovely plastic housing and wiring, making any potential repair impossible.

Splode
Jun 18, 2013

put some clothes on you little freak

GnarlyCharlie4u posted:

Depending on the station I would disagree.
I've melted 2 of the cheap Chinese hot air + soldering stations like you find on Amazon.
The fans poo poo the bed and you have about 4 seconds to turn it off and blow cold air on it before it just completely melts through the lovely plastic housing and wiring, making any potential repair impossible.

Ouch fair enough. I was more referring to the idea that in the end, hot air is hot air. So long as it can maintain a stable temperature, it gives you the same almost the same capabilities you get from an expensive one. The only things you miss out on is that the displayed temperature, if it even has one, will likely be bogus, and it might not last that long.

Also apparently some models will kill you or burn your house down but that's no biggie right

Cyril Sneer
Aug 8, 2004

Life would be simple in the forest except for Cyril Sneer. And his life would be simple except for The Raccoons.
Hey goons, I'm an academic DSP guy and my C is pretty weak. We have a firmware guy, but he's pretty green too.

We're working with the NRF52832 IC. We're taking in 16 bit samples and I want to map them into 8 bit samples, using the non-linear mapping depicted here:

https://imgur.com/a/H0f8GBX

Basically, a tanh look up table, mapping all 65536 values into 256 values. I proposed a LUT implementation, but my FW guy said there isn't enough memory to hold the table (no idea if this a legit claim or not...) Sampling rate is 11025 Hz, so the conversion method needs to be able to keep up with this.

I feel like this should be easily do-able, but I'm pretty naive with this stuff. Any guidance would be most appreciated!

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Why are you trying to map 16-bit input to a 16-bit LUT, and then downscaling it?


Why don't you downscale it first? Just shift right by 8 bits, then do an 8-bit LUT

Edit: or even 9-bit if you're worried about aliasing

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe
E: bad and factually incorrect post, but linear interpolation is good and should be used. It's big cost, however, are the multiplies and adds I didn't even mention here.

Do as few entries as you can get away with (i.e. bound your error) and linearly interpolate. So do two lookups for each point, sum them, and then divide that result by 2 (decrement exponent/shift fixed point value right 1 position). You can afford two lookups right?

Stack Machine fucked around with this message at 01:36 on Jul 1, 2020

Cyril Sneer
Aug 8, 2004

Life would be simple in the forest except for Cyril Sneer. And his life would be simple except for The Raccoons.

ante posted:

Why are you trying to map 16-bit input to a 16-bit LUT, and then downscaling it?


Why don't you downscale it first? Just shift right by 8 bits, then do an 8-bit LUT

Edit: or even 9-bit if you're worried about aliasing

Not following you here (and maybe my understanding of a LUT is incorrect) but the idea is that you take the 16 bit value (which will fall between 0 - 65565) and just pull out the associated 8 bit value. The plot was just a way of showing the overall effect.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
A look up table is just an array.

Like an Excel spreadsheet, one column incrementing from 0-65535 (if it's a 16-bit number) and the other column with whatever your associated output number is. Same number of rows for both columns, it's a 1:1 relationship.


Yeah, 65536 values is quite a lot to store in a microcontroller's memory. I believe your partner that it's not really feasible.



But you actually only want an 8-bit number, 256 values, right? That should be totally fine for most microcontrollers.


Instead of creating a 16-bit LUT, just throw out your 8 LSBs for the input numbers, and create a LUT for that.

Foxfire_
Nov 8, 2010

Other possibilities:
- You may have space to put a 64K LUT in flash instead of RAM.
- You have a FPU on that chip and a fast clock. Do you have time to just compute it with a few terms of a taylor series?
- If you need a table and need it to have perfect edges, use the fact that tanh() is monotonic and have a 256 x uint16_t table of the input values that cause the output to change. Then to convert an input, binary search to find the indices it is between, and that's the output value. You could also exploit symmetry to cut this to 128 x uint16_t

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe
I'm sorry I realize looking at my post that it is too terse to be of any value and actually is not really applicable. Let me try again.

A 256-entry LUT is not what you want for this, probably.

The function you link to looks like it is intended as a form of dynamic range compression. The whole reason for doing this is to preserve information from the LSBs for very "small" values while keeping range for larger values, much like floating point.

If you throw away your LSBs and then use a lookup table, you will still lose information from your LSBs. You will be using one of 256 input values to select one of 256 code words. This function is monotonically increasing and non-linear. This means all 256 code words can't possibly appear in the output of your LUT and some must necessarily repeat. You will lose the detail at small values the function is designed to preserve and also throw away some of the data from just using your upper 8 bits directly!

My original comment mentioned linear interpolation, complete with an incorrect definition. (I've just had knee surgery and I think I'm still a little anaesthesia-woozy) The idea there is you take the values a = lut(floor(x*N)) and b = lut(ceil(x*N + epsilon)) and compute a*(ceil(x*N + epsilon)/N-x) + b*(x - floor(x*N)/N), effectively drawing a line between the two LUT values and selecting a point from along that line. Not only can you get by with fewer LUT entries, even with a very basic approximation, as long as your multiplies are 16-bit, you still fulfill the function's original goal of dynamic range compression.

E: "epsilon" here in the Calc 1 sense of a very very small number. I.e. ceil(1.0 + epsilon) is 2.

Stack Machine fucked around with this message at 01:41 on Jul 1, 2020

Ambrose Burnside
Aug 30, 2007

pensive
How practical is it to use a conventional hot air gun for salvaging parts from old PCBs? not rework proper, nothing precision, just blasting every thru-hole part out of a board w as little labour and fuss as is possible.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

Ambrose Burnside posted:

How practical is it to use a conventional hot air gun for salvaging parts from old PCBs? not rework proper, nothing precision, just blasting every thru-hole part out of a board w as little labour and fuss as is possible.

It's probably the right tool for that particular job, but salvaging isn't really a worthwhile thing to be doing anymore!

Ambrose Burnside
Aug 30, 2007

pensive

ante posted:

It's probably the right tool for that particular job, but salvaging isn't really a worthwhile thing to be doing anymore!

turns out i take a deep and profound joy in stripping a board down to the FR4 and traces, figuring out what they all do/checking their values, and then sorting them neatly in the Salvage Organizer. definitely not a great use of my time, but it is impossibly satisfying for reasons i cannot articulate. also i managed to do an electronics repair for someone despite missing the part b/c i was able to pull it from some junked appliance boards from the dump, which will serve to vindicate my weird hoarding impulses forever

(I also think it's legit a good way for someone with a v patchy home parts inventory to build up a varied spread of certain types of components like sockets/connectors, oddball buttons/switches, transformers, fuses etc- the sorts of things you might need just one of in some very particular configuration down the line, but which you don't need bad enough to justify ordering a variety kit of ahead of time)

Ambrose Burnside fucked around with this message at 02:32 on Jul 1, 2020

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

ante posted:

It's probably the right tool for that particular job, but salvaging isn't really a worthwhile thing to be doing anymore!

depends, if you've found some high end board the PMICs and stuff can be worth a lot

GnarlyCharlie4u
Sep 23, 2007

I have an unhealthy obsession with motorcycles.

Proof

ante posted:

It's probably the right tool for that particular job, but salvaging isn't really a worthwhile thing to be doing anymore!

eh... I mean what the hell else am I gonna do in quarantine.

I'm kidding. It's not like I ever did anything before anyway.
But seriously I've already got boxes and boxes of poo poo that was dumpster bound anyway. So if I can just pop on some music and justify my tool purchases while keeping off the internet and not spending more money on keyboards then I'd say I'm actually making a fair amount from it.

Ambrose Burnside
Aug 30, 2007

pensive

GnarlyCharlie4u posted:

eh... I mean what the hell else am I gonna do in quarantine.

also this, i have a lot of downtime and am living on a shoestring budget, the only components coming in right now are the free kind i can pull out of curbed electronics. gently caress it, why not

Splode
Jun 18, 2013

put some clothes on you little freak
I like to salvage motors, sensors and power resistors but nothing else is worth my time.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Cyril Sneer posted:

Hey goons, I'm an academic DSP guy and my C is pretty weak. We have a firmware guy, but he's pretty green too.

We're working with the NRF52832 IC. We're taking in 16 bit samples and I want to map them into 8 bit samples, using the non-linear mapping depicted here:

https://imgur.com/a/H0f8GBX

Basically, a tanh look up table, mapping all 65536 values into 256 values. I proposed a LUT implementation, but my FW guy said there isn't enough memory to hold the table (no idea if this a legit claim or not...) Sampling rate is 11025 Hz, so the conversion method needs to be able to keep up with this.

I feel like this should be easily do-able, but I'm pretty naive with this stuff. Any guidance would be most appreciated!
Edit:

You're looking for a resource-efficient quantization technique. I thought maybe a Huffman Encoding would be a good way to go about this, but I'm a little bit weak in this area.

There's an awful lot of research in computer vision on this problem; I'm sure there's a very tiny and very fast way to implement your algorithm.

babyeatingpsychopath fucked around with this message at 13:05 on Jul 1, 2020

Dominoes
Sep 20, 2007

I recommend turning that curve into an analytic fn. A general approach might be to use a Taylor series: I'm suspicious you could describe it well enough with a few coefficients. In this case, I think you want to either use the original tanh (What's stopping you from using that? Computation speed?), or perhaps a logistic fn. If the calculations are too slow, as people in the C++ thread pointed out, you can approximate the middle area as linear, so you may wish to divide the range into domains, each defined by simple fns.

Dominoes fucked around with this message at 16:11 on Jul 1, 2020

Forseti
May 26, 2001
To the lovenasium!
Fuuuuuuuuck, my chips from Ali Express finally made it to my local post office after ~2 months, which they then marked as "Delivered" later in the afternoon. Only they weren't actually in my mailbox. loving awesome, it's only $15 but I'm not optimistic about getting my chips or my $15 back. Last time the post office marked something delivered and it wasn't, I called them and they were all "Computer says delivered, therefore it was delivered". That one showed up like a week and a half later, that's my only hope this time I guess :(

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

Forseti posted:

Fuuuuuuuuck, my chips from Ali Express finally made it to my local post office after ~2 months, which they then marked as "Delivered" later in the afternoon. Only they weren't actually in my mailbox. loving awesome, it's only $15 but I'm not optimistic about getting my chips or my $15 back. Last time the post office marked something delivered and it wasn't, I called them and they were all "Computer says delivered, therefore it was delivered". That one showed up like a week and a half later, that's my only hope this time I guess :(

I have had things say they were delivered, but to a different address in a different city, despite having the correct address in the system. USPS clearly has a watertight design.

I was only able to resolve it by going through the sender, which is probably not a productive option for you, unfortunately.

Forseti
May 26, 2001
To the lovenasium!
Yeah I filled out the email inquiry form thing for the USPS but I'm not counting on it. I think I'll try to contact the seller and see if I can buy 5 more chips + DHL shipping and have them throw in another 5 chips with it. Vendor does have good ratings, the problem as I see it in this situation is that both I and the vendor have probably done our parts and (just assuming) USPS probably screwed up and will just say "lol".

This is my first order ever from Ali Express so probably don't have much clout there. I usually buy things from China off of eBay but I couldn't find these on there. Sucks that there's no real mouser/digikey equivalent of this part, it's the F1C200s, an Allwinner ARM SoC with 64MB Ram build in in a QFN package. Closest thing from a western vendor is the PIC32MZ DA as far as I can tell, but those are $20 each as opposed to ~$2.

Edit: Holy crap the AliExpress shipping calculator for this product shows DHL at $53, nevermind. I was thinking more like $15-20 like it is from LCSC.

Forseti fucked around with this message at 16:11 on Jul 1, 2020

Ambrose Burnside
Aug 30, 2007

pensive
fwiw AE sellers give shitloads of refunds if you can demonstrate someone in the selling/shipping chain hosed up, often even if cheap untracked stuff never shows up. just contact them to work sth out before formally disputing it or giving a bad review, but if they try some weird poo poo after you reach out then go ahead and dispute it. also dispute if the protection window is running out.
order stuff by epacket where possible, it’s significantly faster than generic free airmail shipping and it’s tracked so you can prove incorrect deliveries and such. basically if you get shafted on AE you can often get refunded, alibaba is a hardass w vendors on that point or else nobody would roll the dice on waiting months for slightly cheaper goods

the gbs ae thread is handy for learning how to negotiate problems w vendors or get customized products despite nobody on their end speaking english, give it a read if you’re not sure how to navigate

Ambrose Burnside fucked around with this message at 17:43 on Jul 1, 2020

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Ignore shipping / tracking / everything information. Extend your protection time a couple times. Dispute it before it runs out.


The tracking information is usually wrong, just don't sweat it.

Have you played around with those Allwinner chips yet, on a dev board? I managed to compile Linux and get into a shell. Next step, compile the LCD support back into it, but I ran out of quarantine free time

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
Shipping from china is always a crapshoot. The tracking number will show it departing the facility like six times and then nothing, and then it's on your doorstep.

Forseti
May 26, 2001
To the lovenasium!
Yeah, I sent the email to USPS I'll wait to hear back from them. It still has like 25 days open on aliexpress. Like I said, I've had this happen with USPS before a few years ago and it showed up after 10 days or so after they claimed it was delivered. In that case though, I had my own mailbox on the street, this time I'm in an apartment and there's a big community box. They put mail in the wrong ones somewhat frequently and people usually just find where it's meant to go and drop it on the door step. Hopefully it just shows up eventually, but the main problem, I think, is that the tracking shows it as delivered which I assume would make disputing more difficult. I figure I'll at least wait to hear back from USPS before contacting the vendor if I need to.

Really I just want the drat chips, the $15 is annoying on principle but I'd rather just have the chips.

I do have the LicheePi Nano board with the f1c100s (which has 32MB of RAM instead of 64MB) and Linux supports it decently well. I wanted to play with the NTSC composite video input though and they didn't break it out on the board. It's also the chip used in the PocketGo Bittboy gameboy clone emulator thing which is where I first discovered it. For ~$2 it should be a great chip to play with if I could actually get one!

Ambrose Burnside
Aug 30, 2007

pensive
what’s an easy way to measure low capacitances, let’s say ~1pF up to at least 100pf?
wanna build a trim capacitor for my lil radio projects but i only have the plate calculations to go off of, but i may end up going with a weird archaic ~100 year old radio varcap design i found instead of the typical rotor approach. it’s a bit janky compared to the rotor type, the plate spacing is kinda loosey-goosey and the angle between the plates changes as you tune it, so i don’t expect it to hew particularly close to the plate calculations
(getting incredible déjà-vu here, sorry if i asked it 6 months ago and completely forgot)

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Do you have a scope?

Forseti
May 26, 2001
To the lovenasium!
Guess it depends on your definition of "easy", but if you have a scope and a fast edge pulse generator (IIRC he uses some 74HC part for the pulse generator in this video) you can figure it out with some basic parts and equations:

https://www.youtube.com/watch?v=74fz9iwZ_sM

Sagebrush
Feb 26, 2012

or a multimeter, some high-value resistors, and a stopwatch?

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
My preferred method is constant current charging and then just looking at the slope on the scope

Ambrose Burnside
Aug 30, 2007

pensive
No scope, unfortunately. i figured i’d have to use the RC timing method till i found some extremely clever microcontroller alternatives, i like this one b/c it just needs an arduino uno with no additional circuitry but is apparently p accurate down to ~1 pF
https://wordpress.codewrite.co.uk/pic/2014/01/25/capacitance-meter-mk-ii/

Forseti
May 26, 2001
To the lovenasium!
I still recommend that video to anyone interested in the concepts because he explains it really well and his level of grognardity is amazing: ham radio callsign username, Rhodia graph paper diagram, Manhattan style circuit construction, analog scope, and HP-11C calculator.

sharkytm
Oct 9, 2003

Ba

By

Sharkytm doot doo do doot do doo


Fallen Rib

Yeah, some of them were REALLY bad. Mine had the ground ring terminal crimped on the insulation, not the wire. And the front panel was floating compared to ground. A replacement ring terminal and some longer screws for the front panel took care of that. I've got 2 of them now, they're very usable if you don't mind the quality. Next one I buy is gonna be a Quick 861DW. I use mine a LOT, so it's worth spending the extra money IMHO. If you're using it for heat shrink and the occasional rework, an 858 clone is "fine", just check that it's grounded and doesn't have the hot tied to the case or wand tip.

GnarlyCharlie4u
Sep 23, 2007

I have an unhealthy obsession with motorcycles.

Proof
Sorry if this belongs in the tool thread but, I saw a variac on craigslist and the dude said "make me an offer." So I did. He didn't like the offer and countered with more then double what I'm willing to throw at a multi-post transformer with a knob and ammeter.

Why the gently caress do I need a variac again?

I literally can't think of a reason to get one except that it's a fuckton of copper with a big knob on top. I like copper and I also happen to like big knobs :wink:
I don't even own an incandescent bulb (at least a non-automotive one) and I ditched all my AC motors when I moved.
I don't even have any tube amps left.

Is there a cool project or something I could come up with to justify it? I don't really have a desire to gently caress with Tesla coils.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
The last time I used one, I was rectifying the AC to give me a really high current variable DC supply, with which to erode copper. The time before that, I was in school.



They're really really cool, but I probably wouldn't throw a bunch of money at one, unless I had something immediate that needed it. They're also really hard to find good ones now, old universities / ebay are basically the only way.


Isolation transformers, however, are extremely cool and useful and I would pick one up immediately if given the option.

Ambrose Burnside
Aug 30, 2007

pensive
so i finished building that fm locating transmitter that called for that obsolete LM3909 i was posting about a page or two back; i ended up building the LM3909-equivalent w discreets, which lets me power the thing with a single 1.5v battery. which i dont have any holders for. so i designed my own breadboard-compatible wire AA terminals / a modular breadboard battery holder system. and dang these actually work great




the batteries snap right in and are retained under tension from the terminals p securely

Ambrose Burnside fucked around with this message at 03:54 on Jul 2, 2020

Sagebrush
Feb 26, 2012

it is pretty cool that you're independently re-inventing the history of electronics

Adbot
ADBOT LOVES YOU

thehustler
Apr 17, 2004

I am very curious about this little crescendo
Alright that’s awesome, cool trick. Right now I’m feeding battery snap wires in and it’s a pain.

Need an upside down one with pins to connect a 9V. The battery would sit upside down with the pins sticking out downwards from the snap.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply