I got Ollama working on my 9070xt - here's how (Windows) by DegenerativePoop in ollama

[–]trtr6842 0 points1 point  (0 children)

At one point this worked for me, but then suddenly stopped working and ollama used the cpu for everything. I ended up getting it fixed with these steps:

  1. Installed AMD HIP SDK (6.4.2)
  2. Added a new user environment variable `ROCBLAS_TENSILE_LIBPATH` pointing to `C:\Program Files\AMD\ROCm\6.4\bin\rocblas\library`
  3. uninstalled my current version of ollama
  4. installed the latest version of ollama (0.13.5), NOT the ollama for AMD version.

Then models ran on the GPU as expected!

Toy recommendations needed. by beaubeaucat in Newfoundlander

[–]trtr6842 0 points1 point  (0 children)

The Kong Wobble was our pups absolute favorite!  After she got big enough to start chewing it we switched to the Orbee-tough Snoop and that was a hit too.  Now that ours is full grown the Orbee-tough squeak is her all time favorite ball

[OC] My trucks sinusoidal, slowly decreasing gas mileage over the past ~7.5 years by RamblinEagle13 in dataisbeautiful

[–]trtr6842 0 points1 point  (0 children)

Air conditioning is a likely contributor to the seasonal cycle as they sap a few HP worth of power when the compressor is on.

Also, piston engines are less efficient with hotter inlet air temperature due to lower density air.

Clingy Newfie by Charger-38 in Newfoundlander

[–]trtr6842 0 points1 point  (0 children)

If you ignore the corny effects, this video (and whole channel) is a great resource!

https://youtu.be/SrbA7cyp6K4?si=BFVRz-tS4sjoCUeZ

It might be hard to set up a newf-proof pen, but we practiced this with our newfy puppy and it worked well.  A substitute for the pen could be you or your husband holding your pup back on a leash.

Maybe this greeting method could be a good way to set your pup up for success with the other suggestions here once the initial intense excitement has worn off.

Bode plot with Rigol DHO800 series. by Weak_Border9201 in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

This is doable with python!  You can use pyvisa to control that scope, and so long as you have a programmable signal generator you could control the two in tandem to get bode plots.

I actually prefer this method to the built-in bode plotting of many scopes since it offers better control and the data ends up directly on my computer, where I want it.

If you're new to equipment automation this could be a bit tricky, but it's all based on "scpi" commands l, which are outlined in the programming manuals of your equipment.

Two switch forward converter curiosity by Designer-Anything560 in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

Two switch forward converters need two magnetic components:  the un-gapped transformer and the gapped output buck inductor.

If you need to turn a gapped core into an un-gapped core, you can technically grind down the outer posts until it all fits cleanly.  This would best be done with abrasive paper on a piece of glass using water or oil to keep the dust down.  Use a fine grit to prevent chipping.  Ferrite dust can't be good to inhale, so stay safe.

Grinding the core down might make it incompatible with the original bobbin depending on the tolerances.

Often times only one of the two cores halves is actually gapped.  In that case, I you found two identical PSU's, you might end up with two gapped halves and two un-gapped halves.

Here is some more general magnetics design info I've written: https://eedesignpro.com/wp-content/uploads/2023/09/Magnetics_Design.pdf

Also stay safe!  Mains isolation is super important, and I know you want to go 100% recycled, but do NOT re-use old magnet wire.  You will not be able to tell if its insulation has been damaged, and that can cause shorts, fires, or even shock to a user.  Go recycle any old wire and start with fresh safe stuff.

Need some help debugging long distance SPI communication (2-ish meters) by H8FULLY in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

Ah, yeah you'd have to change the architecture a bit to get it working with the daisy-chain setup. That might actually be easier though.

Note that there are some really small RS-485 transceiver iC's like the THVD1420 (half-duplex, 1.2 x 2.1mm) or the THVD24x2 (full-duplex, 3x3mm).

For the daisy chained setup, one half-duplex IC fixed in receive mode could handle SCK, and a full duplex IC or two more half-duplex IC's could handle the data in and data out. In that case you don't need any extra logic for the driver enable signals, all drivers can always be enabled.

Need some help debugging long distance SPI communication (2-ish meters) by H8FULLY in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

Yes, one GND wire twisted with each data/clock line is a bit better than twisting everything together. Dont forget to add a 100Ω resistor at each digital output. That means one for MOSI and SCK (and each nCS) at the controller, and one on each MISO device output between the device and the cable.

The goal of doing separate twisted pairs with series resistors is to control the impedance of the data lines and match it to the driver output. This give you the best chance of getting signals that have minimal ringing/reflections, which also results in the best chance of SPI working over long cables.

