Another full suspension build

Show off your Ebike creation here.
Post Reply
User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 21 2020 10:08pm

Eh. . .

In national news...

If you *need* the upcoming stimulus check then you're in trouble. Batten down the hatches, the first wave is coming. . . . And I don't mean wave of free money :roll:

The economy always has a bunch of hanger'oners. This last six or nine months is definitely going to shake them loose.

The rich folks will make another run on housing. the gambler's will make another run on the stock market. The government will put us another two trillion dollars in debt. . .

Eh. . .

I'm ready.

...

Tools? Check
3 running cars? Check
More skills than last year? Check

Some new skills?

* PCB layout with KiCad
* IoT end to end
* Layout of USB, USBc, Ethernet
* IP67 cable-less assemblies
* Patience to drive for 2.5hrs a day
* Flexible Gas Line install
* 120/240, wire drop calcs, conduit fill calcs, drop from pole
* NFC, BLE, WIFI, 2G, 3G, 4G... From various arduinos
* AWS, about 5 of the services, signature V4 on embedded
* DT, DTM, DTP, and M-Series interconnect minutiae
* 1.8V digital logic, switched from 5V standard to 3.3V

... Last year?
That was charge point!
Thousand volt bi-directional distributed remote control Power supplies. . . In the hundreds of kilowatts. Four different charge standards, API back ends on all sorts of systems, got back into labview and test stand, database and test reports, Pogo pants and test fixtures. . .

Year before that?

:mrgreen:

I've been picking up skillz buddy. That don't pay all the time, but if you have enough of them. . . You can make more decisions in your life.

... I CAN put a product into production. . . And I don't mean just having some TurnKey outfit hold my dick for me. I'm talking about legit. Fully accountable.

. . . Just to get there you have to be able to set up pilot production. If you can't set up pilot production then you're not ready for real production :idea:

The 10X rule

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 8:54am

Example of how to Research / DownSelect

Problem being solved: Out of I/O pins, or want to switch to a module on a smaller footprint with fewer pins and more HP.

Example may be switching from an Arduino Mega to an Adafruit Feather. The Mega is huge, slow, and lame. . . but has many pins. The natural upgrade from a Mega is to a Duo... but those still come in the Mega footprint, which is too large. You can get a 32bit processor that has Mucho-more to offer - IF - you expand your ports.

Google: arduino port expander
(Note that I say "Google" and not "Search". If you are using Altavista or Microsoft. . . you are doing it wrong)

Once you get your results. . . you will need to make a decision.
* Go with something tried and true.
* Do your research, put in your hours, release.

Tried and True means
* Somebody else actually had success with it
* Drivers are available

These days most things work out of the box. . . but make no assumption. There are plenty of chips out there that will leave you RAW. Examples may be. . . that the chip is fussy on timing, fussy on voltage, fussy on temperature, ... the documentation may gloss over some feature you assume is there - whatever.

Go for Simple
Go for name brand

Drivers. . .
Are a significant portion of down-selection on anything. For PCB, you are looking for Symbols/Footprints/Models. For PCB components you are looking for Validated/Drivers/Friendly Package.

I mean...
The reason you buy a USB device is because it just magically works - right? What if I told you that I had a wireless mouse for sale, but there was no Bluetooth driver for it. . . and you had to write it yourself :?

... that is the reality that I exist in, FYI -> LOL

All I do over and over is go to Fry's, buy something like a Mouse... it has no driver, it has poor documentation, and I gotta make it work - LIKE NOW - on Linux, PC, or in this case Arduino.

SO
... Back to the Focus


Expand Ports

You expand ports by dropping a nice hardware chip on your board. This chip will take Serial and turn it into Parallel. We used to do this all the time..... pump 8 or 16 bits down a pipe, then flip it parallel. I remember when it was a big deal to be able to write the pipe without glitches appearing at the output :idea:

SO...
You can write the pipe with something like SPI or I2C. That is the most modern and those will come with drivers. You can also just slam-pipe it... so Data and a clock. It is basically SPI (IS SPI) but it never reads back (no MISO) and you dont really have to Chip Select...

So right off...
Dont do anything that does not scale. Even tho you can get any number of Software SPI emulators. . . that does not port downward well. Try to stick to a few hardware ports, let them do what they do well... and get on with it. Most of Arduino reality does not AT ALL address having interrupts going... so if you have done everything in Software Emulation and then you want to start getting some high priority interrupts going. . .

You are going to YEARN for the days of Actual, Real, Hardware Ports. . .

That do what they do . . . completely outside of the Critical Path.

...

Critical Path
An Arduino is single thread, single core, ... so a Program Pointer doing one thing at a time. You can JMP (Jump or GOTO) the Program Pointer to interrupts, but if you do so, all other execution stops. The only time you can do more than ONE thing at a time on a uProcessor. . . is if you use Hardware Peripherals.

Most common? UART.

Becoming very common? CAN.

These things can negotiate communication, stow a bite or 16,000 ... and you can go about your business until you are ready to deal with them.

SIDETRACKED

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 9:19am

If you are in the Military. . . you do not earn some status and then enjoy the benefits. You train and train and train.

If you are a CPA. . . you have minimum required training every year

If you are a Lawyer, Doctor. . . Required Training

