Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Cybernetic Vermin
Apr 18, 2005

much as i love apl-derived stuff, the point about forth is that it does manage a weird sort of high-level programming while requiring almost no runtime whatsoever (rawer than c for the most part), and it is very predictable and friendly in how it uses memory. notably it basically has a stack (where almost all actual work happens), a small dictionary for words, and then it has the concept of "blocks", which are small (1024 bytes) chunks of contiguous memory, which is what forth code will usually operate on (forth classically does not have a concept of a file). obviously this means that forth has very little need for a simple address space or mmu, since it is expecting to work on fragments of memory as a matter of design

apl and lisp by cocmparison are all implicit temporary memory being thrown around. they are also high-level in a very different sense, but forth is indeed pretty friendly to work with once one gets the hang of it (which does not take long), it is entirely extensible, gets quite readable, and it is good with dynamic loading and changing of code etc.

Adbot
ADBOT LOVES YOU

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.
i wonder if any adaptation would be needed to make simple forth code run on both a Canon Cat and an old power mac's open firmware interpreter

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.
thanks for the LTSpice suggestions -- i think i am figuring it out

here is the tachometer reader thingy again



sooo I downloaded the real trace from my scope and figured out how to load it in SPICE to gently caress around with the circuit and see what happens. quite fun actually and very educational.

one of the things i somehow missed before is that the initial pulse also spikes to -80v or better, like a classic inductor field collapse pattern. that was really messing things up so i put a flyback diode (d1) and small resistor (r1) into the circuit to deal with it. those components handle the oscillation nicely, but can anyone foresee any problems with including them there?

also, having the increased resistance there meant I had to change some of the filter settings to get them to work correctly and yada yada in the end I wasn't sure that there was enough current showing up to drive the optoisolator directly. so i put in a MOSFET to make it voltage-controlled instead of current-controlled and that appears to work well in the simulation.

any pro EEs who would be willing to check my work?

Sagebrush fucked around with this message at 18:56 on May 26, 2017

EIDE Van Hagar
Dec 8, 2000

Beep Boop

BobHoward posted:

idk about the rest but the answer to the last is that forth dudes are weird and super dedicated to doing everything in forth and insisting that no, your fancy modern technology is worthless next to the glory of forth

that green chips thing and the earlier forth chips like the mup21? designed by chuck moore (the deity of the forth world) in eda software he wrote himself, in forth, on what amounts to an os he wrote himself, in forth. it's almost like the losethos guy except there's more of them, their religious obsession is forth, there isn't any overt racism or other horrible stuff, and they're actually rather shockingly competent engineers, some being legit geniuses. just geniuses who are obsessed with forth.

i guess my analogy is bad because they're not really much like losethos guy except in one narrow way, devotion to near total rejection of technology developed outside the weird niche/bubble they've created for themselves

yosposter gazpacho has written up a couple trip reports from attending some of the yearly silicon valley meet ups of the fortherati, he can probably be more informative

had an ion implanted that ran on forth at my last job. the support engineers were exactly like this.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

All forth users look like this fyi

Cybernetic Vermin
Apr 18, 2005

the page of heavy-hitting forth-supporting posts

Luigi Thirty
Apr 30, 2006

Emergency confection port.

even I have not used forth

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.
i know i keep spamming this thread but i am finding this stuff p cool

the version of that thing i posted above was annoying to me bc the flyback still acts like a short across the coil, so here is another one that just rectifies and smooths the signal and feeds into a comparator



this version also shorts the coil but it's continuous and it's through (currently) 2000 ohms, which is about 1000 times the coil resistance. so that shouldn't cut much energy out of the spark. decisions decisions.

e: and i suppose there's no real problem with swapping the resistors to 10k and c1 to 0.1uF and then we're talking about only a few microamps shunted away from the coil

Sagebrush fucked around with this message at 03:21 on May 27, 2017

Bloody
Mar 3, 2013

ya a big fat input resistance when you've got a low impedance source like that n you're just interested in the voltage and it's not some super high speed application is totes legit

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Luigi Thirty posted:

even I have not used forth

you could build a tight Forth in 65816 assembly and then use it for your IIgs hacking

ever think of building any Apple II hardware to interface with it? you've got lots of slots...

gonadic io
Feb 16, 2011

>>=

Sagebrush posted:

i know i keep spamming this thread but i am finding this stuff p cool

fwiw i'm also finding your stuff really cool. especially since my rust arduino project has kinda stalled

longview
Dec 25, 2006

heh.
have you tried wrapping a few turns of wire around the coil and picking it up inductively? or maybe just making a simple current transformer on the coil return line

it might actually be a cleaner signal, isolated, and less worry about affecting circuit operation (it will obviously still tap some energy from the inductor, but maybe a very small amount)

capactively coupling it by just putting an electrode near the coil output would also work, but might be more sensitive to interference than an inductive pickup.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

eschaton posted:

you could build a tight Forth in 65816 assembly and then use it for your IIgs hacking

ever think of building any Apple II hardware to interface with it? you've got lots of slots...

they make blank prototyping cards but I'm not much of an EE beyond loving with arduinos

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
then Apple II stuff should be pretty simple since it's much slower and wider

Midjack
Dec 24, 2007



eschaton posted:

then Apple II stuff should be pretty simple since it's much slower and wider

much like your mom

Sapozhnik
Jan 2, 2005

Nap Ghost
wow, rude

Spatial
Nov 15, 2007

nvidia is using RISC-V to replace their onboard microcontroller Falcon. guess it's got legs

Star War Sex Parrot
Oct 2, 2003

Spatial posted:

nvidia is using RISC-V to replace their onboard microcontroller Falcon. guess it's got legs
yeah here's a video from about a year ago explaining what they're doing with it

https://www.youtube.com/watch?v=gg1lISJfJI0

movax
Aug 30, 2008

Spatial posted:

nvidia is using RISC-V to replace their onboard microcontroller Falcon. guess it's got legs

i think some of the chinese fab houses may be inclined to move towards it -- no licensing fees for something you make 100M+ of? woo hoo!

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull
yeah risc v seems like a no brainer in any application which doesn't care about fmax or super low power, and binary compatibility with arm is not an issue. it's not going to displace arm any time soon but should pop up in all sorts of deeply embedded control stuff

Chill Callahan
Nov 14, 2012

Star War Sex Parrot posted:

yeah here's a video from about a year ago explaining what they're doing with it

https://www.youtube.com/watch?v=gg1lISJfJI0

motherfreakin dave patterson asking a question

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.
i have been workin on the motorcycle thing and hopefully should have some real cool results soon but i just gotta say god drat, it is SO nice having this digital oscilloscope. having the ability to sample 4 channels at once and pause waveforms and zoom in and watch every piece of the circuit doing its thing. like i'm looking at a trace of a 20-nanosecond-long ringing from the inductance of a 6 inch long piece of wire, holy poo poo. feelin like doctor manhattan: "I have witnessed events so tiny and so fast, they could hardly be said to have occurred at all."

fuckin bad. rear end.

every electronics hobbyist who doesn't own a DSO should go out and buy that rigol 1054 immediately

Bloody
Mar 3, 2013

oscilloscopes loving own. make sure to actually read the manual, too, especially when working with higher end scopes. they can do literally everything. love blowing all my coworkers minds, no matter how senior, with wild rear end triggers

big shtick energy
May 27, 2004


are there fancy scopes that allow you to basically script a trigger? like "if data bus 1 value is 0xABCD and then within 20us there is a low pulse on analog line 1 lasting less than 10ns, wait 100ns and trigger"

i mean it's academic because we can't afford anything like that

Bloody
Mar 3, 2013

you might be able to do that with an A-B trigger on a sufficiently fancy scope. set up a data trigger on A then the pulse less than x duration trigger on B then set the delay right

ChiralCondensate
Nov 13, 2007

what is that man doing to his colour palette?
Grimey Drawer

DuckConference posted:

are there fancy scopes that allow you to basically script a trigger? like "if data bus 1 value is 0xABCD and then within 20us there is a low pulse on analog line 1 lasting less than 10ns, wait 100ns and trigger"

i mean it's academic because we can't afford anything like that

the sweet rear end $$$ tek scope we have at work can if you pay more $$$ for the i2c or whatever else software unlocks

JawnV6
Jul 4, 2004

So hot ...
yeah back when i was paid to use big fancy LA's you could set up state machines that triggered logging

like "when you see this address come in over PCIE start sampling until $mangled address goes out over DDR"

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.
hell yeah you guys it works

designed a filter/comparator circuit that I'm happy with, simulated it in SPICE, got results that suggested they should work


built the circuit


connected to motorcycle


oh holy poo poo the scope trace looks exactly like the simulation


aaaaaaaaaa


boooooooieeeeeeeeeeeeeeeeeeeee

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Nice!

grats on making a real Thing that works like the simulation does

Midjack
Dec 24, 2007



Sagebrush posted:

hell yeah you guys it works

designed a filter/comparator circuit that I'm happy with, simulated it in SPICE, got results that suggested they should work


built the circuit


connected to motorcycle


oh holy poo poo the scope trace looks exactly like the simulation


aaaaaaaaaa


boooooooieeeeeeeeeeeeeeeeeeeee

excellent