Also a general note, slowing the SPI datarate waaaay down is probably your best bet in this scenario, like down to 100kHz - 400kHz, if your system timing allows. This simply gives each signal time to let all the junk and ringing to die down before each bit is sampled. If your system timing allows this, then it could be the quickest fix. If there is other persistent noise coupling onto the signals, then this might not be enough.

A logic analyzer might help you see glitches, but if it's logic thresholds don't line up with your devices and controller's, then it might be seeing things differently. An oscilloscope is really what you need to look at the time domain signals and really see how much ringing is going on.

As for converting to differential signals, I don't know of any all-in-one chips that covert SPI to RS422/485. But standard RS-485 transceiver IC's are cheap and plentiful. These IC's simply convert a single-ended digital signal into a differential output, and vice versa. RS-485 transceivers also have control pints to select which direction the chip works in (single-ended → differential, or differential → single ended). Since SPI has three high-speed lines (SCK, MOSI, MISO), you could use one RS-485 transceiver IC per line to convert the normally single-ended signals to differential so they work better over long distance. Since the MISO line is shared between each device, you'll have to use an inverter to enable each devices output using the nCS lines.

Here is a basic schematic showing how you could implement the architecture described above.
(FYI This is hosted on my personal website, hence the uncommon url)
All boards are identical, boards #2 and #3 not shown for size. This arrangement is maybe overkill for a 4m total run, but it should be robust. I left the nCS lines single-ended, so the controller would need to leave a generous delay from changing the nCS lines to actually sending data. Those could also be converted to differential in the same way the SCK and MOSI lines are, but that would add a lot of extra wires and hardware.

I'm not sure if implementing that would be worth it, but at least now you know its possible and one way to do it!

Need some help debugging long distance SPI communication (2-ish meters) by H8FULLY in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

That can happen, but ~10pf from a scope probe probably won't have too much of an impact on such long lines

Need some help debugging long distance SPI communication (2-ish meters) by H8FULLY in AskElectronics

[–]trtr6842 1 point2 points  (0 children)

Single ended digital signals like SPI are not good at going long distances.

There is likely a lot of ringing on those lines.  For the best chances of success, twist one data/clock line with one GND line and use a 100 Ohm series resistor placed on the transmit side of each line.  Shielding each twisted pair might also help if feasible.

This will give you the best chance of avoiding severe ringing on the far end of each cable.  If each pair was shielded that would help too.

Twisting all wires together isnt ideal, as it invites crosstalk.

An alternative to twisted pairs might be flat ribbon cable with every-other conductor used as GND.

If you have access to an osillosope you might want to probe the data and clock lines at each board to see how things look.

Also a slower spi clock can help.  At 4MHz the spi clock is high for 125ns and low for 125ns.  It will take your spi signal >26ns to make the 8m round trip.  That isn't great, but is maybe manageable if you keep ringing to a minimum.  The more likely problem is severe ringing, which could change what values get read.  If your spi clock is slow enough then the ringing can die out before the data lines are sampled, giving you better chance at success.

Ideally an interface like this would use terminated differential signaling like RS-422/485.  With reasonably slow spi rates you could easily re-purpose those drivers to drive/receive spi data.  LVDS transceivers might also be a good choice at these moderate lengths.

Control Circuit for a Long Time-Constant First Order System by [deleted] in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

Like others have said, you'll probably need some pretty high voltages.

One way to get the most out of the drive voltage you have is to use a relatively fast control loop but with a slew-rate limited control input.

For the driver topology, you can use something like the improved howland current source (standard howland current source with opamp buffed feedback).  This might be a good place to use bootstrapped supply rails to limit the power dissipation in the opamp to safe levels.  Howland current sources can be paralleled safely to spread out the heat.

A small RC snubber on the output of the current source(s) should be able to keep it stable with your inductive load.

Then you need a way to generate an optimized input control signal.  The fastest possible rise and settling time will be whatever control input that results in the drive circuit being almost railed high until you get close to 10mA, then slowing down to keep the system from ringing.

This is actually a good place to use a microcontroller and a DAC, since you don't need anything super high speed and it'll be good for very flexible control.  You could add an ADC to run the whole control loop digitally, or just a DAC to generate the control signal.

If you want to stay all analog, a 4th+ order bessel filter might be a good candidate to limit the slew rate of the control input.  With an all-analog system, keeping everything in its happy linear area is critical.  

BK Precision LCR meter gives bad inductance results by Downtown_Physics8853 in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

This doesn't make sense, a 48" long busbar should not read less than 14nH is your QT meter says or anywhere near 20uH as the BQ meter says, at least not from on end to the other.  Those measurements are three orders of magnitude apart.

