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
ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I assume you've looked into the RasPi's low level GPIO drivers and found them too slow?


With an Arm Cortext M4 or similar, you should be able to write an SD card in SPI mode at 12MHz or so, which will give you storage at above your requirements, to later be fed back into the Pi at your leasure

Adbot
ADBOT LOVES YOU

longview
Dec 25, 2006

heh.
That sounds like it's getting into "buy a purpose built data logger/get a big NI LabView setup" territory, especially if you need more than 1-2 channels and actually need 16 bits of resolution.

Parallel I/O is pretty old school these days so I doubt you'll find a common MCU with good support for it (except maybe some ATSam controllers like the Arduino Due one?).

But for a quick fix, maybe the Pi can DMA from the SPI controller?
If that's possible and fast enough then you could maybe hack together some parallel-in shift registers to convert the data to serial and work with it.

carticket
Jun 28, 2005

white and gold.

STM32F line has parallel interfaces still. I believe some of the Kinetis lineup does as well. Both also have SDIO controllers.

His Divine Shadow
Aug 7, 2000

I'm not a fascist. I'm a priest. Fascists dress up in black and tell people what to do.
Asking here instead of continuining in the blacksmithing thread where this originated. Got some capacitors to replace:


I've bought spare components (same type by Rifa, only onesI could find with the right leg spacing) and an ESD mat to be on the safe side. But I was wondering if a welding table which in my case is 100% metal isn't a very good ESD surface (albeit a hard one), if it's hooked up to the welding ground clamp to the machine, shouldn't the whole table be grounded via the electrical socket then? I still got the mat because it can come in handy and probably a brighter, cleaner surface than my welding table.

Shame Boy
Mar 2, 2010

His Divine Shadow posted:

Asking here instead of continuining in the blacksmithing thread where this originated. Got some capacitors to replace:


I've bought spare components (same type by Rifa, only onesI could find with the right leg spacing) and an ESD mat to be on the safe side. But I was wondering if a welding table which in my case is 100% metal isn't a very good ESD surface (albeit a hard one), if it's hooked up to the welding ground clamp to the machine, shouldn't the whole table be grounded via the electrical socket then? I still got the mat because it can come in handy and probably a brighter, cleaner surface than my welding table.

You generally don't want to use a highly conductive short to ground for that. ESD mats and wristbands and the like are designed to have a relatively high resistance, around a megohm or more, because the goal is to dissipate the static continuously and slowly, instead of all at once. If you had something that was all charged up with static and you touched it to the circuit on your welding table, the charge would zap its way to ground through the circuit and into the table as fast as it could, destroying anything sensitive in its path with the entire static charge all at once.

In your case it probably won't matter, as long as you remember to touch the table first before touching the circuitry to make sure any stray static on your body is equalized, but yeah if you were to set up like a workbench or something to do this often it's something to keep in mind.

Stabby McDamage
Dec 11, 2005

Doctor Rope

ante posted:

I assume you've looked into the RasPi's low level GPIO drivers and found them too slow?


With an Arm Cortext M4 or similar, you should be able to write an SD card in SPI mode at 12MHz or so, which will give you storage at above your requirements, to later be fed back into the Pi at your leasure

Yeah, manual GPIO is too slow. For the ARM board, is there a model you recommend? Trying to stick to fairly cheap things, as this thing will be epoxied in a block and dropped into the ocean, so it can't be super expensive, as we'll need to iterate.

longview posted:

That sounds like it's getting into "buy a purpose built data logger/get a big NI LabView setup" territory, especially if you need more than 1-2 channels and actually need 16 bits of resolution.

Parallel I/O is pretty old school these days so I doubt you'll find a common MCU with good support for it (except maybe some ATSam controllers like the Arduino Due one?).

But for a quick fix, maybe the Pi can DMA from the SPI controller?
If that's possible and fast enough then you could maybe hack together some parallel-in shift registers to convert the data to serial and work with it.

