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.
 
  • Post
  • Reply
ryanrs
Jul 12, 2011

Recovery Points Installed

My recovery points are back from Electro Plating Specialties. They're zinc plated with black chromate passivation. EPS said the only difference between yellow and black is the dye in the chromate bath. The part has a deep, glossy black finish. Cost was $140 (zinc plating minimum fee). Pretty pricey to do a couple parts at a time, though.

We'll see how the plating holds up after being dragged across the desert. The zinc will definitely get scraped off on rocks, but my hope is that the galvanic protection from nearby intact plating will keep the rust minimal.


Before plating.



Black zinc.



Installed.



Inside EPS.

Adbot
ADBOT LOVES YOU

Darchangel
Feb 12, 2009

Tell him about the blower!


ryanrs posted:

Recovery Points Installed

My recovery points are back from Electro Plating Specialties. They're zinc plated with black chromate passivation. EPS said the only difference between yellow and black is the dye in the chromate bath.

This is correct. It doesn't need to be any color at all, actually (undyed chromate makes the zinc a brighter silver.) We're just used to the gold color from the old cadmium plating, and it really does look cool when done right. You get that multicolor effect.

quote:

The part has a deep, glossy black finish. Cost was $140 (zinc plating minimum fee). Pretty pricey to do a couple parts at a time, though.

We'll see how the plating holds up after being dragged across the desert. The zinc will definitely get scraped off on rocks, but my hope is that the galvanic protection from nearby intact plating will keep the rust minimal.



Black zinc.

Man, I wish I could get my black chromate to look that nice. For that matter, I wish I could get my zinc to be as bright as industrial places get it without post-processing, but a lot of those processes, especially the brightener, are closely guarded trade secrets.


Those recovery points look aces, and plenty strong. Nice work!

ryanrs
Jul 12, 2011

Darchangel posted:

We're just used to the gold color from the old cadmium plating, and it really does look cool when done right. You get that multicolor effect.



Just got these parts from SendCutSend, using their plating service. This is their yellow zinc chromate. It looks really nice, though definitely not cosmetic (at least by default). For a nicer finish, you might want to to ask them to grind the tabs and clean off the laser scale on external edges.



I'm pleased how symmetrical they came out. Each part was designed completely separately, measured from molds/jigs(?) made of polycarbonate bits glues together with JB weld.




Fit is good, though it could hug the frame more closely. Maybe I was too generous with the clearances. It will be interesting to see how the plating handles corrosion from the mud and sand that's going to accumulate between the frame rail and the bracket. The van frame is galvanized in this area.

When fully assembled, the mid skid plate mounting bolts will pass through these brackets. Upward force from impacts will press up on the bracket, to be transmitted to the edges/sides of the frame rails, where they are strongest. It's basically a load spreader to more efficiently couple forces to the unibody structure.

Cost was $35/ea. They are laser-cut 3/16" mild steel, with 2 bends and a yellow zinc chromate finish.