... Engineers do not have (unless they sign up for) any kind of Board that requires them to complete coursework. . . but then they DO. If you do not use Engineering Skills, they become *very rusty* and you will find that it takes

hours
days
weeks
Even MONTHS. . .

To get the acids worked out of your muscles, do be able to run 4 laps, to be able to do 10 pullups, to be able to hold your breath for the length of the pool and back. (eh hem)

...

Right now ->
We are doing low level interfacing with 8bit/16bit/32bit embedded processors. That means low level comms - so...

SPI
I2C
UART
USB
CAN

There really are not others. CAN is relatively new, as is USB. SPI and UART are as native as native gets. I2C is a bastard herpe, but it has gained enough traction.

UART == USB == RS232
For all you are concerned.

UART goes thru FTDI or other chip to come up as USB on your machine.
UART goes thru a 232 or other chip to come up as ... oh wait... we dont use RS232 anymore :idea:

CAN and USB are now native in a lot of the 32bit machines. Slowly USB-C will take over everything. . . and that is part of what we will demonstrate here.

BACK ON TRACK
TOO MUCH DEPTH TO COVER
TAKE YOUR PRE-REQ CLASSES!

... :o

Google: List of Arduino's
Click: https://en.wikipedia.org/wiki/List_of_A ... le_systems
CTRL-F: "******" (in this case 2/3 down the page)


OK - Random selection that meets my keyword search.
I bet it works, because it is an Arduino
Crypto.png
Crypto.png (64.65 KiB) Viewed 182 times
It is called a "Teensy 4.0"
Sounds like a Porn Movie to me, but it has what I am after. Just like the videogame guys need GPU . . . those of us talking to the cloud need some Crypto support. Crypto is nothing but thousands and thousands of calculations. Doing this with the program pointer is 'tarded. Doing this in hardware -> WAS THE INTENT.

Quick Reminder that nearly all crypto was originally implemented in hardware*
Reference the CRC, or Cyclic Redundancy Check to start understanding this.
Just because we can calculate Crypto longhand. . . DOES NOT mean that we want to. (eh hem)

:mrgreen:

Reminder that your privacy is an illusion, as is your front door lock. I can open your front door in 3 seconds. I can get into your car in 2 seconds. . . Locks are for honest people (is what my Grandfather used to say) and encrypted information is ONLY a time delay

Encryption is ONLY a TIME DELAY folks... DO YOU UNDERSTAND THIS OR DO YOU NOT UNDERSTAND THIS?

frocking retarded. . . omfg.
Let me say it one more time.
Encryption. . . is not... like putting your papers in a safe.
It... is like putting your papers in a TIMED SAFE (like at a bank) where you can be assured that it will take some minimum amount of time before someone has access. During that time, you change passwords, change protocol, etc...

SO F'ING REMEMBER THAT :oops:

Ok... Peace be with you brother Schindler... Peace be with you....

[youtube]Ow_9MglZrhs[/youtube]

Ok... Ok... Its ok...
They will figure it out soon enough.... sigh...

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 9:25am

Now...
We have a controller we want to review.
We have a task we want to complete.

Task: Take the Teensy 4.0 and expand its ports out to 32
teensy40_front.jpg
teensy40_front.jpg (40.03 KiB) Viewed 181 times
That above. . . BAD ASS Arduino.
If you are still talking shit about Arduino. . . I wont even argue with you anymore. You will go to the back of the line and you will get NO SOUP

[youtube]ryNxl-lpOME[/youtube]

I mean it.
Do not joke around about how Arduino is not ready for prime time. If you do. . . FttA (Foot to the Ass)
coremark_barchart.png
coremark_barchart.png (43.54 KiB) Viewed 181 times
Uh... anybody else seeing that benchmark?????
How many times does 7 go into 2,314?
This machine is 350 times more bad-ass than a Mega. Even if you had a perfectly parallel problem to solve (they exist...) you would need something like 420 Mega's running in parallel to match this.

Eh Hem. . .

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 9:40am

These particular Arduino, made by a bad-ass contributor.
They sell on Digikey
They no-doubt work

You can view the source of goodness here: https://www.pjrc.com/store/teensy40.html

You can buy them here (Pedigree Supplier): https://www.digikey.com/en/products/det ... 3/10384551

If there are 500 of them on Digikey. . .
And you can find it referenced on the list. . .
That is a Legit Lego that is SURE TO WORK (for the most part)...

The world has evolved*

Anyway
Back to what we were doing. Lets see what ports are ACTUALLY broken out at the pins. This is the first thing you do with any Arduino. There may be ANY NUMBER OF FUNCTIONS. . . but. .. unless you bought an Arduino with 100 pins . . (lol) you have to be VERY CAREFUL about what you assume you will have access to.
teensy40_card10a_rev2.png
teensy40_card10a_rev2.png (139.75 KiB) Viewed 181 times
You need to learn to read these cards. Every vendor does it different. The colors indicate type. . . and take careful note that everything is multiplexed!

Multiplexing is what we are doing today (offboard) ... so... pay attention.
teensy40_card10b_rev2.png
teensy40_card10b_rev2.png (145.23 KiB) Viewed 181 times
Looks like Purple is I2C and not much else is going on there... so fine with using those pins.

