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
poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five

KnifeWrench posted:

Here's a dumb question I'm having trouble searching: is there a name for encoders that aren't quadrature? "Non-quadrature" seems so clumsy.

Browse through the digikey listing for encoders and you'll find a bunch of different options (under "Output Type"), if you're trying to find a particular term for a part search.

Adbot
ADBOT LOVES YOU

Agrinja
Nov 30, 2013

Praise the Sun!

Total Clam
Just chiming in to say thank you for the advice, it got me looking in the right direction! One thing I do want to ask before I leave anybody alone, would it be better to learn a different chip architecture if I do eventually want to get into DSP? ARM based devices seem like a good possible, but also seem to have a higher minimum complexity, and total overkill for the simpler things I'd want to use a MCU for.

Agrinja fucked around with this message at 01:55 on Sep 11, 2015

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Part of what makes PICs great is the architecture is the same all the way through. I haven't played with a lot of the high end DSPICs, but they get pretty beefy

BattleMaster
Aug 14, 2000

The architecture isn't the same between core types, but peripherals are more or less the same across all cores and that's most of what matters unless you're programming in assembly.

Speaking of which, I recommend PICs because they're jam-packed with peripherals. The product lines of each architecture are huge and that's because there are large numbers of different combinations of pincount and peripherals. Microchip's thing lately has been tons of analog peripherals (you can get ADCs, DACs, comparators, op-amps, zero-cross detectors, high-current pins and more) and you don't have to learn much to adjust to a different part if you find one with peripherals you want to use.

BattleMaster fucked around with this message at 02:25 on Sep 11, 2015

Agrinja
Nov 30, 2013

Praise the Sun!

Total Clam

ante posted:

Part of what makes PICs great is the architecture is the same all the way through. I haven't played with a lot of the high end DSPICs, but they get pretty beefy

This is more or less why I was looking at them in the first place, but it's good to have confirmation from someone that knows better. Much thanks to the both of you.

KnifeWrench
May 25, 2007

Practical and safe.

Bleak Gremlin

taqueso posted:

Do you want SSI output or step/direction or something else?

Sorry to be vague. I'm interfacing with someone else's encoder that only has one digital line, and I am trying to set the nomenclature in the code so it's readable. I was hoping quadrature had an antonym of sorts, but so far all I've seen is "non-quadrature". I'm fine with that if that's all there is, but I figured it was worth asking.

Edit: searching digikey leads me to believe they may just be called binary encoders, which makes sense. Thanks for the tip, poeticoddity!

KnifeWrench fucked around with this message at 04:38 on Sep 11, 2015

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Speaking of quadrature encoders, why the hell do they do 4 steps per physical detent. How is that ever remotely useful and not incredibly infuriating.

wormil
Sep 12, 2002

Hulk will smoke you!
Google tells me that serial cable wires are 22 and 24 but I'm having trouble finding what wire comes in a vga cable. Anyone know? And what size wire should I have to carry low voltage DC, say 12v, over about 6-8 feet? You probably see where I'm going -- I want to use a serial cable for low voltage. But I already have some vga cables so I'm debating on using what I have vs. buying some serial cables.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
What current?


You probably won't be able to find a datasheet for a "serial" cable, but look up standard resistance-per-metre measurements of 22AWG / 24AWG and decide if that resistance is okay for your use and if the cable won't get too hot.

I talked about this a couple pages back with connector resistance, but the math is the same. Just pretend it's a really long connector.



(Without knowing your application, I can say with 90% confidence, unless you're running big motors, welders, or soldering irons, you'll be fine)

wormil
Sep 12, 2002

Hulk will smoke you!

ante posted:

What current?

I'll have to measure next time I'm in the shop, probably pretty low.

asdf32
May 15, 2010

I lust for childrens' deaths. Ask me about how I don't care if my kids die.

wormil posted:

I'll have to measure next time I'm in the shop, probably pretty low.