Yeah, I'm trying to find a cheaper solution then professional data loggers because we're going to be losing these during development and testing. We have a fancy DAQ board now for measurement calibration, but we can't afford to buy multi-grand DAQs for this (too expensive and too large/heavy).

Do you have a recommendation on doing Pi DMA? I found one beat up github of ugly code and not much else. Was hoping for a library.

Mr. Powers posted:

STM32F line has parallel interfaces still. I believe some of the Kinetis lineup does as well. Both also have SDIO controllers.

So fast read/write to SD, then some kind of slow spool-off to the Pi via serial, you think? Was hoping to avoid the extra step due to complexity, but if there's no other way, it's an okay fallback.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
STM32F103 boards are like $3 from China, which is awesome.

Depending on the peripherals it has, it might not work though - The STM32F4 line (and above) has the Flexible Static Memory Controller, which might fit the bill. You'd have to do some more datasheet mining, I'm not sure offhand.

Stabby McDamage
Dec 11, 2005

Doctor Rope

ante posted:

STM32F103 boards are like $3 from China, which is awesome.

Depending on the peripherals it has, it might not work though - The STM32F4 line (and above) has the Flexible Static Memory Controller, which might fit the bill. You'd have to do some more datasheet mining, I'm not sure offhand.

Thanks. I have some STM32F103's now I'll look at, and I'll look further down the line as needed.

FYI, I've been told that the hardware-clocked GPIO on the Pi has a period of 5us (200kHz) according to the pigpio library, so that's probably out.

sharkytm
Oct 9, 2003

Ba

By

Sharkytm doot doo do doot do doo


Fallen Rib

Stabby McDamage posted:

Trying to stick to fairly cheap things, as this thing will be epoxied in a block and dropped into the ocean,

You piqued my curiosity. Shooting you a PM.

carticket
Jun 28, 2005

white and gold.

Stabby McDamage posted:



So fast read/write to SD, then some kind of slow spool-off to the Pi via serial, you think? Was hoping to avoid the extra step due to complexity, but if there's no other way, it's an okay fallback.

I would cut the pi out of the loop completely. A K64 freedom board has Ethernet and USB, so you can get the data to wherever. I don't know if it exposes enough of it's FSMC equivalent bus, though.

TerminalSaint
Apr 21, 2007


Where must we go...

we who wander this Wasteland in search of our better selves?
I'm a bit bamboozled here and maybe someone here can help me understand. I recently acquired a large painting from a dear friend, and the poor lighting in my apartment bedroom does not flatter it at all. Enter a picture light. As luck would have it, a local lighting place was liquidating their stock since apparently no one uses picture lights anymore, and I managed to snag a $700+ CAD LED model for $70 CAD.

Here's where it gets odd.

I got it home and plugged it in, and it flickered something fierce. My first thought was "I can't believe a $700 light would flicker like cheap Christmas lights. No wonder the price was so low." followed quickly by "Wait, it has a wall-wart, why the gently caress would it flicker at all?"

Upon further inspection, the power supply outputs 24V AC. :psyduck:

Why on earth would they do that?

I tried hooking it to a 24V DC supply and it lights up fine with no flicker. It gets even weirder because inside the mounting housing there's a certification sticker that says it should be supplied with DC; right next to where the wires are spliced to an unpolarized cord that was made to fit the AC supply.

The manufacturer is appropriately named "Wac Lighting".

Is there some sensible reason to power it using AC or is this just a fuckup somewhere between engineering and manufacturing?

Aurium
Oct 10, 2010
Probably old stock from incandescents/halogen, which wouldn't care. As far as why those would be AC instead of DC, I'm going to go with inertia.

Shame Boy
Mar 2, 2010

TerminalSaint posted:

I'm a bit bamboozled here and maybe someone here can help me understand. I recently acquired a large painting from a dear friend, and the poor lighting in my apartment bedroom does not flatter it at all. Enter a picture light. As luck would have it, a local lighting place was liquidating their stock since apparently no one uses picture lights anymore, and I managed to snag a $700+ CAD LED model for $70 CAD.

