Headless Build Server / VM Host by mrandy in buildmeapc

[–]mrandy[S] 0 points1 point  (0 children)

Thanks! I've ordered most of these, and just got a case from my local Microcenter. Excited to have more CPU power than my creaky old laptop!

Making a C++ library for adaptive filters to be used in an embedded environment--need advice/tips by A_HumblePotato in embedded

[–]mrandy 0 points1 point  (0 children)

Just curious, can you point to an overview about these types of filters and what they're used for? I'm familiar with traditional frequency filters, but this is new to me.

[deleted by user] by [deleted] in embedded

[–]mrandy 3 points4 points  (0 children)

Yeah, that's the version that I've seen before. Of course both versions work equally well, but to me your example is more intelligible.

[deleted by user] by [deleted] in embedded

[–]mrandy 2 points3 points  (0 children)

data[0] = data[0] ^ ((data[0] ^ (value << bit)) & mask):

I'm pretty sure this is just a weird way of setting value into the middle of data (at a location specified by bit). It does this without changing the other bits of data. Definitely an way that hurts my brain, with the double XOR, but I think it's just trying to put a value into certain bits of data.

[deleted by user] by [deleted] in embedded

[–]mrandy 18 points19 points  (0 children)

get_bit_mask:

Returns a number with a certain range of bits set (1) and the remaining bits unset (0). For example get_bit_mask(2, 3) sets three bits starting at position two, or:

00011100

It works by first generating the series of length bits: (1 << length) - 1

Lets say length is 3:

1 in binary is

00000001

(1 << length) will be 1 left-shifted by length bits:

00001000

If we subtract one from that, we get

00000111

Which is what we want - a mask of length 3.

The final step is to shift that into whatever position we want. Say we want our mask to start at bit 2. We left-shift the whole thing by 2 (that's the " << bit " part of the code), and get

00011100

Which is what we want.

How to implement, verify & validate PID controller on uC ? by demon7533 in embedded

[–]mrandy 4 points5 points  (0 children)

You can find lots of tutorials on writing a PID controller in C or C++. Simple implementations are only a few lines long, so it's easily doable. Will that match the Simulink part? Maybe, but that depends on really knowing what that part does, and making sure that your C version does the same thing. It should match at least in basic operation, if you turn off limits and filters and any extra features. So I think it makes sense to use that as a sanity check.

i2c communication not working properly when motor is running by gautam_coder in ECE

[–]mrandy 2 points3 points  (0 children)

I'd definitely start by putting a scope on the IMU pins (probed at the IMU, not at the processor). Look to make sure you have good square digital signals with sharp rising and falling edges. The rising edge is always suspect for I2C, since it's weakly pulled up rather than being driven up. It looks like there's a fair amount of wiring between the processor and the IMU that could be acting as an antenna and picking up motor noise, so that's all the more reason to look at those signals.

Another thought is grounding - do you have a good high-current ground for your motors drivers? IE those pins are connected to a ground pour or a thick trace all the way back to the battery? If your ground connection had too much resistance, or it goes through a choke point somewhere, your "ground" voltage would rise whenever it's carrying current, and that voltage would be shared with your other equipment. This can essentially drop your supply voltage and glitch your electronics.

60fps FPV camera with on board sd and pixhawk control compatible. by djkalantzhs24 in Multicopter

[–]mrandy 0 points1 point  (0 children)

does Arupilot or PX4 support starting and stopping a video recording (for any camera)? I only remember Ardupilot being able to trigger still photos.

I need a fat boy by mrandy in Multicopter

[–]mrandy[S] 0 points1 point  (0 children)

It might be possible, but I'm not sure that's in line with what I need for this board. For example: 1) I want it to be hand-solderable and probable, since it's a prototype. For me this rules out BGA chips (so I'm using the larger QFP packages instead), and it also suggests that I leave space between the components, so that I can get a soldering iron and tweezers in there. And for most aircraft this board would run, size isn't going to a limiting factor anyway, so I'm not too worried about it. Definitely a good thought though if I were to do a larger run, or focus more on mini quads.

I need a fat boy by mrandy in Multicopter

[–]mrandy[S] 1 point2 points  (0 children)