Beware that these chips run perpendicular ports... so stick to the 2x20 if you want to be safe.
Beware that these chips run pads. . . so account for that if you access those.
Beware that these chips will NO DOUBT be power hogs. . . so figure that out.
Power.png
Power.png (127.64 KiB) Viewed 181 times
Notice Power In is 3.6V to 5.0V. . . so choose wisely.

5V * 100mA = 0.5W
That is quite a bit of heat. . . but then. . . if you read the page linked you will see that this chipset is designed to be able to dynamically change clock speeds (power consumption) WITHOUT affecting timers like millis(). That is V E R Y important. . . as we will be limping this thing (LOW POWER) then SLAMMING this thing.

Docs say you can over-clock beyond 600Mhz... Why? :mrgreen:

OMFG so far off track. . .

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 9:52am

Back On Track:

Rolling the clock back to an hour ago, here is one of the Hits on our original Google Search.

https://create.arduino.cc/projecthub/xr ... der-48a7c6

Ok, digging into that, this is what we care about::
Jenk.png
Jenk.png (108.84 KiB) Viewed 181 times
Gotta figure out what the hell that means.
An IO pin can be in one of 4 states:

* Output LOW
* Output HIGH
* High Impedance/Input
* Multiplexed to some other resource

We do not seek anything these days that starts up with High Impedance. I mean... you can... but then you just need to lay down a bunch of pull up or pull down resistors. . . and it is lame.

You need to fire up HIGH or LOW
Pick one.... :wink:

If you dont, then what will happen. . . is you will fire up with an indeterminate state. This is during the most critical time when all the circuits are warming up. You... REALLY... gotta have control over your shit from T-Zero thru T-CashMoney*

So
What is it?

https://www.ti.com/lit/ds/symlink/pcf85 ... 8644761861

It is a TI part so it is a legit part.
Simple.png
Simple.png (42.67 KiB) Viewed 181 times
Ok
So far we have

* An Arduino
* A Port Expander
* A 5V USB Power Source

We will connect those to via I2C and that will give 16 new DIO (quasi) channels to our VERY POWERFUL processor.
Right?
Everybody to this point? (come back later if you need to buy the parts... Dont buy the parts if you are not on like... your 50th Arduino project. Go buy a Feather if you are just getting started)
Pinz.png
Pinz.png (167.29 KiB) Viewed 181 times
Sweet!
This thing looks simple, and it looks like it SCALES*

... When you are making a 10,000lb robot that is hardware redundant. . . it needs to be simple. If you start crushing people at Maker Faire, things will be bad for you. Everybody is all DIY and awesome. . . until you crush their children... then the lawyers get after you... so ... TAKE IT SERIOUS. :evil:

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 9:54am

What happened?

...
If you are paying attention we went from a very high level search down to very low level digging. You might wonder why we did it in this order, when we could have gone many other routes. There are literally hundreds of different choices down on Digikey. . . endless whitepapers to read. . .

NO

THE REASON WE DID IT THIS WAY?

... :oops:

Who has not figured it out yet?
:lol:

Because. . .
If something is labeled as "Arduino" then by the very definition. . . IT HAS A DRIVER.

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 9:56am

It has a driver. . .

Just. . .
Slow down for a moment with all the Apple Hype and all the jack off this and jack off that.

Drivers

The Personal Computer

. . .

Think

...

What is the most important part of a compute system?

...
...
...

(Your ability to contribute)

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 9:59am

. . .
The only thing we are going to say to ourselves for the rest of the day is. . .

* It comes with a driver
* It comes with a driver
* It has drivers
. . . * At least I wont have to write that I2C driver stack

At least I wont have to figure out the SPI timing on that.

At least I wont have to re-invent CAN OPEN

At least. . . (Pay attention)
At least .. ... Someone has already Validated it for me (sigh)

...

Greenhorns make the same mistakes every time.
Listen
Do NOT invent anything that you dont absolutely have to.
YOU MUST
Re-Use anything you possibly can
AND IF
Someone has been kind enough to opensource some of their work
THEN READ
The rules and follow them.

Most of it is free to use for whatever you want. You cant just re-brand their shit and try to sell it (eh hem, snakes) but you can definitely REFERENCE their code***

:roll:

If code is out in the wild. . . that is YOURS to use as a REFERENCE*

so... do so please.
Quit wasting time re-inventing the wheel on garbage platforms that do not support Arduino :)

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 10:28am

...

What is a "Startup"?
What is "The Bay Area?"

... This is a place where we do 3 years of work in 9 months. To accomplish this you offload work. For the last decade we have been offloading work to Manufacturers*

If you are building something Mechanical you buy the piece parts from McMaster, get the 3D model for free, and put it into the assembly. You DO NOT sit around modeling M3 fasteners :roll:

If you are laying out a PCB you select only parts that come with a 3D model, Symbol, and Footprint. You do not sit around creating library parts all day long. That shit is for DraftsPersons at the National Lab.

If you are designing embedded hardware systems you use only parts that come PRE VALIDATED with a DRIVER. You do not sit around for 3 weeks fingering out 32 pages of SPI protocol. LOL...

If you are purchasing Production Inspection Gear. . . the first thing you look for is WHERE ARE THE DRIVERS?
* Are the drivers in LabView?
* Are the drivers in JAVA?
* Are the drivers in C, C++?
* Are the drivers in Python?

There are only two valid answers
* NI Drivers
* C-type drivers

You access production gear with Labview (NI or National Instruments) and anything else you do in something like C.

ARDUINO's run C-code
Ok?

Anything in C can be ported to run on an Arduino. Usually you just have to patch a few things. On modern 32bit Arduino's. . . you have to patch almost nothing. Just be careful about your use of Memory.

Anyway. . .

For Electrical Engineering the biggest time sink is Validation
What leads up to Validation
What follows Validation

All of it is extremely time consuming so we SHARE our Validation. If you can not share your validation then you contribute in any way you can.

...

"A lot of a little makes a lot"

I learned that from a first generation immigrant man who was selling jugs of water for $0.25

It is a Universal Truth
...

SO
We employ that by realizing that there are INFINITE new 3D models to make.
There are INFINITE new Symbols and Footprints to make
There are INFINITE drivers to write

SO

We offload that task to anyone who will take it.

* Digikey
* Mouser
* McMaster

This is the tip of the spier and it is YOUR TASK to only down select on parts which come with

* Symbol
* Footprint
* 3D model

In doing this. . . you will skew the algorithms. . . and more and more pressure will be placed on upstream suppliers to pay for the time it takes to do the baseline work (3D model, Symbol, Footprint, Driver)

:lol:

THAT ----> Is how you create a Time Machine

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 10:38am

So
Now you understand part of what a "Pedigree Supply Chain" means. There is a whole hell of a lot more, but ... to make it practical for those who are not designing Weapons, Spaceships, or new Kitchen Appliances... there you go.

The reason a part costs more from Digikey is because:

* They get it to you by 9AM the next morning
* They show you live stock and re-fill times
* They provide you with Symbol and Footprint links
* They properly store your items (temperature, humidity, etc)
* They never botch an order
* They only source from reputable vendors (not some clown selling junk they bought from China)
* They. . .

Back on track
MyWholeWorld.png
MyWholeWorld.png (137.7 KiB) Viewed 181 times
Above. . . that used to be my whole world. We used to have to solve every riddle from scratch. We erased this reality for you Greenhorn Engineers. . . and now this is your reality

[youtube]jWeHzBLeN6s[/youtube]

You are welcome (sorta) because that is quite possibly the worst Youtube video on the planet!

F- Using Youtube for everything.
What you want is pictures.
testReadWriteLedButton_bb-1024x496.jpg
testReadWriteLedButton_bb-1024x496.jpg (70.7 KiB) Viewed 181 times
Ah...
Now THAT is what we did for you (punks)

:mrgreen:

See how nice that picture is?
Any questions on how to hook it up?
Ever felt the extreme anxiety of laying out a PCB board that HAS TO WORK on a really tight timeline????

Ever forget to route a control line?
Every get some trace or another mixed up?
Ever miss-read a datasheet?

... If your answer is NO to any of those, then you are not an Engineer yet.

... Just... Please... FOLLOW THE RULES
The Rules are what made your life so f'ing easy... and if we are going to build on this foundation, we have to keep going at it in a methodical way.

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 11:05am

So
Credit where Credit is Due.

We are currently reviewing the following Contribution to the Community found HERE: https://create.arduino.cc/projecthub/xr ... der-48a7c6

If you are this persons boss, or looking to hire this person... please take into consideration that they contributed to the community. They even directly helped out ES member "methods" and for that "methods" gives a thumbs up to that individual. :banana:

So ...
What do we have?

+5V & GND -> Standard
SCL & SDA -> Standard (tho I dont use I2C)
Interrupt -> Else how will you know when a change has occured?

8)

Simple right?

The TI Datasheet is 39 pages.
The picture above captures EVERYTHING you need to know in one single picture. Pure Brilliance I tell you. . .

Now
Lets go look at code (Drivers)
Contributor.png
Contributor.png (71.46 KiB) Viewed 180 times
I dont know who this contributor is yet. . . but look what they are doing for you. They are explaining (in only a paragraph) the minimum (MVP or Minimum Viable Product) of what you need to know (NTK) about I2C.

...

PAUSE

I just dropped off the biggest load!
It was like someone blended Corn and Bacon into a Chocolate Milk Shake, loaded it into a pastry bag, then stomped it!

:bigthumb:

RESUME
Code.png
Code.png (69.29 KiB) Viewed 180 times
All you really need in there is the Header and CPP
Notice that nothing here is "Arduino" :idea:
GoodFootprint.png
GoodFootprint.png (294.07 KiB) Viewed 180 times
Take note that we are on a "Good Footprint" - so something TSSOP or otherwise exposing pins that we can HAND SOLDER and VISUALLY INSPECT.

I...
Actually use Stencils and Solder paste and an IR oven for this sort of work, but sometimes you need to lift a pin. We only use COMMUNITY FRIENDLY FOOTPRINTS when laying out PCB boards. . . RIGHT?

RIGHT?

We only use "Community Friendly Footprints"

* Visually Inspectable
* Exposed Pins
* Not too tight of pitch

Dont be a douche and spec a part which has tucked pins or BGA if you can get it in something hand-solder. IF... you do spec something BGA or Tucked then you BETTER make a module for it on a standard 0.1" spacing

Eh hem (dont be a douche)

:mrgreen:

......

SO
As a part of Down Selecting you look for indicators

* Has anybody done a Project with it?
* Is there a HackaDay
* Is there an Arduino Example Set?
* Is it available on Spark Fun?
* Is it available on Adafruit?
* Is it available on Seeed Studio?
* Is there a Module available at all?

... Be careful with sketch modules from China. Many of those are wicked-Jenk. If it makes it to Seeed, Adafruit, Sparkfun, or another high volume supplier. . . then you are pretty much in the clear.

What we are doing is called De-Risking :idea:

Risk comes in 3 flavors.
* HIGH RISK
* MEDIUM RISK
* LOW RISK

Risk adds up in a project. If a board has 8 different sections, each of those has a risk associated with it. The board itself then has various RISK associated with it, then its interface with next assembly

Blah blah blah. . .

There is a reason why some people can "turn a board" in less than a week, and other people get stuck. . . and deliver non-working goods, 9 weeks late.

Sometimes this is because someone comes with solutions "in pocket". This means they have done it before and know it will work. I have M A N Y solutions "In Pocket" 8)

When I dont, what I do is De-Risk until everything in my deliverable is LOW RISK

... and to wrap this up...

All of this works toward the UBER (not the ride company)
The UBER is when we all align our efforts to drive Volume up and Price Down. ***

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 11:15am

The Catch

Arduino used to be Arduino. If it Ran it Ran.
The same is no longer true.

Since 3rd parties are (partially) porting Arduino over to extremely different architectures you now have to be very careful if you want to COPY AND PASTE someone else's "Drivers".

The above example is for an ESP. These are very common now and you can get into them over at Adafruit. For this project, I am reaching to a new height. .. with a Teensy. :wink:

SO

What this means is that we will have to dig into the supplied driver, definitely change a little, possibly change a lot, to make it all work with the different underlying hardware.

THE IDEA THEN IS

If I complete this (and validate it) I then "Contribute" my additional driver set for the next guy. Since I worked from someone elses foundation, if I post my new solution, I must take great care to credit them for the work.

... You can go about this part of it as you please. . . but every once in a while (if not every time) please take a moment to share whatever new additions you have. This can be a raw GitHub dump without a pinch of explanation. DONT WORRY -> :mrgreen: We will find it and figure it out.

Your contribution is appreciated

Remember the Alamo

Remember the Revolution.

Over and Out for today

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 11:54am

The Future (in the slide deck, it is now tomorrow)

Next two topics

* Porting Code
* Test Cases

The first is the Firmware Engineering, the second is the Validation

...

Practically all microcontrollers these days will run C-ish code. What this tells you is that the .CPP (C++) and the .h (header) are the parts of the code that directly run on the target device. You will have to modify these for whatever hardware you are using.

The Test Cases...
Are then in Arduino...
So the Test Cases (Examples) will run on ANY Arduino.

In this way

We only have to write the test cases once.
We can all share test cases and contribute HARDWARE INDEPENDENT Unit Tests
(The most important thing you read all day, except for my description of taking a corn/bacon/milkshake dump)

:bolt:

SO
Since this particular driver was put together for the ESP, we need to get in there and see HOW hardware dependent it is. Some hardware has resources that other hardware does not have.

We do not need to look at the Arduino code at all, save for looking to which C++ codes it calls. We start with the pin assignments, move into the inits, then go to the core functions. You dont have to port it all, but it is polite to do so. Do what you have to do to accomplish mission success.

SO

You start by opening the header file. Sometimes there is 30hrs of work in here. . . mapping all kinds of crazy shit to other crazy shit. Do not underestimate the work here. If you are moving from an ESP32 to a Teensy, this could mean 0hrs of work, 3 minutes of work, 3 days of work, or even ... sifting thru 300 pages of horrific and wretched bit level assignments.

AVOID AT ALL COSTS. . . any MCU that uses bit level garbage without some high level abstractions to control that*

Anyway :-)

So lets do that.
Header.png
Header.png (103.62 KiB) Viewed 177 times
All that is saying is that you can use the code, but if you do... you must not strip away the free use statement. Share and share alike, DONT BE A DICK. Santa is watching . . . and we are many.
WeAreMany.jpg
WeAreMany.jpg (43.43 KiB) Viewed 177 times
Be nice.
Do not try to profit only for yourself.

We all profit by not being greedy. Remember that and you will get farther in life. If you are some douche money-grubber skimming my contributions for something you can make easy money off of. . . :|

eh....
Not a sustainable plan. Go rip off old people win reverse mortgage scams or something like that. Leave us alone, we have a good thing going over here.

Just think of it like Santa watching you all year long
(or if you prefer, a scary masked man with no identity who can read your personal email)
Just... do whatever you have to do to be fair and equitable.
Includes.png
Includes.png (51.99 KiB) Viewed 177 times
Right off we start including external dependencies.

...
The first step is to deal with multiple includes. That is a standard IF defined, do nothing. If not defined, define now. This is just a way to allow the Compiler to accept multiple entries of identical header files. In the past.. . this would have broken... and you would have to hack and hack.

