text stringlengths 83 79.5k |
|---|
H: Best fit wireless technology for long range application
My project goal is to have 2 devices, a transmitter and a receiver. The transmitter should transmitter a measured distance +- every second and the receiver which could be at max. 10 miles away from eachother should receive the data. Both do not have a static location. Every day their location could be changed. They would not have line of sight.
I am wondering which wireless technology would be best fit for this task. I've considered the following:
LORA: downside: coverage ( there might be no gateway )
RF: downside: range. The most long range module that i found was an Xbee pro 868 (Europe) which has a LOS range of 48km but urban range stated only 500m. Two highly different values but I wonder if it could archieve 10 miles non line of sight.
Cellular 2G/3G/4G/5G: downside: network topology (maybe also power usage but no strict constraints here). There can not be a point to point connection, there should be a server that stores the data and the receiver should poll the data (or am I wrong?).
Any advice on which technology to go for?
AI: If I understand, you want to send data (a measured distance, let's guess 6 decimal digits for now) about once a second, from a portable transmitter to a portable receiver, which can be up to 10 miles apart and do not have line-of-sight.
Here are some RF frequency ranges and technologies you could consider:
LF: about 300 kHz to 3 MHz. Pro's: Ground wave propagation follows the curvature of the earth. Con's: needs a reasonably long, preferably vertical antenna; licensing required (amateur radio bands).
HF: about 3 MHz to 30 MHz. Pro's: lower portion still has effective ground wave, antennas not so long. Con's: still needs to be licensed.
VHF: 30 MHz to 300 MHz. Pro's: antennas are reasonable length. Con's: no ground wave, unless you transmit a lot of power, you need line of sight. However, there are repeaters available in many areas, on hilltops, that will relay your transmission, but again you need an amateur license.
UHF: 300 MHz to 3000 MHz. Same issue as VHF, without line of sight you need a relay. Pro's: Many providers: cellular networks, satellite networks, etc. Con's: have to pay for service.
Summarizing, I think two options are to either pay and use existing cellular or satellite networks, or learn some radio technology and get an amateur radio license. |
H: Does wireless power have any effect on batteries without being in a circuit?
I have this wireless charger. I put the transmitter in a 3D printed enclosure and the receiver in another 3D printed enclosure. On top of the receiver, I've put 8x INR18650-30Q 3000mAh batteries.
I've done some experimenting and have ultimately decided that the batteries get hot when they are not connected to anything and the wireless charger is working.
Am I correct?
Is there a way to stop the heating?
Edit:
Am I correct? Yes, @John Doe answered that this kind of power transfer is used in induction cookers. This effect seems to cook my batteries while charging them.
Is there a way to stop the heating? I did some more experiments.
As @Neil_UK suggested, I added a copper sheet between the batteries and the wireless receiver coil.
In the above image, two batteries are on top of the receiver. One of them is coated with a copper sheet, while the other isn't. After a minute, the naked battery is hot, while the coated is barely warm.
I added a plastic separator of 10 mm between the coil and the battery pack of 10 batteries in the above image. The current is 0.347A. Almost twice the nominal of 0.158A.
I added a copper sheet inside the battery pack just below the batteries. The current dropped to 0.187A. Still above nominal. So I added another sheet and it dropped to 0.142A.
After 10 minutes of running the wireless charger and two copper sheets below the batteries, they didn't get hot. Thank you all for helping out.
AI: Yes you are correct. The wireless charger in this case acts exactly like an induction cooker. Even though the battery is not connected, the changing electromagnetic field produced by the wireless charger induces an eddy current in the metal components (such as electrode plates) inside the battery, causing them to heat up. The battery in this case acts like a metal pot placed on an induction cooker.
Both induction cookers and wireless chargers transfer energy through electromagnetism. The energy is reproduced as heat by chaotic eddy current in the cookware, but as ordered and filtered usable energy in the receiver coil in a wireless charging receiver.
Below is an image of the inside of an induction cooker. As can be seen it has the same construction as a wireless charger.
Image from Wikipedia courtesy of Wdwd, CC BY-SA 3.0 View citation |
H: The meaning of cable should be wound around cylindrical ferrite
What is the purpose and meaning of a cable wound around and passed through a cylindrical ferrite, that black non-conductive ceramic metal ?
AI: This Ferrite clamp is called a cable lossy Common-Mode choke for the VHF band. This is different than a differential ferrite bead for a single wire. There are some CM chokes that you will find on all VGA cables molded in the cable for RGB video DAC harmonics.
It is a slurry mixture of ceramic capacitance, Zinc oxide with either manganese or Nickel to form a ceramic metallic magnetic material that conducts with a lossy series resistance.
The equivalent circuit is a parallel RLC circuit with a series R that has this effect on a pair of wires to Raise the impedance of both wires at RF so they become more balanced and while absorbing RF somewhere along the cable, the balancing of raised impedance in RF makes the EMI in/out attenuated alot more in that band.
But not all ferrites are created equal.
Reference material
https://incompliancemag.com/article/all-ferrite-beads-are-not-created-equal-understanding-the-importance-of-ferrite-bead-material-behavior/
https://resources.pcb.cadence.com/blog/2020-selecting-ferrite-chokes-and-clamps-to-minimize-rfi-and-resistance
credits: https://www.analog.com/en/analog-dialogue/articles/ferrite-beads-demystified.html |
H: Is this explanation of the workings of a rheostat consistent with the diagram?
I came across this description of a rheostat along with a diagram:
...The best example is the traditional dial controlling volume on a radio. The outer ring, or toroid coil, consists of a resistive wire wrapped in a spiral about a ring of insulating material. Electricity must travel along a sliding wiper and through the coil before itleaves the resistor. When the knob is turned clockwise, the electricity has less wire to travel through so that the resulting current is stronger and the volume is louder.
Won't turning the knob clockwise increase the distance between input and output, causing the electricity to have to travel through more resistive wire, thus increasing resistance, decreasing amperage and consequently, volume?
AI: Yes you are correct, the drawing appears to be mirrored. However, note that wire wound pots are rarely used these days. Instead carbon or conductive plastic potentiometers are typical, which use the same principal. Wire wound pots are usually often used when high current/power rating or low resistance is needed. |
H: Is there a linear relationship between energy production and global horizontal irradiance?
I'm an apprentice in data science. I am currently working in a company that produces and installs energy storage systems. One of the clients of this company wants to estimate the loss due to the energy curtailment.
For this purpose, I've used the active power at the exit of inverters and the value of global horizontal irradiance (GHI) for a month, and tried to find a relationship between the energy production and GHI so that I can calculate the loss in periods of curtailment.
What I actually did is sample the GHI with a step of 20 W/m2 for all the values between 0 W/m2 and 1200 W/m2 for everyday of the month, then I took the mean of the active power for all the values that fall into the segments: [0,20] , [20,40],... I plotted the active power as a function of the GHI and it gave me the following curve:
The curve is not quite linear, especially for values of GHI higher than 900 W/m2, so I would like to know if it's correct to assume that there is a linear relationship between the energy produced and the GHI, or are there other things I'm missing.
AI: The photovoltaic effect itself is quite linear (but not 100% due to serial resistance and other effects), You have other factors that comes in on a system.
The major one, is the temperature dependency of the solar array, which is negative for the Pmax and quite important. As the irradiation increases, the temperature on the array does as well, which lower the efficiency of the panels.
Another factor, is that as the irradiation increases, the panel produces more current, and thus produces more losses in the cables, inverter and so forth as Ploss=R*I^2.
The spectral irradiation will also have an impact as c-Si panels are more sensitive in infra-red, lower irradiance in the morning/evening may actually have slightly more efficiency as IR traverse the atmosphere with more ease.
In the end of the day, many factors affects the power output.
Note that 1'200W/m2 is quite rare and only happens in specific weather condition. If you get 1'200W/m2 often you may have a calibration issue. |
H: Running a pedestal fan over UPS
I'm considering buying a UPS to power a pedestal fan during power outages.
My fan is 60W. I was contemplating buying this UPS model, which is set at 360W.
Will this work at all? Or are mechanic motors problematic for UPS for some reason?
Could I expect it to work for 360/60 = 6 hours? If not, how long would it be safe to assume it will last for? (I could go for a higher Watt model)
On the model page I linked to, there is a battery graph, which shows that the battery wattage over time - Starting at 260W and emptying over ~50 or so minutes. How come the model is rated at 360W if it can't provide 360W for one hour?
AI: It should work OK with a fan
Read the information in the link: -
Run-time for delivering 60 watts is 37 minutes.
360 watts is the peak power it can deliver and it doesn't mean it can supply 360 watt-hours.
3) How come the model is rated at 360W if it can't provide 360W for
one hour?
It can provide a peak load power of 360 watts and not a continuous power of 360 watts for 1 hour. Peak power of 360 watts would be sustained for maybe a minute or less. |
H: Question about pipeline techniques in FPGA
I'm trying to improve timing in my FPGA design. I need my logic to work with a 150MHz clock, the synthesizer is saying it can work only with ~138MHz maximum.
I know that one of the popular ways to improve timing is by pipelining some of the logic in the design.
I have a finite state machine (FSM) that reads data from an ADC, all the data reading, and the creating of SCLK for the interface occurs inside one process (I am using VHDL.)
In this FSM there are two counters that increment in every state. One of the counters is used to generate the SCLK (dividing the internal FPGA clock to create the SCLK for the ADC.) The other counter counta the bits I read/write, together these counters dictate when I switch states in the FSM.
One of the counters is counting as well as the condition to read bits from the ADC all in the same clock cycle.
The critical path is the path between the output of the counter flip-flop to the data shift register that occurs inside an "if (count = ...)" block.
I am using a Lattice MachXO3LF FPGA with a custom board.
As a result, I thought about pipelining the counter, which means to leave the counter as is in the process but just to assign inside the process the counter to another counter_reg, and use inside the if conditions the counter_reg instead of the counter:
(note that the pieces of code are incomplete and just to show the idea in example)
Without pipeline
process(clk)
if (rising_edge(clk)) then
case (state) is
when STATE0 =>
if (count = NUM) then
state <= STATE1;
count <= 0;
else
count <= count+1;
end if;
...
With pipeline:
process(clk)
if (rising_edge(clk)) then
count_reg <= count;
case (state) is
when STATE0 =>
if (count_reg = NUM-1) then
state <= STATE1;
count <= 0;
else
count <= count+1;
end if;
...
Is this a valid way to make a pipeline in FPGA design if I need to pipeline and improve the timing between the counter and the logic created inside the if condition used by the counter?
I found that it does improve my timing.
If it improved my timing, what else do I want from you guys?
It is improved but not enough (now the maximum clock is now 148MHz,) so I tried something:
Another attempt to pipeline:
process(clk) begin
count_reg <= count;
if (rising_edge(clk)) then
case (state) is
when STATE0 =>
if (count_reg = NUM) then
state <= STATE1;
count <= 0;
else
count <= count+1;
end if;
...
As you can see, I tried to make the assignment to my pipeline register outside of the clock rising edge, and my counter_reg now changing every change in clk (rising/falling edge.) As you can see now there no need to do NUM-1 anymore because there is no delay in the counter (because the counter_reg changing in the falling edge, and until next rising edge of clk, the counter reg is already ready to go.)
What I found out is that the synthesizer loved this move, now there is no timing error for this path anymore, and my maximum clock cycle is 153MHz, so from a timing report perspective, I solved my problem.
BUT, I am not sure if it's a good design practice I am using the rising and falling edges of the clock to do my logic and far as I know it's not recommended, but it does solve my timing errors and works perfectly.
What do you think about this? Is it ok to make a pipeline like this? What am I missing?
AI: The first thing to do is look at the STA (Static Timing Analysis) report. That will show the longest paths, their start and end points, and the logic between them. There are probably a lot of similar ones, pointing to one specific design problem.
Re-pipeline that path, adjusting anything else necessary (e.g. delaying signals elsewhere) to keep the logic correct, re-simulate to show it's still correct, and re-synthesise etc to get a new STA result. There may be another failing path in this one; rinse and repeat.
If you're stuck, or can't see why the longest path is so long, edit that path's analysis into the question so more eyes can help. It's not always obvious...
From 148 to 150MHz you may get away with applying more synthesis or P&R effort : e.g. ask some tools for 160MHz and they'll still fail but give 155 MHz...
Critique on code...
process(clk)
if (rising_edge(clk)) then
case (state) is
when STATE0 =>
if (count = NUM) then
state <= STATE1;
count <= 0;
else
count <= count+1;
end if;
...
This ought to synthesise just fine and get close to optimal.
However some synthesis tools are a bit sub-par, and may make the assumption that incrementing Count follows a conditional test on itself, and unnecessarily sequentialises the two operations.
In fact the two operations (increment, and test) can happily proceed in parallel, with no need to add a pipeline register (which feels like a crutch here.
I would signal that parallelism explicitly to synthesis...
process(clk)
if (rising_edge(clk)) then
new_count := count+1; -- variable, updates immediately
case (state) is
when STATE0 =>
if (count = NUM) then
state <= STATE1;
count <= 0;
else
count <= new_count; -- variable used after assignment
end if;
...
This related Q&A separates out the delay counter altogether, allowing multiple states to use it for different length delays; also taking advantage of the fact that a zero comparison is simpler and often faster than an equality counter.
Your first pipelined version includes a cycle delay, giving further problems requiring complex little fixes, and your second implicitly updates count_reg on the NEGATIVE clock edge, requiring the counter to work in HALF a cycle. The implicitness dares synthesis to get it wrong!!! but you can add an ELSE or elsif falling_edge(clk) to see if that reproduces the faster result. If not, carefully inspect the generated RTL to see if the expected -ve-edge clocked reg is there... |
H: Can a magnet-free motor do regenerative braking?
There are news talking about the new magnet-free motor for electrical vehicles from the manufacturer Mahle. They boast an efficiency of 96%.
Links:
YouTube Video about it
My question is: Is a motor like that able to do regenerative braking?
AI: The motor described is a wound-field synchronous motor with a brushless excitation system. It is basically the same machine as most large power station generators. Yes, it can provide regenerative braking.
The "new" aspect of this motor is said by the manufacture, Mahle Gmbh, to be the excitation system. It is a wireless system that they have designed. The motor is being developed as a vehicle traction motor with the motor and controller integrated into a single housing. It appears to be a liquid cooled assembly. |
H: Monitor a 5 A system with a compatible current sensor
I need to monitor a system that can consume up to 5 A of current on 5 V. Its components consume between tens and a few hundreds of mA each. A 10 mA resolution is acceptable.
I need this monitor to have a digital comm output (i2c is good).
When searching for a suitable current sensor I came across components that either could take high currents but not to have a good resolution, or they were not good for currents above a couple of A.
I have seen the ina3221 but I can’t find the max current I can put through its main line.
What IC can I use for my application?
AI: I2C sensor INA260 from Adafruit or MIKROE-4039 (digikey) has internal shunt resistor, Kelvin current sensor, and claims to handle 15A at resolution of 1.5mA. Also measures voltage and calculates power. There is a datasheet for the chip available via keyword search. |
H: Schematic notes: Place capacitor as "close" to pins: Is this a necessary note? Is it a significant point?
Background
I am building a ATMega4809 board that allows the board to be programmed using the Arduino IDE.
While examining the following schematic I noticed that where the caps are placed the author included a note on each.
Here's a close up of the note:
Question: Close To Pins?
My question is, "Is this a mis-understanding by the author, or is it actually necessary that the capacitor be placed very "close" to the pins which they are attempting to shield?
Close seems a bit subjective. Should you solder them to the pins? Should they be in the breadboard holes exactly next to the pins. Do you just insure that their is nothing (no other component) "between" the cap and the pins?
Does this really matter -- have significance?
In contrast, I can imagine if they were "far" there could be a difference possibly. But if they're all connected it seems as if it wouldn't matter.
I've (attempted) to use capacitors like this in the past and I'm wondering if I should consider this as I use them in the future.
AI: Capacitors don't "shield."
Capacitors are placed on the power supply pins to absorb noise coming in from the power supply and to supply short bursts of high current when the processor switches states.
Long wires act as inductors. That reduces the effectiveness of the capacitors.
The author really meant for you to place the capacitors as stated in the comments in the schematic.
"Close" means as close as phyically possible with the smallest inductance conenctions possible. Short, wide traces between the capacitor and the pins. Ideally, you'd use a surface mount capacitor and snuggle it right up beside the pins.
This not an ideal circuit for use on a wireless breadboard - getting the oscillator to run correctly will be painful.
Capacitors placed just anywhere because they are all connected together is a bad plan. Put each capacitor where the schematic tells you. |
H: Best configuration for ethernet-as-speaker-wire?
I'm hooking up a couple of small speakers (3w max each) outside, and I have a small run in my house from inside to out that was done with ethernet cable. There's no way I can pull speaker wire through, I need to use the ethernet for about 15 feet. I'll run heavy gauge speaker wire from the amplifier to ethernet cable, and then speaker to ethernet cable (both those runs are short, 5 feet or so).
What is the best way to use the ethernet cable (23 gauge cat6)?
Should I join each twisted pair together and treat it as 4 wires (one each for positive and negative times 2 speakers)?
Should I take one wire from two pairs (eg white-green, white-orange together are positive for one speaker, green and orange are negative)?
Should I just use two twisted pairs total and leave the others unused?
I know I need to keep the resistance down but I'm not sure of any capacitive effects are going to interfere, or what's best overall.
AI: You can ignore cable capacitance effects at audio frequencies for speaker wiring.
Inductive coupling could be noticeable but not over that distance.
Just use as much copper as you can to keep the resistance down.
One way is to parallel up the two wires in each pair so you now have four separate wires. Use two for each channel. |
H: Which technique is used to create high value resistance inside a IC?
Various ICs have resistances inside them. For example, AVR microcontrollers have an internal 10k pull-up resistor inside them. Which kind of technique is used to design these resistors? If I want to design a resistor of 470k or 100k, which procedure I should follow?
AI: You first step will be to determine what type of resistors are available in the process technology you're using.
Common resistor types are:
Nwell resistors
diffusion resistors (P-type or N-type)
polysilicon resistors
If you want high value resistors you need to keep the area that will be needed for the resistors in check.
Usually the poly resistors offer the highest resistance for a given area.
The poly resistors are normally made of the polysilicon that is also used to form the gates of NMOS and PMOS transistors.
For transistors we typically want a low resistance, that would be a resistance of for example 300 ohms / square.
Some processes offer an "high poly" resistance option where the square resistance is higher, for example 1 kohm / square.
Since you don't want one very long and thin resistor you generally need to make many smaller resistors, of for example 20 kohms and connect many of these in series.
Realize that resistor values aren't very well controlled. A tolerance of +/- 20% is quite common. Also very narrow resistors (small Width) can have larger variations (and mismatch) than wider resistors. But making a resistor wider while keeping the total resistance the same will result in a larger used area so there's an area versus accuracy trade-off.
It is suggested in the comments that a FET can be used as a resistor. Yes it can but its value will depend on the applied voltage so this can only be used in certain applications.
As an alternative for pull-up / pull-down resistors which need to have a high value but also a small area, I would also consider using a MOSFET as a current source. That current source would then be designed for a very small current, for example 1 uA. Part of such a current mirror can be shared with many inputs making the total area much smaller compared to using high value resistors. |
H: How to add 12V cooling fans to existing 48V circuit?
I have a 48V stepper running off a 240W supply, max current of the drive is ~4A. I am looking to add an 80mm cooling fan to this circuit. I know 48V fans exist, but 12V are more widely available and easily replaced. In my research, most 12V fans <30dBa draw less than 0.2A of current at max RPM, so I have enough current even with the stepper at max load.
Could I simply use a stepdown converter off the 48V rail to power this fan?
Or should I split from my 120VAC power entry module to a separate 12V transformer (which seems like overkill for one measly fan)?
AI: Not a big fan (as it were) of adding 7W+ of heat by linear dropping or regulation where you are trying to get rid of it. There are also a few other 'potential' issues considering the voltage drop and irregular current draw.
You could add an inexpensive (about 8 USD in MOQ 1) NSD05-48S12 DC-DC converter to create a 12V supply.
These happen to be isolated DC-DC rather than simple buck topology but it does no harm and tends to make it less likely it would fail with high voltage output.
They're 80% or thereabouts efficient, so a 200mA 12V fan should draw around 60mA from the 48V supply. |
H: What is the difference between "differential" and "differential-coplanar" in controlled impedance?
I am routing differential pairs in Altium 20 and using controlled impedance profiles. I am using microstrips on external layers only.
For instance, I want a 100 Ω controlled impedance pair, and have used "differential" before which seemed to work fine. Because the traces are together on the same layer (plane) I'm not sure how "coplanar" differs. Information on Altium's page about this is not really clearing it up for me.
What's the difference between "differential" and "differential-coplanar?"
With "differential", selecting the top layer provides this properties panel:
Using "differential-coplanar", selecting the top layer provides this properties panel:
I've always manually created a DRC rule to keep the ground pour on the same plane away from the differential trace by some amount. It appears that the coplanar option specifies a clearance (S) which aims to do the same thing. (Although the value provided is smaller than expected.)
AI: The coplanar option designs a grounded coplanar waveguide structure. In this design there is a coplanar ground plane a controlled distance away from the trace that is close enough that it significantly affects the impedance of the trace. See how in your microstrip example the traces are 192 um wide while in the coplanar design they are 117 um wide. This difference is to compensate for the extra capacitance to the nearby coplanar ground. For this reason it is different than just setting a design rule to keep the ground pour away. If you let the ground get this close to the traces you would mess up your controlled impedance. See how the gap between the traces is the same as the gap to the coplanar ground. This should be much closer than your normal ground pour design rule would allow. |
H: Why does current noise flow through the parallel combination of R1 and RF in a non-inverting opamp?
I am following this reference for noise calculations of a non-inverting op-amp.
I am not able to understand why the equivalent resistor is the parallel combination of R1 and RF as shown below:
I couldn't find any explanation for this anywhere. All application notes just state consider the parallel combination without any explanation.
Maybe I am missing something obvious here but while trying to analyse the circuit the current source is throwing me off.
Will virtual ground still be valid here now that a current source is present between the terminals?
If not, how do we go about this then? If yes, the inverting node becomes 0V, in which case all current should have flown through R1 as it gets shorted. In neither of the cases, do we get parallel combination of R1 and Rf.
AI: The reference is wrong.
Write the nodal equation at the inverting input
$$i_n = V_-(1/R_F + 1/R_1) - VF1/R_F$$
and for an ideal op amp with \$V_- = V_+\$ , if \$V_i\$ is applied to the non-inverting input, then
$$V_{out} = VF1 = V_i(1+R_F/R_1)-i_nR_F$$
You can see this without solving the nodal equations as the summing inverting amplifier simply sums the currents fed to the inverting input and multiplies them by \$R_F\$ |
H: Hysteresis curve does not look like what is expected on the oscilloscope
update: Based one the comment from @Andy aka, I tried to obtain the curve without using the integrator. It does give me a better looking graph.
Afterward, I switched the power supply to another larger one (which I can gradually change the input voltage by turning a knob. However, this time the curve looks so fat and unconcentrated. Why is this happening?
(other than this issue, the curve looks good!)**
________________________________________________________________________________________
I am using a 600turns 2A - 300turns 4A step down transformer with an iron core, AC voltage of 3V, and an RC integrator consisting of a 47 microfarad capacitor and an 8 ohm resistor (I got this from a variable resistor)
This is my setup:
This is my circuit diagram:
****This shape of the hysteresis curve looks like this. I observed that as I increase the voltage, the shape of the hysteresis curve does not actually change. From what I see, it is probably only the size of it that is changing.
this is the curve I get when the input voltage is 1V. This looks the same as the one when the input voltage is 3V, but just a smaller in size...
This might be why that I cannot get a saturation point on the curve...Why is this happening, how can I correct this?
I am unsure about why the curve looks round. I increased the voltage up to 15V. However, the curve still has not yet reached saturation.
I was expecting to see a curve like this when the curve has not yet reached saturation:
Also, the resistance of the resistor in the integrator is currently 8 ohm. If I increase it, for example, to 122 ohm, the shape turns really round like this:
Where is the mistake..?
AI: This answer addresses the integrator, which accepts as input the sense winding, and provides an output voltage that's proportional to magnetic flux in the core.
A simple RC integrator can be used, but it does output a tiny voltage. Most oscilloscopes bottom-out at 2mV/div or 5mV/div. The RC integrator is most accurate when its output voltage across the capacitor is a tiny fraction of its input voltage. In some cases, where the sense winding has few turns, the simple RC passive integrator provides too-small output - as Hearth has pointed out in comments an active opamp integrator must be used in this case.
The OP's integrator uses a 47uf capacitor, which is likely polarized (either electrolytic or tantalum). Since output is AC having +ve and -ve polarity, a non-polarized capacitor should be used. Although 10uf non-polarized capacitors are available, 1uf is more common.
At 50 Hz., a 1uf capacitor has a reactance of 3183 ohms. The R of a simple passive integrator must be many times larger than this reactance, else the integrator has both phase and amplitude error: Ellipses appear on the oscilloscope display instead of straight lines. For this integrator running at 50 Hz, a resistor should be greater than 100k ohms. A larger resistor provides a better integrator, but smaller output voltage.
simulate this circuit – Schematic created using CircuitLab
To saturate a magnetic core, sufficient ampere-turns must be applied. Voltage induced in the sense winding "spikes" to high amplitude when the core is saturated...when not saturated, this waveform is much more sinusoidal.
Below, the red waveform represents sense-winding voltage of a saturated core. In green, the voltage across C1 is very small, and has been "amplified" 50 times so that you can see its shape...it is integrating the 50 Hz waveform fairly well:
Using an opamp integrator releases you from the requirement \$R >> {1 \over {2\pi f C}}\$. A smaller C produces a larger output voltage. Keep R1 fairly large, so that little sense-winding current flows.
The opamp must be powered from dual DC supplies (one positive, the other negative) since input and output are AC above and below ground. A large-value resistor R2 is required across the integrating capacitor to maintain DC-stability, otherwise output voltage will slowly wander to one or the other DC supply rails:
simulate this circuit |
H: What if the LDO feedback resistor has higher value, how it will affect the feedback current?
Following is the application digram of LDO.
I have calculated the resistor values R1 and R2 under the assumption of following recommendaton (R1||R2 = 250 kΩ).
Calculated values are R1 = 517.38 kΩ and R2 = 483.7 kΩ.
Can this higher resistor values affect the feedback current or the perfomance of LDO?
AI: The datasheet recommended value for R1 is 110k\$\Omega\$. Using 4-5x higher values will mean potentially more error from variations in the feedback input bias current.
It is specified as +/-500nA worst-case over the temperature range. With a 250K R1||R2 as you have, the worst-case error would be +/-125mV at the feedback pin, or about +/-10% at the regulator output.
simulate this circuit – Schematic created using CircuitLab
As you can see from the simulation, the numbers work out and the variation is from 2.242V to 2.76V (plus whatever additional error is contributed by the resistor tolerances and drifts, and the reference voltage tolerance and drift).
Also the compensation capacitor has to be adjusted as noted in your question. |
H: What, if anything, prevents you from putting the switching transistor on the output side of a power supply?
When you look up power supply theory online all of the sample schematics have the switching transistor on the input side of the transformer. Is there a reason for this? What engineering tradeoffs are involved if it is possible to put the switching transistor on the output side of the transformer?
Especially in the case of a power supply converting 100 volts or more to a lower voltage it would seem you could lower the voltage requirements of the transistor by putting it after the transformer. It would also completely isolate the voltage/current regulation circuitry from the high voltage side of the circuit. Additionaly, it would make it dirt simple to make a high current dc to dc power supply for hobby purposes. You could take a microwave transformer, put a power transistor on the transformer output, then connect the transistor output to a rectification diode and smoothing capacitor. Quick, dirty, simple, reasonably dangerous, and cheap.
Since my main question is if you can convert one of the standard power supply types to have the switching transistor on the output side of the transformer I figure this flyback converter example circuit (pictured below) from Wikipedia will be a good circuit to focus the question on.
The main points I would like answered are:
Is it generally possible for a power supply to work in practice when designed this way?
Are there any engineering tradeoffs this causes?
Are there any design pitfalls you must avoid to make it work? (For example, would this design require you to put the switching transistor directly after the transformer or could you put it after the capacitor and rectification diode and still have it work fine - this part may need to be a second question spin-off post though.)
If it is generally not possible in practice to put the switching transistor on the output side of the transformer please explain why. For the purposes of the question I am assuming the input power source is 100v dc. I am also assuming the transformer windings are not a 1:1 turn ratio. This design change would require the transformer to change the voltage.
Edit: I am on mobile so it is not easy for me to edit a proper picture at the moment, but for my question the switch S would be on the secondary side of the transformer. At the node labeled "I subscript D" in the picture below.
AI: You always have to have AC input for the transformer to work, doing its job stepping down the voltage. So powering a transformer directly with 100V DC is a non-starter. You have to use a primary switch just to get the transformer to do anything.
Say your supply is 120V AC. You can indeed make a step-down switching supply using a transformer followed by the rectifier to make the raw low voltage DC, and use a switching regulator in the secondary. Before off-the-line switchers became common this was how it was done. It was, and still is, a really easy way to make an AC/DC power supply. It avoids nearly all the hassle of high-voltage components and safety certification, and can use easily-sourced transformers. Is it a good way, given the technology and design tools available to us now? Hard to say.
A long time ago I made an audio product that used exactly that AC/DC approach, as an effort to reduce noise. That product used a large, heavy (and expensive - it was a low-leakage toroidal) transformer to deal with 60Hz. The designer / manufacturer was an audio person who did guitar amps as a business (a famous one at that) and pushed for that approach so I went with it.
Was it better than using a more-typical 30KHz or so used with primary switching? It certainly was heavier and more expensive, and it added some heft to the product making it seem more substantial. Nevertheless I don’t think I’d do it that way again. It’s less efficient, bulkier and costs more than the primary-switch approach. |
H: How does amplitude dimming (CCR) work?
When a LED driver dims using constant current reduction (CCR), what voltage and current is sent to the LED chip at the various dimming levels?
Say I have
a CCR-compatible LED chip which takes 500mA and 20V
a 10W CCR LED driver with 6-52V output and 500mA output
How much current and voltage is running through the chip at
100% dimming
50% dimming
25% dimming
1% dimming
What happens if I replace the LED chip with another one which takes 500mA and is labeled for 5W (as opposed to 10W)? Won't it receive way too much voltage? How much is too much?
Extra bonus if you also can explain what happens when the driver is using hybrid dimming with amplitude modulation from 1% to 100% and then PWM from 0.1% to 1%.
AI: The current is proportional to the dimming percentage.
For your example, if 100% is 500mA, then 50% is 250mA and 1% is 5mA.
Voltage will be whatever it takes for the LEDs to pass the defined current through them - at 100% it will be about 20V but will not be exactly 20V due to manufacturing tolerances and at lower currents it will be somewhat less.
If you replace a 500mA 10W LED with a 500mA 5W LED, the 500mA power supply still drives 500mA to LED. Only voltage is lower. 500mA * 20V = 10W and 500mA * 10V = 5W.
What happens during hybrid dimming is the constant current is set to 1% but then that 1% current is not applied constantly but using PWM, where 100% PWM is 1% current and 10% PWM is 1% current applied but 10% on and 90% off at some frequency so actual brightness is 0.1%. |
H: Typical tolerance of transformer secondary voltage?
I bought a transformer that said it would transform 230VAC to 34VAC (actually 2x17VAC, but it came with instructions how to connect the two secondary windings in series to get 34VAC.)
Even taking into account that my outlets give 240VAC, the measured secondary voltage of 41VAC seems excessive. This is a difference of about 20% with respect to the transformer's rating.
Is this within the normal tolerance of secondary voltages, or should I look for another supplier?
The reason this bugs me is that I was planning to use this transformer to build a power supply based on an LM317. I had planned for a rather small heat sink on the LM317 (at 34VAC, my design says that there will be just two or three extra volts to be sunk), but if I now have to sink several more volts (at 1 A max), I will need a rather larger one.
AI: Well, technically, the secondary voltage varies with loading.
Considering the real-world model of a transformer:
ImgSrc
There's always a non-zero Rs in the secondary. This resistance is real and dissipative and is defined by the number of turns, material, and thickness of the wire. Since it's always present and non-zero, there'll always be a drop across this resistance. What you are measuring is probably the open (i.e. unloaded) secondary voltage. So, if you load the secondary, you'll observe that the measured secondary voltage will be lower due to the aforementioned drop.
Remember that the secondary voltage written on the transformer's label is the voltage when it's fully loaded. For example, assuming the transformer has a VA rating of, say, 34VA. If you connect the secondaries in series and load this combined secondary with a pure resistance of 34 Ohms then you'll measure 34Vac across the secondary. |
H: How to practically decide the size of a segment (or number of segments) in a distributed transmission line of some given length?
I want to know in a practical scenario, what is the least optimal size that is as good as infinitesimally small value? I mean practically we can't take infinitesimally small segments, so with what size are we better off...? And how to arrive at that quantity?)
(Another related query, Does this optimal size depends on the wavelength of the wave which is travelling on wire?)
AI: You want each lumped segment to be significantly less in equivalent length compared to one-quarter of one wavelength of the highest frequency in the spectrum you are are interested in.
A good rule of thumb is about one-tenth to about one-hundredth of the shortest wavelength. To get better accuracy use a shorter lump in terms of wavelength AND, don't forget that an electrical signal travelling down a cable will not travel at the speed of light but circa 0.65x the speed of light hence, you should take this into account when calculating.
Another related query, Does this optimal size depends on the
wavelength of the wave which is travelling on wire?
It totally depends on it. |
H: Diagnostics of the IGBT transistors in the three phase inverter
Let's say I have three phase voltage source inverter i.e. following circuit
I have a suspicion that one or more IGBTs are damaged. To confirm this hypothesis I have decided to use multimeter in ohmmeter setting and I have measured the resistance between the collector and emitor terminals of the individual IGBTs. I have measured resistances between:
terminal 30,31,32 and terminal 2 for IGBT in upper row on the left
terminal 30,31,32 and terminal 6 for IGBT in upper row in the middle
terminal 30,31,32 and terminal 10 for IGBT in upper row on the right
terminal 27,28,29 and terminal 4 for IGBT in lower row on the left
terminal 24,25,26 and terminal 8 for IGBT in lower row in the middle
terminal 21,22,23 and terminal 12 for IGBT in lower row on the right
My multimeter displayed follwoing values of the resistance
OL
\$22.95\,\mathrm{k}\Omega\$
\$23\,\mathrm{k}\Omega\$
\$7\,\mathrm{M}\Omega\$
\$5.7\,\mathrm{M}\Omega\$
\$4.8\,\mathrm{M}\Omega\$
Does it mean that all of the transistors are ok (because none of the measurements displayed \$0\,\Omega\$ or some value close to that) or is there any mistake in my measurement (I expected that all the measurements should be OL in case all of the transistors are ok)?
EDIT:
I have done another measurement with multimeter configured in diode test mode and I have measured voltage drop between
terminal 2 (positive probe) and terminal 30,31,32 (negative probe) for IGBT in upper row on the left
terminal 6 (positive probe) and terminal 30,31,32 (negative probe) for IGBT in upper row in the middle
terminal 10 (positive probe) and terminal 30,31,32 (negative probe) for IGBT in upper row on the right
terminal 4 (positive probe) and terminal 27,28,29 (negative probe) for IGBT in lower row on the left
terminal 8 (positive probe) and terminal 24,25,26 (negative probe) for IGBT in lower row in the middle
terminal 12 (positive probe) and terminal 21,22,23 (negative probe) for IGBT in lower row on the right
My multimeter displayed follwoing values of the voltage drops
\$0.03\,\mathrm{V}\$
\$0.374\,\mathrm{V}\$
\$0.374\,\mathrm{V}\$
\$0.374\,\mathrm{V}\$
\$0.374\,\mathrm{V}\$
\$0.000\,\mathrm{V}\$
AI: Something is wrong with your upper left and lower right IGBTs; both of them appear to show no antiparallel diode. I'm not sure why they don't show low impedance in the opposite direction, though. When you say you measured the resistances between two nodes, do you mean you put the positive probe on the first and negative on the second? It does matter with semiconductor devices.
Another test that's good to make is the gate to emitter and gate to collector impedance--if it's anything less than hundreds of MΩ, something is probably wrong. If it's less than a kΩ, something is definitely wrong. |
H: Size of a memory cache
Assuming we have a virtual address issued by a model CPU that contains a total of 32 bits and 20 bits of this address are reserved for the tag + the cache comprises a total of 1024 cache lines.
Should the rest of the bits in the virtual address (12 bits) be generally considered as the block size of a cache line ?
AI: Assuming this is a direct-mapped cache, \$20\$ bits are reserved for tag. It means \$32-20=12\$ bits are reserved for index + offset.
There are \$1024=2^{10}\$ cache lines, which means \$10\$ bits are needed to select a cache line ie., index = \$10\$ bits. The remaining \$12-10=2\$ bits should be for offset then. i.e., the cache-block/cache-line size = \$2^2 = 4\$ bytes = \$32\$ bits. |
H: What type of MOSFET can be controlled by an Arduino PWM output?
I'm looking for a MOSFET that can be used controlled by an Arduino output that increases and decreases in voltage. I need to control a bright LED that needs 5V. The PWM output on the Arduino doesn't output enough, so I will use a MOSFET as shown in the image:
I don't know which type will be suited for my project. Where can I maybe find one in everyday equipment?
AI: You need (for predictable results) a logic-level MOSFET. One that has a specified Rds(on) with 4.5V or 5V drive (or lower is okay too), assuming an Arduino that has 5V nominal outputs. Eg. IRLZ44.
• Logic-Level Gate Drive
• RDS(on) Specified at VGS = 4 V and 5 V
You also should have a series resistor on the LED.
You can look up datasheets for most parts that you can salvage and see if they meet those requirements. |
H: How can I Identify this IC marked SDA
I'm trying to find what this part could be. I'm pretty sure the packaging is SOT-23-6 based on measurements I took (about 3.5mm by 4.5mm counting the length of the pins). I know that the middle top and bottom pins are Vcc and GND, it looks like bottom left is the input and top left is the output. My guess for top right would be an enable pin because most things on this board have them. I took measurements while the board was running and measured 2.7V DC on bottom left and 1.35V DC top left. I measured top right and also got 2.7V DC.
There are two right next to each other with their outputs tied together and running into an op-amp while another IC (which happens to be unidentified) is connected to both of their top right pins. When I was measuring it seemed like only one was getting anything in its input at any given time but I'm not 100% sure of that. I've searched based on top marking and can't find anything that makes sense as well as trying to search some voltage regulators using the measured dimensions and one output. Any help with where I can go next would be appreciated.
AI: ADG751 from analog devices comes in that package with those markings and the power pin locations seem to match. |
H: Bitwise OR operator confusion
Can anyone tell me the difference between the following two assignments?
control_reg |= (1<<2) | (1<<4);
control_reg = (1<<2) | (1<<4);
AI: control_reg |= (1<<2) | (1<<4);
This only affects bits 2 and 4 -- all of the other bits in control_reg are left unmodified.
control_reg = (1<<2) | (1<<4);
This modifies all the bits in control_reg -- bits 2 and 4 are set to 1 and all the other bits are set to 0. |
H: How to find the time taken for the output to reach a certain value in LTSPICE?
This question is software related. I just wanted to know if it was possible to get the time at which my circuit reaches a certain value without just running the cursor and getting a approximate value. For example if I have a RC circuit , plot the time at which the voltage across resistor reaches 1/2 * Vdd. Is there someway to do code it and get the exact answer? if yes can you please explain how it can be done?
AI: Use a .meas statement.
.MEAS TRAN res4 FIND V(out) WHEN V(x)=3*V(y) rise=last
Print the value of V(out) the last time the condition V(x)=3V(y) is
met when approached as V(x) increasing wrt 3V(y). This will be
labeled res4.
Source: LT wiki
If I wanted to find the time when a node was at 0.5V, I would use a statement like this:
.meas TRAN newsignal2 FIND time WHEN 0.5=V(vout)
The results will show up in the spice error log, also if it says "Measurement [nameofsignal] FAIL'ed" that means the statement didn't find anything OR the syntax is wrong so this can make it difficult to debug. |
H: Software filter for load cell readings
I looked through lots of questions, but I didn't find a suitable answer for the project I'm working on. The project can be thought of as a simple control box, water valve, and scale.
The mcu control board inside the valve receives a binary on/off signal to control the flow. The mcu control board inside the scale has an ADC which interfaces with a load cell, and it sends the digital reading over a long shielded cable. The scale control board has appropriate lowpass filters and proper shielding, so the ADC readings themselves are very clean.
My problem has been infrequent spikes in digital readings. I believe it is due to the noisy environment the cable is routed through, and inductive spikes in the cable. The digital communication is simply using GPIO pins with a driver/buffer chip on each end of the cable.
My initial approach was to keep a 5 frame rolling average, and reject a reading if it is outside the mean of the readings +/- a predetermined value. This had issues with the third graph shown being entirely rejected, and didn't account for increases in flow rates. I was considering using a calculated flow/delta rate as the threshold, but decided to see if a better solution exists before trying to reinvent the wheel. The main controller needs to retain a good time response to shut off the valve accurately, and the ADC is selectable to be 10 or 80 samples per second.
I am wondering if anyone has encountered a similar problem and fixed it with a simple solution. All I need to implement is a way to throw out signal readings if it is a temporary spike, but keep the readings if it remains high. I am partly asking in case someone in the future searches the internet and finds this question.
Here are some graphs which demonstrate:
This is a typical operating cycle. Valve turns on, and when the reading hits the fill threshold (blue), it turns off.
This is an example of the problematic reading. An outlier in the signal trips the valve early, and the real value of the fill ends up being too low.
This is what happens when the scale is calibrated or used as a part counter. This spike remains high, and does not need to be rejected. These values are much higher than the filling values.
AI: The method I have used in the past that works well is track the rolling 3sigma and exclude if it exceeds the range. This works if your S/N ratio is >100. You can adjust sigma multiple according to expected short term number of values computed and rate of change of signal.
This could be using the rolling mean of signal-squared values with the min/max range as an inclusion range with a tolerance added for thresholds for changing inputs.
I have also used analog S/H with differential filters to inhibit transfer of the hold value to the ADC input. Also I have used converting to digital locally and adding parity or hamming code for long links.
But ultimately tracking down the source of interference to improve SNR is best. I would use look for EMI correlation … (even a soldering iron thermal controlled relay can cause a glitch) and if failed, do ingress susceptibility tests with a magnetic coil noise generator.
You may want to change the GPIO to differential balanced RS485 or simply add 150 Ohms to the driver to approach matching a 200 ohm cable to eliminate mismatch ringing on twisted pair. |
H: Night light broke after trying to dim LEDs
I purchased a cheap night light that plugs directly into a 240V wall outlet. It has three color changing LEDs.
The problem was, those LEDs were way too bright. I decided to modify that night light a little, so they're not as bright.
The reverse-engineered schematic is a little strange in that when the light is off (during daylight) it actually draws a considerable amount of power - about as much when the LEDs are turned on.
(Value of C2 is just the default value for caps the schematic tool I used assigns to those components. I don't know the actual value. LDR1 is red, because it was the selected item when I took the screenshot, it has no significance)
As you can see in the schematic, at night, the current drops through the LEDs (they have no current limiting resistor.)
As the ambient light gets brighter, the resistance through LDR1 drops, and the transistor Q1 starts conducting current.
During daylight, the LEDs are effectively shorted through the resistor. As more and more light gets on LDR1, the LEDs will be less and less bright.
I tried to limit the maximum brightness of the LEDs, by introducing a current-limiting resistor (red circle in the schematic, just above D1). I noticed that I had to use a quite large resistance, around 180k, to have any effect.
The brightness was limited alright, but I also noticed, that when LDR1 was fully covered, i.e. the entire current dropped through the resistor and the LEDs, a buzzing sound emanated and after about two minutes the device broke and is now completely broken. I don't know what part broke as of yet, but I assume Q1 failed open.
LDR1 had a maximum resistance of around 33kΩ - 38kΩ; it was difficult to measure in complete darkness without any light bleeding onto the LDR.
C2 is a tiny 0402 capacitor of unknown value, I assume it's a tiny little bypass capacitor that probably doesn't do much to begin with.
Unfortunately, I don't know the current draw after the bridge rectifier. It was difficult to get a reading with a multimeter as the color-changing RGB LEDs constantly kept changing the voltage drop through them. I seem to have measured a voltage drop of around 9V. Taking the bridge rectifier diodes into account, I'd assume a 10V drop:
\$ 10V \times \tfrac{1}{\sqrt2} \approx 7V_{RMS} \$
The capacitive dropper has an impedance of \$ X_c = \tfrac{1}{2\pi f C} = \tfrac{1}{2\pi \times 50Hz \times 100 \times 10^{-9}F} \approx 31.8kΩ \$.
Together with R1 this must therefore drop \$ 240V - 7 = 233V \$.
\$ \tfrac{233V}{32.36kΩ} = 7.2mA \$, now that to me, seems really low.
Now here are my questions:
This circuit seems very weird to me, especially how the LEDs are shorted to turn them off and the entire voltage is dropped via the transistor. I'd understand using the transistor as a low-side switch in line right after the LEDs, but using them like that seems just wrong. Am I misunderstanding something? Is this preferred for some reason?
Why did the circuit break when I introduced a resistor right in front of the LEDs? Where did it most likely fail?
How would I actually go about dimming the LEDs such that the whole thing doesn't break?
I'm assuming for point 3, that I should simply have made the resistor R1 a higher value, further limiting the current through the rest of the circuit.
AI: Most likely you did not measure the power, but rather the current. The power when the LEDs are off is low but the current will be almost unchanged. Trying to interrupt the current would require a high voltage semiconductor which would be more costly and probably less reliable.
When you added the resistor you increased the voltage that the transistor has to block. At some point the transistor will fail. It's rated for about 45V (knock-offs may be slightly different rating).
To dim the LEDs you could try shunting the LEDs with a resistor- that's not ideal because it will have other effects.
Better would be to replace C1 with a lower value than is there currently, suitably rated for that 'X' service.
Keep in mind that this circuit is not isolated from the mains and any contact while powered could result in a (possibly fatal) electrical shock. |
H: Is there a way to remove the Ref and Value markings from the preview and final print?
I just started using KiCad.
The "Ref" and "Value" markings are getting quite frustrating.
I can remove them from the design preview by disabling some layers, but when I open it in the 3D viewer they are still visible.
How can I remove them?
AI: In 3D Viewer, go to Display Options menu either by clicking the third button on the top toolbar or using the Preferences menu. There you can uncheck the Show silkscreen layers checkbox.
Normally, only references are shown in 3D viewer, not the values because they are part of the Fab layers. The solution I mentioned hides the all silkscreen layers. I don't know any option to hide references only.
Plotting to Gerber, you can selectively disable the footprint values and reference designators using these checkboxes: |
H: Why is my Arduino's GND pin emitting power instead of grounding it?
I was debugging the circuit below with my new multimeter when I found that my Arduino's ground pin was actually emitting power. I connected the longer leg of an LED to the ground pin and confirmed that in fact the pin was powering the LED.
I feel like this is likely the issue I am having with this circuit and am wondering what would cause the ground pin to emit a non-negative voltage? Better yet, how could I solve this problem?
simulate this circuit – Schematic created using CircuitLab
AI: You don't need to solve the problem because there is none. What you see is perfectly normal, if you put a LED on a ground return wire, but putting a LED to ground return wire of Arduino is not normal.
Arduino takes in power by consuming current from the 5V supply via the 5V pin. The current then must return out from the GND pin back to the power supply. That current will light up a LED if you put it in the path of current taken by Arduino.
Just remove the LED because it does not belong there to begin with and the circuit is fine. If the Arduino consumes more current than the LED can handle the LED will get damaged and it can burn out. |
H: Why do some car fan resistor modules have both a wirewound resistor and another component?
I'm reusing/salvaging a car radiator fan and fan resistor module (for a non-car related project), and wondered: why does the resistor module have both a wirewound resistor and another component? (Perhaps this other component is also a resistor?)
As I understand it, the resistor is connected to a relay which is only triggered when the engine is off, operating the fan in "slow mode". I imagine that if they are both resistors, perhaps either one is used as a backup, but I could be way off. If the smaller component is not a resistor, perhaps it's a fuse?
When using the resistor module, is it important which direction the current flows? There doesn't appear to be a positive and negative label. For instance, should the current flow first through the wirewound resistor, or through the other component?
The wirewound resistor has "R48K" printed on it, and the other component I'm not sure about (maybe it's also a resistor, or perhaps it's some sort of fuse). The module is called a "Fiat 500 PA66 Radiator Fan Resistor Pack".
Edit: The unidentified component appears to be wired in series, and when I increase the heat, the resistance increases. So, I guess it's a thermal resistor of some kind.
AI: That looks a lot like a thermal fuse. it will go open circuit if it gets too hot.
It's most-likely purpose is to prevent the resistor from starting a fire if the fan motor is jammed.
With a series connection all the current flows through both parts, and as these parts are both non-polarised the direction that the current flows is not important. |
H: Is there a way to reduce current, other than PWM, without creating heat?
I'm trying to reuse/salvage an old 12V DC car radiator fan for a non-car related project, and have found that it has a high load (actually seems to be somewhere around 200W, as it's a powerful fan). I want to reduce the speed of the fan because I don't need it to spin that fast for what I'm using it for. If I could reduce the current/speed variably using an Arduino, that would be ideal. Using my bench power supply, I found that being able to vary the power between 10W and 50W would be ideal.
I realized that I could use a high wattage aluminum shell power resistor or similar to reduce the current, but this will of course generate heat and waste energy which I'd like to avoid if possible (also, the speed wouldn't be variable).
I've experimented with using an IRLB8721 MOSFET for PWM, but the transistor gets very hot (and seems like I'd need to attach it to a heatsink). Since the MOSFET also generates heat, I'd like to find a cooler solution. My bench power supply can of course limit the volts and current, and it has a fan for heat dissipation, so whatever current limiting method that uses would not be ideal either.
Regular AC household fans usually have a button or other control to adjust the fan speed, so that's making me think there must be a way.
So, other than PWM, is there a way to reduce current/fan speed without creating heat and wasting energy?
If the answer is no, then I will either use the MOSFET with a heatsink, or use a different, lower wattage fan (but it'd be a shame if I couldn't put it to use).
AI: The other answers are true, but they don't explain the dilemma...
If you don't want to do PWM, you need to reduce the voltage across the fan. (Note that it's not clear that this is a good idea, if you use this approach make sure to check the temperature of the fan motor.) In order to limit the current, you have to introduce an element in series to limit the voltage across the fan. This means that the remainder of the voltage will appear across the new element.
Since the new element is in series, it will also pass the same current as seen by the fan motor. With voltage and current across this element, it will have to dissipate power, and the usual mechanism is heat.
Therefore, anything you use (without PWM or something similar) will need to dissipate a certain amount of heat. If you go this route, you'll find out semiconductors are better at dissipating that heat than resistors, especially when properly heatsunk.
I'm not sure what your PWM setup looks like, but the motor is an inductive load, so you don't want to switch the current off abruptly. At a minimum, a flyback diode across the motor should be used so the inductor can pull current through the diode when the transistor is off. This might help with your overheating problem on that MOSFET.
I |
H: Which parameter from the datasheet of a Zener diode should I consider for voltage regulation?
I am using a 4.7V (1N4732A) Zener diode to regulate input voltage from 24V to 5V for an Arduino input. Everything works perfectly. I am not really sure how.
Which current parameter in the datasheet should I consider when using a Zener diode for voltage regulation?
AI: A Zener diode has three datasheet values to consider; one, is a package-related power limit; second, a recommended bias current. Third, is the dynamic impedance (the equivalent resistance for small signals when under bias). Bias current, in the above circuit, is nil, so it isn't really
regulating at 4.7V at all.
Accuracy of the voltage at the Zener cathode has two terms: one is the
unit-to-unit variation allowed by the manufacturer, the other is the
current variation (if any) drawn by the Zener times the dynamic impedance of the diode.
For a 4.7V Zener, a 0.5V terminal voltage indicates the bias current
is not sufficient to achieve regulation. 1N4732A is a typical
4.7V Zener diode, and at 53 mA bias (24V source and 360 ohm, 1W resistor)
its equivalent resistance is about 8 ohms.
That makes it a good regulator of its output voltage, since the
fluctuations of the 24V supply only connect through higher (360 ohm)
resistance than the 8 ohm value. It also wastes quite
a lot of electrical power, which is why the 1W rating of the
resistor is important.
That diode can, with air cooling, take up to 1W, so the bias current
could be raised to 200 mA, allowing zero to 150 mA delivered to the load,
while remaining a 'good' regulator. That would mean a pullup resistor
of about 100 ohms, rated for 4W, however. |
H: Why can't the LED flash for a while?
I am new to electronic circuits. I made a circuit as this picture shows:
I want the LED to flash for a while when the switch is open, but it seems the capacitor doesn't do its job well.
power source input: 5 V
both resistors: 100 ohms each
capacitor :100 μF, 50 V
AI: The capacitor and resistors will have a time constant given by τ = RC = 100 × 10-6 × 200 = 2 × 10-2 s = 0.02 s.
The delay is there. You just can't see it. |
H: Adding an on/off switch to a USB cable (switch VBUS or all conductors)?
I want to add an on/off switch to a USB cable as easy alternative to plugging/unplugging a keyboard.
What difference between:
Adding a switch only to a red (VBUS) wire.
Adding a switch to a red (VBUS) and a black (GND) wires.
Adding a switch to all wires (VBUS, DATA-, DATA+, GND).
What is the safest solution?
AI: Usually this is implemented in (cheap) USB hubs by switching VBUS. (in fact I have a hub that does just that). Since most keyboards designs will most likely shut down (because they use VBUS as a power source) if VBUS voltage drops or is disconnected that is the best way.
Adding a switch to ground is unnecessary and could create common mode noise through extra resistance.
Adding a switch to all wires is also complicated because the switch would need to preserve the 90Ω characteristic impedance of the data lines (if not you get reflections noise and data loss. You would need to be able to find a 90Ω switch for both data lines (or transistor switches/buffer) |
H: Synchronized reset signal on asynchronous input - D flip flop
For a D flip flop with an asynchronous reset, what is the behavior if the reset input signal is synchronized with the input clock?
This is what I'm picturing:
If the CLR signal is just a divided version of the CLK input, will the output ever change? I drew a possible output - what is the correct output? ~Q will only go low when CLR is high and CLK is on a positive transition.
The first output I drew for ~Q is what I think it would be for ideal, zero delay flip flops. In this case, CLR and ~Q would change on the same clock edge.
The second output I drew for ~Q is what I think it would be for non-ideal flip-flops. For even larger delays, I think ~Q would never go low.
What is the correct output for ~Q in this case? I'm using a similar circuit for re-timing a clock signal, where the CLR input will be synchronized to the CLK input.
EDIT: cropped image to remove an incorrect output I drew.
AI: The CLR signal is not just a divided version of the clock...it is also delayed after the clock. If the delay from clock-to-Q for the bottom flip-flop is less than the CLR input hold time of the top flip-flop then the behavior is unpredictable.
Assuming that the clock-to-Q is greater than the CLR hold time, then the CLR will clear the top flip-flop shortly after the clock edge. You will see short "runt" high pulses from the top flip-flop. |
H: Op amp introduces phase shift at high audio frequencies
Context:
I am trying to design a solid-state microphone preamp using dedicated audio op amps (ex: API 2520).
Goals:
flat ≈60-66dB of gain from 20Hz to 20Khz
Limit changes in phase shift as much as possible as the frequency varies (ideally within +/- 5 degrees).
Setup:
I am currently experimenting with classic non-inverting closed loop op amp designs: Output feeds back to the negative input of the op amp using a voltage divider to adjust gain (with a capacitor in parallel of the first resistor to reduce parasitic oscillations).
See https://www.electronics-tutorials.ws/opamp/opamp_3.html for diagram with notations.
Ex: values for the gain-setting voltage divider: Rf: 10KΩ, R2: 10Ω or Rf: 100KΩ, R2: 100Ω.
I have a good oscilloscope which can produce frequency / gain-phase response diagrams by scanning a frequency range and measuring the gain and phase shift at a set number of points in the frequency range (ex: 100 points).
Problem:
There is little phase shift (+/5 degrees) at "low" gains (<40-50dB) - this is good. However, when the gain is set to a "high" value (ex: 60dB or more), the deviation to linear phase increases to unacceptable values between 10kHz and 20kHz (ex: 20+ degrees @ 20kHz).
The issue increases as the gain increases (ex: 66dB) and is also present when the capacitor in parallel with the first resistor (Rf) of the feedback voltage divider is removed entirely.
This bad as it will introduce distortion for signals where high frequencies are important (ex: cymbals, pianos, woods, etc...)
I am operating under the assumption that the op amps are good since the API 2520 is a professional audio classic and I was able to reproduce the issue with different op amps (2 original API 2520, and 4 "good copies").
Questions:
Am I missing something in my design or this part of typical op amp limitations / imperfections? (Apparently John hardy gets to +/-2 degrees of phase deviation by using servos: http://www.johnhardyco.com/M-1details.html, I don't mean to do as good as a real professional and more elaborate product but I would like to explore simple ways to mitigate this phenomenon).
If this is classic problem? If yes, what are the typical approaches to address this issue?
Thanks!
--
Edit: based on popular demand, I am adding 6 pictures of the scope at Gain=0, 40 and 60dB for frequency ranges 20Hz-20MHz and 20Hz-20KHz.
AI: I haven't found a real data sheet on this part, and judging from the gain BW product (using mHz for MHz), I suspect this is an audiophool part.
Without going in to too much detail, higher gains will mean that you will get more phase shift at 20kHz as can be seen from the simulation of some random opamp that has a GBW of 80MHz (close to the GBW of the 2520). The simulation is for three different gain settings, apx 20, 40, & 60dB. You'll notice the phase at 20kHz is closer to zero when the gain is less. Question, will you hear the group delay difference of 100ns for your 60dB gain preamp? Probably not.
If you really want this much gain and have minimal phase shift, you need to cascade two gain stages, perhaps 30dB + 30 dB. Try using something like the NE5534 (10MHz GBW) opamp (around USD 1.30 each) and see if this will meet your requirements.
As for harmonic distortion, you will get more because you are sacrificing less gain (difference between open loop gain and closed loop gain), not because of the phase shift.
Gain, Phase, group delay plot from LTspice for three different gain settings. Plots are separated to make it easier to read.
Schematic from LTspice. |
H: Basic Circuit Analysis Question - Supermesh
Studying for the PE and am going through all the problems in my circuit analysis book in college. I'm working problem 3.33 which asks to compute the total power created in the circuit. The answer in the back of the book is 1650 W, but I keep coming up with 1406.25 W. I'm not sure what I'm doing wrong, but I'm pretty sure it has to do with the power developed in the dependent source.
I've attached the circuit and my attempt. Can anyone see my mistake or offer a suggestion?
AI: I hope this accurately reflects the problem:
simulate this circuit – Schematic created using CircuitLab
Here's the initial mesh work straight from head to paper as fast as I can write it out:
$$\begin{align*}
0\:\text{V} -R_4\cdot I_1-R_3\cdot\left(I_1-I_3\right)-R_1\cdot\left(I_1-I_2\right) &= 0\:\text{V}
\\\\
0\:\text{V} +V_1 -R_1\cdot \left(I_2-I_1\right)-R_2\cdot\left(I_2-I_3\right)-V_2 &= 0\:\text{V}
\\\\
0\:\text{V} +V_2 -R_2\cdot \left(I_3-I_2\right)-R_3\cdot\left(I_3-I_1\right)-V_{IA} &= 0\:\text{V}
\\\\
I_3&=0.2\cdot R_1\cdot\left(I_2-I_1\right)
\end{align*}$$
That's four equations and four unknowns. (Since you know that \$R_1=5\:\Omega\$, you could just go around the first three equations replacing \$I_3\$ with \$I_2-I_1\$ and reduce it to three equations and three unknowns.)
These solve out in the following way (using a free tool called sympy):
var( 'r1 r2 r3 r4 i1 i2 i3 via v1 v2' )
eq1 = Eq( 0 - r4*i1 - r3*(i1-i3) - r1*(i1-i2), 0 )
eq2 = Eq( 0 + v1 - r1*(i2-i1) - r2*(i2-i3) - v2, 0 )
eq3 = Eq( 0 + v2 - r2*(i3-i2) - r3*(i3-i1) - via, 0 )
eq4 = Eq( i3, 0.2*r1*(i2-i1) )
ans = solve( [eq1, eq2, eq3, eq4], [i1, i2, i3, via] )
for v in ans: v, ans[v].subs( {r1:5, r2:7.5, r3:2.5, r4:17.5, v1:125, v2:50} )
(i1, 3.60000000000000)
(i2, 13.2000000000000)
(i3, 9.60000000000000)
(via, 62.0000000000000)
So, given the direction of \$I_2\$ and \$V_2\$'s polarity, it's pretty clear that the power dissipated by \$V_1\$ is \$-V_1\cdot I_2=-125\:\text{V}\cdot 13.2\:\text{A}=-1650\:\text{W}\$. It's supplying power to the rest of the circuit. And the number matches up with the book value (at least in magnitude, if not sign.)
Just as a double-check, if the current \$V_2\$ is taken as exiting its positive terminal, then \$I_{V_2}=I_3-I_2=-3.6\:\text{A}\$. So the power is positive and therefore \$V_2\$ is dissipating. So you do not need to add it in.
Likewise, the current in \$I_A=I_3=9.6\:\text{A}\$ and voltage across it is \$62\:\text{V}\$. Given the polarity and direction this is also a dissipating element.
So there really is only one circuit element powering things, \$V_1\$. And you have the answer.
Please feel free to go through what I wrote, and what you did, and find your own error. It was less work for me to write this up than to parse your red script. |
H: Can I Charge 2 18650 with 2 TP4056 boards with single input
I found this video on youtube where they charges 2 18650 with 2 TP4056 modules with one input. below is the schematic he uses. Is it safe to do that?
AI: If I would re-draw that "hookup" and made a proper schematic, it would look like this:
simulate this circuit – Schematic created using CircuitLab
Note how this boils down to two batteries each charged by their own TP4056 module and the charger modules sharing the same 5 V USB supply.
This is perfectly fine!
Note how the batteries are not connected to eachother.
These batteries are not in series. A TP4056 module is not suited to charge batteries that are in series (I mention this in relation to your previous question where you meantion a 2s battery pack where the batteries are in series). |
H: Dynamo connected to ceiling fan to charge a battery
Just a hypothetical scenario :
I am thinking of connecting a dynamo to the ceiling fan to charge up a battery which might be later used to power some low power gadgets. Whether this would save my electricity as I charging a battery from an already running device (ceiling fan) and later using this energy to power some other gadget which would otherwise require electricity directly.
Can someone guide me whether it is possible to save electricity by this method? If not, why?
AI: By the law of conservation of energy you can not get more energy out of a system, as you put in. So the answer is no.
You put energy into your fan to make it spin, then draw energy from it to run a dynamo to charge a battery. So either you have to put more energy into the fan to drive the dynamo, or simply your fan runs slower and less efficient due to friction.
It's the same, when you power your bike light with a dynamo. You have to pedal harder (put more energy into the bike) to reach the same speed, when your dynamo is connected and your light turned on, as those draw energy out of the system, which would otherwise result in more speed.
Why not plug the battery directly into the wall outlet? No spinning fan, no air moved, no spinning dynamo, no friction produced, no losses in converting the energy.
If you could save energy like that, everybody would do it. |
H: Looking for the name of an electrical component
I am looking for a relay, but one whose output channels are always on, acting more as a permanent distributor of electricity to all connected devices, rather than an optional on/off switch to all devices.
What is the name of this component?
AI: What is the name of this component.
A normally-closed-contact relay springs to mind. It consumes zero power in the inactive state and connects a load to the source supply. There are millions available: -
NO means normally open
NC means normally closed
Picture from here. |
H: Glass of microwave oven
From a user who "doesn't know" anything about Maxwell's equations. How to explain simply the behavior of a transparent glass of a microwave oven? Lets the light pass ... but blocks the "dangerous"
"radiation" emitted by a powerful generator of electromagnetic waves (~ 1 kW). How's it going ? How to explain the manufacture of this glass slab?
Thanks to all contributors and comments.
Below my answer at the question. (not complete ...)
I don't know if it is usefull, but I hope so.
AI: It isn't the glass in the microwave oven door that blocks the microwave radiation.
The microwave radiation is blocked by the metal plate with holes behind the glass.
The inside of a microwave oven is a Faraday cage. It blocks (most) electromagnetic radiation.
The small, closely spaced holes in the metal allow light through but still block the microwave radiation. This works because electromagnetic waves require as much "space" to pass through as the wave itself is long.
The microwaves used to heat food have a wavelength a couple of centimeters long. They cannot pass through the millimeter sized openings in the metal grid.
Light has a wavelength that is in the range of thousandths of a millimeter. Light waves can easily pass through the millimeter sized openings in the metal grid. |
H: Re-reflow SMT boards
A SMT supplier messed up the reflow process of several PCB, though I have to urgently ship.
As seen on the picture, the reflow temperature was too low and thus the solder did not properly flow on some components.
Is there any ways to re-reflow the boards? The problem is that the flux is dried up / cleaned, and there are too many components to put flux on each pin.
Anyone has experience fixing this?
AI: The only way with good quality is to add paste and reflow by hand.
The other way is to richly use spray on flux and reflow again.
A lot of rework will be required anyway to fix tombstoning and shorts.
And you will have to wash the boards afterwards. |
H: Verilog counting problem - posedge detector with if statement not working as expected
First I am doing reset with reset input. Then I check the led position by turning on pinA. Next, a shift posedge to switch to the next led but the counting not going to its next led.
After doing reset from "00" it goes to "10" or "11" on shift posedge. But as I am adding just 1 so that should have gone to "01"
Where am I going wrong?
module syScore(
input clk,
input shift,
input enb,
input reset,
input pinA,
input pinB,
input pinC,
input pinD,
input pinE,
output reg out1,
output reg out2,
output reg out3,
output reg out4,
output reg out5,
output reg out6,
output reg out7,
output statusBit
);
reg [1:0] enPosition;
reg out;
wire w1,w2;
wire w3,w4;
reg j;
always @ (posedge clk) begin
// posedge detector block with if statement
if (j == 0 && shift == 1) begin
j<=1;
enPosition <= enPosition + 2'b01;
out3 <= 1;
end
if (shift == 0) begin
j<=0;
out3 <= 0;
end
if (reset == 1) begin
enPosition <= 2'b00;
out1 <= 0;
out2 <= 0;
out3 <= 0;
out4 <= 1;
out6 <= 0;
out7 <= 0;
j <= 0;
end
else begin
out4 <= 0;
end
case(enPosition)
2'b00: out1 <= statusBit;
2'b01: out2 <= statusBit;
2'b10: out6 <= statusBit;
2'b11: out7 <= statusBit;
default: out5 <= statusBit;
endcase
end
assign statusBit = pinA;
endmodule
AI: I'm having difficulty understanding your intent, but I think you are trying to detect a positive edge on the shift input, and then use that edge to increment a counter. The counter is then used to connect the statusBit input to different outputs, i.e. out7, out6, out2, out1.
Firstly, you need a clear demarcation between the reset condition and normal operation:
always @(posedge clk)
begin
if (reset == 1)
begin
// Do reset condition.
end
else
begin
// Do normal operation.
end
end
Secondly, you need a to detect the positive edge on shift. If shift is coming from an external button or switch, it needs to be debounced. The positive edge detector could be implemented like this:
// Positive edge detection of shift input.
assign shift_posedge = (shift == 1) & (shift_previous == 0);
...where shift_previous is a single bit register that is assigned the value of shift every clock cycle in "normal operation" in the above always block:
shift_previous <= shift;
Lastly, you need to decode the counter value to connect the statusBit input to the correct output, and zero the other outputs:
always @*
begin
case (enPosition)
2'b00: {out7, out6, out2, out1 } = { 1'b0, 1'b0, 1'b0, statusBit};
2'b01: {out7, out6, out2, out1 } = { 1'b0, 1'b0, statusBit, 1'b0};
2'b10: {out7, out6, out2, out1 } = { 1'b0, statusBit, 1'b0, 1'b0};
2'b11: {out7, out6, out2, out1 } = { statusBit, 1'b0, 1'b0, 1'b0};
default: out5 = statusBit; // Indicate invalid enPosition.
endcase
end
Putting it all together it could look something like the following code just to give you the general idea. In response to comments, I've removed the multiple drivers and changed the assignments in the synchronous reset block to non-blocking. As an alternative for synchronous and registered outputs, the case statement that decodes the enPosition counter could be moved to the normal operation block and the multiple drivers uncommented in the synchronous reset block:
module syCore
(
input reset,
input clk,
input shift, // Debounced signal from switch or button.
input statusBit,
output reg out1,
output reg out2,
output reg out3,
output reg out4,
output reg out5,
output reg out6,
output reg out7,
output reg out8
);
reg shift_previous;
wire shift_posedge;
reg [1:0] enPosition;
always @(posedge clk)
begin
if (reset == 1)
begin
//
// Synchronous reset.
//
shift_previous <= shift;
enPosition <= 2'b00;
//out1 <= 0; // Removed multiple driver.
//out2 <= 0; // Removed multiple driver.
out3 <= 0;
out4 <= 1; // Indicate reset condition.
out5 <= 0;
//out6 <= 0; // Removed multiple driver.
//out7 <= 0; // Removed multiple driver.
out8 <= 0;
end
else
begin
//
// Normal operation.
//
out4 <= 0; // Indicate normal operation.
if (shift_posedge)
begin
// Indicate positive edge on shift.
// Will go high for one clock cycle.
out3 <= 1;
// Increment counter.
enPosition <= enPosition + 2'b01;
end
else
begin
out3 <= 0; // Indicate level voltage on shift.
end
shift_previous <= shift;
end
end
// Positive edge detection of shift input.
assign shift_posedge = (shift == 1) & (shift_previous == 0);
always @*
begin
// Decode the counter and connect statusBit to the correct output.
case (enPosition)
2'b00: {out7, out6, out2, out1 } = { 1'b0, 1'b0, 1'b0, statusBit};
2'b01: {out7, out6, out2, out1 } = { 1'b0, 1'b0, statusBit, 1'b0};
2'b10: {out7, out6, out2, out1 } = { 1'b0, statusBit, 1'b0, 1'b0};
2'b11: {out7, out6, out2, out1 } = { statusBit, 1'b0, 1'b0, 1'b0};
default: out5 = statusBit; // Indicate invalid enPosition.
endcase
end
endmodule
Figure 1 – Simulation waveforms
Figure 2 – RTL synthesis schematic |
H: Inductors: Saturation Current or Rated Current?
I am designing a 5V, 5A buck converter, and I am trying to spec my output inductor.
The datasheet specifically mentions that my inductor should have an appropriate current rating, but
I also wonder about the saturation current rating.
Wouldn't it be important for my inductor to have the same inductance over the entire range of the
output load?
AI: The two current values are distinct.
The rated current is used mainly for average DC current due to heating.
But as it is used in a buck converter, there will be by design about 30% of ripple current on top of the average DC.
So under maximum load, the inductor needs to handle the peak ripple current without saturating, so that the switching current does not go off the safe limits for the buck converter, and it does not shut down due to overcurrent.
The datasheet of your buck converter will usually indicate what kind of inductor ratings you typically need.
So for a 5A buck converter, you need at least 5A rated current, and maybe 6.5A or 7A saturation current, depending on how much ripple current the buck converter is intended to have. |
H: Sequential EEPROM writing
I am using an M24C64 EEPROM with an STM32F4, but I have a problem with sequential writing. When I try to write 16-bit data sequentially like this, I get HAL_I2C_ERROR_AF error:
write_eeprom(address1,data1);
write_eeprom(address2,data2);
But if I put a 5 ms delay between write operations, I could write successfully.
How can I write faster to the EEPROM?
AI: Some sort of delay is required because the device is busy writing the data.
The datasheet for this device gives you two options to minimize it:
page writes (section 5.1.2) to write 32 bytes at a time
polling instead of using a fixed, worst-case delay of 5ms (section 5.1.6)
If you do page writes, be careful that your addresses are aligned with page boundaries, otherwise the device will silently corrupt the data. |
H: Phasorial notation
In the phasorial notation (of a voltage or current, for example), should i use the peak value of a sinusoidal wave or its effective value (rms)?
I ask this, because i get confused after reading some books, for example:
In the Electric Circuits book by James William Nilsson, we got this:
He considers the peak value in the phasorial notation.
While in the Power System Analysis book by John J. Grainger and William D Stevenson, we got this:
Now the rms is being used in the phasorial notation.
AI: When you are specifying a voltage using sin(ωt + φ), the mathematics yields a peak amplitude of unity hence the multiplying factor for that equation has to be the peak value i.e. it makes no sense to multiply it by the RMS value.
When you specify a voltage or current as an amplitede and angle you must use the RMS value.
See also this answer entitled "How do you differentiate between rms and peak voltage": - |
H: NPN on top of L298N H Bridge
I understand how an H Bridge works, but the common ones use pnp transistors on top and npn on bottom. In L298N's datasheet it is attached this circuit and I just can't figure out how the Vs is going to supply the motor if there is a npn on top. I know that the emitter voltage of the transistor on top is depending on base voltage as follows: Ve = Vb - Vbe, so where is the Vs? Also, shouldn't the base voltage (MCU output voltage) be greater than the collector voltage (Vs) in such a circuit?
AI: The high side NPN is used as an emitter follower.
Yes, it cannot provide up to VCC, but about a Vbe drop less.
The MCU interface does not affect the output, because there is an internal voltage translation to VCC, so that is why the motor output is VCC minus the Vbe drop. |
H: Driving electromagnetic coil "out of spec"
I'm designing automatic watering system for my garden. I've bought these bistable electromagnetic valves.
But specs are somewhat confusing: voltage range is 3.6-6 V, current consumption is 200-300 mA, coil resistance is approx 9 Ohms. I've measured the latter parameter for all valves bought and got mean resistance of 9.08 Ohms with SD = 0.13 Ohms so coils have pretty much the same resistances.
But I can't figure out numbers for volts/amps - seems like "datasheet" and description are simply contradictory. Given that coil resistance is valid I've got the following current values for boundary voltages (assuming R = 9 Ohm): 400 mA @ 3.6 V and 667 mA @ 6.0 V; while the specs are 200-300 mA.
As I remember from my previous practice with relays the device itself (relay switch) is just rated for some voltage (at which I guess it's safe to use it without insulation breakage, arcing etc) but the coil is characterized with resistance and working current. As soon as bistable valve is just a coil it's performance should depend only on current value and not the voltage directly.
I've conducted small test: feeding SN754410 with 10.9 V and powering my coil in series with 2 parallel 47 Ohm 1 W resistors I've got that for 9.8 V drop on the whole circuit (coil + 2 par. resistors; -1.1 V due to drop on SN's outputs) I'm getting 265 mA and valve works well (I've tried to change pulse polarity too). At the same moment voltage drop across the coil is just 2.4 V. Seems like it is the current which specified right in valve datasheet and not the voltage!
And the question is for what reason the seller has specified 3.6-6 V range? Will I get any troubles/glitches with valves using them undervolted? Or it will be ok while current is enough to stay in specified 200-300 mA range?
AI: No one here can tell you what's in the mind of a seller. But you've done a wonderful job characterizing the devices. So you have all you need. Just ignore the seller's writing and use what you've learned about them. (I'm actually quite impressed with the detail work you've done in preparing yourself.)
Most relays (and yes, I'm aware that strictly speaking these aren't "most relays") are designed to operate (this is an "always operate" spec) at about 70% of their voltage rating. This is a \$3.6\:\text{V}\$ device. If I applied that "rule" here, I'd guess that these would always operate at as little as \$2.52\:\text{V}\$. Just as an educated prediction, anyway.
That seems to be what you are finding, as well.
I don't find it any problem that you are sourcing these the way you are, if you are willing to go to the lengths you have already done in validating what you are getting. Again, I'm really impressed with your practice, here.
In any case, you know everything you need to know to drive these. Believe what you have observed and use that information.
If on the other hand you are making something for others where you need guaranteed specifications to limit your own legal liability, then all of the above advice goes out the window. Then you need something from the supplier or manufacturer that places them in the middle between you and someone who may feel harmed. That's an entirely different topic. |
H: AD5693 digital to analog converter
I am using an AD5693 as digital to analog converter with an Arduino Uno. I have connected the SDA andSCL pins of the AD5693 to the I2C pins of the Arduino Uno. I have connected the LDAC active low to gnd. The reset pin is connected to VDD.
I got the example code from GitHub.
The below code works properly:
#include<Wire.h>
// AD5693 I2C address is 0x4C(76)
#define Addr 0x4C
void setup()
{
// Initialise I2C communication as Master
Wire.begin();
// Initialise serial communication, set baud rate = 9600
Serial.begin(9600);
delay(300);
}
void loop()
{
unsigned int data[2] = {0x80, 0x00};
// Start I2C transmission
Wire.beginTransmission(Addr);
// Select DAC and input register
Wire.write(0x30);
// Write data = 0x8000(32768)
// data msb = 0x80
Wire.write(data[0]);
// data lsb = 0x00
Wire.write(data[1]);
// Stop I2C transmission
Wire.endTransmission();
// Convert the data, Vref = 5 V
float voltage = (((data[0] * 256) + (data[1])) / 65536.0) * 5.0;
// Output data to serial monitor
Serial.print("Voltage : ");
Serial.print(voltage);
Serial.println(" V");
delay(500);
}
I want to take an input from user which is an analog voltage value and the same value should be the output of the DAC IC.
Do I need to convert the the analog voltage value from the user to hexadecimal? Is there any other way.
AI: Hex or not does not matter, but you do have to convert the number from Volts to DAC units. This is because the DAC has no idea about absolute voltages, everything is proportional to its reference voltage (here 5V? But this depends on your circuit. One version of this chip has an internal 2.5V reference, the other has a pin to take an external voltage).
The datasheet gives you the formula on page 19, but it's the wrong way around:
\$ V = V_{ref} \times Gain \times \frac{code}{65536}\$
So the first step is to invert this:
\$ code = 65536 \times \frac{V}{V_{ref} \times Gain}\$
And make sure the value is of integer type, not greater than 65535 (not 65536!), and not lower than 0.
Now comes the second trick: code is a 16 bit number, and the DAC expects it in two "words" of 8 bits each:
first the upper 8 bits: msb = (code >> 8) & 0xFF
then the lower 8 bits: lsb = code & 0xFF
So you must write these two values in succession.
Assume the gain is 1 by default, but this can be changed in the DAC's config. |
H: Can a 12V relay coil handle 350mA passing through it?
I have an 12V electromagnet that draws 350mA at full hold strength and I want to put a relay in series with it so that when the magnet is energized the coil of the relay is too, which will turn on a lamp that indicates this. Is it possible to do this or will the relay interfere too much with that? I was thinking of using a T9AP1D52-12. If it's not possible is there some way to hook up an indicator light that will stay on as long as the electromagnet is on? This is the circuit I would like to build.
This is a modification of a pre-existing circuit that is identical except it doesn't have the relay or the light.
I have tried putting the LED in series but it is too low of a wattage and it doesn't let the electromagnet turn on
AI: You're trying to use the relay as a current sensor. That's of course possible, but it requires a low voltage relay that has a low coil resistance.
For example, suppose that your sensing relay would be Axicom/TE IM00 model, with 1.5VDC 16Ω coil. The coil expects about 100mA when operating. Since the current you're sensing is 350mA, you'd need to bypass 250mA around the coil. For that, you can use a resistor with 2.5x the conductance of 16Ω, that is 6.4Ω. Even a lower value, like 5Ω, would work, since the relay cuts-in 75% of the operating voltage. This would further reduce the voltage drop across our current sensor.
Thus, your circuit would be:
simulate this circuit – Schematic created using CircuitLab
D1 and D2 should be close to the coil L1 - ideally mounted right across its terminals. D3 can be any signal/switching diode, e.g. 1N4001 would work just fine. D4 can be most any modern LED. C1-R3 protect the contacts of the pushbutton switch from arcing, prolonging its life.
Note how there's no need for a diode parallel to RL1's coil. Also, the electromagnet's L1 should have two anti-paralleled 12V Zener diodes to equalize the turn-on and turn-off time constants. A single diode has the unfortunate effect of making turn-off up to an order of magnitude slower than turn-on. Sometimes you don't care about it, but sometimes you do.
Now, this circuit isn't just a voltage indicator: it is current detector, and e.g. if the electromagnet coil L1 fails open, you'll get immediate feedback: RL1 will stay open in spite of the button SW1 being closed, and D4 will stay off.
If all you need is a simple indicator without current detection - you don't need any extra relays! Just connect D3-R2-D4 in parallel with the electromagnet coil L1. |
H: ATmega328P reading DIP switches using the lowest possible power
I'm currently looking for some advice about making my circuit as low power consumption as much as possible.
I need to use three DIP switches in order to set the address of my ATmega328P board in a LoRa custom network.
I've seen that one of the most used solution is to wire up the external pull-up resistors to VCC, as reported below:
...but, this approach is extremely inefficient for my purposes (my hardware, during deep-sleep needs to reach 1-5 µA of current draw).
So, my intention is to remove the external pull-up resistors and use the internal pull-up resistors of the digital input of the ATmega328P.
This approach will allow me to enable the internal pull-up resistors only when I need to read the switches status (during boot for a very limited time).
So, theoretically, this will be very efficient and low power.
This will be the resulting schematic (taken from here):
This is my idea to solve this issue. Anyway, I've not tested yet. I would be glad if someone will share their thoughts about that.
AI: I don't recommend turning off the pull-up. This has two problems:
Input pin is vulnerable to noise pickup
The pin can float to a mid-state, causing increased input buffer power
If you can spare one more pin, connect the switch commons to that pin instead of GND, and drive that common low only when reading the switches. Then during the non-reading time the pins are always tied by either the pull-up (switch open) or to the driven-high common (switch closed), yet don't have any standby draw. Like this:
simulate this circuit – Schematic created using CircuitLab
Even then, the internal pull-up (30K or more) is kind of weak, especially if this is to be deployed in a harsh environment. Adding some capacitance to the pin (30pF or so) will bypass noise from the pin and improve its immunity. You can also switch the pins to output mode during the non-reading time for the best possible noise immunity.
But why DIP switches at all? Maybe do away with them altogether and store this state in EEPROM along with your other device configuration info.
But... why bother with even that? Take advantage of the fact that it's a wirelessly-connected device with a unique ID. Idea: use the LoRa device unique identifer (DevEUI) and assign its physical position at the application level as you install it. If the nodes are widely spaced, use a geolocation coordinate; if they're part of a tight array, use some gridding location in the plant or on the equipment.
More about LoRa addressing here: https://www.thethingsnetwork.org/docs/lorawan/addressing/
Finally, a bit of unsolicited advice. As a hardware person it’s easy to fall into the direct, seemingly obvious solution, as DIP switches, jumpers and the like often are. I encourage you to think outside the hardware box and push for a software solution instead. The PC industry struggled for years with jumpers and switches until someone finally said ‘enough’ and Plug’n’Play and its descendants (PCMCIA, Cardbus and PCIe CIS) came into being.
tl; dr: Jumpers are evil. Avoid them if you can. |
H: Why P-MOSFET is this way and not on the contrary?
I was reading this application note from Microchip (AN1149) and I can't figure it out why this P-channel MOSFET (Q1) is placed like this:
I thought the parallel diode integrated with the MOSFET will allow battery voltage pass to the load, why it isn't?
I thought current through an p-channel MOSFET used as a switch goes from source to drain, but this appnote shows source is connected to the load an drain to the battery, why is that?
Regards!
AI: From the schematic and the text, Q1 is there to prevent the external power from back-feeding the battery and screwing up the charge management.
So Q1 is supposed to be on when the external source is off.
The reason Q1 is "backward" is because a FET, by itself, is a pretty symmetrical device. The only thing that distinguishes source from drain is where the bulk connection goes -- that's what determines the direction of the internal diode. And in this case, a "normal" connection would cause problems when external power is applied.
So at the moment that the external power goes off, and the FET part of Q1 may or may not be on, the internal diode will conduct. Then when the FET does turn on hard, the diode will be bypassed.
When external power is on (and the FET off) the internal diode won't backfeed the battery. |
H: RS-485 full-duplex driver termination, where do I place the terminator?
Where are the right places to put termination resistors in RS-485 networks? Specifically in full-duplex networks, I see app notes either use the termination at the driver node (Maxim (Page 15), TI (Page 2)), while others suggest otherwise (ADI). You don't really need to open these datasheets - the conundrum is essentially about these resistors:
Not whether you need them or not (I know in a few cases everything work without them), but are there any benefits to including them when not necessary, or maybe even drawbacks? Unfortunately I'm not too familiar with the transmission line theory, from some light reading (in particular, this TI "blog") it sounds like having a resistor on the driver side will help dampen any waves reflected from the receiver quicker, which should help with EMI. But what does everyone else think?
AI: Short answer : The picture in ADI appnote contradicts the text in ADI appnote, so it basically means all sources agree. The drawing you posted shows a full-duplex multi-drop RS-485 bus where multiple transmitters are connected along the same bus - which is more than enough to determine that it's not a RS-422 bus and so at least the upper bus must have dual termination. And for the sake of symmetry, or to allow the placement of the host controller anywhere on the bus instead of just at the end of it, the lower bus should (or must) also have dual termination.
Longer answer :
The difference is whether the whole network is built up to RS-422 or RS-485 standards, it's not just about chips and terminations but also the placement of the devices.
The RS-422 specs define that there must only be one single transmitter and up to ten receivers on a bus, and the driver must only be able to drive a single termination which at the end of the bus. This also means that the transmitter must also be at the beginning of the bus to prevent reflections. And usually the transmitter is always enabled. So the electrical specs do not allow terminating the bus at both ends as it will violate the specs.
The RS-485 specs define that a transmitter must be able to drive a bus with termination at both ends. This allows for placing the transmitter anywhere on the bus, and even multiple transmitters if only one is enabled at one given time. But as that is half-duplex, sometimes there are two buses to make it a full duplex configuration, just like on RS-422, but it allows for many devices on a full-duplex bus, instead of just two devices on a full-duplex RS-422 bus.
If RS-485 devices are used like RS-422 devices, i.e. transmitter always at one end of the bus and always enabled, then the second termination is not absolutely necessary, as it is not on RS-422 bus either. It's just that since RS-485 drivers can drive a doubly terminated bus, it makes no harm there, but double termination makes it incompatible with RS-422 chips. But with RS-485, having the double termination allows to place the transmitter anywhere on the bus, not just at the end. Double termination consumes more power obviously, but with RS-485, that can easily be handle by for example turning the driver off when not transmitting.
So the difference is which standard is used, and that limits how the buses are terminated, and how the devices can be connected to it. |
H: Why does a MOSFET's temperature shoot up when the gate isn't at the correct voltage?
I've fried 3 MOSFETs today, quite frustrating.
When I connect the gate directly to positive, it's pretty happy, the motor runs and the FET temp stays below 40 deg C.
When I connect the gate to negative, the motor turns off, and it still stays below 40 deg C, great!
I measured the gate voltage with a multimeter and noticed that when I connect gate to positive, the voltage is between around 0.01V and 0.001V (fluctuates a lot.) This doesn't make much sense to me, as I thought the gate had to be at least 4.5V to trigger. When connected to negative it's -0.01V.
When I connect it to the Arduino, the MOSFET temperature explodes and reaches over 100 deg C in no time. If I'm quick I can cut the power and save the MOSFET, but I've managed to fry 3 of them today.
When the Arduino is in the circuit, the multimeter shows the Arduino giving the gate 5V when digitalWrite uses HIGH and around 0V when digitalWrite uses LOW. So, I'm wondering if I need to get the Arduino to match the voltages in the non-Arduino scenario to avoid frying the MOSFET. But, apparently it isn't possible to get the Arduino to produce a negative voltage on the pins.
Here's the Arduino code:
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(11, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, LOW);
digitalWrite(11, LOW);
delay(5000);
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(11, HIGH);
delay(5000);
}
Edit: The multimeter is in series from the gate. Full part number is IRLB8721, which is N-chan.
Edit 2: Though the fan is a 12V 200W motor, I'm driving this from a bench power supply at about 5V 5A. I tried driving it from a 12V 20A power supply, but it apparently trips the overcurrent protection. Maybe it's a +240W fan.
AI: multimeter is in series from the gate
That's not how you measure voltage. Voltage is a difference in potential.
All you're doing is inserting a couple tens or hundreds of MegaOhms of the multimeter input impedance between the driving voltage and the gate. The situation is static, so those are all DC impedances.
Since the gate's input impedance is orders of magnitude higher than that of the multimeter, the multimeter is relatively speaking a short, and the gate is relatively speaking an open circuit. The multimeter will measure zero - it's not really connected to anything (gate is an open!), and there's a short across it.
The voltage that actually turns on an N-MOS is between the source and the gate. So you have to connect one lead of the multimeter to the source, another to the gate.
Also: there shouldn't be such direct connections between the high power circuitry and the microcontroller. I bet that you'll destroy the Arduino many times while you experiment like this - as soon as you start PWM-ing the motor, and put some load on it so the currents get serious.
In your circuit, at this point, the most important part is the physical layout and protection features. You absolutely have to show us a picture of how you put it together. My assumption is that:
You don't nearly provide enough heat sinking for the MOSFET, since you don't run the motor at full load.
You have thin wires/traces and way too much parasitic inductance that will ring like crazy and kill everything on your board over and over.
Also: motor drivers must measure motor current. You must be in fact actively limiting the motor current, in software.
Once you do that, the typical way to test MOSFETs in motor drivers for overheating is to lock the rotor, so that the motor can be actually driven at its full rated current. I bet you that your MOSFET will release the magic smoke soon enough.
To get your design going along, I'd start with an off-the-shelf PWM motor driver module - you can buy them on eBay, Alibaba, etc. It will have a proper MOSFET driver and optical isolation, and will be safe to use with your Arduino without much worry.
Many such cheap driver modules only provide an adjustable hardware current limit, but no current feedback to the controller. You could then use a separate current measurement module, transfer the current limiting responsibility to software, and "peg" the current limit on the driver at maximum.
You'll need the current feedback to implement reasonably decent velocity control loops. |
H: Audio amplifier - input stage, negative feedback and current limit
I am reading Audio Power Amplifier Design by Douglas Self and have a couple of questions.
With no input signal, (Q2 base = Q3 base = ~0V) no current Ivas should coming out of the long-tailed-pair (LTP)
shouldn't VAS stage (Q12+Q4) in cut-off mode (very high resistance) and Q4 collector (tied to constant-current-source) be at +37V?
But in reality, VAS being a Class-A amplifier means 6.5mA quiescent current flowing and Q4 collector is at GND minus 1.4V.
With AC sinewave (say 1Vpp) fed into Q2 base, a sinewave of current coming out of Q2 collector. Say, at negative peak of AC sinewave:
all 4.5mA of tail current will forward-bias Q12 (MPSA06=TO-92).
Q12 collector tied to GND, 1K-Ohm load, exceeding TO92 dissipation rating (burned BJT)
Q12 with Ibase=4.5mA, hfe=100, Q4 should dissipate 0.45A & 37V = 16.65W constantly (very in efficient)
Again, in reality, Q12 and Q4 are not smoked or dissipating that much heat. What is wrong with my analysis?
Can I put a current limiter in the form of constant-current cource/sink (CCS) at the power supply?
Say, smaller BJT pair (like TIP29A/30A) are used at output stage and I want to limit load current to 1.5A - of course CCS transistors will require serious heatsink.
What is the purpose of R20 & C7?
I editted original image and my question 1 and 2 to clarify my points.
I also added Ic Q2, Ic Q3 label to facilite quick discussion.
AI: With no input signal there's still the DC operation going on. The feedback forces all currents and voltages to settle to those values which generates to the load same voltage which is at the base of Tr2 - that's 0V, fed through R1.
You should know, that the circuit is essentially a non-inverting amplifier made of an operational amplifier. I mean this (Wikipedia image):
The opamp is in your case made of discrete transistors for high enough output power. All of its transistors except the output transistors conduct all the time for proper class A operation - no clipping as long as the amp is not overdriven.
The voltage gain is (1+Rf/Rg) . In your version the effective Rf is reduced at higher frequencies by C7. You see there's also another miniscule capacitor C3 in VAS. That also affects to the frequency response. Those small capacitors have common role. They are there to prevent your amp oscillating. Oscillating would mean full power continuous output at high frequency, for ex at 30kHz.
To fully know the subject you should learn what frequency compensation of feedback amplifiers means and how it's done in terms of rigorous circuit mathematics. Every opamp application theory book above hobbyist level contains it. The qualitative explanation can be found also in many hobbyist level texts.
Your current limiter can be designed to work. But it's not simple. Know that your drawn starting sketch of the limiter tells nothing of what actually works. It also doesn't tell where you thought to connect the wire ends. You should search for earlier tested and working full solutions. You can easily cause stability problems, a short circuit to elsewhere and overheating.
I would insert for limiting 2 things:
an audio input limiter which reduces the gain if the signal peak rises too high. That prevents distortion which easily blows tweeter speakers which do not have own amps but are connected to the same output through high pass filters.
a fast enough working fuse or other circuit breaker which stops DC voltages in case of a short circuit. A current limiter in the output stage generates distortion in too high input case and can blow the tweeters.
As suggested by others, run simulations. Get some capable enough program. Component manufacturers like Texas Instrument or Linear Technology offer good ones. There's also an independent previously high priced item Micro-Cap. The developer of it has retired and gives now his masterpiece for free. The latest version is v12. I use a much earlier version (=v10) because it seems to fit better into my legacy computer. Micro-Cap knows numerous components, but of course, there's no newbies without inputting the model parameters or building a macro model.
ADD1: The updated output current limiter may work but it causes distortion at high levels. The harmonics can blow the tweeters. It causes also very bad distortion at low levels because transistors are non-linear in low voltages. Quiet sounds are like a saw. The aural effect is the same as zero-crossing distortion in badly biased class B amps.
In addition if your speaker has short circuit it prevents the fuse blowing. The output transistors (Tr7,Tr9) can overheat or get destroyed due secondary breakdown. You see the safe operating area in power transistor datasheets. Simulate! It's useful.
ADD2: After you labeled the problematic currents in the image
The currents taken by the halves of the current mirror are not the same in submicroampere resolution. The base currents are taken from IcQ3. The balance state of your feedback amp has some Ivas as you have simulated.Check the Vce voltages of the current mirror transistors and their emitter resistance currents. I guess there's some difference. Current mirror is not at all steep and exact with low Vce voltages. |
H: Is it a bad idea to use 2 vias to change layers in power tracks?
I have some power traces (net VIN) in my PCB design that might (in an extreme scenario) carry up to 1A of current. Although nominally, I wouldn't expect to see more than 250 mA. These are 50 mil traces, just to be safe, and since I have to switch layers, I have put two 28 mil hole vias. Is it a bad idea to use double vias like this?
AI: I use multiple vias to connect power traces to other layers all the time on many projects: -
Is it a bad idea to use double vias like this?
No, it's a valid way of doing it. Many of the connections in the picture above use 24 vias. Mind you, the tracks are carrying over one hundred amps and are multi-layer connected. |
H: Clamping to rails of an unpowered circuit?
Clamping diodes are a common way to limit an input to a safe voltage range: if the input goes below 0V or above 3.3V, one of the diodes begins to conduct and clamps the input to (roughly) the rails.
What happens if the circuit is unpowered? My 3.3V is generated using an async buck converter that doesn't have any low-impedance path to GND, and DigIn2 is connected to an ESP32. If the input is still active with a voltage of, say, 12V or 24V, wouldn't the same voltage be present at the MCU input? Wouldn't that be enough to damage the MCU, even with the current-limiting input resistor?
I believe an alternative would be to use a zener diode to clamp the voltage, but low-voltage zeners are so soft that I'd rather avoid them, if possible.
AI: If the input is still active with a voltage of, say, 12V or 24V,
wouldn't the same voltage be present at the MCU input?
Even if your circuit is powered, because you are using a non-synchronous buck regulator (or a standard linear regulator for instance) it won't prevent the rail voltage rising above where it should be unless your circuit current consumption and the 47 kΩ form enough of a potential divider to restrict this problem.
If your inputs are 12 volts or 24 volts, you should try to ensure that a potential divider exists on the input pin directly so that an excessive voltage is not passed through the upper clamping diode to Vcc. It matters not whether your circuit is powered or unpowered.
For ESD surges then it's not a problem but, if 24 volts is continuously present and, your MCU operating current is normally very low, then you need to take care of this situation.
Nothing wrong with using a zener diode across your power rails unless you are worried about leakage current consumption on battery powered equipment BUT, then, that's where your problems are going to happen without a proper input potential divider. |
H: How can this MOSFET steer the current of this LED driver?
I am powering a Charlieplexed LED array with this current source as shown in the first picture attached:
One requirement was to be able to control the current so I decided to insert an array of MOSFETS that allowed me to control the current through a PWM signal following the datasheet of the LED driver manufacturer.
As can be seen in the second image the circuit actually works, what I don't understand is why.
Ignoring the current variation given different loads (resistor + LED) my intuition would say that the PMOS would control the voltage level but not the current due to the AL5810 that should keep it constant.
Is that so or are there other variables which I'm not considering?
AI: The PMOS, which is in series with the IN terminal of the current source IC, operates as an on-off switch: When it's on, the constant-current driver IC sees the input voltage, turns itself on, and sets the output current. Then this current flows through the LED. When it's off, no current flows through the LED.
If you apply this input voltage as PWM (i.e. on-off signal with variable on-time), the variable duty cycle will reflect the LED as variable brightness because the average value varies with the duty cycle: \$\mathrm{I_{LED-avg}=I_{set}\ \frac{T_{on}}{T_{on}+T_{off}}}\$. |
H: Custom TFT Screen Question
I'm looking to get a custom Resistive Touch TFT screen made for a project. The company have specified that the screen will utilize a F31L-1A7H1-11040 type connection to go between the screen and microcontroller I want to use.
My question is - does the screen manufacturer need to specify a display controller for me to use for this project (E.g IL9341 Chip) - or is this something I can select myself. I've added the pinout for the screen below in case it helps.
AI: When you get a TFT screen, the control chip is embedded into the screen, so they have to specify it, and you need to make sure you can drive it.
Besides, the control chip like ILI9341 have several method of drive, SPI, SPI with additional line, 8 bit parallel, 16bit parallel, and this is chosen from some pin setup of the chip. (Yours seems to be SPI)
Not all TFT display has an actual pin to select the mode, some are directly set within the flex ribbon, so you need to make sure you have the control logic you want or that the pin to set it are available.
Besides all that, TFT can be quite tricky to get started and some libraries are really messy. Stay away from Microchip stack.
Make sure to get the driver for the particular chip and particular logic for your MCU, some control chip are quite obscure and drivers a tricky to write because you have no feedback until the screen start to display something.
I had good success with STM32 and their stack, ST have an awesome UI designer, TouchGFX and a solid display stack which is definitely what I would recommend. Took me a while to check different solution and I think that is the best.
Make sure your chip has a fast SPI and clock to have good refresh rate.
Here is a driver for the TouchGFX stack an ILI9341 if that is the chip you have, I used it and works well.
EDIT:
Get started with TouchGFX:
It's a bit daumpting at first because you need to use STM32CubeIDE, STM32CubeMX and TouchGFX all together.
Create your project on the IDE and use the MX to configure and generate code (download and activate the GFX libs), then you can open from the IDE the GFX software to make your screens.
TouchGFX has some driver for some chips, but not all, you can find quite a bunch on the internet and implement it in the GFX stack.
If you want to avoid headache, choose a controller that has a driver on the stack already implemented or that has some good how to online. |
H: Understanding back EMF measurement in brushed DC motors
I have been doing some preliminary research for a project and am trying to understand how sensor-less speed control of brushed DC motors can be done by inspecting the back EMF.
Where I am at with my understanding is that there are two key methods in use for this.
Measure Current & Voltage and do a calculation based on coil resistance.
I believe in this approach the back EMF is calculated by measuring the average voltage across the motor and using information about the average current and coil resistance to get the back EMF. i.e.
$$V_{EMF} = V_{motor}-I_{motor} \times R_{coil}$$
This approach sounds pretty straight foward to implement but I found references that accuracy is compromised with changes in temperature due to resistance changes in the motor windings, this makes sense but I don't have a feel for what the temperature co-efficient of motor coils is, is it possible to just assume the temperature co-efficient of copper?
Measure the voltage across the motor while not being driven
This sounds like the more advanced approach but I don't quite understand how it works. I believe the idea is meant to be during the switch off period it is possible to directly measure the back-emf after waiting for "switching noise" to subside. What I don't understand is why the voltage drop from the coil resistance doesn't mess up this value.
I have been using the following resources for reference.
AN893 - Low-Cost Bidirectional Brushed DC Motor Control Using PIC16F684
AN10513 Brushed DC motor control using the LPC2101
AB-021 : Measuring RPM From Back EMF
The last of these links portrays a basic uni-directional PWM control with a low side switching. Best of all the article includes some scope plots (if it is impolite to include there plot here let me know and I will remove it)
In the plot we can see the spike after turn off, and then back EMF being measured between the supply and motor terminal. I would have thought the only voltage we should see is the flyback diodes voltage drop. The only way I can understand this technique is if the current through the motor is dropping to zero in each PWM cycle, the "switching noise" being the time the current is flowing through the flyback diode is this typically what actually happens? I haven't really had any experience driving DC motors, but have had some experience in building test gear to measure solenoid opening times based on back EMF.
In Summary
Does motor current really drop to zero each PWM cycle for a typical brushed DC motor.
Am I understanding both methods correctly
Are there any key criteria to select one method over the other (noting that I probably want to measure current anyway)
AI: What I don't understand is why the voltage drop from the coil
resistance doesn't mess up this value.
When you make the measurement you have to wait for the current to fall to zero as indicated by the spike in your diagram. After that point, the back-emf is valid.
Does motor current really drop to zero each PWM cycle for a typical
brushed DC motor.
yes it will providing the energy stored in the leakage inductance of the motor has depleted (as per the end of the spike in your picture).
Are there any key criteria to select one method over the other (noting
that I probably want to measure current anyway)
Both are used but, the back-emf measurement is a more reliable indicator for motor speed in my opinion. |
H: Voltage divider resistor value
What happens if the difference between the resistance of two resistors is too large in a voltage divider? Let's say that I want to use a 1 megohm and a 2 ohms for my voltage divider.
AI: 'Too large', but too large for what purpose..
If you apply 100V to the 1M resistor and the 2 ohm resistor is grounded, you'll get about 200uV across the 2 ohm resistor and the source impedance will be about 2 ohms.
Easily measurable to fairly high accuracy.
One issue with having a high-ratio divider is the connections to the 2 ohm resistor may have significant resistance, even a few m\$\Omega\$ is significant if it's a precision circuit, so it may be better in some situations to divide down in two stages.
simulate this circuit – Schematic created using CircuitLab
In the second case, the output impedance is about 1K rather than 2 ohms but the sensitivity to connection resistances is reduced by about 500:1. |
H: Isolation circuit using optocouplers for three phase voltage circuit
I'm trying to design an isolation circuit, using optocouplers, for a circuit like this one:
This system allows to control the thyristors turn on angle and change the resulting voltage on the resistive load.
For what I understand from the image, the control circuit has three outputs and each one of them is connected to the isolation circuit.
I've worked with a single phase AC voltage circuit previously, this other one:
And I used this circuit to isolate the control circuit from the main circuit:
My question is: Can I use the same isolation circuit with three optocouplers, each one with a different input Ig1, Ig2 & Ig3 and connect all of the optocouplers emitters to a single cable that goes to the common point, where the three thyristors cathodes are connected? Something like this:
AI: Providing you use an isolating DC-to-DC converter with sufficient break-down voltage rating, the three-phase circuit should be OK. I mention this because you don't appear to have covered this in your question and I'd hate to think that you thought it could all be powered from the control signal side of the opto-isolators.
For the opto-isolators, I'd be tempted to use something a bit more powerful and quicker than the 4N25 but, if you are happy with that part and its ability to drive the thyristors you intend to use, then it should be fine.
You also said this: -
...and connect all of the optocouplers emitters to a single cable...
I think you meant to say "collectors" and not "emitters".
Also note that with a 10 kΩ emitter resistors \$t_{PLH}\$ is about 50 μs (which is why I would recommend a better coupler circuit like the FOD8343 or similar). |
H: Impedance of a circuit that contains a 2 port network
simulate this circuit – Schematic created using CircuitLab
So, firstly, find the y parameters of a network ( says the assignment). Which I did. Now for the impedance I get the a parameters (for the box), from those y.
I get $$ \frac{V1}{I1}=\frac{ a_{11}*V_2 -a_{12}*I_2}{a_{21}*V_2-a_{22}*I_2}$$
Can I use this expression to find impedance of a whole circuit? That is, to express I2 as I2=Ig-V2/4 and plug that into above equation. Will that give me the correct result?
AI: There is no such thing as the "impedance of the whole circuit". You can ask about the input impedance at port 1 or at port 2. You could convert your y parameters to z parameters to give a matrix of impedance and transimpedance parameters. But talking about the "impedance of the whole circuit" makes no sense.
Can I use this expression to find impedance of a whole circuit? That is, to express I2 as I2=Ig-V2/4 and plug that into above equation.
Not without also knowing what's attached to port 1. The input current at I2 doesn't just depend on what's at port 2, it also depends on what's connected to port 2, because the VCVS will generate a current if there's a nonzero voltage at port 1.
If you have some fixed circuit connected to port 1 you could cascade your given 2-port together with it to form a composite 1-port device, and use whatever techniques are convenient to find the Thevenin or Norton equivalent of that device. This could involve converting the two-port description to T or ABCD-parameters, combining it with the source device, and then convverting back to Y or Z parameters. |
H: How can I test a ballast circuit without?
I have an old table lamp. I want to repair it. It has an external ballast circuit and 9 watt fluorescent lamp (PL). I don't know the circuit is working or not. Is there any way to check it without buying a new lamp ? What inductance and what resistance values would be reasonable to expect from a good ballast?
If circuit is okay then I can go for buying a new lamp, otherwise I want to repair the circuit.
Any help would be appreciated.
Update
As per the answer and few comments, I have bought a new lamp. After fixing some soldering and wires it is working now. Thank you all.
Here is the link for the lamp I used: http://www.lighting.philips.com/main/prof/lamps/compact-fluorescent-non-integrated/pl-s/pl-s-2-pin/927901786503_EU/product
AI: Different ballasts have different strategies for delivering the initial high voltage, then a reasonably constant current. It will be difficult to test the ballast without knowing its individual specs, and difficult to repair if broken.
It will be easier to test the lamp in some cases. If the lamp has two pins at each end, then connect a ohmmeter between the pins, separately at each end. There should be a heater, like a lightbulb fillament, between the pins. For a small lamp like yours, the resistance will probably be in the 10-100 kΩ range. No matter what, it should be clearly distinguishable from a open circuit. If the ohmmeter reads open circuit, then the heater fillament broke and the lamp is no good.
If the lamp has a single pin at each end, then you can't reasonably test it yourself.
Otherwise, just get a new lamp and see if it works. They aren't that expensive. |
H: TCA9548A I2C Multiplexer - 10k resistors on the address lines
I'm looking over the schematics and PCB layout of the Adafruit TCA9548A I2C Multiplexer breakout board. I've attached the schematic below.
I cannot figure out why there are 10k resistors on the A2,A1,A0 addressing lines. Do these serve just as current-limiting resistors?
AI: They are just simple pull-down resistors, used to set the default value of the device address.
You can buy multiple of these boards, hook them up to the same bus and give them different addresses by pulling the lines high (note the solder pads on back side of the board).
10K value is a standard pull-up/pull-down resistor value, but anything between 5K and 100K would work just as well. |
H: What is the most commonly used transistor?
Just a question about transistors from a rookie.
I was wondering what kind of transistor is most commonly used? Bipolar transistors? JFET? MOSFET?
AI: The highest volume of discrete transistors used in products are bipoler transistors. This is mainly due to their low cost. Most of the transistors in the world are however MOSFETs inside integrated circuits (chips). A single digital IC often contains millions of transistors. |
H: Wiring two leds
I have two questions.
If I have one led 2.2v@20mA and other one 2.2v@15mA, can I use them in series connection? Or do I have to use parallel wiring?
And if I have 2.2v@20mA and 3.2v@20mA leds, can I use them with parallel wiring?
I think answer to both of them is no, but am I right?
AI: The easiest way to use two LEDs in series with different maximum currents is simply to constrain the current to the smaller of the two maximums. If you really want to run the LEDs at different, but similar, currents, it's possible as follows:
simulate this circuit – Schematic created using CircuitLab
D1 sees 20mA nominal
D2 sees 15mA nominal
Connecting them in parallel is easy, but you need two resistors, each calculated for the respective Vf, supply voltage, and desired current.
simulate this circuit
Generally for best LED life it's better to run LEDs at less than their maximum rated current, and note that the rated current may be less at the actual operating temperature- precise details will be in the data sheet and application notes for any reputable manufacturer.
Modern indicator LEDs actually tend to be excessively bright when run anywhere near full rated current. 0.5mA to 5mA is often quite sufficient- it saves power and is less of a distraction. The 'power on' LED in my computer case casts a blue-lit shadow several meters across the room even in somewhat subdued light- there is really no need for that. |
H: No Miller effect in differential amplifiers
Why is there no Miller effect in differential amplifier and cascode circuits? (from the book Art of Electronics)
AI: Brian provided a great hint, but here's some more info for reference:
The Miller effect says that if a capacitor is connected between two nodes with a negative voltage gain between them (-A), then the input capacitance looking into the input node will be approximately A times bigger than the capacitance between the nodes.
As a rough analogy think of adding water to a swimming pool with a bucket (That's the input node). At the same time somebody on the other end is taking water out with a bigger bucket (the node pulling the other end of the capacitor in the opposite direction of your input). Now you need a lot more water to fill the pool.
In a cascode (bipolar for example) you're using a common base stage to keep the collector voltage of the common emitter stage relatively constant. So the voltage across the base-collector capacitance isn't changing nearly as much as it would if the collector weren't clamped by the cascade device. "A" is close to 1. Therefore the Miller effect is greatly reduced. |
H: What type of switch is this?
I need switch which is normally closed, but when I press it, it goes to off state. As soon as I move finger from it, it must go to default state (normally closed). Which type of switch is this? I need two of them, for limit switch control of DC motor when it reaches full travel in either direction.
Thanks in advance
AI: You need a limit switch (often called "Microswitch") - this type of switch is designed to be controlled by things, rather than directly by a person. Most such switches are single pole, double throw (SPDT), so they can be used as either normally open or normally closed.
Limit switches are available as pushbuttons, or with various lever or roller actuator arms. |
H: Why such low voltage across my filtered half-wave rectifier?
Essentially my problem is this: I built a simple half-wave rectifier with some capacitive filtering, but I can't account for why my voltage is so low.
Below is the circuit I built:
Vs is 5V amplitude, 10 Vpp, 60 Hz, sine wave. Using newer Tektronix Oscilliscopes and Signal Generators.
As you can see from the diagram, the scope probe locations are defined. In the image below, yellow is CH-1 (input) and blue is CH-2 (output):
From my hand calcs, the output voltage should have been about 3.1V to 4.4V (the 1N4007 diode has a forward voltage of about 0.6V). Just to make sure I wasn't crazy, I confirmed this with LTSpice:
So there are a number of things bothering me here:
Why does the input waveform look strange?
Why is the output voltage so much lower than expected?
Why is the ripple voltage narrower than expected?
I spent some time with the 1N4007's datasheet and played with the SigGen impedance but that didn't help and I'm not really able to answer this question in my head.
Thanks!
AI: Your signal generator's output impedance is non-zero. It's probably at least 50Ω, but could be much higher. It cannot source very much current (in fact, trying to source a whole lot of current may make it very unhappy).
Add some series resistance to your LTSpice simulation's voltage source, and you'll see a graph that matches what you have on the scope.
Also, not entirely on topic, but your schematic has 10F and 33F capacitors in it, which at 60V would probably about the size of my head. I'm guessing those are supposed to be uF. Notation is important. Additionally, in LTSpice, you can use suffixes like Meg, k, m, u, n, p for units, which makes things much more readable.
Edit: neatly enough, if you put that circuit into LTSpice, and change the source impedance to 50Ω, it matches exactly to your scope traces! So everything is right in the world: you've got a signal generator with a 50Ω output impedance, and your simulation matches the real world exactly. Pretty rare, that. |
H: Vivado is removing registers which will be used
I am working on a verilog program that I want to have display some sort of audio waveform (captured from my microphone) over a VGA. I use the following module to shift in new audio samples, and swap it with the buffer used to store the values for the current frame being rendered by the vga controller.
module audio_shift_buffer#
(parameter BUFFER_SIZE = 1280)
(
input vga_clk,
input smp_clk,
input [7:0] sample_in,
input sample_in_valid,
input [10:0] vga_read_index,
output reg [7:0] vga_read_out,
input vga_swap_buffers
);
reg [7:0] smp_buf[BUFFER_SIZE - 1:0];
reg [7:0] vga_buf[BUFFER_SIZE - 1:0];
integer i;
always @(posedge smp_clk)
if(sample_in_valid) begin
for(i = 0; i < BUFFER_SIZE - 1; i = i + 1)
smp_buf[i] <= smp_buf[i + 1];
smp_buf[BUFFER_SIZE - 1] <= sample_in;
end
integer j;
always @(posedge vga_clk) begin
if(vga_swap_buffers)
for(j = 0; j < BUFFER_SIZE; j = j + 1)
vga_buf[j] <= smp_buf[j];
vga_read_out <= vga_buf[vga_read_index];
end
endmodule
This module is created inside of my top level audio visualizer along with the vga_controller.
module audio_visualizer
(
input clk,
input m_data,
output m_clk,
output reg m_lr = 1'b1,
output vga_hs, vga_vs,
output [3:0] vga_r, vga_g, vga_b,
input sw
);
wire vga_clk;
wire [10:0] sound_level_index;
clk_wiz_0 cwz(clk, vga_clk);
wire [7:0] vga_read;
wire swap;
audio_shift_buffer sb
(
.vga_clk(vga_clk),
.smp_clk(vga_clk),
.sample_in({8{sw}}),
.sample_in_valid(swap),
.vga_read_index(sound_level_index),
.vga_read_out(vga_read),
.vga_swap_buffers(swap)
);
vga_controller v
(
.vga_clk(vga_clk),
.hsync(vga_hs),
.vsync(vga_vs),
.r(vga_r),
.g(vga_g),
.b(vga_b),
.sound_level_index(sound_level_index),
.sound_level(vga_read),
.swap_buffers(swap)
);
endmodule
Finally here is my VGA controller.
module vga_controller#
(
parameter H_VISIBLE = 1280,
parameter H_FRONT_PORCH = 72,
parameter H_BACK_PORCH = 216,
parameter H_SYNC = 80,
parameter V_VISIBLE = 720,
parameter V_FRONT_PORCH = 3,
parameter V_BACK_PORCH = 22,
parameter V_SYNC = 5
)
(
input vga_clk,
output [3:0] r, g, b,
output reg hsync, vsync,
output [10:0] sound_level_index,
input [7:0] sound_level,
output reg swap_buffers
);
localparam H_RES = H_VISIBLE + H_FRONT_PORCH + H_BACK_PORCH + H_SYNC;
localparam V_RES = V_VISIBLE + V_FRONT_PORCH + V_BACK_PORCH + V_SYNC;
localparam H_IN_VIDEO = H_VISIBLE;
localparam H_IN_BP = H_IN_VIDEO + H_BACK_PORCH;
localparam H_IN_SYNC = H_IN_BP + H_SYNC;
localparam H_IN_FP = H_IN_SYNC + H_FRONT_PORCH;
localparam V_IN_VIDEO = V_VISIBLE;
localparam V_IN_BP = V_IN_VIDEO + V_BACK_PORCH;
localparam V_IN_SYNC = V_IN_BP + V_SYNC;
localparam V_IN_FP = V_IN_SYNC + V_FRONT_PORCH;
reg [10:0] x = 0, y = 0, next_x, next_y;
always @(posedge vga_clk) begin
x <= next_x;
y <= next_y;
end
always @* begin
next_y = y;
if(x == H_RES - 1) begin
next_x <= 0;
if(y == V_RES - 1)
next_y <= 0;
else
next_y <= y + 1;
end else
next_x <= x + 1;
end
always @(posedge vga_clk) begin
hsync <= ~(next_x >= H_IN_BP && next_x < H_IN_SYNC);
vsync <= ~(next_y >= V_IN_BP && next_y < V_IN_SYNC);
swap_buffers <= next_y == V_IN_VIDEO && next_x == 0;
end
reg vout_enable;
always @(posedge vga_clk) begin
vout_enable <= next_x < H_IN_VIDEO && next_y < V_IN_VIDEO;
end
wire [10:0] request_x = next_x + 1;
assign sound_level_index = request_x < H_IN_VIDEO ? request_x : 0;
wire [10:0] ubound = 11'd360 + sound_level;
wire [10:0] lbound = 11'd360 - sound_level;
reg color;
always @(posedge vga_clk) begin
color <= next_y <= ubound && next_y >= lbound;
end
assign r = {4{color & vout_enable}};
assign g = {4{color & vout_enable}};
assign b = {4{color & vout_enable}};
endmodule
Right now I just have it hooked up to a switch on my board. It adds a "sample" of the switch after every frame. When I tested it everything seems to work perfectly. White bars scroll across the screen when the switch is on and black otherwise. However, I get the following synthesis warnings which do not make any sense to me. The elements it is listing are clearly being used. If they weren’t then I doubt the program would work. It even lists vga_read_out as unused which can't be true since it is the only way the controller can get data out and display the correct result. What is going on here?
[Synth 8-3332] Sequential element (\smp_buf_reg[1279][5] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1279][4] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1279][3] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1279][2] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1279][1] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1279][0] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[0][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[0][5] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[0][4] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[0][3] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[0][2] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[0][1] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[0][0] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_read_out_reg[7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_read_out_reg[5] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_read_out_reg[4] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_read_out_reg[3] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_read_out_reg[2] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_read_out_reg[1] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_read_out_reg[0] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1279][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1278][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1278][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1277][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1277][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1276][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1276][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1275][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1275][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1274][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1274][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1273][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1273][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1272][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1272][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1271][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1271][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1270][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1270][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1269][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1269][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1268][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1268][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1267][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1267][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1266][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1266][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1265][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1265][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1264][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1264][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1263][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1263][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1262][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1262][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1261][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1261][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1260][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1260][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1259][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1259][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1258][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1258][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1257][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1257][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1256][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1256][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1255][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1255][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1254][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1254][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1253][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1253][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1252][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1252][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1251][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1251][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1250][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1250][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1249][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1249][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1248][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1248][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1247][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1247][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1246][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1246][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1245][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1245][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1244][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1244][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1243][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1243][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1242][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1242][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1241][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1241][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\smp_buf_reg[1240][7] ) is unused and will be removed from module audio_shift_buffer.
[Synth 8-3332] Sequential element (\vga_buf_reg[1240][7] ) is unused and will be removed from module audio_shift_buffer.
AI: If it is removing them, they are in fact unused, but it is not always obvious why.
I think in your case, the reason is:
.sample_in({8{sw}}),
The synthesiser is clever enough to realise the bits in each word of your memories (smp_buf and vga_buf) are identical. As a result, it decides there is no point duplicating the hardware, it might as well just have a 1 bit wide version.
Wherever the 8bit wide word was used, it just fills all 8 bits with the value from the new 1bit wide word. This results in the same behaviour but with less logic. |
H: Generic question about interfacing a microcontroller with a device: when is the current limit a problem?
I have an Arduino Board, to be precise many models, but let say I want to interface a ATmega328p with another integrated circuit (all is running at 3.3 V). In this case I want to connect Arduino with a A4988 microstepping Driver.
As everybody knows each output pin of the Arduino Board can source or sink max. 40 mA of current. Looking in the datasheet of the driver I find such electrical characteristics:
which clearly state that the max current 20 uA is.
Now, I don't know whether under those circustances possible is, to connect each Arduino Output Pin with the control logic of the driver directly or not. So here a few questions:
If is it possible to connect both devices directly, how can I make sure that the arduino board doesn't source 40 mA into the driver destroying it? Comparing max current of input and output is the right way to be sure, that nothing is going to fry??
If the current must be sinked to max. 20 uA (because the motor driver is the weakest component in this simple circuit), then I would insert a resistor. But how to dimension it? All what I know is that the output of the arduino board can output 3.3 V as Voltage and max 40 mA. At the input's side I know that a logic O is any voltage between 0 and 0.99 V (3.3 x 0.3 as per datasheet). So I would write:
\begin{equation}
R = \frac{(V_{output} - V_{input})}{I_{max_{driver}}} = \frac{(3.3 - 0.99)}{(20 * 10^-6)} \approx 120 k\Omega
\end{equation}
Is this consideration right or I'm missing something very important or doing a mistake somewhere??
I'm not really sure about the 2nd idea because in the datasheet there is a clear example on how it should be connected with a microcontroller:
But is the depicted example real or is a really simplification which cannot be used but just reconsidered for each different possible microcontroller?
AI: Power sources don't force their specified maximum current into a load - the load will just draw what currrent it requires. This applies to logic inputs and outputs just as well as to power supplies and their loads.
In almost all cases, logic inputs and outputs are designed to be used together, with no extra components, provided the input and output voltages are compatible. |
H: Op Amp balancing impedances
I know that I should balance input impedances in opamp circuits to avoid input bias currents from causing unwanted behaviour. I can understand how to do this in simple cases, but not in more complex cases. For example, in the case of a simple inverting amplifier, R3 should be added and made equal to R1//R2 (R1 in parallel with R2) if my understanding is correct:
simulate this circuit – Schematic created using CircuitLab
But what should I do in more complex cases, such as this:
I would think that I should put a resistor to ground on the 'fb' node and it should be 5.1k//10k. But what should I do with the other amplifier? How do I balance those filter impedances without changing the corner frequency of those filters?
AI: The purpose of this matching is to minimize DC offset due to bias current. If the op-amp has low bias current and the application is not sensitive to offset, you don't necessarily need to match the DC resistance. You can calculate the offset using the bias/leakage current figure from the op-amp datasheet.
In this case, if you want to change the impedance looking out of the U1 inverting terminal to 10k, it would be pretty easy. Just change R1 and R2 to 10k, and change C1 and C2 to 1nF. This will not change the corner frequency, but it will increase the input impedance on "in."
Since it is a DC phenomenon, the matching applies to the DC resistance only. |
H: How can I derive a voltage equivalent without affecting the output?
In the above schematics, I want to make the equivalent of the circuit on the left side. What I mean is I want to derive V2 from V1 and get rid of using two supplies. I want to derive V2 from V1 by using only resistors.
My first modification attempt on the right side with output2 is not exactly outputting as in output1. You can see the difference in the output waveforms. I tried to obtain V2 by voltage divider method. But obviously in this case it is not right this way.
How can I derive output2 exactly same with output1 by using resistors and eliminating V2? What is the methodology?
edit: if not possible with only resistors, extra diodes or transistors also allowed. but i don't want to use a voltage regulator.
AI: How about this?
simulate this circuit – Schematic created using CircuitLab |
H: Input Resistance vs Output Resistance
I am having trouble understanding the difference between these two concepts. I know that input resistance is the resistance looking into the input terminals and output is looking into the output terminals. What I don't understand is how to evaluate these. In the image below, are the input and output resistances simply the Thevenin resistances at the input and output terminals?
AI: Disconnect the source. Calculate the equivalent resistance seen across the open terminal Vi. That's Ri.
Disconnect the load, as well as short the voltage source (prefect voltage sources have zero resistance). Calculate the equivalent resistance seen across the open terminal Vo. That's Ro. |
H: TL431 low battery cut-off
Could somebody please explain the operation of the attached diagram?
The circuit was proposed here and here as a low voltage cut-off circuit, which switches off the MOSFET when the voltage drops below the reference voltage set by the voltage divider.
What I don't understand is how the TL431 keeps the MOSFET on when the input voltage is above the reference voltage. How is the MOSFET switched off when the voltage drops below the preset voltage? Will the value of the set cut-off voltage influence the working of the circuit? For example, can the reference voltage be set too low to be able to switch off the MOSFET?
I read through the datasheet, but it didn't help me understand this phenomenon. It did help me to choose my resistor values, though.
AI: The TL431 is being used as a comparator and shunt. If you look at the functional diagram, you'll notice that all it is is a voltage reference, comparator and n-channel transistor/fet:
When VRef, set by R1 & R2, is Higher than the reference voltage of 2.5 Volts, the comparator's output goes high, which enables the transistor. This pulls the cathode towards ground. The cathode is connected to R3 and the gate of the P-Channel Q1. So when the cathode is pulled towards ground, Q1 is turned ON.
When VRef is Lower than 2.5 Volts, the comparator's output goes low, which turns the transistor off. The cathode node is then pulled high by R3, which pulls Q1's gate high, disabling Q1.
As for VRef being too low, yes. If the voltage divider of R1 and R2 is chosen so it's mid point is always below 2.5V, even if the battery is fully charge, Q1 will never turn on. The opposite is true too. If the midpoint never goes below 2.5V (before the battery gets drained too low), then Q1 will never turn off. |
H: Electric Timer With a Micro-Controller
I am trying to replace some electric timers with some sort of a micro-controller based solution http://www.directindustry.com/industrial-manufacturer/panel-mount-timer-154503.html. I would like to run at least 10 timers from one micro-controller, a 20x4 LCD and 4 push buttons. All these requires 38 pins (I think I counted it right). The LCD will display the timers set value. Since there are 10 timers I though a 20x4 will be ideal. The push buttons will be used to set the time. The timers will be independent from each other.
I was planning to use a PIC16F887A micro-controller but I released that the number of pins are not sufficient. An Arduino Mega would be ideal but forums suggested that it is not reliable for an industrial application. What other micro-controllers are out there for this sort of application.
The current timers has 24V inputs and 24V outputs. How can address this issue?
I am new to this micro-controller business and PCB designing. I've been trying to learn on the internet so some links would be really helpful, specially for programming.
Also, do you guys think replacing those timers with a micro-controller is a good idea?
Thanks a bunch.
AI: Personally, I'd try to create a general purpose module by using small boards and relays and put them into a larger plastic box. For a microcontroller, I'd use something like this solution. http://www.cnx-software.com/2015/01/18/one-dollar-development-board/
This is a $1 stm8s board. It'll do pretty much what you want from a controller standpoint. You'll need to get an SDLINK debug interface which you can get for about $5, but you can use that on STM32 boards too. You can also get low cost STM32 minimal ARM boards for under $4, which will have much more Flash and RAM, but for simple timing functions you only need the STM8S. This would be an example of the STM32 board you could get cheap... http://www.ebay.com/itm/STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-Arduino-M2-/221982023431?hash=item33af28df07:g:BU0AAOSwKtlWhJmi
That being said, you will then need some kind of relay board to work with the higher voltages. All the MCU boards will run from either 5V or 3.3V. None of these CPUs will be able to handle any serious amount of industrial current. You will need a relay board. It could be done using semiconductors too like SCR's or power transistors or something, but the easiest and most reliable way to do it is to use relays. Some kind of board like this one could handle 10A, 250V, etc, etc.. http://www.ebay.com/itm/8-Channel-DC-5V-Relay-Module-Board-for-Arduino-Raspberry-Pi-DSP-AVR-PIC-ARM-/201400438757?hash=item2ee466cfe5:g:JMYAAOSw9N1VwDSM
Based on the panel meter examples you provided, I'd could use a calibrated potentiometer and use the ADC on either STM8S or STM32 board to read the voltage and use that to set the time value. Alternatively you could hook up a cheap LCD and a keypad to enter it digitally. With the more complex one, you might want to use the STM32 rather than the STM8S. For all these boards if you search around you can find the lowest price.
That kind of relay board could be had for about $10.
I'd say your most important step is your initial research into how you want to put it together and the features you want..i.e. your design. Your lowest cost solution is to use a calibrated potentiometer with no LCD to specify the time. The most expensive would be to have an LCD or LED display and possibly showing the time counting down. Remember the more complex your user interface, the higher the price.
Finally, don't forget that someone else may already have done this. You can get a simple panel timer for under $10 already...like this one. http://www.ebay.com/itm/Panel-Mounted-Type-110V-AC-5A-8-Pin-DPDT-60s-Power-On-Delay-Time-Relay-Timer-/271425503741?hash=item3f323881fd:g:gsoAAOSw~gRVidjM
...or here is an even cooler solution for even less money... http://www.ebay.com/itm/DC-12V-Multifunction-Self-lock-Relay-PLC-Cycle-Timer-Module-Delay-Time-Switch-/271958222133?hash=item3f51f92535:g:hnYAAOSwhcJWLiuB
Good Luck and remember to let us know what you finally ended up doing. |
H: How does a structural architecture know which entity to use?
So I'm following this tutorial in which they explain some basic VHDL by using a four bit adder as an example:
-- Example of a four bit adder
library ieee;
use ieee.std_logic_1164.all;
-- definition of a full adder
entity FULLADDER is
port (a, b, c: in std_logic;
sum, carry: out std_logic);
end FULLADDER;
architecture fulladder_behav of FULLADDER is
begin
sum <= (a xor b) xor c ;
carry <= (a and b) or (c and (a xor b));
end fulladder_behav;
-- 4-bit adder
library ieee;
use ieee.std_logic_1164.all;
entity FOURBITADD is
port (a, b: in std_logic_vector(3 downto 0);
Cin : in std_logic;
sum: out std_logic_vector (3 downto 0);
Cout, V: out std_logic);
end FOURBITADD;
architecture fouradder_structure of FOURBITADD is
signal c: std_logic_vector (4 downto 0);
component FULLADDER
port(a, b, c: in std_logic;
sum, carry: out std_logic);
end component;
begin
FA0: FULLADDER
port map (a(0), b(0), Cin, sum(0), c(1));
FA1: FULLADDER
port map (a(1), b(1), C(1), sum(1), c(2));
FA2: FULLADDER
port map (a(2), b(2), C(2), sum(2), c(3));
FA3: FULLADDER
port map (a(3), b(3), C(3), sum(3), c(4));
V <= c(3) xor c(4);
Cout <= c(4);
end fouradder_structure;
I am trying to understand why the component part in the fouradder_structure has to redefine the ports used in the FULLADDER entity; they both contain the following parts:
port(a, b, c: in std_logic;
sum, carry: out std_logic);
I then read somewhere that component defines the interface that the fouradder_structure is expecting. That would explain why entity and component both need to declare the used ports, but then how does the fouradder_structure know to use the FULLADDER entity that was defined previously? Is it a naming convention?
TL;DR, how is the architecture fouradder_structure aware it has to use the entity FULLADDER?
AI: If you don't specify which architecture an entity instantiation is going to use, it uses the most recently compiled architecture for that entity.
Personally I would use direct entity instantiation. To use this, delete the component declaration (component FULLADDER ...), and instantiate it thus:
FA0: entity work.FULLADDER(fulladder_behav)
port map ( ...
In this way you can easily see which architecture is being used, and you save yourself having to maintain a component declaration as well as the instantiation.
If you don't want to do this for some reason, look at using configurations. |
H: equivalent inductance
If two circuits 1 and 2, are coupled through the coils of inductance L1 (in circuit 1) and L2 (in circuit 2), how does the inductance value of L2 affect L1 ? and what is the inductance value seen by circuit 1?
simulate this circuit – Schematic created using CircuitLab
In the schematic how is L1 affected by L2? or how is Leq calculated?
How is the resonance calculated? when L2 is affecting L1?
AI: If you have a 1:1 transformer, L1 = L2 and any voltage applied to L1 will appear across L2 at the same amplitude providing the coupling factor (k) is 1. Any load connected to L2 will have no effect - input and output voltage amplitudes will be the same
If the coupling factor is (say) 0.5 and L2 is unloaded, the output voltage (across L2) becomes 50% of input voltage. In effect, a k of 0.5 turns L1 from a coil that was totally coupling L2 to a coil that is only 50% coupled. So, using simple numbers, if L1 is 1 henry it can be regarded as a leakage inductance of 0.5 henries and a coupled inductor of 0.5 henries in series. This forms a potential divider and the coupled inductor part only "sees" 50% of the input voltage and, of course this 50% voltage is seen on the unloaded L2 terminals: -
simulate this circuit – Schematic created using CircuitLab
L2 is also split the same way - 50% of it is coupled to 50% of L1 and there is a leakage inductance of 50%. This leakage inductance has no effect if no current is being drawn from the secondary. So, for coils that are equal but coupled 50% (k = 0.5) the unloaded output voltage is 50% of the input voltage.
Any loading on the secondary becomes in series with 50% of L2. This further changes the output voltage in two ways: -
50% of L2 forms a potential divider with the load
The extra current through the primary leakage inductance further drops the voltage that is coupled.
Without a specific proposal for a load and values of L1 and L2 I'm not going to do a whole load of maths to give a generic solution. |
H: What would the best way to filter high frequency noise? Decoupling/Bypass Capacitor? 1:1 Audio Transformer?
As many high end graphics card have high frequency coil whine and my particular one is causing whine on my diy studio monitors, what would be the best way to filter this noise?
My studio monitors are powered by 24v 750mAh DC adaptors (each) which I suspect aren't properly filtered. Audio signal is carried from Sound card by stereo cable. When using headphones, there's no noise. When I use a different audio source to the monitors, there's no noise. When I exit any GPU intensive application (gaming/rendering) the noise disappears. So that rules out any troubleshooting. High frequency noise is jumping from the graphics card over to my diy monitors.
My proposed solution:
4,7uF ; 0.1uF ; 0.001uF Bypass filtering capacitors rated at 60V connected in parallel on my 24vDC voltage input.
1:1 600 Ohm Audio Isolation transformer on my input.
Please criticize and give a better solution if you have one.
AI: I do not see how adding caps to the 24 V line would help. The noise appears to be entering through the audio connection from the PC. Decoupling the 24 V for the monitors seems pointless to me.
Regarding Audio isolation transformer: this could help if grounding is a problem. But if the noise is already present in the audio signal, the isolation transformer will not help.
But let me suggest a different solution for you which I use myself in combination with a high-end Headphone in order to prevent all audio issues.
I use a separate audio DAC, you could use this model, (mine is a different one with a headphone amplifier) and connect it optically (with a TosLink cable) to your PC. That is assuming your PC has an optical output. If your PC has a digital SPDIF COAX output, you could also use that.
If you do not have optical or COAX digital outputs on your PC you could get a USB soundcard like this one, this is the actual model I use.
I use the optical connection because it gets rid of any grounding issues. Also the audio signal does not become analog before it is outside the PC. |
H: Dimensional Tolerance for US Standard NEMA 1-15 Plugs
I am trying to find the dimensional tolerance on US electrical plugs. I have tried looking online, but I have only been able to find that they are called NEMA 1-15, and have found the picture below showing length and height for the male connector (but not width of the male prong), and I haven't been able to find dimensional tolerances anywhere.
I ask here because I'm assuming there's a US code that governs electrical plugs, but I can't seem to find the standard anywhere.
AI: You can find the dimensions in ANSI/NEMA WD 6. The standard costs money, but the free excerpt (linked above) will probably suit your purposes:
Dimensions are in inches, of course. |
H: Finding the voltage on a capacitor
Each capacitor is \$24\text{nF}\$ and I need to find the voltage on \$C_\text2\$.
\$C_1+C_4=2*24=48nF\$
\$\frac{1}{C_\text{(1+4)||2}}=\frac{1}{C_\text{1+4}}+\frac{1}{C_2}=\frac{1}{16}\$
\$C_\text{(1+4)||2}=16nF\$
\$C_\text{(1+4)||2}+C_5=16+24nF=40nF\$
\$\frac{1}{C_{tot}}=\frac{1}{40}+\frac{1}{24}=\frac{1}{15}\$
So \$C_\text{tot}=15\text{nF}\$ \$Q_\text{tot}=C*V=15nF*48=720\text{nC}\$.
How should I continue to find the voltage on \$C_2\$?
Built the qeustion using CircuitLab how
simulate this circuit – Schematic created using CircuitLab
AI: You've made an excellent start.
You have calculated the value of C1+4//2+5 = 40nF, and you know C3. This will allow you to calculate the potential at their common node, as whatever current flows through that node from C3 flows into the C1+4//2+5 effective capacitor.
Rinse and repeat for C1+4, and the value of C2.
This will give you the voltage at each end of C2, the difference is what you require.
Be aware that the learning intention of this exercise was not to calculate the voltage on C2 per se. It was a) to get you to recognise a ladder of impedances, b) to do as you did which was to cascade the impedances up from the bottom, until you find the effective impedance at the first node (40nF) c) from which you can get the voltage at that first node (18v) d) from which you can calculate back down to get the voltage a node at a time.
This is a ladder. The simplest non-trivial network of components. |
H: DC/DC Converter Instant Off
The output voltage of my DC/DC converter and my power supply both slowly descend. I believe this is due to capacitors being close to the output of each device.
I want to get an instantaneous, or as close as possible, off signal from the power supply so that I can connect my backup supply at that moment.
I currently signal the base of a p-channel mosfet with the output of the power supply. Because the voltage slowly descends the mosfet is not signaled until much after the supply is disconnected which leads to a break in power.
It looks something like this,
Where the 5V supply is the main off of the DC/DC converter or Power Supply, the 4.7V is the backup supply, and the 100k resistor is the load. (The load draws much more than a 100k resistor.)
I have tried adding a voltage divider at the base of the mosfet to lower the voltage and a cap at the output to smooth out the main signal. The problem with this is depending on the load the output capacitor has to be very large.
I have also tried using two NPN transformers to pull the mosfet directly to GND. They are signaled sooner than the mosfet but not fast enough.
Is there any way to quickly drain the power supply output caps without adding a constant power drain on the system or signal the mosfet as soon as the power supply starts to decrease its power?
AI: I have the feeling, unless I misunderstand or just miss some extra requirement, that you are over-engineering this.
You have a supply that is higher than your backup-supply by more than 0.1V.
Just the diodes will give you the best and quickest response: Leave out the P-MOSFET.
So long as you have a back-up supply that is a little lower than the main supply, you need to do nothing other than have those two diodes. Once the 5V drops below 4.7V the 4.7V back-up will take over instantaneously. Well, yes, there is a transition period, but it's in the order of millivolts for most diode types of the same type and same batch, if not less. I'm too fuzzy right now to do the full maths.
If your back-up is higher than the main supply (this is an exceptionally weird situation, to be honest), you will need a switching element, the easiest way to get that is to use a comparator. They can give a very nice, sharp and hard response on a fixed voltage.
If you have a 2.4V reference and divide the main supply by 2 through a resistive divider, you can compare those with a comparator directly and it will be able to switch a transistor. If the comparator has an open-collector output you can use it directly for your higher-voltage back-up supply, if it doesn't you'll likely need a support-NPN-transistor to translate its output upward to the P-MOSFET of the higher back-up voltage.
But again: Your back-up is below the main voltage, as is very usual, so just the diodes are more than enough. |
H: 4N32 Opto-Isolator Questions
I am looking into using a 4N32 opto-isolator and am struggling to find information on its pin 6. This looks to be the base of the transistor (darlington). I see example circuits where they appear to leave this pin floating. I am curious to know if I should make a pulldown resistor connection. Anyone have any advise or insight as to what I should do. What pull-down resistance to use.
AI: Normally you would leave it floating. Adding a resistor to the emitter can speed up the isolator somewhat, at the expense of CTR.
You wouldn't (or shouldn't) be using a Darlington optoisolator if you cared about speed, but if you want to give it a try, something in the 100's of K ohms would be a starting point. |
H: Homemade Electromagnet from Microwave oven transformer
I want to make an electromagnet in order to perform this trick
I have taken the following parts from a microwave oven, and following some instructions i have made the following electromagnet:
I have tried to supply it with power from an 1.5V AA battery then i tried from 4 x 1.5V batteries in serial then i tried from a 12V motorcycle battery and finally i tried from a 12V car battery. None of them gave enough strength to keep down a spoon inside a soup. They did gave some attraction, but it was too weak for what i needed.
Is it safe to plug it directly in 220V / 50Hz AC?
Is there another way to increase the strength or it is impossible with this equipment?
Is there any safety precautions i need to have in mind?
AI: a) not safe to plug into mains
b) need more copper wire, fill the available space with turns
c) decide how long you want it to remain attracting for, then aim to heat up your windings in that time, ie use as much input power as you can without overheating. Depending on the cross section of your copper, this may be a car battery, or several in series.
This will allow you to maximise the attraction for that core geometry. It may still not be enough for your spoon.
A steel spoon will be strongly attracted to a magnet. A stainless steel spoon, depending on the precise grade, will be somewhere between very weakly attracted to completely not attracted at all. Make sure you are using the right type of spoon! |
H: How to calculate the Timer Preload Properly on PIC32MX575F
I am trying to achieve 1 second on a timer in PIC32MX575F but somehow I am not reaching what I want.
Some people says I have to look into the the PLLDIV, some other people says I should look into the PLLMUL.
I have followed a couple of equations but none of them are reaching the 1 second interrupt.
I don't know what I am doing wrong so I want to know what is the best way to calculate.
Here is my code:
void initTIMER2(void) {
T2CONbits.ON = 0;
IFS0bits.T2IF = 0;
T2CON = 0x0;
TMR2 = 0;
PR2=0x7A12;
T2CONbits.TCKPS = 0b111;//1:256 prescale value
T2CONbits.T32 = 0;//16 bit timer
IPC2bits.T2IS = 0;
IPC2bits.T2IP = 2;
IEC0bits.T2IE = 1;
T2CONbits.ON = 1;
}
This is the configs I have made:
#pragma config FNOSC = FRC //
#pragma config FPBDIV = DIV_1
T2CONbits.TCKPS = 0b111
EDITED:
After some investigation it seems the code is calling OSCConfig( OSC_FRC_PLL, OSC_PLL_MULT_20, OSC_PLL_POST_2, OSC_PB_DIV_1) somewhere. I already made calculations with these new values but without success.
So if OSC_FRC_PLL is declared as #define OSC_FRC_PLL (1 << _OSCCON_NOSC_POSITION) it means by the datasheet "001 = Fast RC Oscillator with divide-by-N with PLL module (FRCDIV+PLL)".
Please take a look at the Diagram:
AI: #pragma config FNOSC = FRC // Oscillator Selection
You've chosen the 8MHz FRC oscillator as your system clock, so it doesn't make any difference what the PLLMUL or PLLDIV settings are as you're not using the PLL in that mode.
#pragma config FPBDIV = DIV_1 // Peripheral Clock divisor
Your Peripheral Bus clock is not being divided, so it is set to the same value - 8MHz - that's what your Timer2 module sees as its input.
T2CONbits.TCKPS = 0b111;//1:256 prescale value
You've selected a 1:256 prescaler in your Timer2 module, so it is going to be running at (8MHz/256) = 31.25kHz
Now all that's left is to set PR2 to an appropriate value.
The value you have (0x6768) is 26472 decimal.
The timer module will count up from 0 until it reaches that value, and we've just worked out that its counting at 31.25kHz, so it should take 0.847104 seconds - and then reset back to 0 and carry on counting up again.
This should give you a repetition rate of 1.18Hz
Since you're aiming for 1Hz, you should set your PR2 to the same value as the timer's input frequency - in your case 31250 (0x7A12).
Edit:
So, from your comments it seems that your system clock is not 8MHz, but 80Mhz (if my quick glance at the OSCConfig parameters is correct).
Following the procedure above would lead you to a PR2 value of 312500 - which doesn't fit into a 16-bit register ... So with these settings you can't achieve a 1Hz interrupt rate.
Some options might be:
- run your Timer2 in 32-bit mode by chaining it to Timer3
- slow down the Peripheral Bus clock by changing the PB_DIV setting in your OSCConfig() call
- leave Timer2 running at 10Hz (which it probably is running at now) and add a counter to the interrupt function so that you only do stuff every 10th interrupt |
H: Function generator output voltage
In a function generator, when I set Zout to be 50 Ohm, and Vpp is 1V. Is this Vsource, or the Vload when I have a matching load of 50 Ohm?
simulate this circuit – Schematic created using CircuitLab
AI: Typically, when you set the 50R output impedance on a signal generator, it assumes that the load is also 50R. Therefore, you will get 1 Vpp with a 50R load and 2 Vpp open-circuit.
Some function generators allow you to specify the load impedance, so the SG knows to calculate the correct voltage.
From Agilent 33220A Manual: |
H: Cannot enter programming mode ATMega328p
I'm using an ATMega328p Xplained Mini development board. I was able to program it using Atmel Studio 7, being new to AVR programming I accidentally set the RSTDISBL fuse to 0 (has a default value of 1). After trying to reprogram the board using SPI I found out that the RSTDISBL needs to have value 1. Now I cannot enter programming mode using Atmel Studio.
So, is there a way to reset this fuse without having to purchase a different type of programmer, such as JTAG? I have a few spare Arduino boards laying around if those could be of any use. I read through the ATMega328p docs and could not find any info on how to set this fuse.
AI: EDIT: Below descrobed HVSP apparently doesn't work for ATmega328p, check this HVPP as an alternative. The remainder of my answer is still valid.
Check this blog article: Arduino AVR High-Voltage Serial Programmer. You'll probably need to tweak a couple bytes in the code, check the datasheet for the default fuse bytes and change them in the code near the top:
// Desired fuse configuration
#define HFUSE 0xDF // Defaults for ATtiny25/45/85
#define LFUSE 0x62
Basically what it does is create a High Voltage programmer using an Arduino board and a handful discretes to reset the fuse bytes. Once the fuses are reset to their default values, you can program the chip in the regular way.
The circuit needs a 12V supply to pull !RESET high and enter HV programming mode. Be careful, only this single pin is 12V tolerant.
This little (Linux based) project defaultFuses may be of some help trying to figure out the default fuses. All it does is program the default fuses to the configured controller, but of course you'll first need the HV-programmer to unbrick your controller. It does however show the values which it will attampt to program. |
H: Where do I find models for various common op amps for use in LTSpice
I have just started using LTSpice. I need to simulate a circuit with op amps, where the parasitic elements of the op amp may effect performance. So I need to try different 'real' op amps to see which on is best.
Is there a source of commonly available op amp models like TL074 or LM324
AI: From the manufacturers. For example TL074 spice model
Be aware there are sometimes problems with manufacture's spice files. I have found that they sometimes use node zero in parts of the internal circuit. This result of this is that the model works fine unless you supply it from power rails at a potential far removed from your circuit ground. Also you sometimes need to do a little bit of translating of p-spice specific syntax. |
H: Can I solder a RG316 coax directly to a PCB instead of using the intended SMA connectors?
I have a length of RG-316 single shield 50Ω coaxial cable carrying a 5.8 GHz signal that I need to connect to a PCB. While cheap relative to most coaxial connectors, SMA connectors are still quite expensive, take up space and are relatively heavy. The PCB was designed for side mount SMA connectors.
Could I replace the original SMA connectors with direct soldering joints like this, without causing a large impedance mismatch?
How could I improve the RF performance of the connection?
The mechanical strength of the joint is poor, and the teflon insulator does not bond well with common adhesives. Can I protect the joint with nonconductive adhesives (epoxy, hot glue) without significantly affecting its RF performance? What would be the best way to secure it mechanically?
AI: Soldering directly to the pads of the SMA connector instead of using SMA connectors should work fine electrically.
The obvious problem is that the cable is no longer removable. If you're fine with that, then go ahead.
It would be good to have some mechanical strain relief if this has a chance of getting flexed. At only 2 inches wavelength, you do need to be careful about impedance changes over only a few mm. I'd stay away from adding any material around the solder joint or the wires outside the shield. However, you can do most anything you want back down the cable a bit from the solder joint and where the shield is still intact. Perhaps you can hold the cable down with cable ties or something further from the board. |
H: What are the essential properties of a PWM signal that can be captured with an oscilloscope?
My question is regarding general guidelines when it comes to using oscilloscope captures in a professional-grade report to be presented to people working with signal processing, embedded systems, etc. Although there are a few obvious ones (i.e. cursors and labels), I was hoping to hear from the community about what kind of information do you think would be the most useful on an oscilloscope screen capture?
The focus is on different characteristics of a PWM signal.
To narrow down the question - I am looking to put together a small presentation (~ 15-20 slides including pictorial slides and bullet point info) that gives an overview of a PWM module on a specific uC. One of my main assets for facilitating this task is an oscilloscope. The purpose of this question was to ask fellow users for an advice regarding possible properties of a PWM signal that may be of interest to a professional embedded systems engineer evaluating a new board.
AI: An ideal PWM signal will have the following characteriestics, high time, low time, high voltage, low voltage. Your scope trace graticule needs to be annotated with at least seconds/div and volts/div. If you have time and voltage markers to give these in numbers, then so much the better. These can be illustrated using a cycle or two per screen.
A non-ideal PWM signal will further have limited or unequal slew rate on rising and falling edges, overshoot after rising and falling edges and ripple and droop on high and low regions. These may need the voltage and time scales increasing to highlight just these parts of the waveform. |
H: how is the 1PPS signal generated in GPS receivers?
The question might seem stupid, but the time of flight from the satellite is unknown and moving, the doppler effect is skewing the frequency (and is not constant due to the relative trajectory) and satellites are constantly coming and going to view, forcing a constant change of the reference clock.
Moreover, the 1pps is meant to have low jitter but also be in phase with the UTC clock (but I don't think it is claimed to be accurate in this aspect, it's mostly famous for low jitter).
Here is a secondary question: is the 1PPS phase connected to the carrier wave or to the demodulated signal?
AI: The receiver maintains its own internal timebase, and some of the unknowns that it needs to solve for are the frequency and phase offsets between that local timebase and "GPS system time" as inferred from the received signals.
Once the receiver has those values, the 1PPS output is generated from that timebase. There is no "direct connection" to either the carrier or the modulation of any of the satellite signals — there is significant Doppler shift on those signals anyway.
Low-end receivers use an inexpensive TCXO (temperature-compensated crystal oscillator) to drive the local timebase, but no attempt is made to frequency-lock that oscillator to GPS time. As a result, the 1PPS output may have some jitter in it, with the peak-to-peak value related to the period of the oscillator (usually on the order of 20 - 50 nsP-P).
Fancier high-precision receivers have the option of frequency-locking the local oscillator to GPS time, eliminating the jitter.
In my applications, I usually use low- to mid-range receivers that do not frequency-lock their timebases. In some of my designs, I don't care about the low-level jitter. In other designs, I have used a second PLL as a jitter filter to create my own low-jitter timebase. |
H: designing a pcb breakout board with micro dsubs
I am a beginner in the world of pcbs and I'd like to make a breakout board. The board will be breaking out signals from micro dsubs. There are no other components on the board.
What is the simplest software for me to use? I looked at multisim and orcad(I have working licenses for both) but I couldnt find the micro dsub connector available.
Is there some connector database I am not aware of for those two software suites?
Otherwise, what free alternative should I look at? Should I be making the connectors myself?
AI: Just my opinion, but you don't get very far in any package without learning how to add parts to the libraries, and that once you know it, making the parts on your own is marginally faster and more reliable than finding it on some database.
Sometimes you get lucky, and the part manufacturer will actually provide engineering files that can be opened or imported into your CAD program (sometimes using Ultralibrarian) |
H: Why does TI have so many microcontrollers?
I am working on a project with a group and I am responsible for the digital part of the project, so I will be writing the code. To go from Analog to Digital, I have to choose a microcontroller.
I was looking at TI microcontrollers and found that they have so many. They have:
Stellaris
Hercules
MSP430 Series
And the list just goes on..
My questions:
Which micro controller does one use and why ?
Under what conditions should I use microcontroller X rather than Y ?
Why are there so many different micro controllers?
AI: I am a TI employee who works in an MCU development group, but this is not an official statement from TI. In particular, this is not an official statement about roadmaps or priorities. Also, I'm not in marketing, so if I contradict any of our marketing material, they're right and I'm wrong. :-)
M D's answer is correct, but I thought some more detail would be helpful. TI targets different applications with different requirements. When you're competing for an MCU socket (and there is a lot of competition in this industry), both features and price matter. A ten cent cost difference can win or lose the socket. One of the main drivers of cost is die size -- how much stuff is on the chip. Thus, it makes sense to have different product lines, and different families within those product lines. Product lines differ mainly in peripheral types and architecture, while families within a line products differ mainly in terms of cost and feature set.
Here are some details on the product lines:
Hercules is a continuation of the TMS470/TMS570 line. It's focused on safety and performance. One of the key features of Hercules is dual CPUs running the same code in parallel ("lock-step"). This lets you immediately detect faults in the CPU itself. Check out this datasheet for some performance info on a newer product. The Cortex-R5F CPU runs at >300 MHz, and there's a large number of peripherals with higher-end features -- the CAN modules have 64 mailboxes, for example. Obviously, this stuff isn't cheap. But look at the applications -- defibrillators, ventilators, elevators, insulin pumps... these are places where customers are willing to pay for safety. Hercules also goes into automotive products that have a wider temperature range and longer operating life.
C2000's focus is on supporting control algorithms. The C28x "CPU" is really a DSP, and its instruction set has been extended to handle things like trigonometry and complex numbers. There's also a separate task-based processor called the Control Law Accelerator (CLA) that can run control algorithms independently of the CPU. The ADCs and PWMs support a lot of timing options, too. Performance varies from midrange (Piccolo) to high-end (dual-core Delfino). The big applications here are power converters, power line communication, industrial drives, and motor control.
MSP430 is all about low power. They have some products that use FRAM (ferroelectric nonvolatile memory), which uses less power than flash, and even one that runs off of 0.9V (one battery). They have some less-common peripherals to support things like LCDs and capacitive touch sensing. Look through their datasheets and you'll see applications like remote sensors, smoke alarms, and smart meters.
I don't know much about the Wireless MCU group, but obviously wireless connectivity has its own special requirements. They seem to have Cortex-M and MSP430 CPUs, with applications in consumer electronics and the Internet of Things. IoT has been a big buzzword for a while now, so I'd imagine that's one of their main targets. Their newest (?) product is described as an "Internet-on-a-chip™ solution". UPDATE: Fellow TIer justinrjy commented with more info about Wireless/Connectivity MCUs: "'Wireless MCU' products are distinguished by having a processor core that runs the drivers/stack of the wireless protocol. For instance, the CC26xx runs the entire BLE stack on the uC itself, making it really easy to develop for. Same with the CC3200, except that processor runs the WiFi drivers all on the Cortex-M4. The integrated core and drivers are really what make these a 'Wireless MCU', instead of a transceiver."
As you can see, these product lines are targeting very different applications with very different requirements. Putting a 300 MHz Hercules chip into a battery-powered device would be a disaster, but so would putting an MSP430 into an airbag. Physical size can also matter. A 337-pin BGA package is awkward to fit in a tiny sensor, but it's nothing for a piece of industrial equipment.
Within the product lines, there are multiple families. C2000 Delfino devices are faster, have more peripherals, and have more pins on their packages. They can also cost (at least) twice as much as a Piccolo device. Which one do you need? It depends on your application. MSP430 has some products that balance power consumption and performance, and others that focus solely on low power. (That one-battery MCU maxes out at 4 MHz and 2 kB of RAM.)
There are many products within each family because new products are developed all the time. Transistors get smaller/cheaper, so more stuff can go on a chip. A mid-range MCU today would have been ultra-high-end ten years ago. Each product is usually made to target a few specific applications and support others where possible.
Finally, there are multiple variants of each product (AKA the last digit in the part number). These usually have different amounts of memory and (maybe) small variations in what peripherals are available. Again, this is all about providing a price range.
The short version is that each product provides a different balance of price, performance, and features. It's plain old market segmentation. Our customers are manufacturers, who care much more about small price differences than end users. People buy every part number we have, so clearly the demand is out there. :-)
UPDATE: Jeremy asked how the requirements of big customers affect the design process, and whether we make custom MCUs. I've seen several TMS470/570 MCUs that were made for a single large automotive customer. That group also had a couple MCUs whose architectures were designed by and for one customer. In at least one of those, the customer wrote most of the RTL. Those are under heavy NDA restrictions, so I can't give details.
General market products usually have at least one big customer in mind. Sometimes big customers get a special part number. Sometimes we'll add a peripheral just to win a big socket. But in general, I think big customers are more of a floor than a ceiling when it comes to features.
An extreme example of custom parts is our high-reliability group. I've only heard stories about these guys, but apparently they take existing products and remake them to work in extreme conditions -- high temperatures, radiation, people shooting at you, etc. I know someone who buys HiRel TMS470s for down-hole drilling, where the temperature can reach 200C. (Maybe this one -- in stock at Arrow for only $400/chip!) They have a bunch of standard products listed on the web site, but from what I've heard, they can build to order even in small quantities -- you can buy a dozen HiRel versions of any chip you want if you're willing to spend $50,000+ per chip. :-)
As a rule of thumb, everything in business is negotiable if you're spending enough money. |
H: How to explain the advantage of Schmitt trigger over comparator for pulse conditioning?
Above is the unshaped input pulse train. Red line is the set point for the comparator.
I see many pulse conditioning and sharpening circuits use Schmitt triggers instead of comparators.
Imagine the input pulse train is not sharp enough so we need to make it sharper. There are some applications in industry where you need sharp pulses to count frequencies. My question is:
Why not only to use a comparator? Is that because rising and falling edges are sharper in case of Schmitt trigger? Could one explain it in an illustrative manner?
AI: If you're feeding a digital input, a Schmidt trigger is preferable in most cases because it will clean up the signal and match your logic levels. It will also help avoid meta-stablity (ie when the voltage level is right in the middle of on and off, its bad).
A comparator could possibly give you metastable values if the amplifier is fast enough and if your digital input is clocked really fast or an interrupt.
It also depends because a comparator has only one voltage value and a schmidt trigger has two points when it transistions |
H: Neutral vs ground wire?
I have a simple question about neutral and ground wire.
Since the neutral is connected to the ground, I have problems understanding the difference. Assuming it is connected to the ground, it should be just a ground?
I believe the only way it could be different is if the current can only go from the Neutral -> Ground and not the opposite?
If not, what is then the difference between both?
AI: The Neutral and Ground are generally connected together at your service panel, not at your devices.
At the device, neutral is the path for return current. All the current that comes "from" the hot leg "returns" through the neutral wire. I'm using quote marks because current actually alternates directions in an AC system. Hence the name AC!
Anyway, the ground wire should only carry current in the case of a fault condition. In the USA, residential ground wires are often just bare, uncovered copper. When plugging in a grounded appliance or other device, the ground wire gets attached to the chassis.
Say, for example, that the insulation on your hot wire gets damaged and the conductor comes into contact with the metal body of your washing machine. The current shorts through the chassis and then through the ground wire. This high current causes your circuit breaker (or fuse) to trip. If you didn't have the ground wire then the mains voltage would electrify the entire chassis. Then the next person touching it becomes the return path :) |
H: Difference between the natural response and transient response of an RLC circuit
Some books talk about the natural response of the RLC circuit. This is when the voltage source is taken out from the circuit. Some other books talk about the transient response of an RLC circuit, which is the time it takes the circuit to reach to steady state. The equations seem similar. I googled and some people are saying that natural response and transient response are the same thing. I don't see how, when one depends on the voltage source and the are doesn't. Could anyone shed some light on the two concepts?
AI: Natural response refers to the zero-input response, where only initial conditions generate the system response. Transient response refers to the system response to a time domain input signal, such as an impulse or a step. The exponential terms in both types of response will be closely related - having the same exponential time constants, for example.
For an RLC circuit, the natural response could be obtained by having an initial charge on the capacitor when the circuit is closed (by a switch, e.g.), but with no other sources of EMF in the loop. |
H: Electricity provider switching
I live in a deregulated state where I can choose my electricity provider. But I'm confused how this is achieved technically.
Some time ago, I lived in an apartment, and each tenant wad able to choose their own provider. Does each provider need to run their own lives in this scenario? If so, wouldn't that mean that any new provider must also run lines if they intent to supply electricity for the complex?
Tried Google and only got legal answers about deregulation, but nothing technical.
NOTE I know that the switching tag isn't quite what this question is, but I couldn't find anything else.
AI: You're basically paying a power provider to show that you're not stealing the power. There is a meter that get's checked and if you're not paying someone, then the last company who got paid is supposed to turn off that circuit and lock it so that you can't turn it back on. Then, when you start paying someone who is a provider, they unlock the circuit and use the meter to determine how much to charge you. No extra wires, everything is from the same grid.
This is a very simplistic view, but should be sufficient to understand. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.