Here's where it gets odd.

I got it home and plugged it in, and it flickered something fierce. My first thought was "I can't believe a $700 light would flicker like cheap Christmas lights. No wonder the price was so low." followed quickly by "Wait, it has a wall-wart, why the gently caress would it flicker at all?"

Upon further inspection, the power supply outputs 24V AC. :psyduck:

Why on earth would they do that?

I tried hooking it to a 24V DC supply and it lights up fine with no flicker. It gets even weirder because inside the mounting housing there's a certification sticker that says it should be supplied with DC; right next to where the wires are spliced to an unpolarized cord that was made to fit the AC supply.

The manufacturer is appropriately named "Wac Lighting".

Is there some sensible reason to power it using AC or is this just a fuckup somewhere between engineering and manufacturing?

Is the only AC component the wall wart? Maybe it was like a floor model or something and the store just mixed up the power cords :shrug:

e: Also congrats on getting super-lucky and not immediately exploding it like every time I've accidentally plugged in an AC power supply :downs:

TerminalSaint
Apr 21, 2007


Where must we go...

we who wander this Wasteland in search of our better selves?

ate all the Oreos posted:

Is the only AC component the wall wart? Maybe it was like a floor model or something and the store just mixed up the power cords :shrug:

Seems to be, but it's branded by the company and was packaged with the light, and the wire from the lamp is definitely meant to be used with that supply. The cord is also not polarized and can plug in either way, so if it's not intended then the error goes as far as assembly.

Stabby McDamage
Dec 11, 2005

Doctor Rope

Mr. Powers posted:

I would cut the pi out of the loop completely. A K64 freedom board has Ethernet and USB, so you can get the data to wherever. I don't know if it exposes enough of it's FSMC equivalent bus, though.

How does the K64 help...can it read 16 inputs at 250 kHz?

We're using a Pi because the pod needs to be able to transmit the data via WiFi fairly quickly, and microcontroller-based WiFi didn't have the performance we need.

carticket
Jun 28, 2005

white and gold.

Stabby McDamage posted:

How does the K64 help...can it read 16 inputs at 250 kHz?

We're using a Pi because the pod needs to be able to transmit the data via WiFi fairly quickly, and microcontroller-based WiFi didn't have the performance we need.

Sorry, we got too far from the original question. I went back and reread it.

The K64 might be able to handle 16x250kHz, not sure how many bits of resolution its ADC puts out. I had brought it up for the parallel memory interface it has, that you can probably interface to your parallel ADC that you said you had. If not the parallel ADC, you might be able to get a fast SPI ADC also.

From there, you can be a USB device and send the samples to the Pi that way, or you could use SPI as a slave and read it out from the Pi as master. I2C and UART are probably too slow.

E: if you can get a SPI ADC, just drive it from the Pi.

E2: might be worth looking at the Kinetis M (for metrology) line. They might be able to meet your requirements with the internal ADCs.

carticket fucked around with this message at 07:43 on Jul 8, 2018

Shame Boy
Mar 2, 2010

Whelp got my first boards back from the fab that use 0603 components primarily, wish me luck in assembling this trainwreck of wobbly hands and smeared solder paste :downs:

kid sinister
Nov 16, 2002
You know the great thing about LED exit signs? The lights last 10 years. Well, it's been 10 years since they've been installed... How do I know which brightness of red LEDs to replace the dead ones with? Bright as all gently caress? They're just 5mm through hole ones, so they'd be easy to rework.

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

kid sinister posted:

You know the great thing about LED exit signs? The lights last 10 years. Well, it's been 10 years since they've been installed... How do I know which brightness of red LEDs to replace the dead ones with? Bright as all gently caress? They're just 5mm through hole ones, so they'd be easy to rework.

My experience has been that forward voltage and max current matter more. The supply voltage and current limiting resistors will likely be expecting an LED with particular electrical characteristics. If you get something with too low of a V_f or I_max, you might end up burning it out prematurely with overcurrent. Optical characteristics are a secondary concern.