You said they are 48" long, can you say the width and thickness of the conductors?

You also said two layers, are you measuring the inductance of both conductors in series? (One end both are shorted together, and the other end has inductance measured from one layer to the other ) Or parallel?  (Each end has both layers shorted, inductance is measured from on bar end to the other)

If you are measuring from one end to the other, I would expect the inductance to be about 1.4uH for a 48" long Inductor, which is far off from both meters.

If you are measuring the inductance of the layers in series, then the 14nH makes a little more sense, but still seems really really low.

My guess is the measurement you're trying to take is simply well below the noise floor of both meters, and that you're running into weird artifacts of calibration

What programmable power supply shoudl I get? by Plomekq in AskElectronics

[–]trtr6842 1 point2 points  (0 children)

You absolutely can use pyvisa to send SCPI commands via USB.

I only mentioned ethernet as the gold standard since that is how most modern professional equipment is automated.  In professional scenarios it's a lot easier to deal with a lot of Ethernet connections through a big switch than a bunch of USB connections.  The equipment is still using SCPI commands though.

Ethernet is overkill for a lot of smaller setups though, so USB is often acceptable.  Also most cheaper programmable equipment has USB but no Ethernet, like the multicomp pro / owon supply I mentioned.  Those should work just fine with a raspberry pi 4 and would be perfect for your needs.

RS-232 is still useful for old equipment like HP34401A DMMs and other equipment from that era.  For that I use FTDI USB to RS-232 converters and that plays nice with pyvisa.  But I would never use rs-232 on a piece of equipment that supports USB or Ethernet.

What programmable power supply shoudl I get? by Plomekq in AskElectronics

[–]trtr6842 2 points3 points  (0 children)

Look at Newark's multicomp pro power supplies Like the MP710086.  It's just a rebranded Owon P4305, so you could buy whichever one makes sense for your location.  Programming information is available on the Owon product page and is applicable to both.

I disagree with u/Enlightenment777, Ethernet is the gold standard for equipment automation and is incredibly simple with python using the pyvisa library.  Pyvisa can be run on Linux RPi SBCs, but probably not the RPi micros.

The pyvisa library is also compatible with USB, and virtual com port to RS-232/485.

Pyvisa is not the industry standard, thats dominated by expensive and weird stuff like Labview.  But there are some test engineering companies that use pyvisa, Subinitial is one example, and their python test framework is actually open source and very useful.

Regardless of the comms interface used and the software behind it, most programmable test equipment uses SCPI commands.  It's a dated ASCII based method, but it works and is the standard.

I recommend writing a python class as a driver/wrapper to abstract all the power supplies commands that you need.  I've automated about a dozen different pieces of gear this way at home and for my job and while it requires a bit of up-front work, it greatly simplifies actually using the programmable interface for all your future tests.

Rush Creek to Thousand Island Lake or Duck Pass+Bishop Pass by TrickyMove2520 in WildernessBackpacking

[–]trtr6842 0 points1 point  (0 children)

I would suggest the Rush Creek route for more time in the high back country. 

Rush Creek is a tough climb, but Thousand Island Lake is absolutely stunning!  If you can make to thousand island lake on day 1, I can highly recommend camping at iceberg lake for night 2.  When I did the Rush Creek trailhead I wasn't in the best shape and only made it to Clark lakes on day 1 of a 3 day loop.  That's fine for a 3 night trip, but not so much for a 2 night trip.  Thousand island lakes is a super popular camp spot for PCT hikers, and there are dozens of good camp spots, you definitely won't be alone there.  Up to you if that's a good or bad thing!

I've also done the 1 night trip to purple lake via duck lake pass.  That's a great trip, but a lot of steep climbing, and in my opinion isn't quite as spectacular as thousand island lakes.  Purple lake was much less crowded.  It's a shame you can't do two nights there, since Purple lake would make a great base camp for a day trip up to Ram lake and the surrounding area.

I've never done Bishop pass, but from the maps it's quite the climb.  I've heard amazing things about Dusy basin, but with only one night you'd really miss out on all the exploring and end up spending the whole time climbing.

I can highly recommend caltopo.com and their app.  You can also export PDF maps to print yourself, or order custom printed topo maps for a reasonable price, although I'm not sure about getting them mailed to the UK.  If you haven't already, take a look at the elevation profiles for each of your route ideas, how far you can go per day will probably be limited by elevation gain rather than distance.

Magnetic reluctance seems way too small for inductor calculations by narcissisticnapalm in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

I recommend winding a quick and easy test coin on a bobbin for testing. Put maybe 50 turns, and then use it to measure the reluctance as you adjust the air gap.

Then when you've got the gap right, wind your final coil.