It probably fine but low voltage stuff can surprise you because things need to draw more current for a given load and voltage drop matters at a lot more. If you size a cable for its safe carrying capacity you still may find that voltage drop becomes excessive at any decent length.

wormil
Sep 12, 2002

Hulk will smoke you!

asdf32 posted:

It probably fine but low voltage stuff can surprise you because things need to draw more current for a given load and voltage drop matters at a lot more. If you size a cable for its safe carrying capacity you still may find that voltage drop becomes excessive at any decent length.

It's just leading to a remote potentiometer. I want the wiring to look good and it needs to handle lots of use and serial cables are tough and cheap. I'll try it and if it gets hot then I'll try something else.

Captain Cool
Oct 23, 2004

This is a song about messin' with people who've been messin' with you

wormil posted:

It's just leading to a remote potentiometer.
So you only need two wires? Keep in mind that VGA cables have 10 conductors (iirc) so you can cut the resistance by a factor of five with a little bundling.

wormil
Sep 12, 2002

Hulk will smoke you!

Captain Cool posted:

So you only need two wires? Keep in mind that VGA cables have 10 conductors (iirc) so you can cut the resistance by a factor of five with a little bundling.

3 wires. But I think I'm making this too complicated. I'm going to find some 18-3 wire and order a couple of those cable glands and call it a day.

Collateral Damage
Jun 13, 2009

You could just grab a length of Cat5 which is cheap and will be good enough for most low voltage applications, and you get 8 conductors to play with.

Stabby McDamage
Dec 11, 2005

Doctor Rope

wormil posted:

3 wires. But I think I'm making this too complicated. I'm going to find some 18-3 wire and order a couple of those cable glands and call it a day.

Is this just a control potentiometer? As in you give it ground, ~5V, and get the in-between voltage from the center pin, which is read by something like an Arduino? If so, then you can use pretty much any gauge ever, since the amount of current is near zero.

For example, if your potentiometer is 10KΩ and your reference voltage is 5V, that's I=V/R=5/10000=0.5mA of current. You could run that over a football field at 30AWG and lose less than 1% of the power. Calculator.

wormil
Sep 12, 2002

Hulk will smoke you!
Yeah, control pot that connects to a pwm. I measured the current as .009A, 11V, DC; but not 100% sure I measured the amps correctly. I have a roll of cat5 but that doesn't seem very durable. The remote control will get potentially rough handling, not like chimps, but it needs some sturdiness.

asdf32
May 15, 2010

I lust for childrens' deaths. Ask me about how I don't care if my kids die.

wormil posted:

Yeah, control pot that connects to a pwm. I measured the current as .009A, 11V, DC; but not 100% sure I measured the amps correctly. I have a roll of cat5 but that doesn't seem very durable. The remote control will get potentially rough handling, not like chimps, but it needs some sturdiness.

Well if it's a potentiometer then almost by definition it won't have significant current flowing and work properly. A potentiometer is a variable resistor divider which 1) probably has reasonably high resistance (>1k ohm) and 2) would have significant error if any current were flowing through the third leg (in the majority of applications anyway).

The 0.009 amps seems plausible. A resistance measurement will give you more information. 1k would be 11mA at 11V which is close to what you measured.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

wormil posted:

Yeah, control pot that connects to a pwm. I measured the current as .009A, 11V, DC; but not 100% sure I measured the amps correctly. I have a roll of cat5 but that doesn't seem very durable. The remote control will get potentially rough handling, not like chimps, but it needs some sturdiness.

You're overthinking it, bro

Use the serial cable.

wormil
Sep 12, 2002

Hulk will smoke you!

asdf32 posted:

Well if it's a potentiometer then almost by definition it won't have significant current flowing and work properly.

That's what I assumed from the beginning but I kinda wanted second eyes on the situation to prevent me doing something stupid.

ante posted:

You're overthinking it, bro

I plead guilty and throw myself on the mercy of the court.