In other words, it likely wasn't designed to be user serviceable, and you're probably expected to replace the whole module. The good news is, that means you can play around with guess and check, and if you gently caress it up, you won't be any worse off.

Are we talking a fire exit sign? Make sure you're not going to run afoul of the fire inspector by violating some kind of compliance certification requirement.

ickna
May 19, 2004

It is highly likely that they’re run of the mill 5mm LEDs that take 20-30ma. Order a pack of 100 and have a blast.

I also recommend grabbing a desoldering iron, it will make removing the old ones a breeze.

kid sinister
Nov 16, 2002

KnifeWrench posted:

My experience has been that forward voltage and max current matter more. The supply voltage and current limiting resistors will likely be expecting an LED with particular electrical characteristics. If you get something with too low of a V_f or I_max, you might end up burning it out prematurely with overcurrent. Optical characteristics are a secondary concern.

In other words, it likely wasn't designed to be user serviceable, and you're probably expected to replace the whole module. The good news is, that means you can play around with guess and check, and if you gently caress it up, you won't be any worse off.

Are we talking a fire exit sign? Make sure you're not going to run afoul of the fire inspector by violating some kind of compliance certification requirement.

Yes it's an exit sign. If they won't allow me to rework in LEDs to a circuit board but will let me swap in backup batteries and bulbs for the floodlights, then there's something wrong with the world.

Speaking of backup batteries, it's a 6V SLA brick of a battery. Sure, LEDs don't need much juice, but the old incandescent floods do. The boards do 5 red LED circuits in parallel, 2 per series. The existing resistors for each 2 LED circuit were 68 Ohms, which if I did my math right on a 6V circuit comes out to a forward voltage of 2.4V, which is a little high for red LEDs. I'll probably have to replace the resistors as well to compensate. Does that sound right?

Shame Boy
Mar 2, 2010

kid sinister posted:

Yes it's an exit sign. If they won't allow me to rework in LEDs to a circuit board but will let me swap in backup batteries and bulbs for the floodlights, then there's something wrong with the world.

I'd think it would depend on what the original manufacturer specifically designed and certified. Stuff like batteries and bulbs are supposed to be replaced, so the process of replacing them is probably covered by the certification or regulation or at least warranty. Once you start modifying things outside the bit you're explicitly allowed to touch you've pretty much given any insurance company that covers anything within a 5 mile radius a dumb reason why they don't have to pay out if something happens.

kid sinister
Nov 16, 2002

ate all the Oreos posted:

Once you start modifying things outside the bit you're explicitly allowed to touch you've pretty much given any insurance company that covers anything within a 5 mile radius a dumb reason why they don't have to pay out if something happens.

So could a burnt out exit sign. Also, this is for a strip mall retail location with an all glass front. The exit signs are pretty superfluous in that situation. If someone is dumb enough to die there because he or she didn't see an exit sign, they pretty much had it coming.

Shame Boy
Mar 2, 2010

kid sinister posted:

So could a burnt out exit sign. Also, this is for a strip mall retail location with an all glass front. The exit signs are pretty superfluous in that situation. If someone is dumb enough to die there because he or she didn't see an exit sign, they pretty much had it coming.

I'm not saying don't do it, just be aware that by being the last person to touch it it automatically becomes your own personal legal problem if anything goes wrong.

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.
i just wanna pop in to say you could not pay me enough to try and repair an emergency exit sign for a commercial building myself, even if it was just like soldering back on a single wire

ain't no way i am gonna expose myself to that liability. tell the boss (in writing) it needs to be replaced and will cost $much, and your job is done.

kid sinister
Nov 16, 2002
Alright, how about another one then. At home, my microwave keeps forgetting what time it is. The timer counts down just fine and the little 7 segment displays work, it's just that the clock keeps forgetting what time it is and goes blank. What could be causing that?

Shame Boy
Mar 2, 2010

kid sinister posted:

Alright, how about another one then. At home, my microwave keeps forgetting what time it is. The timer counts down just fine and the little 7 segment displays work, it's just that the clock keeps forgetting what time it is and goes blank. What could be causing that?

... power outages?

Or do you mean you set the time, leave it sitting for a minute or so and it just spontaneously forgets it?

e: Sorry that came off a bit snarky and mean :v:

Assuming it's the second one, that might happen if it has a clock chip that's faulty, or if the chip isn't getting the right voltage, or any number of things, you'd need to open it up and poke around on the circuit board with a meter to see what's going on.

Shame Boy fucked around with this message at 19:37 on Jul 11, 2018

kid sinister
Nov 16, 2002

ate all the Oreos posted:

... power outages?

Or do you mean you set the time, leave it sitting for a minute or so and it just spontaneously forgets it?

e: Sorry that came off a bit snarky and mean :v:

Assuming it's the second one, that might happen if it has a clock chip that's faulty, or if the chip isn't getting the right voltage, or any number of things, you'd need to open it up and poke around on the circuit board with a meter to see what's going on.

That only affect one outlet? I replaced all the outlets in the kitchen with commercial grade ones 7 years ago. Oh shoot. I just checked the plug and it was at a weird angle. Let's see if that fixes it.

To me, it appeared to just spontaneously forget it. I've never timed it, but it used to go out every month or so, then it became more frequent: every other week, every other day... Lately it's only lasted for a couple hours before going blank again. You inspired me though. I just programmed in the time and set the stopwatch on my phone, so we will see how long before someone notices it went out.

Bronze
Aug 9, 2006

DRRRAAINAGE!!!
wrong thread

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Might be a dead RTC battery inside

Open it up and check for coin cells or soldered in batteries

Shame Boy
Mar 2, 2010

ante posted:

Might be a dead RTC battery inside

Open it up and check for coin cells or soldered in batteries

Yeah I was thinking about RTC batteries too but I've never actually seen a microwave that had one and I've never seen an RTC that loses the memory if the normal power is on but the battery is dead... maybe if the battery went dead short or something?

mobby_6kl
Aug 9, 2009

by Fluffdaddy
I too doubt the microwave has an RTC battery. No idea what it could actually be though other than some general wonkiness in the circuit.

mobby_6kl posted:

Thanks. It's hooked up with I2C. I think it's sampling in normal mode, at least I don't remember switching it. I'd probably need to review the code as it's been a while, as well as investigate the library which is supposedly a wrapper over Bosch reference implementation. Unfortunately of course this hides a lot of what's really going on there from me, so this might be a great opportunity to finally bust out my ebay logic analyzer. Hopefully I'll have a bit more time this week to mess with this so I'll post an update.

All right, too me a while but I finally got to use my $5 logic analyzer. I read from the sensor every minute and this is what it looks like on the wire:


Uh-huh well I couldn't quite figure out what's going on there yet so I clearly need to read the data sheet some more. One challenge though is that this is an intermittent problem so I need to capture a ton of these and then correlate them with the data I get. Is there any way to get the Saleae analyzer to pause the capture until the next trigger?

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.
Okay fun theory question.

Any time I read about coaxial cables (and calculating the fields and such inside them), its often simply stated that the current flowing through the inner conductor is equal and opposite to the current flowing on the inner surface of the outer conductor (e.g., top of the second page here http://www.ittc.ku.edu/~jstiles/220/handouts/Example%20The%20B-Field%20of%20a%20Coaxial%20Transmission%20Line.pdf).

Why is this necessarily the case? What underlying aspect of Maxwell's equations says this must be true?

nmfree
Aug 15, 2001

The Greater Goon: Breaking Hearts and Chains since 2006

Cyril Sneer posted:

Okay fun theory question.

Any time I read about coaxial cables (and calculating the fields and such inside them), its often simply stated that the current flowing through the inner conductor is equal and opposite to the current flowing on the inner surface of the outer conductor (e.g., top of the second page here http://www.ittc.ku.edu/~jstiles/220/handouts/Example%20The%20B-Field%20of%20a%20Coaxial%20Transmission%20Line.pdf).

Why is this necessarily the case? What underlying aspect of Maxwell's equations says this must be true?
My copy of The ARRL Handbook only says that it's because of the skin effect, but doesn't go into the underlying reasons.

You might want to ask in the Amateur Radio thread.

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.

nmfree posted:

My copy of The ARRL Handbook only says that it's because of the skin effect, but doesn't go into the underlying reasons.

Nowhere ever does!

Apathy0o0
Jul 9, 2004
Fire is my friend

Cyril Sneer posted:

Okay fun theory question.

Any time I read about coaxial cables (and calculating the fields and such inside them), its often simply stated that the current flowing through the inner conductor is equal and opposite to the current flowing on the inner surface of the outer conductor (e.g., top of the second page here http://www.ittc.ku.edu/~jstiles/220/handouts/Example%20The%20B-Field%20of%20a%20Coaxial%20Transmission%20Line.pdf).

Why is this necessarily the case? What underlying aspect of Maxwell's equations says this must be true?

If I recall correctly, this is due to gauss's law. Your statement about the currents is equivalent to the statement that the field from the currents on the inner conductor will be cancelled out by the reverse current on the inner surface of the outer conductor so that there is no net change in charge, I think. I'd have to find my copy of an electromagnetism text and actually do math to be more precise.

Shame Boy
Mar 2, 2010

Yeah I was gonna say it seems like it would sorta intuitively follow from conservation laws :shrug:

VictualSquid
Feb 29, 2012

Gently enveloping the target with indiscriminate love.
The current in the inner and outer conductor are equal due to the conversation of charge.

The current is on the inner side of the conductor because that is where the EM-fields are.

The current is zero on the outside of the cable, because otherwise it would be an antenna, not a cable.

The current is on the surface of the conductors, because of the skin effect. This is caused by the way that EM-Fields penetrate conductors. It actually needs some maths to explain, but you should find them in any good EM or Microwaves book.

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.
oh boy....

tonberrytoby posted:

The current in the inner and outer conductor are equal due to the conversation of charge.

Why does charge have to be conserved in this geometry? Its a wire surrounded by a cylinder - that's a capacitor, and maybe its being charged up?


tonberrytoby posted:

The current is on the inner side of the conductor because that is where the EM-fields are.

While we all know this is true, this isn't a rigorous answer.

tonberrytoby posted:

The current is zero on the outside of the cable, because otherwise it would be an antenna, not a cable.

Current very often does exist on the outside of the cable, and it very often does act an antenna.

tonberrytoby posted:

The current is on the surface of the conductors, because of the skin effect. This is caused by the way that EM-Fields penetrate conductors. It actually needs some maths to explain, but you should find them in any good EM or Microwaves book.

I know what the skin effect is and I'm quite familiar with the maths.

Again, when discussing coax cables, it is always stated that the two currents are equal, but I've never seen it demonstrated (by the maths, not by high level though arguments) that this must be so.

Adbot
ADBOT LOVES YOU

VictualSquid
Feb 29, 2012

Gently enveloping the target with indiscriminate love.

Cyril Sneer posted:

Why does charge have to be conserved in this geometry? Its a wire surrounded by a cylinder - that's a capacitor, and maybe its being charged up?
Conversation of charge is a fundamental law, just like the conversation of Mass. It doesn't follow from anything. Though I suppose there are some physicists arguing that it follows from gauge invariance, but you have to ask the physics thread for that.

The conversation of current applies in this geometry because it can transmit a DC current. That mean that Kirchhoff's laws apply directly. You can not transmit things through the cable without turning both conductors into lines that complete a simple circuit.

I might be misunderstanding you. Are you looking for proofs of the fundamental laws of EE, or are you looking for explanations for why they apply to coaxial cables?

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