Use them, they work.
Scrolling down...

https://www.arduino.cc/en/reference/wire

Include wire.h, that is just an I2C driver set

Include Arduino
That allows you to reference Arduino specific code while down in a .cpp If you dont have this, then you will not be able to do things like print and println

Notice that include of Arduino.h happened right before writing to the terminal started.

...

Now lets look at how you use #define to first-pass (compiler pass) replace

Code: Select all

// Define where debug output will be printed.
#define DEBUG_PRINTER Serial

// Setup debug printing macros.
#ifdef PCF8575_DEBUG
	#define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
	#define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
#else
	#define DEBUG_PRINT(...) {}
	#define DEBUG_PRINTLN(...) {}
#endif

#define READ_ELAPSED_TIME 10
#define a keyword called DEBUG_PRINTER and set its value to Serial
All you have to do is then replace every instance with DEBUG_PRINT with the key word Serial, and the code above will make sense.
print.png
print.png (59.88 KiB) Viewed 177 times
There is the first pass using Find and Replace
See how it is starting to look like something you recognize from Arduino???
print2.png
print2.png (43.33 KiB) Viewed 177 times
Here it is with even less...

IF
You have defined this phrase: "PCF8575_DEBUG"
THEN
We are going to take every instance of "DEBUG_PRINT" and replace it with the line of code:

Serial.print(__VA_ARGS__);

Where Serial.print is your standard Arduino terminal write and "__VA_ARGS__" is a placeholder for the VALID entry into that.

Same is true for Println, with the only difference being that we tag on a "ln" ... so we execute a Print followed by a CR, LF, or CRLF :wink:

...
Line by line
Simple by simple
You gotta understand it all if you want to really get traction.

... You CAN just skip all this shit and spend 3hrs searching the internet for someone who solved your exact problem... OR ... you can get in there, figure out what is going on, and get it working.

NOTE:
There are "signatures" in code and it is FAR MORE than what you read (and deleted) in my comments. I have a very distinct way of writing my code and I also include binary data (non-printable) in the source. If you did not use my code as a reference, and instead used my actual source files, then it says right there in the non-printable binary whitespace (CRC included) that you snatched my code and now I am mad.

ASCII is printable
ASCII is made of hex
Hex is just binary bits

Copy and paste the file
Do a CRC

Now do another CRC on just my raw files, the result will come out different.

The reason is . . .
When you did a copy-n-paste, you copied only my ASCII printable chars (possibly)

When you used my actual source files (that were generated on my machine) you carried forward binary data that I hid in the files. I manually inserted this data using a LabView program that I wrote in 2003. . . it edits pictures and inserts encrypted messages right into the color bits.

It is undetectable.

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

john61ct   100 GW

100 GW
Posts: 7230
Joined: Dec 18 2018 2:06pm

Re: Another full suspension build

Post by john61ct » Dec 22 2020 12:04pm

keep it coming

might not get processed now but building up references might just pollinate later

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 12:36pm

Good job brother.

From this firehose. . . all we would ever expect is to set the boundaries of the solution set for you. By this I mean we will::

* Bound the Problem *

...

What makes something (seemingly) impossible to understand is the (lack of) knowledge of how deep it goes... how far side to side...

* Is it 1cm?
* Is it 1meter?
* Is it 1 kilometer?

Knowing this is the key to managing the stress and emotions that come from learning something brand new. In School. . . what they do for you is::

* Assure you it is solvable
* Assure you it can be solved in 1hrs... or some reasonable time
* Assure you that they can get you un-stuck if you get stuck
...

They set up an environment where there is a net under your rope. This allows you to swing farther and farther from the earth. . . while knowing that you will land on your feet.

NOW

Before I sign off for the day -> The above poster mentioned a few dozen posts up that he was thinking about moving to the bay. Here is my advice on that.

* Dont do it

That is the short
The long looks more like this

* Even a room costs $900 - $1,300 here
* Competition is Fierce and it is a clicky place
* Pay is shit and everybody is looking to take advantage of you

Most people with basic skills are barely making $15/hr. If that sounds like a lot to anyone. . . :shock: ... Tripping dawg. You cant even eat here for that much money. Minimum wage is about $10 an hour for zero skills. $15 is what you get paid for doing harsh repetitive labor all day long.

* Pounding Nails
* Pinching Wires
* Over and over and over

$22 an hour is considered "good money" for single guys who are looking to afford beer. Anybody with kids. . . :oops:

$30 an hour is Skilled Labor
These are people who can handle shit on their own and require little of our time. My time is $150/hr so if I spend 20% of my day holding your hand. . . that is A LOT OF BURN.

A lot...

And this is why Engineers are DICKS.

I have a really big expectation over my head and only a tiny fraction of that is training people.

...

$40 an hour is what we pay greenhorn engineers. Maybe $50. If you think you will make something like $150k out of the gate with an Engineering Degree... you are thinking of Google Wages. They select only the top 0.1% and you are going to need

* A 4.0 GPA
* A good bit of project work and internships
* Extracurricular activities
* Something to differentiate you (Female, First Gen, Black, Hispanic, Handicap, etc)

Otherwise...
Like in LA (Hollywood) if you wash out then you end up at the Slave Shop working for a Tyrant like myself. We pay you shit, we expect a lot, you will have your nerves frazzled down to the bone. . . and only some will make it. Most will wash out.

IF
You make it...
THEN
You can take that real world experience back to Google and apply again

IF
You wash out....
THEN
You end up living in your car on the side of HW1

:confused:

Anybody can laugh. . . but dont let me see you cry. This is the Bay Area and it is the real deal. Many small shops have a little click going. Church, Friends, shit like that. Good for them, I am not a part of their Click. I survive on my CONTRIBUTION alone.

* I ask what the problem is
* I say what I am going to do
* I Execute on that

If I fail... I have to eat it.
If I succeed... the employers only want more.

It is a super rough life and I do not suggest moving to the west coast without at least a BS degree in the Sciences. Right off... there is a $20k differential. If you did not get your degree then you have two choices

* Be amazing
* Get raped

Sorry to say it - but that is the way it goes. We run maybe 10% to 30% "cowboys" who never went to or finished college. These guys and gals are "exceptional". Not just in brilliance (we are all brilliant) but in diligence and (the most important thing) our ability to L E A R N

Cowboys learn fast
Cowboys learn on the job
I love cowboys... but cowboys can be dangerous

For that reason
For the most part
We probably hire at least 3 degreed engineers for every 1 cowboy. These degreed individuals ARE REQUIRED to execute. Much comes with a degree and a lot of it is just boilerplate shit.

* Delivering on time
* Not over committing
* Being super honest
* Not cheating
* Knowing your math...

Anyway
My point here...
Is that I do not want folks reading the forum to think that we have a Gold Rush going over here that they are going to cash in on. People like me may be pulling 1oz gold nuggets out of the river. . . but I am running $40k worth of gear with 20 years of experience.

You are going to be panning fines, drinking whisky, sleeping on the trail, and wishing you could afford some ass.

In any gold rush
The people who get rich are
* 0.1% of Investors
* Those who supply goods and services

People who sell tools and materials
People who have specialty services

Shovels, picks, boots, cans of beans. . .

...

I am an outfitter, trail guide, sharp shooter, and many other things. Pull my underwear over my head, stuff me into a trash can, laugh all you want.

I am doing it over here. ... back on track

eh
We are moving all of the low wage work East. Nevada, Texas... so folks who come out here (and cant stay) end up re-locating to places with really harsh weather.

Calculate that move into any equation. I just talked with a guy yesterday who was asking tips for being homeless :idea:

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 12:48pm

Ok Pivot

I am going to go swimming in the Ocean, the decision when I come back is:

* Do I want to run an Arduino with more available pins
* Do I want to find a fan-out that is not reliant on unvalidated rivers.
* Do I want to go find another fan-out with drivers I know will work

I do not personally like or trust I2C. . . so I usually steer toward SPI. It is lower level and I can bit-bang it if push comes to shove. I2C has more layers over it (like CAN) so it can be a pit.

... The next task is to finish digging thru the Header and CPP files to find out how hardware dependent the code is. Realistically... It will fo-sho work on the Teensy 4.0, but it may cost me half a day... and half a day is an eternity on a fast turn.

I am on a REAL FAST TURN (at all times) so ->
Gotta consider that.

...

As for the time I spend writing?

That is on a different budget.
All work is charged against a budget. Call it a bucket.

* Production Bucket
* Quality Bucket
* Engineering Bucket
* Promotional or Sales or Advertising Bucket
* R&D Bucket

Each bucked has deliverables and expectations.
Each bucket has a timescale that it works on.

Some pay more, some pay less.
Sometimes you make $3.50 an hour and sometimes you make $350 an hour. All depends on how much responsibility you can manage.

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 2:51pm

I got a Recumbent-Compatible bike rack rigged by measuring the width and length.

Found a board. . . wide enough.
Pounded the pedal extension in with a 2x4 + Hammer to allow it to center without hitting other cars.
IMG_20201222_112955_compress39.jpg
IMG_20201222_112955_compress39.jpg (304.86 KiB) Viewed 165 times
IMG_20201222_113029_compress35.jpg
IMG_20201222_113029_compress35.jpg (189.72 KiB) Viewed 165 times
IMG_20201222_113036_compress14.jpg
IMG_20201222_113036_compress14.jpg (286.61 KiB) Viewed 165 times
Half inch, fast cut, Ryobi wood drill
Some synthetic grease
Some UL rated, Milspec ZipTies
IMG_20201222_113805_compress69.jpg
IMG_20201222_113805_compress69.jpg (332.62 KiB) Viewed 165 times
IMG_20201222_114032_compress20.jpg
IMG_20201222_114032_compress20.jpg (374.64 KiB) Viewed 165 times
An old ratchet strap.

... The primary tie-down on the trike wheels is single zipTie for now. Double would do it, single WILL BREAK, long term we want to see something like

* Heavy rubber strap, cut just right
* Block and pin, held by pressure of tire
* Other

...

* Dead blow hammer vs steel hammer with a block of wood
* Lubricating rusty metal interfaces, friction, working in burs.
* Removing a rusted fastener with penetrating fluid
* Tying down at the lowest point
* Understanding how a load. . . unloads under shock and vibration
* Keeping a drill bit sharp by not hitting metal
* Putting tools back where they came from
* Fitting 10lbs of shit in a 5lb bag for $0.50 in ZipTies