e: better pics of the templates (that's the word! thx Raluek)


The plastic rails are tubes that new silicon chips are shipped in. And by 'new', I mean obsolete stuff that isn't packaged in tape and reel.

ryanrs fucked around with this message at 06:45 on Mar 5, 2023

Raluek
Nov 3, 2006

WUT.
gently caress, using polycarb for mock-up template so you can easily see through it for where you need to put your holes, why didn't i think of that. another addition to the mental toolbox

ryanrs
Jul 12, 2011

Hold up the plastic, mark hole.

Drill hole and use it to bolt the plastic to the car.

Then glue down more plastic bits and nudge them up against car features to capture the shape. JB Weld cures really slowly, so you can push stuff around and get it perfect.

Rick
Feb 23, 2004
When I was 17, my father was so stupid, I didn't want to be seen with him in public. When I was 24, I was amazed at how much the old man had learned in just 7 years.

ryanrs posted:



Google Street View confirms.

e:

Ah, but check out the landscaping.

I love this building.

ryanrs
Jul 12, 2011


Bear Radar transmitting packets using LoRa+FHSS.

Bear Radar work continues
All the major firmware pieces seem to be working now. I think the next step is getting some kind of command line interface running, maybe some scripting.

Language possibilities:
- Tcl
- Lua
- Embedded Python variant
- ?

Command line:
Either an interactive interpreter for the scripting language, or maybe something like Cisco's IOS syntax.

Platform hardware:
- 32-bit ARM Cortex-M4 @ 64 MHz
- 1024k flash
- 256k RAM

I am looking for a language that will play well with my C code, aggressive power management, and Nordic's BLE SoftDevice. I don't want something that's going to try to replace the entire software stack from the bootloader up.

Other unimportant things are low-level hardware support and big repositories of 3rd party libraries. I don't need to be able to twiddle GPIO or configure SPI peripherals from a script. It will be more for supporting development and orchestrating high-level behaviors.

kastein
Aug 31, 2011

Moderator at http://www.ridgelineownersclub.com/forums/and soon to be mod of AI. MAKE AI GREAT AGAIN. Motronic for VP.
Clearly the answer is common lisp, Erlang, or Haskell.

(This is not a serious suggestion don't do this)

Safety Dance
Sep 10, 2007

Five degrees to starboard!

I was gonna say TinyGo, but that's my answer to everything and I've already forgotten what microcontroller you were using.

LightRailTycoon
Mar 24, 2017
Forth!

Commodore_64
Feb 16, 2011

love thy likpa




I've done a bit with Nordic's pre Zephyr stuff, mostly integrated libraries and HAL. I really am curious what sort of things you will come up with to do with a scripting layer. The Nordic bootloader / over the air update ble service is pretty nice and useful, I recommend you keep that at all costs.

ryanrs
Jul 12, 2011

Commodore_64 posted:

I've done a bit with Nordic's pre Zephyr stuff, mostly integrated libraries and HAL. I really am curious what sort of things you will come up with to do with a scripting layer. The Nordic bootloader / over the air update ble service is pretty nice and useful, I recommend you keep that at all costs.

I want the system to be field-hackable to do new stuff, without a laptop + firmware dev environment. That includes configuration, monitoring, and system debugging. Not "why did my device crash" but more like "why is reception so lovely? let's change the modulation parameters, or alter the re-transmit logic". I want to do this from my phone or maybe a tablet.

It would be very nice if I could send useful queries/functions in a single 200 byte packet, so I don't need to worry about fragmentation. Terse and expressive syntax is good. A compact, portable bytecode would be even better.

I need an interactive shell to type in. Part command line shell, part debugger shell. Some kind of doc/help system, tab completion, and introspection, so you can look around, list available interfaces, etc. I want this shell to run on the Bear Radar, not on my phone.

Phone
||
|| bluetooth serial
V
Bear Radar #1
||
|| bytecode over LoRa
V
Bear Radar #2,3,...

Max resource usage:
500 kbytes Flash
100 kbytes RAM

(but that's half the chip, so try to use less)


The broad goal is that the system should be powerful enough, and flexible enough, to allow Scotty to jury-rig it and save the day.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Doesn't Zephyr have a built in serial console?


So maybe your scripting requirement is python on your laptop, sending serial commands OTA

ryanrs
Jul 12, 2011

Zephyr looks pretty interesting.

So yeah, there's a whole other question of what should be the underlying OS/kernel/RTOS. Right now, I am using Adafruit's Arduino APIs implemented on top of Nordic's nRF52 SDK and FreeRTOS. This platform has some quality-of-implementation issues, such as lack of thread safety in memory allocation (and thus printf), so a lot of the standard library is unsafe to use outside of the main loop() task. The Arduino APIs also ignore the nRF52 DK's resource allocation APIs, for example getting a free PPI or GPIOTE channel.

On one hand, I sure would like to get rid of all traces of Arduino.

On the other hand, I like not having to write and debug code to talk to all these sensors and chips.


Maybe I need to move to a more sensible framework now, before things get too out of hand?

ryanrs fucked around with this message at 03:00 on Mar 15, 2023

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
I would generally go with the lowest resistance path to framework. Your other list of requirements is secondary.

ESP32? Use the built in ESP-IDF based on FreeRTOS, no other option.

Other venders, you have the option of an RTOS or a HAL, usually from the vender. I would go with an RTOS, but that's very much user choice, it comes with a lot of complications.

Nordic? I'm not 100% sure, but I thought they were pushing for Zephyr. ST integrates with FreeRTOS

ryanrs
Jul 12, 2011

Lowest resistance is this stuff from Adafruit, since I'm using their dev board. But it makes it hard to use Nordic's low level APIs, which I need to use the hardware peripherals. I want to do sophisticated stuff with the nRF52840 task and event system.

But if I get rid of the Arduino layer, then just Nordic HAL + FreeRTOS seems decent.

e: Looks like Nordic's current/favored platform for this stuff is nRF Connect SDK.

My Adafruit dev board is pretty generic. Power, crystal, couple LEDs, 2MB QSPI flash. Unfortunately I don't have easy access to the SWDIO/SWCLK pins (though I could bodge it for future boards).

ryanrs fucked around with this message at 03:35 on Mar 15, 2023

Cactus Ghost
Dec 20, 2003

you can actually inflate your scrote pretty safely with sterile saline, syringes, needles, and aseptic technique. its a niche kink iirc

the saline just slowly gets absorbed into your blood but in the meantime you got a big round smooth distended nutsack

is this still the thread about a dude driving a lifted toyota minivan. i had to double check the title

Raluek
Nov 3, 2006

WUT.

OMGVBFLOL posted:

is this still the thread about a dude driving a lifted toyota minivan. i had to double check the title

the minivan is now augmented

Platystemon
Feb 13, 2012

BREADS

OMGVBFLOL posted:

is this still the thread about a dude driving a lifted toyota minivan. i had to double check the title

It’s a lifted Toyota minivan that’s loaded for bear.

Kesper North
Nov 3, 2011

EMERGENCY POWER TO PARTY

OMGVBFLOL posted:

is this still the thread about a dude driving a lifted toyota minivan. i had to double check the title

it's getting a deployable sensor network, it's going to be the all-seeing sienna

Platystemon
Feb 13, 2012

BREADS
It’s going to be like the XCOM battle scanner.

LightRailTycoon
Mar 24, 2017
Toyota Panopticon

Hollow Talk
Feb 2, 2014
It’s going to be the Mako from Mass Effect. Probably drives similarly, too.

Platystemon
Feb 13, 2012

BREADS
https://www.youtube.com/watch?v=G38QRmA4LMw

Commodore_64
Feb 16, 2011

love thy likpa




I'll also add that there appears to be a micropython Zephyr port. I sort of want to try this, but all my Nordic dev kits are too old for Zephyr ;.;

Edit: I bought a new 53840 Dev kit, I really want to try this as I've wanted a BLE-Zigbee bridge for a work project for a while and I might learn a thing or two.

Commodore_64 fucked around with this message at 15:19 on Mar 15, 2023

ryanrs
Jul 12, 2011

OMGVBFLOL posted:

is this still the thread about a dude driving a lifted toyota minivan. i had to double check the title

The van is mostly working right now, and it's been pissing rain over the entire state, so it's a good time to work on tech upgrades.

With this recent bout of software development, I've proved out enough board functionality to design it into my off road lighting controller. That will control my off road lights, backup camera, and some other stuff. For example, I'd like to be able to unlock the van from my phone.

Later this month I'll probably go on a trip somewhere.

Cactus Ghost
Dec 20, 2003

you can actually inflate your scrote pretty safely with sterile saline, syringes, needles, and aseptic technique. its a niche kink iirc

the saline just slowly gets absorbed into your blood but in the meantime you got a big round smooth distended nutsack

i figured, it was just funny to check on an old thread and see a wall of radio shack rear end gibberish

actually, now that i think about it, making the off-road sienna an Internet Of Things gizmo is probably very much in line with the "he did what to a what" theme

ryanrs
Jul 12, 2011

But if you want to add bluetooth entry to your car, the first step is picking a bluetooth chip, then you design the circuit, then you write the iphone app, etc.

At least that's how I think it's supposed to work?

ryanrs
Jul 12, 2011

SoC Peripherals

There are two hardware functions used in the Bear Radar that depend on traditional microcontroller timer capabilities. I feel like these are not especially esoteric uses.


GPS Input Capture

Run a counter at 8 MHz, and take snapshots of the counter value when the GPS PPS goes high. Also capture timer snapshots when the radio IRQ line goes active. This gives sub-microsecond, GPS-accurate timestamps for radio activity and other interesting things. This is the precision heartbeat for the Bear Radar system.

Any microcontroller can do this. 30 year old PICs that need to be erased with UV can do this.


LED PWM

4-phase PWM for dimming the LED floodlight. To minimize flicker, the PWM signals should be 90 degrees out of phase.

A lot of micros will have issues with this, and end up needing 2 or 4 timers to implement 4 phases with shared period but independent on and off times (requires 8 compare outputs). The nRF52840 can do it with 2 timers.


And I want these functions to run even when the CPU is asleep. The idea is to do these things entirely in dedicated hardware, not with interrupts or (god forbid) polling. Again, the nRF52840 can do this fine, and I have it working already.

The catch is that I have it running as a mess of Adafruit Arduino and Nordic nrfx APIs. The Adafruit code itself uses nrfx internally, but doesn't export enough info for the application to cooperate. For example, I can't set a pin interrupt using the Arduino API, then ask it what GPIOTE channel it assigned, and muck with it in nrfx. So I have to do things like assign Arduino pin interrupts in a certain order, and rely on it using GPIOTE channels 0, 1, 2 in order. It works fine, but it's kind of a gross hack.

So before I start porting my code to Zephyr, I need to know: is it better? Does Zephyr expose APIs that I can use to implement input captures and multi-phase PWM? Or barring that, does Zephyr play well with mixed nrfx code?

https://devzone.nordicsemi.com/f/nordic-q-a/74248/setup-input-capture-in-zephyr

https://docs.zephyrproject.org/latest/samples/boards/nrf/nrfx/README.html

quote:

Zephyr GPIO driver is disabled to prevent it from registering its own handler for the GPIOTE interrupt.

Oh, you can setup nrfx timer captures if your application disables Zephyr GPIO. That's a red flag!


I've only been looking at the docs for a day, so maybe Zephyr support has improved. Maybe I am misunderstanding this stuff?

But if I have to do everything behind the back of my RTOS/framework, then maybe I'd rather work around Arduino, as it's a lot simpler and smaller than Zephyr.

ryanrs
Jul 12, 2011

Project Status: Turing Complete

code:
560 ~$ screen /dev/tty.usbmodemFA214401
Connected to vanlink.
lua> print(temp())
26.625
lua> print(temp()*1.8+32)
79.925
lua> 
I gave the Bear Radar a second virtual serial port, and connected it to Linenoise and Lua.

Now I can write programs for my program.

Nystral
Feb 6, 2002

Every man likes a pretty girl with him at a skeleton dance.

ryanrs posted:

Project Status: Turing Complete

code:
560 ~$ screen /dev/tty.usbmodemFA214401
Connected to vanlink.
lua> print(temp())
26.625
lua> print(temp()*1.8+32)
79.925
lua> 
I gave the Bear Radar a second virtual serial port, and connected it to Linenoise and Lua.

Now I can write programs for my program.

IIRC you said Bear Radar was also a demonstration to show you can take an idea from conception to production. Is that that still a goal for you with this? As a layperson it’s highly impressive.

ryanrs
Jul 12, 2011

Well, maybe not to completion, but at least far enough along that the application programmers can write their code.

I think those initial stages--circuit design, BOM selection, low-volume manufacturing, board bringup, firmware--are in general less accessible than mainstream software development. Not because it's harder, it's just that fewer people do it. And it's more expensive as a hobbyist, because you're paying for labor and physical goods, not just moving bits around.

So if I was interviewing at a <10 person startup, possibly one with no hardware engineers on staff, my pitch would be something like "yes, I can design a custom board, get it debugged and running, and get 50 manufactured". The idea is to show the hardware capabilities built into the Bear Radar, and let them envision their product in its place. Add if I can get 10 Bear Radars manufactured overseas for hobbyist money, then I can get 100 of their devices made, which will provide for internal developer usage, showing to investors, etc. Turning all that into an actual commercial product and scaling manufacturing is beyond my experience, but I think management can usually imagine themselves solving those problems.

If it's a bigger company with strong internal hardware expertise, then I guess we'll talk shop about ARM microcontrollers or minivans or something.


Anyway, this seemed like a great plan before all the tech company layoffs.

Kesper North
Nov 3, 2011

EMERGENCY POWER TO PARTY
At least you're well prepared for hashtag vanlife!

ryanrs
Jul 12, 2011

Gotta get some yoga clothes and monetize my insta.

ryanrs
Jul 12, 2011

ryanrs posted:

M18 Ham Radio
I want to make a power converter so I can run my 50W ham radio off my M18 chainsaw battery. I want to be able to take the radio out of the van, and hike it to the top of a ridge to get reception.

Taking a break from Bear Radar software to work on the power converter project.

I'm using an off-the-shelf TDK DC-DC switching module based on the LT8390 4-Switch Buck-Boost Controller.



Key specs:
9-36V input
8-24V, 20A output
300W max
Smoothly transitions between step-up and step-down, as needed.

The module is more-or-less the circuit from the LT8390 datasheet, pg 28.

Building on that switcher module, I need to add my own circuits for:
+100V / -40V input protection
Undervoltage shutoff (prevent over-discharge of li-ions)
Adjustable output voltage (run radios vs charge car battery)
Display input and output voltage, output current, watts
User Interface in general
Fan for cooling
Fuses
Connectors
Enclosure

So the TDK switching power supply module is only about 20% of the project. The other 80% is stuff required to turn it into a rugged and useful device.




Trying out component placement on the power PCB. It's 150x80mm and has all the power circuitry, protection, and metering. All functions are controlled over I2C. It's sort of a "power supply super-peripheral".

Power board key parts:
LTC4365 Overvoltage, Undervoltage and Reverse Supply Protection Controller
LTC2946 Wide Range I2C Power, Charge and Energy Monitor
LT8631 100V, 1A Synchronous Micropower Step-Down Regulator
p.s. BOM costs don't matter when you're only building one device

Not shown (or designed yet) is the processor board which has all the knobs, switches, and other UI elements. It'll use some kind of ARM microcontroller, doesn't really matter which one.




Front panel brainstorming. Two pushbuttons, two rotary switches. It's dominated by the fan, which is unfortunate, but none of the other surfaces are large enough to hold a 50mm fan.


Operation

First set the Under Voltage Lock Out (UVLO). If the input voltage drops below this setting, the power converter shuts off. This is to prevent over-discharge of lithium batteries, and might prevent draining your car battery all the way.

Then set the desired output voltage. Use 12V if powering 12V stuff. Use 14V to power heavy duty devices like a tire inflator or ham radio. These high drain devices work better at 14V, which is the battery voltage when the engine is running. The 15-18V settings are for charging car batteries with minimal finesse. Not sure what the 20 and 24V settings are good for.

Press "ON". That 'commits' the knob settings and turns on the switcher. Changing the knobs does not change the output unless you press ON again.

Press "OFF" to shut off the output.

It would be pretty unfortunate to bump a knob or button and accidentally send 24V to your ham radio. I'll 3D print a shroud to protect the ON button.


I've ordered several pushbuttons with different mechanisms, to see which feels best. One of them has a 58 oz detent, which should click like an automatic center punch.

The screen is an afterthought. Originally there wasn't supposed to be one. But since the microcontroller already knows all sorts of useful things like input voltage and output current, it would be silly not to display it. Now it's crowding up the front panel, and it's not even a very nice looking screen (128x64 OLED).

I am vaguely considering making the whole device larger to get better proportions between the screen and buttons, ha ha. Maybe I just need to make the font smaller?


Once this thing is built, I want to hook up the following:
M18 12Ah battery --> my power converter --> 300W AC inverter --> Milwaukee rapid charger --> M18 6Ah battery

If I can drain a full 12Ah battery to charge an empty 6Ah battery to completion, I will consider that a huge success. This would require 85% efficiency at each of 4 power conversions (3 electrical, 1 chemical), for 50% end-to-end. Kinda like connecting all your socket adapters and extensions together, ha ha.

Platystemon
Feb 13, 2012

BREADS
You should take the van down to the lake, Tulare Lake.

ryanrs
Jul 12, 2011

Is there anything interesting going on there, or just a bunch of wet almond trees?

I’ve been waiting for the weather to clear up so I can head up to Tehama, but I think it’s still raining there.

Maybe I should go back down to Ocatillo Wells? I think temps were in the 80s this week.

Safety Dance
Sep 10, 2007

Five degrees to starboard!

What are you using to model the parts you're sending to Sendcutsend?

ryanrs
Jul 12, 2011

Solidworks. I model it in 3D, then export a DXF of the face I want them to cut. It kinda feels like overkill for flat shapes, but it is very nice for bent parts.

Adbot
ADBOT LOVES YOU

ryanrs
Jul 12, 2011

Exhaust Leak


that's not really smoke

I would like to fix/improve this minor exhaust leak. The flange has a lip inside, so the gap isn't as big as it appears. It's not loud. This flange is downstream of the cat, before the muffler.

Would this be a candidate for some kind of muffler cement? It needs to be removable (perhaps with a hammer?). But it really doesn't matter if it fails on a trip. I might not even notice until I got home.

Has anyone used J-B Weld Muffler Seal or similar products? I am definitely looking for a cheap, half-rear end, 3-6 month solution (that I can repeatedly reapply).

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply