Recent Posts

Pages: [1] 2 3 4 5 6 ... 10 Next
1
Is this always guaranteed to work for integers:

int16_t Clamp360(int16_t value){
  value= value % 360;
  if(value >= 0){
    return value;
  }else{
    return 360 - (0 - value);
  }
}

In languages like C and C++ where % is modulo, not truly a remainder and therefore returns negative results when negativeNum % positiveNum is done.

I'd rather avoid resorting to sin, cos and atan2 because this needs to run fast on a microcontroller in the end, so I'm trying to avoid trig functions or proper dot and cross products. And I'd also like not to have a while loop which may go on for a very long time if it subtracts 360 each time.

I've tested for all integers -1080 to +1080 and it plots out the right graph for input vs output, but I've had nasty experiences with angle wrapping code before. I want to make sure this is right before I continue with any further code built around it.

Is this a guaranteed solution for signed integer variables? Will it also be one if floating point variables are used instead?
Thanks
2
Test Equipment / Heads up on MicSig Probe
« Last post by watchmaker on Today at 09:13:43 pm »
I was cruising and came across the DP10013 on Amazon.  It was $190USD but then Amazon provided a $35 coupon.  Of course I had to use it; but check and see if you get offered the coupon. I know for a fact I am not that special (except to my wife)(sometimes).
3
Beginners / Re: 555 driver and Transformer questions
« Last post by DanMann on Today at 09:09:48 pm »
can you explain to me what to look for in the schematic that shows a strong DC offset? C1, R1, R2 I gave no values, but can very close to a 50/50 time.
I think I am starting to understand the scope a little more with some reading.
Please help me if I am wrong:
Top picture shows a 0 voltage on one box down from center line, rises up to 5 volts with some spiked up to the 7.45 volts?
the very narrow spikes are the -35 volts?
It shows a 57% duty cycle which I assume to be based on the 0 to+5 volts?
this actually drives the transformer but think it can be better.
With 6Vdc input, how is it generating the -35 volts? Could it be feedback voltage from the HV made by the transformer?

I have been playing and can get a fairly square wave. Once I introduce the MOSFET I can get a very different wave where the drop to minus is thin but curves for the remainder of the time up to zero.
Being that the transformer is not yet connected I am thinking wrong MOSFET or maybe I damaged it.

Thank you for your help.

4
The duplicate net name may have to do with how you have the project structured.  Altium isn't very sophisticated about how it compiles net names across multi instance sheet symbols, so there are some ways to set up sheets and connectivity between them that will confound it.  It's entirely possible that whatever is causing the duplicate net names is also causing the designator problems, so you might want to try to resolve that first.

As for the board level annotate, you might need to delete the annotation file from the project and start over once you get.any underlying issues resolved. 
5
I would pay about 80€ like you had. But they are all around 140€... There is not much in it, its 95% air.

But i think one device would be good, as they have 2 channels which i could combine, to have them running synchronously.

My primary use at the moment would not be logic levels.
6
Security / Re: Microsoft repackages apps with a telemetry .NET wrapper
« Last post by madires on Today at 08:50:55 pm »
Unfortunately the GDPR enforcement is slow, especially when the Irish DPC is involved.
7
If I needed a new bench PSU, I'd choose between the GPP-4323 and the hackable SPD3303X-E. Budget would most likely be the deciding factor.
8
General Technical Chat / Re: Cable Management
« Last post by Smokey on Today at 08:45:25 pm »
My workbench is in a small bedroom and all my parts and cables are kept in the closet.
The clothes shelf in the closet is a wire mesh and I 3D printed a cable hanger to clip
onto the outer edge.


I do this.  One of these racks on the wall next to the lab bench.  Cables draped through slots.  Bonus feature is you get to also fill the shelf with junk!  Win-Win!
9
General Technical Chat / Re: Cable Management
« Last post by Smokey on Today at 08:43:24 pm »
Each individual cable loosely coiled inside a ziplock bag, with a descriptive label on a card insert. All the bags stacked filing cabinet style (on edge) so the labels are visible, in a drawer. Apart from mains leads, which breed when you don’t look at them.

With the bags, don't forget the desiccant packet and moisture monitor card!  That is, unless you are purging with argon.  Or better yet, full vacuum.
10
Beginners / Re: Convert US standard 115V to International 230V
« Last post by Jwillis on Today at 08:41:09 pm »
On a SMPS, frequency of the mains voltage doesn't matter because the mains power is rectified to DC then the frequency is set to a by the PWM for the transformer.
You have to be very careful when making such very general statements. A SMPS designed for 60 Hz will have greater ripple at the capacitor when connected to 50 Hz. Most of the time the capacitor will have enough margin but if the capacitor is very tight initially or if it loses some of its capacitance it could lead to problems.

I agree that the statement is a simplified explanation of how a SMPS works. But if you look at main stream switching power supplies on the market they are designed for a broad range of frequencies and input voltages. You need to choose a power supply rated for the application to which it is intended. There are SMPS's rated for medical applications. So why reinvent the wheel just get a power supply rated for your application. 
Pages: [1] 2 3 4 5 6 ... 10 Next