...

Most importantly, packing the tools needed in the GO KIT

* Hammer
* 2x4 block
* Vice Grip
* End-Cuts (to remove zipTies)
* Bag of ZipTies

... That is the Go-Kit needed for this load. The hammer is to knock the pedal-pole back out to the extended length to fit my frame.

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
E-HP   1 MW

1 MW
Posts: 1930
Joined: Nov 01 2018 9:20pm

Re: Another full suspension build

Post by E-HP » Dec 22 2020 2:56pm

What's the capacity of that battery. I looks huge :shock:

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 3:11pm

That is 13S worth of 2013 zero cells.

I spent like 10 hours extracting them. Call it a usable 20 or 25 amp hours is my guess.

... All I know is that my bike never runs flat. :mrgreen:

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
Skaiwerd   100 W

100 W
Posts: 246
Joined: Jun 16 2016 4:55am
Location: CT

Re: Another full suspension build

Post by Skaiwerd » Dec 22 2020 7:35pm

Love the old 4runners. That era are all rusted away and gone on the east coast. Like the bronco and the Chevy version the tops came off. No one ever did. But when you saw one you were blown away. Now the tops don’t come off, been that way for some time, sadly. All the cool gets taken away to make room for maximum profit.

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 22 2020 8:55pm

I hear you.

We take the top off all summer, but in the winter it rains around here. We put the top on about 2 weeks ago.

...

Another issue -
With the top off, the vehicle feels very vulnerable to theft. I ended up installing a steel Lock Box.

The tops are also heavy -
So I set up a rig in my car port made up of 2 heavy duty ratchet straps. I back it in, remove the bolts, latch on, pull it up an inch, drive away.

We can replace the fastening system in about 8 minutes with two of us.

...

But to your point ->
There is nothing like riding around in a truck with the top off :mrgreen:

When I was a kid (growing up in the bush) all sorta folks had seats bolted in the back of the truck (rear facing). If the seats were not there. . . we would just ride in the back and hold on!

... I grew up on a dirt road with a gate. After you closed the gate, you got to ride on the rear bumper of the car... Depending on which car (Taurus Station Wago...) you had very little to hold on to :shock:

The simple things

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

99t4   100 W

100 W
Posts: 130
Joined: May 10 2020 10:31pm
Location: PNW

Re: Another full suspension build

Post by 99t4 » Dec 23 2020 3:11pm

methods wrote:
Dec 22 2020 2:51pm
... The primary tie-down on the trike wheels is single zipTie for now. Double would do it, single WILL BREAK, long term we want to see something like

* Heavy rubber strap, cut just right
* Block and pin, held by pressure of tire
* Other
* Other could be a simple piece of cord, always useful:
https://www.animatedknots.com/shoelace- ... t-surgeons
Simple rope + knot-tying knowledge can be just as functional, and less wasteful (being re-usable and handy), than zip ties in many situations.

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 25 2020 9:44am

Most excellent advice.
I will do that for the next run.

...

Those two RC cars landed. Epic blast.
Metal parts in all the right places.
Headlights (that I thought were gimmick) help a lot at night.

Car rips plenty hard, hard enough that an 8yo "turns it down" better than 90% of the time. ... Has steering trim/reverse as well as throttle scale (40% to 100%)

... Came with 2 packs, two chargers, one 5V wall nugget
IMG_20201225_063340_compress34.jpg
IMG_20201225_063340_compress34.jpg (187.02 KiB) Viewed 107 times
Way too slow for what is claimed to be a 30C pack... But then when I was a kid you waited all night to run the car for 8 minutes... Then all night again. All I had was the slow charger man :lowbatt:
IMG_20201225_063406_compress14.jpg
IMG_20201225_063406_compress14.jpg (163.63 KiB) Viewed 107 times
Now...
After guys like Fetchter set me straight. . . I have no fewer than 9 ways to pound 80% into those packs at the park. ... Going to live the dream today. :arrow:

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

User avatar
methods   100 GW

100 GW
Posts: 5065
Joined: Aug 08 2008 12:08pm
Location: Santa Cruz CA
Contact:

Re: Another full suspension build

Post by methods » Dec 25 2020 9:56am

Another member ordered samples of some stationary lead replacement. I will get the meter on them and test the saggage. Absolutely no info on the site, but sometimes simple is better when you want to turn people on to lithium.

Plug it in here
Get juice out there
Don't worry about Ballance, LVC, etc. . . BMS protected.

Eh...

Spent down my purchasing budget for 2020 except for the rest of the year it will just be RC car level stuff. 20 spar battery packs, various fast chargers, upgraded components...

Then.... :wink:

I can finally get another epp wing :idea:
I hear they are flying pretty regular out in Scotts Valley. Some regular soaring up by the lumber mill on highway 1. . . . . I can fly a wing like it's nobody's business. ... Nothing more satisfying than a high performance RC airplane. All the fun of an e-bike without the risk of thrashing your body.

If anybody is stuck in a wheelchair. . . I suggest getting into high performance RC over video games. Super satisfying.

-methods
Increasing battery voltage and controller current limit will result in a non linear experience

Post Reply