insta
Jan 28, 2009
Get a $1 super-small project enclosure, mount the pot in there, use a panel-mount DB9 connector ... that way you can use your serial cable, it can be replaced when it gets hamfistedly destroyed, and the pot is reasonably enclosed from debris & dust.

Sir Bobert Fishbone
Jan 16, 2006

Beebort
I have two stupid babby questions regarding capacitors that I'm hoping someone can help me answer:

- In a DC circuit, can I use a capacitor to increase the voltage going to a component? In this instance it'd be a push solenoid.

Separately:

- Can I have a capacitor in a circuit such that it charges, and then when I hit a button to trigger a thing (again, solenoid), the only current that drives the solenoid is the charge in the capacitor? I guess what I'd want would be a basic cap-driven refractory period that only lets the trigger fire every x interval, where x is the time it takes the cap to recharge enough to drive the solenoid.

This should be easy to figure out but as I said I'm a stupid babby.

BattleMaster
Aug 14, 2000

Capacitors in a circuit with static unchanging currents (assuming that's what you mean by DC in the first question) will just charge up to a voltage at or less than supply and sit there. You need to do some kind of switching to make that work.

With switching you can use capacitors as doublers (or triplers, or quadruplers, etc., or even inverters) as seen in charge pump circuits like the popular MAX232 that doubles and inverts the supply voltage to gain the ~+/-12 volts for RS232. Or as seen in high-side MOSFET drivers that use a bootstrap circuit to create a voltage kick above supply voltage to use N-channel FETs on the high side.

How this works is a capacitor is charged up, and then switched so that the capacitor is then in series with the supply voltage which adds the two together and roughly doubles it (though the capacitor will then begin to discharge, so the cap value or the frequency of switching need to be high to maintain a steady voltage).

I'm not sure if you'd be able to get the kind of current out of a charge pump needed to actuate a solenoid though. Typical applications of a charge pump are for low currents like signals or bias voltages or charging FET gates.

Consider a DC-DC boost converter instead. Boost converters will allow better control over the output voltage (for instance if you have 5 volt power and you want 12 volts for the relay that can be done) and will be more stable especially under high draws. Don't build one yourself, buy a module.

BattleMaster fucked around with this message at 16:35 on Sep 14, 2015

Jamsta
Dec 16, 2006

Oh you want some too? Fuck you!


You may find it easier reading up a bit on electronics (sorry if that sounds patronising - it's not meant to be)

I'd highly recommend watching for increasing voltages:
https://www.youtube.com/watch?v=wJU7AJgERG8

And the rest of Afrotechmod's vids for the basics, including circuit switching and mosfets.
https://www.youtube.com/watch?v=user?Afrotechmods

Jamsta fucked around with this message at 17:19 on Sep 14, 2015

Sir Bobert Fishbone
Jan 16, 2006

Beebort
No, you're totally right. I'm trying to get my head wrapped around this kind of thing, and mostly looking for pointers to help get me going in the right direction.

Thanks, all, for the input so far!

Delta-Wye
Sep 29, 2005

Sir Bobert Fishbone posted:

No, you're totally right. I'm trying to get my head wrapped around this kind of thing, and mostly looking for pointers to help get me going in the right direction.

Thanks, all, for the input so far!

Can you explain more about what you're doing? What does this contraption do, what is the solenoid (part #, power ratings, etc), what is your input power source, timing requirements, etc - we maybe able to help find a better approach if we know more your problem rather than just your current proposed solution.

Based on what I understand you're trying to do, I can think of a few 'clever' solutions but they all scream "there has got to be a better way!"

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.
I'm running into a weird EMI issue at work. I have a box with some digital electronics in it and some RF lines. The RF lines leave the box through a bundled coaxial cable, where they connect with to a rather complex ~1 ft. FPC. At the end of the FPC is a very small electronics package. The reason for the FPC is that it needs to route through a very restictive geometry. The FPC is NOT 50ohm controlled at all, and indeed, changes stackup/layout numerous times.

Anyway, when I turn the RF on I pick up very pronounced harmonics of the fundamental. I figured the RF was just saturating the electronics at the end so I removed them - and the problem persisted. I then removed the FPC, leaving only the cable, and the harmonics nearly vanished.

I'm trying to figure out just what might be happening here and my three theories are as follows:

(1) The harmonics are always there. The FPC is badly designed and radiates them really well.
(2) The impedance mismatch, along with the prescribed amplitude, once transformed all the way back to the amplifier, is putting it into non-linear operation.
(3) Materials/construction of the FPC itself is introducing harmonic distortion.

(1) and (2) both seem like reasonable leads, but I'm curious if (3), non-linear distortion from PCBs, is a thing at all? And, in particular, if there's any known issue here with regard to FPCs?

JointHorse
Feb 7, 2005

Lusus naturæ et exaltabitur cor eius.


Yams Fan
I need some shop advice:
The battery in my Baofeng radio is dying, and instead of buying another battery pack with unknown quality li-ion cells inside, I'm planning to buy just the cells to fix it. Any hints for a place that sells/delivers to EU? (And I'm not talking about the ubiquitous 18650 cells, I need flat ones (whatever those cell-phone style ones are called))

[edit] Actually never mind, it's just easier to keep buying new battery packs.

JointHorse fucked around with this message at 14:21 on Sep 18, 2015

longview
Dec 25, 2006

heh.

Cyril Sneer posted:

(1) The harmonics are always there. The FPC is badly designed and radiates them really well.
(2) The impedance mismatch, along with the prescribed amplitude, once transformed all the way back to the amplifier, is putting it into non-linear operation.
(3) Materials/construction of the FPC itself is introducing harmonic distortion.

(1) and (2) both seem like reasonable leads, but I'm curious if (3), non-linear distortion from PCBs, is a thing at all? And, in particular, if there's any known issue here with regard to FPCs?

My guess is a combination of 1 and 2, the source is probably generating the harmonics. You haven't said anything about the drivers or signal level/type but I suspect an impedance mismatch could lead to a driver running near saturation to start distorting, since it could be running into a different impedance load than it's designed for.

Making some assumptions on your flat flex: In general if you have a stripline/microstrip with no ground reference (ground plane for stripline types or ground fill on both sides for coplanar waveguides) then the impedance will go way up, when the line is then terminated to 50 ohm it's anyones guess what the impedance looks like at the driver.
Using a single ground line or grounding only via chassis components will add to EMI issues because current will flow through the transmission line trace, and has to return through a ground return that's far away from the signal conductor, giving a larger loop area.
One potential fix is to use baluns on each end and twisted pair/differential traces, if the lines are completely balanced in both ends then the ground current will be negligible and can in principle be left out (as in copper based Ethernet).
Other options include fixing the impedance of the FPC, or perhaps something as simple as measuring the actual impedance of the traces and making sure they're terminated appropriately at the receiver, losses will be high but it might reduce the SWR. You'd still be radiating the harmonic due to the lack of a proper ground return in that case.

Digression:
For a flat flex changing layers won't really be a huge problem in itself, the only real problem with changing layers at high speeds is a) via inductance and b) forgetting to put ground vias near the transition (return current has to follow the signal closely like with a coax shield. At very high speeds changing from adjacent layers will also leave a via-stub that can mess up GHz frequency signals unless you have buried vias or a super thin board.

Materials can cause non linear distortion, a big word in the RF sector now is passive intermodulation, which I think is mostly caused by metallic junctions and such, there are special connectors designed for low PIM that are popular in modern telecom equipment where antennas can have many different frequencies in use through combiners. The effect is small enough that it's almost never a problem outside of special cases like that.

ArcticZombie
Sep 15, 2010
I have an ATmega328 controlling a relay which is hooked up to a 12V horn capable of pulling 8A. I'd like to power both the horn and the ATmega328 using the same 12V 25-50C 1300 mAh battery. How can I do that? I have tried it in parallel and it works fine until the relay is closed. The horn will come on for a split second but then the ATmega loses power. What exactly is happening? Is the horn taking all the power, starving the ATmega?

Aurium
Oct 10, 2010

ArcticZombie posted:

I have an ATmega328 controlling a relay which is hooked up to a 12V horn capable of pulling 8A. I'd like to power both the horn and the ATmega328 using the same 12V 25-50C 1300 mAh battery. How can I do that? I have tried it in parallel and it works fine until the relay is closed. The horn will come on for a split second but then the ATmega loses power. What exactly is happening? Is the horn taking all the power, starving the ATmega?

Essentially.

It might just be causing a dip that's long enough for the arduino to reset and stop. If that's the case, stick a large capacitor across the arduino's power input.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Also how are you switching the relay, is it on a little shield or something, or do you have an arduino pin going straight to the relay coil? Because the 328 can only put out max 40mA on a pin and I'm pretty sure most relays require more than that to activate. You need an extra transistor, and diode if the relay isn't on a litle module board.

ArcticZombie
Sep 15, 2010
It's a SparkFun Beefcake Relay. It gets 5V straight from the voltage regulator, switched using a transistor. I'll have to try the capacitor tomorrow, the neighbours won't appreciate me firing up the horn at almost 10PM.

Hadlock
Nov 9, 2004

If the arduino is a single task device here, could you wire all the pins to the relay? 40ma * 12 pins might be enough juice. Not sure on what the cumulative max is for the chip itself though.

Aurium
Oct 10, 2010
Overall rating of a 328 is sourcing/sinking 200ma.

Also, you'd definitely want a flyback diode if you need to parallel pins for powering it. And at that point a MOSFET isn't really any harder.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Hadlock posted:

If the arduino is a single task device here, could you wire all the pins to the relay? 40ma * 12 pins might be enough juice. Not sure on what the cumulative max is for the chip itself though.

Looks like you can go up to 300mA total.

http://playground.arduino.cc/Main/ArduinoPinCurrentLimitations

Aurium
Oct 10, 2010
According to the Atmel datasheet, page 299, the absolute max rating is

quote:

DC Current per I/O Pin . . . . . . . . . . . . . . . . . . 40.0mA
DC Current VCC and GND Pins. . . . . . . . . . . 200.0mA

There is only one Vcc pin*. AVcc doesn't count. As written, you might be able to do some kind of current sharing between the 2 ground pins and sink a bit more, but that's not what that diagram is showing. What it's showing is that there's further power banking within the ports. Summing it up is the equivalent of a an otherwise blank picture with 20 pins each marked 40ma.

*On the DIP package, on the TQFP package there are 2 Vcc pins.

BattleMaster
Aug 14, 2000

Wait guys, this isn't the issue. I looked at the relay in question (it's actually a board with a relay on it) and it incorporates a freewheeling diode as well as an NPN BJT for actually switching it, with a 1k resistor on the base so the issue can't possibly be flyback or too much current drawn from the I/O pin.

It's probably the relay taking a big slurp of current when it switches with insufficient local capacitance to prevent the voltage from temporarily dropping, resetting the micro. Nominal current on the relay is 185mA and I'm betting the capacitance in the design past the voltage regulator isn't sufficient; the relay board itself doesn't have any. Try adding a big capacitor on the 5V rail near the relay connection.

ArcticZombie
Sep 15, 2010
It wasn't the relay sucking up the current, it was the horn. The circuit worked fine without the horn connected. Anyway, I added a capacitor and all is well. Thanks.

Adbot
ADBOT LOVES YOU

BattleMaster
Aug 14, 2000

ArcticZombie posted:

It wasn't the relay sucking up the current, it was the horn. The circuit worked fine without the horn connected. Anyway, I added a capacitor and all is well. Thanks.

Cool; glad you figured it out. In general if you have a big switchable load somewhere on a DC rail you want to put some big capacitors near it to prevent it from giving other things near it brownouts.

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