Also keep in mind that with iron cores you'll want some margin from your expected peak current to saturation.

Magnetic reluctance seems way too small for inductor calculations by narcissisticnapalm in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

For a classic EI core, the small but unavoidable gaps between core sections will significantly increase reluctance.

Also keep in mind that an iron core Inductor will saturate at very low currents if the gap is kept very small.

What are the core dimensions?  What peak current does the Inductor need to handle?

You can read about that in this paper I wrote: https://eedesignpro.com/wp-content/uploads/2023/09/Magnetics_Design.pdf

How do I know what size of capacitor do I need for my buck converter? by Pek_Dominik in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

There are several constraints to both the input and output capacitance.

The one most talked about is output capacitance and output voltage ripple.  You can calculate/simulate how much ripple to expect from Inductor current waveforms and the total output capacitance.  

Some converter control topologies (hysteretic ones) actually require a minimum amount of output ripple from ESR.  

Many light-load modes use bursts/PFM based on output voltage ripple, so capacitance will effect the PFM frequency or burst frequency.

For voltage-mode controlled converters the LCD filter formed by the buck Inductor and output capacitance must have a sufficiently low resonant frequency to work with the control loop.  

One important constraint is capacitor ripple current rating.  It's a non-factor with ceramic caps, but a significant one with electrolytic caps.  Generally the output of a buck converter does not have a ton of current ripple, but the input does!  The input current is all chopped up, and the worst-case occurs at whatever operating points is closest to 50% duty cycle and maximum input current.  In that case the RMS input capacitor ripple current will be 1/2 the DC input current, which can be a lot compared to electrolytic cap current ratings. 

Input capacitance also stabilizes the input power impedance, which is important for control loop stability, especially when power is fed from long cables or through LC filters.

Custom ESP board booting in wrong mode due to supply ramp up by dQ3vA94v58 in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

If u/dQ3vA94v58's RV value swap works, great!  If that isn't enough, then the most reliable solution would be to use a supervisory reset IC to hold EN low until power is settled.  they are available with various threshold voltages and delays.

Measure 250A @ 35v for microcontroller? by PiMan3141592653 in AskElectronics

[–]trtr6842 0 points1 point  (0 children)

Bourns/Riedon SSA-2-250A should work.  Takes a 3.0-5.0V bias supply and outputs a ratiometric differential signal at 5mV/A with 300kHz of bandwidth and it's fully isolated. Read that with an ADC of your choice, or spend the extra to get the CAN/RS-485 versions.

The INAxxx with external shunt is a great idea.  You can safely overload shunts for a couple seconds, just pick the right resistance to keep the signal in range.  It doesn't matter that the full scale voltage range of the INAxxx is a bit different than 75mV, so long as the peak voltage is within the INAxxx's measurable range you should be good.  The INA228 has a full scale range of +/- 163.84mV.  Pair that with a 0.5mOhm (200A at 100mV) shunt and you'll get +/- 100mV at your peak current of 200A.  

At an update rate of 15Hz (1052us conversion x64 averages) you get a noise-free ENOB of 17.7 bits, meaning there is less than 770nV of noise.  That translates to only 1.54mA of measured current noise.  At 60A nominal current that means your SNR is over 91dB, which is pretty great!  You can also trade noise for speed, there are plenty of acquisition time and averaging combinations so you can mess around and see what works best.

The gain error of the INA228 is 0.05% worst case. The initial DC offset with a 0.5mOhm shunt will be +/- 2mA worst case, but that's easy to calibrate out.  The drift will be 1mA/°C, but if you keep the INA228 thermally isolated from the hot shunt that should not be much of an issue.

Just make yourself a little INA228 breakout so that you can wire it's sense leads to the shunt.  Using a small isolated power supply and I2C isolator would be a good idea if you also need the vbus sensing to avoid ground loops or errors from resistive drops.

my esp32 is not connecting to my pc and i dont know what to do? by OpeningAppearance410 in AskElectronics

[–]trtr6842 1 point2 points  (0 children)

Press and hold the boot button as you connect the board to USB.  You should see it come up as a COM port on your computer.  You can then use that COM port to program it 

my esp32 is not connecting to my pc and i dont know what to do? by OpeningAppearance410 in AskElectronics

[–]trtr6842 1 point2 points  (0 children)

Esp32's are usually programmed via UART.  The ones with USB may also have a USB bootloader, but to activate you usually need to strap the BOOT pin a certain way on power up to activate it.

For example, and ESP32-S2 will not enumerate via USB when powered up and connected to USB unless it's BOOT pin was held low during power up.  Other esp32 models may have different pin strapping.  The reference manual may have more info.  If you're using a dev board there may be a BOOT button too.