3 ms·
You probably will get a lot of google help for embedded stuff. Treat it like psuedocode even if its C++. Not as easy as adding a open source library and using
by VLM 13y ago
You probably will get a lot of google help for embedded stuff. Treat it like psuedocode even if its C++. Not as easy as adding a open source library and using it, but much easier than replicating the theory from nothing, or even worse not knowing a problem can exist.
Did you know, that if you make a control loop running basically newton's method of approximation (more or less), it can be statically stable in continuous analysis but when you run it on real world discrete math with short-ish rounded floating point it can get squirrely and oscillatey (are those even words?) so that's why you ram the output thru a low pass filter to damp out the oscillations. Or at least that's one way to fix it.
Oh another funny one is picking a local maxima / minima that randomly happens to have a near zero derivative. From memory Newton doesn't like that very much. Another funny one is any time you have tiny rounded floats divided by other tiny rounded floats, who knows what you'll get as an answer. You can fix that by fuzzing the input first guess with some random noise. Makes your execution speed non-deterministic, but stuff is fast now a days isn't it, and its faster than doing double/quad floating point anyway, which may or may not help much.
Sure the google found some python or fortran or mathematica which on the surface is useless, but psuedocode is psuedocode and compilable fortran is a tighter syntax than any random human generated psuedocode so in some ways its better.
This is before you hit the "well, that library speaks to 16x2 LCD displays, I guess I'll have to start over from scratch because I'm using a 20x2 LCD..." Well, typically, no.
For HFT I agree, you're stuck behind layers and layers of patents and trade secrets. But embedded is not a problem to get google-type help.
- derefr 13y ago> Did you know, that if you make a control loop running basically newton's method of approximation (more or less), it can be statically stable in continuous analysis but when you run it on real world discrete math with short-ish rounded floating point it can get squirrely and oscillatey (are those even words?) so that's why you ram the output thru a low pass filter to damp out the oscillations. Or at least that's one way to fix it. I encourage anyone who wants to get an intuitive grasp of simulations to just write a simple little 2D game engine, and try to work up toward a simple two-player realtime LAN system with predictive physics for expected network input. Seeing sprites shudder and vibrate against their integer pixel positions, jump instead of smoothly curving when a correction is issued, etc., is a visceral learning experience.
- SiVal 13y agosquirrely and oscillatey (are those even words?) Well, "chaotic" is what you'll read in textbooks, but that's just because they couldn't come up with "squirrely and oscillatey", I assume.