moose-mousse - Electronic Moose
Electronic Moose

Helloooo! I am Moose! They/Them/He/Him I am a embedded software engineer with autism, depression and anxiaty ( Wooo! ). I post about... whatever I want... software things, mental health things... whatever I feel like Feel very wellcome to send me asks about... anything that strikes your fancy :3

266 posts

The Universal Serial Bus Is Often Not Universal...

The Universal Serial Bus is often not universal...

So there is this problem you often run into when doing development. You come up with a solution. You research the solution, and find only tiny amounts of people talking about it, and/or they seem to say many different things and disagree. Most of the time, that is for 2 reasons 1: it is a very novel solution, so no one have tried it much, and everyone who have, has made very custom versions of it. 2: There are variables that makes it impossible to do it in one single way. I needed a rechargeable battery system to power my robot. These can get... VERY complicated, and pre-made solutions can quickly be expensive and you might end up with batteries catching fire, or destroying the batteries so they can never be used again. You need protections on them, but which kind depends on a bunch of things. I know electronics, but I am mainly a software guy, and I know when I do not know enough about electronics to do it myself. This being such a case. So, I came up with the idea to use powerbanks. One for each steppermotor, and one for the microcontroller(so the noise fromt he motors could not cause issues).If I use ones that can output enough amperage, they should just work and they are cheap. They are meant to be used by normal costumers, so have all the protection needed, and are quite idiot-proof(Which is a very handy thing when you are an idiot, like me) so should be easy to use. But I could not find much info about doing this... and I did not realize I was looking at reason 2. Basically, BECAUSE powerbanks are idiotproof, they do not want to discharge themselves unless there is a real device at the end of the USB cable. So if they cannot detect one, they turn off after about a second. How do they determine if there is a real device? Depends on the power bank.... No really, there is NO standard way to do it, as far as I can tell. And it does not depend on the power bank MODEL. I have 2 identical power banks, bought at the same time, and they do NOT behave the same. Which means that when I connected the powerbanks to supply my system, they (SOMETIMES) did not supply anything. Some check how much current is being drawn, which can be faked with a resistor wasting some power. 500mA was being quoted a lot, but that is more of a "That is probably enough to get it going". Others check for impedance(Basically, also resistance, but from frequency dependent sources). Those can be "faked" by having a coil or a device that acts like one to the faking resistor. I wanted a tiny 5 volt fan to cool the stepper motor drivers anyway, so I had one power bank also power that. That ensured that it actually stayed on (But if I used the other, (identical!) power bank it just turned off anyway). The other one could be connected up directly. If I used the powerbanks lower amperage socket. If I used the high amperage one, it just turned off. So now it works... I have 2 powerbanks for the motors, each with painters tape marking which powerbank and socket to use for what. Took me a week longer than I had hoped to figure all this out and do all the experiments. Sometimes, things that should be simple are just headaches.

  • neuroglitch
    neuroglitch liked this · 1 year ago
  • pifanjr
    pifanjr liked this · 1 year ago
  • frog707
    frog707 liked this · 1 year ago
  • monk-of-mystery
    monk-of-mystery liked this · 1 year ago
  • thatgeek42
    thatgeek42 reblogged this · 1 year ago
  • the456
    the456 liked this · 2 years ago

More Posts from Moose-mousse

2 years ago

Immediate shutdown

So I had my first post become a bit popular... and so my brain decided to do the dumb thing it does, and stop me from even opening Tumblr for a week. yay!


Tags :
2 years ago
Every Programming Expert On The Planet: "NEVER Throw An Exception As Normal Program Flow"Kotlin: "Good

Every Programming expert on the planet: "NEVER throw an exception as normal program flow" Kotlin: "Good practices are for OTHER people!"


Tags :
2 years ago
I... Hope What This Job Posting Means Is AUTOMATING Verifying Light Outputs... I... I Don't Want To Be

I... hope what this job posting means is AUTOMATING verifying light outputs... I... I don't want to be hired as a guy in the corner who points at a LED and yells "THE LIGHT IS ON!" all day....


Tags :
2 years ago

Just a quick project...

"Ok Moose, you can do this. We just need to make the robot take commands, drive around and report odometry. Keep it simple, keep it quick". So anyway, I implemented the software in layers. Hand crafted a automated testing framework from scratch and implemented it via CMAKE, and then made full suite unit tests for every layer, a full functional test suit for the HAL layer, and a system test Suite. I also came up with a unique way to calculate odometry that makes it super light on CPU time (Only works for stepper motors... which are a bad choice on mobile robots... I really need a word that means being both clever and dumb...)... And now something that should have taken weeks, will end up having taken months... Why... why am I so very unable to pick simple projects... and after picking harder projects, I just MUST decide to "Do it properly" and spend time implementing something that could pass industry certification... despite it in no way, shape or form NEEDING to be made like that... It would be like wanting to make a small block of wood to stabilize a wobbling table, and then spending weeks polishing, painting, measuring and documenting it... it... it does not need that... calm down...

How I handle that problem professionally is having a team around me to keep me in check... but I have too much depression, anxiety and no clear roadmap to find people to do projects with... I have been a member of a maker space for... 2 years now, and have not yet... you know... shown up... Despite it only being 40 min away... Blaaaaa!


Tags :