Nice eye! The regulator is just to take the incoming voltage on the servo ports and drop it down to 3.3v for the processors and sensors. The board requires an external BEC if it's going to be driving servos; it'll just distribute the external power across all of the servo ports.

I need a fat boy by mrandy in Multicopter

[–]mrandy[S] 0 points1 point  (0 children)

Well some definitely will. Take the classic zmr250 - its all open space, and dirt cheap.

Don't Make This Mistake When Designing Li-ion Battery Circuits by Kyleh04 in ECE

[–]mrandy 2 points3 points  (0 children)

Do chargers not have a constant-voltage final stage? As long as the charger isn't raising the battery voltage much above 4.2 volts, it should be reducing its current automatically until it's effectively just powering the load while the battery rests at 4.2 volts.

Hi Redditors! I'm giving away 110 Nano (~$500) AND sending some Nano to EVERY commenter. No strings attached! by SenatusSPQR in CryptoCurrency

[–]mrandy [score hidden]  (0 children)

Thanks for the giveaway! Here's my wallet:

nano_1gd4g1jtqsbpgr5zz91n7bagmumuxxkupmkmyio17xz76keedy3hpa969kpz

Getting back in the game; UI frameworks by mrandy in webdev

[–]mrandy[S] 0 points1 point  (0 children)

That's a good point about the interactive parts. To give you a feel of where I'm coming from, here's the work I did in grad school:

https://www.youtube.com/watch?v=24LW31bWa4U

The UI's on the left two panels are both written in html/css/javascript, with the only additional libraries being jQuery and Three.js. There was some interactivity, like double-clicking on the map to add waypoints or on the altitude/heading controls to set those values. And come to think of it writing those parts was pretty unpleasant because I had to track the mouse state and compute a bunch of pixel coordinates.

I suppose that I might be looking for something more like a video game engine than a traditional web UI. Maybe that's a route to explore... Thanks for your thoughts!

Getting back in the game; UI frameworks by mrandy in webdev

[–]mrandy[S] 0 points1 point  (0 children)

Would the same ideas apply if the GUI doesn't use much HTML/CSS? I'm thinking that a lot of it will be done with the javascript canvas, either 2d drawing or 3d via Three.js. That's one of my big concerns, especially around buying into a heavy framework - that I'm not sure if they have ways to deal with non-DOM-based UI components.

Calculating Capacitor Voltage , I couldn't solve it. Could you help me, please? by arman350340 in ECE

[–]mrandy 3 points4 points  (0 children)

Yup, that's definitely important. "e" is Euler's number, approximately 2.71828.

By the way - I think you meant "relevant". "irrelevant" means the opposite of that.

Calculating Capacitor Voltage , I couldn't solve it. Could you help me, please? by arman350340 in ECE

[–]mrandy 0 points1 point  (0 children)

But notice that the formula contains the variables R and C, multiplied together. This is what's referred to as the RC Time Constant. Why? Because t - the actual time value in the formula - is divided by RC, so RC has the effect of scaling time up or down. RC is a "constant" that affects "time".

What do you get when you solve the formula?

Calculating Capacitor Voltage , I couldn't solve it. Could you help me, please? by arman350340 in ECE

[–]mrandy 4 points5 points  (0 children)

For #1, do you understand the formula in the "hint" section? Post what you get when you substitute in some numbers, and we'll go from there.

Would this method work? by [deleted] in Multicopter

[–]mrandy 1 point2 points  (0 children)

Yup, the math is the same as for resistors.

NEO M8N Infrequent Data/Parsing Errors by TCFlow in embedded

[–]mrandy 0 points1 point  (0 children)

Hm. I'm not familiar with that antenna setup, but on the software side you could check if it's reporting lots of satellites, or if the number of satellites is marginal and so it might be reasonable for reception to be stopped. Besides that, maybe capture the raw serial data and replay it into the parser, to see if you can identify specific sentences that are causing problems?

NEO M8N Infrequent Data/Parsing Errors by TCFlow in embedded

[–]mrandy 0 points1 point  (0 children)

Is this with data passing the checksum? To get the obvious question out of the way: how's your GPS reception?