Hunter2 Thompson
Feb 3, 2005

Ramrod XTreme
super cool!

Bloody
Mar 3, 2013

matches the simulation? what is this sorcery

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.

Luigi Thirty posted:

Nice!

grats on making a real Thing that works like the simulation does

Thanks. Personally I'm more proud of being able to work the simulation accurately enough that the results I get are representative of the real world and not just total junk

Like sometimes my students will ask about doing an FEA simulation of their part in SolidWorks, and I ask "what are you going to make it out of?" and they're like "wood" and I'm like "ok, that's anisotropic, so what's the Young's modulus of the wood you're using in each axis"? and they're like "what" and I'm like "hahahahahahaha"

One thing I noticed that is different is the real world capacitance at C1 appears lower than in the simulation. I believe that has something to do with derating capacitors at high frequencies and voltages. Still works tho

Sagebrush fucked around with this message at 01:42 on Jun 4, 2017

Bloody
Mar 3, 2013

also caps have absolute garbage tolerances

hobbesmaster
Jan 28, 2008

Bloody posted:

also caps have absolute garbage tolerances

one thing I remember from circuits lab was that the big capacitor in our kits had a 20% tolerance

mine was actually 25% under spec

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.
I wonder if we have any trimmer caps in the right range sitting around the lab. That might be neat to experiment with

Is there a way to measure the actual capacitance of little tiny capacitors that doesn't require a mega expensive meter? I suppose I could do it with my scope and a precision measured voltage and resistor, but my Fluke meter, though pretty accurate, only goes to 4 digits so I don't know if I could really analyze these little 10 nanofarad dealies

Another solution of course would just be to bring the capacitor rating way up and the resistors way down, since bigger capacitors seem to be a little more accurately manufactured, but then I'd start to worry about shunting too much power away from the coil circuit. Right now the reader circuit has like 150 kiloohm impedance and the engine doesn't miss a beat

Sagebrush fucked around with this message at 01:51 on Jun 4, 2017

hobbesmaster
Jan 28, 2008

Sagebrush posted:

I wonder if we have any trimmer caps in the right range sitting around the lab. That might be neat to experiment with

Is there a way to measure the actual capacitance of little tiny capacitors that doesn't require a mega expensive meter? I suppose I could do it with my scope and a precision measured voltage and resistor, but my Fluke meter, though pretty accurate, only goes to 4 digits so I don't know if I could really analyze these little 10 nanofarad dealies

you have a good scope. calculate the time constant and use your good dmm to measure the resistor

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
That's some cool poo poo right there

Would an indirect measurement with a magnet and hall sensor on the chain work ?

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.
this particular bit is for the tachometer, so no -- measuring from the chain/sprockets would give you wheel speed. to get engine speed i need to read something coming from the engine before the gearbox, so as detailed earlier in the thread, that means
1) the existing signal that drives the stock tachometer (what i did)
2) wrap a wire around a spark plug lead and count those pulses inductively (reasonable, but I don't want to add extra wires running all over the bike if possible)
3) patch into the spark generator unit's pickup (don't want to splice the wires to something so critical)
4) add a hall/optical/inductive/other sensor directly on the crankshaft (way overkill, far more complicated)

also i wouldn't gently caress with the chain either way. you really don't want to risk jamming or breaking it somehow. there are systems using magnetic reluctance to read the rotation of sprocket-like objects -- that's how an ABS system measures wheel rotation, for instance -- so i could theoretically get wheel speed by sticking something like that on the swingarm and counting rotations of the rear sprocket. however, i already have a really convenient spinning cable coming from the front wheel (drives the stock speedometer) and i have built a little adapter that takes that cable and spins a magnet in front of a hall effect sensor to read the front wheel revolutions, and hence distance and speed. so you are right on the money there.

Adbot
ADBOT LOVES YOU

Sagebrush
Feb 26, 2012

ERM... Actually I have stellar scores on the surveys, and every year students tell me that my classes are the best ones they’ve ever taken.
the way the stock speedometer works is super cool, btw. the spinning cable is connected to a ring-shaped magnet, and that magnet rotates at a 45-degree angle inside a metal cup. the metal cup is connected to the speedometer needle. as the magnet spins and its field goes in and out of the cup (bc half of it is inside and half is outside), it induces a current in the cup, which creates a counterbalancing magnetic field, so the cup is "dragged" along with the rotation of the cable. the needle is on a carefully balanced spring, and as the magnet spins faster, the pull on the cup increases and the needle is pulled further around the dial, stopping at whatever point the induced magnetic pull is balanced by the spring tension. slow down, field drops, spring pulls it back down the scale.

no electronic parts whatsoever, just electromagnetic physics.

  • Locked thread