#avr Logs

Jul 09 2017

#avr Calendar

12:19 AM day is now known as daey
01:36 AM rue_house: good night
01:36 AM rue_house: in an hour, I'll say good morning
01:37 AM rue_house: 12 is 0
01:37 AM rue_house: so 12 is less than 11
01:37 AM rue_house: who the hell came up with our time system again?
01:40 AM Thrashbarg: someone who liked base 60
02:10 AM antto: someone who wanted to make most other people feel stupid
02:48 AM rue_shop3: good morning
04:01 AM Thrashbarg_ is now known as Thrashbarg
12:39 PM enhering: one question: shift registers are two way, or one way only?
12:41 PM enhering: Ok. Sorry. Found the answer. http://pdf1.alldatasheet.com/datasheet-pdf/view/5714/MOTOROLA/74LS348.html
12:50 PM enhering: Nope. This is what I meant: https://assets.nexperia.com/documents/data-sheet/74HC_HCT165.pdf
12:55 PM LeoNerd: Usually they're unidirectional, yes. I imagine it might be possible to find a bidirectioal one but it's rare
12:55 PM LeoNerd: By that point you're better off using one of the GPIO expanders, such as the PCF8574
12:56 PM enhering: I found a parallel to serial shift register
12:56 PM enhering: Is is worse then a GPIO expander?
01:00 PM LeoNerd: Well, it's unidirectional
01:00 PM LeoNerd: Depends what you wanted to use it for
01:00 PM cehteh: for what usage?
01:01 PM LeoNerd: E.g. if you're just offloading a bunch of indicator LEDs or similar off to SPI to save some GPIO ports, then a 74'595 is fine for that
01:01 PM xentrac: or even a chain of 74595s
01:01 PM LeoNerd: But you can't read inputs with that; e.g. buttons. You *could* read a 74'165 but that is a little awkward over SPI, and also doesn't give you a change interrupt, like a PCF8574 does
01:02 PM xentrac: you could rig up a change interrupt with some XOR gates if there was some reason not to use a GPIO expander
01:02 PM LeoNerd: But that's be bigger and more expensive and use more custom parts than just using an 8574 :)
01:03 PM enhering: I want to read the power goods of 8 LDOs
01:04 PM enhering: if possible, through the SPI main bus
01:04 PM xentrac: probably, LeoNerd!
01:04 PM xentrac: well, I don't know about "custom parts"
01:04 PM xentrac: it'd use more parts
01:06 PM LeoNerd: OK, so if it's just read, and doesn't need change-interrupt ability, then either some sort of GPIO expander or just a 74'165 would be fine
01:06 PM LeoNerd: The latter isn't *quite* SPI compatible but with a bit of work it can be close enough for most purposes
01:06 PM enhering: the 8574 is I2C. I'd need a SPI based one
01:06 PM LeoNerd: Yah. .you can find SPI-shaped similar ones
01:07 PM enhering: I'll search more than. Thanks a lot.
01:07 PM LeoNerd: But maybe a 165 is good enough
01:07 PM LeoNerd: It doesn't have an SS-suitable line, it won't hiZ the output when not selected, but maybe this can work for you?
01:08 PM enhering: Maybe not. It will share the SPI bus with other stuff
01:08 PM enhering: It should behave well
01:09 PM cehteh: mhm
01:09 PM xentrac: you could put a MOSFET between it and the SPI bus, but that again might be more hassle than using an SPI-native part
01:09 PM LeoNerd: Yah.. I've never really found an SPI-capable *input* shift register
01:09 PM LeoNerd: Standard tricks include using a 74'1G125 on the output line to make it SPI-shaped
01:10 PM LeoNerd: Well, 126 in this case since the chip has an active-high "select" pin
01:10 PM cehteh: for your modular FC?
01:10 PM enhering: Yep, cehteh. Individual LDOs for each slot.
01:10 PM enhering: with PG and EN
01:11 PM enhering: The EN I can do with a regular shift register
01:11 PM cehteh: why dont you just handle each module its 'sanity' by itself, query/ping it regulary, then it may either respond "good/bad" or not at all
01:11 PM xentrac: the 74c126 would basically be functioning as a mosfet
01:11 PM LeoNerd: It practically *is* a MOSFET ;)
01:11 PM cehteh: that would allow logging/latching of any kinds of problems instead only power
01:11 PM enhering: cehteh: because if a module shorts it will kill everything.
01:11 PM xentrac: well, it also gives you low output impedance, no, LeoNerd?
01:12 PM LeoNerd: Yah
01:12 PM LeoNerd: They're useful. I keep stock of 125s and 126s for exactly this reason
01:12 PM cehteh: enhering: i dont mean changing the hardware, except routing the power good to each module and handle it by itself
01:12 PM enhering: ah, ok cehteh.
01:14 PM enhering: That is a possibility. But it may be more useful to have that info on the main module, so it can disable misbehaving stuff in case it is needed
01:15 PM enhering: What do you think?
01:17 PM enhering: There is this one: http://www.nxp.com/docs/en/data-sheet/PCA9502.pdf
01:18 PM xentrac: btw, since qualcomm bought nxp, it might be a good idea to hoard nxp datasheets now
01:18 PM xentrac: grab all the nxp info you can, in case they decide to be qualcommy with it later
01:19 PM cehteh: your main module becoming a single point of failure
01:20 PM cehteh: also .. you overengineering a bit, because unless you have some plan how to handle power fails (and any other fail) sanely it would be a waste to just detect it
01:21 PM cehteh: of course one can have plans for handling such errors, having a spare module which can replace any other module or such
01:21 PM cehteh: but thats makes things way to compliucated for a start imo
01:22 PM cehteh: and power failing could be just one of possible problems/failures, when you manage to integrate that into some general protocol/bus then you can save a lot work
01:22 PM xentrac: this is for an octocopter carrying expensive scientific instruments around Antarctica?
01:23 PM cehteh: hehe
01:23 PM enhering: yep.
01:23 PM cehteh: anyway i'd made the backplane as simple/stupid/passive as possible
01:23 PM enhering: remember I have a second main module ready to ssume control.
01:24 PM cehteh: possibly not even LDO's on it, just redundant power rails and then the ldo's on each module
01:24 PM enhering: redundant power rails means bigger main bus. Biggger conenctors too
01:25 PM enhering: LDOs with enable can be disabled
01:25 PM cehteh: not really
01:25 PM enhering: no?
01:25 PM xentrac: so presumably if one of the eight motors fails, the plan is to turn it off and spin the rotors near it a bit faster?
01:25 PM enhering: no.
01:25 PM cehteh: well you can leave the redundancy out if you want but its vcc and gnd
01:26 PM cehteh: xentrac: that doesnt work
01:26 PM cehteh: you need to cut the opposite motor as well :D
01:26 PM xentrac: oh :)
01:26 PM enhering: if a servo control module shorts due to a servo failure, the module shuts down and the second one turns on. Each module controls n motors, if you want a spare motor set.
01:26 PM xentrac: I haven't written any quadcopter firmware myself yet
01:26 PM cehteh: enhering: actually with power rails you have less signals on the connector
01:27 PM enhering: I must read about that, cehteh
01:27 PM enhering: cannot see it
01:27 PM cehteh: maybe you want 'enable' but no power good and others
01:28 PM enhering: xentrac: This is not just a quad cntroller. It will control whatever you plug on it, as long as you plug in the proper pilot module
01:28 PM enhering: or flash the proper firmware on the pilot module
01:28 PM cehteh: while enable could be daisy chained and latched, that also allows for easier initialization
01:28 PM enhering: i was thinkn of driving the enables using a shift register
01:29 PM cehteh: with the feature (or drawback) that it will not start up when any module is defect
01:29 PM enhering: and disabling only in case of a module failure
01:29 PM cehteh: always think about failure modes
01:30 PM cehteh: this shift register become an additional hardware which is a single point of failure
01:30 PM enhering: yeah.
01:30 PM enhering: there will always be a single point of failure.
01:30 PM cehteh: and it needs to be on the backplane
01:30 PM enhering: yep
01:30 PM cehteh: i wont want that
01:31 PM enhering: i could connect PG with EN
01:31 PM enhering: if PG goes down, EN goes too.
01:31 PM enhering: or something like that
01:31 PM cehteh: did you evaluate how high the chances are that power fails?
01:31 PM enhering: But I would not know it from ground
01:31 PM cehteh: and pg may glitch
01:32 PM enhering: servos are most prone to power failure
01:32 PM cehteh: read datasheets
01:32 PM enhering: GPSs may fry.
01:32 PM enhering: Servos may fry
01:32 PM enhering: Servo cables may be smashed
01:32 PM cehteh: you dont want to reboot the module when PG has a microsecond drop
01:33 PM cehteh: servos are something else
01:33 PM enhering: or somebody may build a module that fries my system
01:33 PM cehteh: then he shoot himself into the foot
01:33 PM enhering: servos may inject 6V into my 3V main line
01:34 PM cehteh: you cant protect against each and everthing
01:34 PM cehteh: servos are supposed to have their own voltage rail
01:34 PM enhering: individual LDOs can protect the system against a bad module
01:34 PM cehteh: yes, but the ldo's could be on the module itself
01:35 PM enhering: yep. They can.
01:35 PM cehteh: unless someone malicious shorts the ldo that wont make a difference, actually it will be easier
01:35 PM cehteh: each module can generate the voltages it really needs and you can keep the backplane passive
01:36 PM enhering: individual LDOs would change the main bus to route only 5.5V to the modules.
01:36 PM enhering: I would need only hte buck on the backplane
01:37 PM cehteh: something like that
01:37 PM enhering: That means changing the MCU module again. 6th generation.
01:37 PM cehteh: lol
01:37 PM enhering: convergence is slow, but happens.
01:38 PM enhering: All the rest remains the same
01:38 PM cehteh: you understand what i meant with daisy chaining?
01:38 PM enhering: i believe I do, but if something fails during flight, all system shutsdown
01:39 PM cehteh: no
01:39 PM enhering: so i do not uderstand
01:39 PM cehteh: because each module can latch it
01:40 PM cehteh: the only thing is that you will detect at startup time when anything is wong and it will not startup properly
01:40 PM enhering: sorry. I'm too ignorant to get it
01:40 PM enhering: ah, ok.
01:40 PM enhering: But how will I detect? By software? In the initialization phase?
01:41 PM cehteh: yes
01:41 PM enhering: ok
01:41 PM cehteh: you send enable which connects so the first module
01:41 PM enhering: But what is the difference between a failed module and an empty one?
01:42 PM enhering: sorry and an empty slot
01:42 PM cehteh: module initializes, sends data back, latches its own enable high, and eventually sends enable to the next module, rinse repeat
01:42 PM cehteh: the last modules enable feeds back to the first so you can detect that the link is closed and all modules are initialized
01:42 PM cehteh: on a empty slot you need to bridge this pins with a jumper
01:43 PM cehteh: http://tinyurl.com/ybu28rop
01:43 PM enhering: this is too complicated. Currently I call all the slots, one by one, in the init state. The ones who answer are identified.
01:44 PM cehteh: me thinks my idea is much easier
01:45 PM enhering: I have to call them, one by one, anyway, to know what is plugged into the system
01:45 PM cehteh: anyway .. have fun
01:46 PM enhering: I believe, if everyone hre makes one version of this controller, each version will be different
01:47 PM enhering: cehteh: If a module in the middle shuts down, what happens to the following modules?
01:49 PM cehteh: thats why i saied each module needs to latch its own enable
01:49 PM cehteh: as part of its init routine
01:50 PM enhering: hum
01:50 PM enhering: ok. understood
01:50 PM cehteh: but then disabling a module becomes a bit more tricky, a healty module could send some command to shut itself down
01:50 PM enhering: but an unhealthy one?
01:50 PM cehteh: but a failed module isnt trustworthy in any way, there the tricky part starts
01:51 PM enhering: how would you fix that?
01:51 PM cehteh: *maybe* you just keep it up and ignore anything it does (if it sends data on the bus)
01:51 PM xentrac: unless it shorts out your power rail
01:52 PM cehteh: or you add a bit logic to disable all unaddressed modules
01:52 PM xentrac: you can't ignore that
01:52 PM cehteh: xentrac: at some point you just have to fall out of the sky
01:52 PM enhering: that is why remote enables were suggested
01:52 PM xentrac: or if it jabbers on the bus
01:52 PM cehteh: when a module shorts the power rails then its already to late anyway
01:53 PM enhering: LD/os have current limiters
01:53 PM cehteh: well when you are desperate you may add some more logic to address each module and send enable/disable
01:53 PM xentrac: nless you have, as you suggested, redundant power rails
01:53 PM enhering: LDOs
01:53 PM cehteh: how many modules at most? 8? more?
01:53 PM enhering: 8
01:54 PM enhering: More would require a second backplane
01:55 PM enhering: LDOs with a current limiter wont defend against a module short?
01:56 PM enhering: And, placed in the backplane, they would not let the main power rail fry
01:56 PM enhering: unless they, themselves short
01:59 PM xentrac: shorting is the normal failure mode for a MOSFET, isn't it?
01:59 PM xentrac: but there are bipolar LDOs
01:59 PM enhering: https://filebin.ca/3SnulzSyHFhh/MainBus.pdf
01:59 PM enhering: a draft, incomplete
02:00 PM enhering: work in progress of the next possible generation backplane
02:00 PM enhering: current is passive
02:03 PM enhering: There are many things that are not there yet.
02:10 PM enhering: If I have a parallel to serial shift register capable of SPI in the main SPI bus, I can check all the LDO PGs in the main control cycle, i.e. more than 100 times / sec. If I get a low PW, I can disable the module very fast.
02:10 PM enhering: PW no, PG
02:11 PM enhering: And even retry to enable it in the future.
02:11 PM enhering: And, of course, I would still have the LDO overcurrent shutdown
02:13 PM enhering: This design is a suggestion from other collaborator. He lifted all these questions and suggested these solutions, which seem to be fair.
02:14 PM enhering: I wanted to keep the MCU modules as simple as possible, to make it easy to substitute a 8bit MCU for a 32bit one when needed
02:14 PM enhering: This means no LDOs on the modules
02:15 PM enhering: Power should be provided by power stuff, not by thinking stuff
02:17 PM enhering: modular linear independence
02:17 PM xentrac: sounds awesome
02:17 PM enhering: a work in progress.
02:18 PM enhering: result of suggestions of many collaborators, including you guys
02:19 PM enhering: https://hackaday.io/project/11724-yauvc-yet-another-unmanned-vehicle-controller
02:20 PM enhering: The red board is the current backplane. All passive, and missig many features. I had a power supply in a module. It failed and almost fried the other modules.
02:21 PM enhering: This should not happen. The power suply module had a LiPo charger and a buck converter. I wanted to plug in an adapter and let the system manage the lipos.
02:22 PM enhering: This will happen no more. Now I will connect a lipo to the backplane and the bucks will step down to working voltage. Lipo management is for the future. A far one.
02:23 PM enhering: Sorry again. I write too much
02:24 PM xentrac: not at all!
02:24 PM xentrac: I just wish I had more to contribute
02:25 PM cehteh: enhering: alternatively you can make one fat regulated power rail and add a fuse for each module, done
02:25 PM enhering: yep
02:25 PM cehteh: dont care about fails, powergood, enable, etc
02:26 PM enhering: that is much simpler indeed
02:26 PM enhering: put a big ldo in the backplane
02:26 PM xentrac: like a house
02:26 PM enhering: sre there smd fuses?
02:26 PM xentrac: and maybe a capacitor big enough to finish blowing the fuse
02:27 PM enhering: whatever is there should be small
02:27 PM cehteh: well i already saied i would put the ldo's on the modules, less noise creep and each module can do whatever is right for it
02:27 PM enhering: that is a possibility
02:27 PM cehteh: stm32 for example needs 1.5V too and 3.3v ..
02:27 PM cehteh: and when you have analog sensors you want to put them on their own regulator
02:27 PM cehteh: no digital noise
02:27 PM enhering: that is a point. Did not know that
02:28 PM xentrac: well, less digital noise
02:28 PM cehteh: actually you want to do that for all sensors, digital ones too
02:28 PM enhering: sensor boards attach to the modules. They should have whatever is needed for their function
02:29 PM enhering: what kind of fuses are u talking about? Big, glass like ones?
02:29 PM cehteh: nah
02:29 PM cehteh: i'd expect this never to fail, so small smd ones, on the modules
02:30 PM enhering: never heard of smd fuses. I'll google that
02:30 PM cehteh: and when the fuse blows then the module is prolly toast anyway
02:30 PM cehteh: dont you do surface mount?
02:30 PM cehteh: you can also use through hole fuses
02:30 PM enhering: I do
02:30 PM enhering: all those soldering were done by hand
02:30 PM enhering: hot air rework station only
02:31 PM cehteh: but surface mount or through hole?
02:31 PM cehteh: https://www.reichelt.de/Picofuse/PICO-0-25A/3/index.html?ACTION=3&LA=2&ARTICLE=23851&GROUPID=7656&artnr=PICO+0%2C25A&SEARCH=%252A
02:31 PM enhering: surface mount. no through hole
02:31 PM enhering: oi want to get rid of those through hole module connectors as soon as possible.
02:32 PM cehteh: https://www.reichelt.de/SMD-Sicherungen/SMD-SF-0-25A/3/index.html?ACTION=3&LA=2&ARTICLE=23915&GROUPID=7660&artnr=SMD-SF+0%2C25A&SEARCH=%252A
02:32 PM cehteh: there are also self reseting fuses, but i'd recommend against that
02:33 PM cehteh: they are more expensive and you may get some modules which fail/restart unreliably in case of error
02:33 PM enhering: Erlend suggested diodes i the logic lines too
02:33 PM cehteh: depends on the microcontrollers you use and what signal level you have
02:34 PM cehteh: avr's are pretty robust but not overvoltage tolerant (vcc+0.5v)
02:34 PM cehteh: they have fuses already
02:34 PM cehteh: stm32 has 3.3v levels with some ports are 5v tolerant some not
02:35 PM cehteh: so you need a level shifter
02:35 PM cehteh: and stm32 is weaker/less robust than avrs iirc
02:35 PM enhering: https://www.reichelt.de/SMD-Fuses/SMD-T-0-16A/3/index.html?ACTION=3&LA=2&ARTICLE=110731&GROUPID=7660&artnr=SMD-T+0%2C16A&SEARCH=%252A
02:35 PM enhering: Probably something like this
02:36 PM cehteh: for incoming signals you may just add some resistor in series to limit the current in case something goes wrong
02:36 PM enhering: He suggested that too
02:36 PM cehteh: thats good enough for AVR's .. just 1k and done
02:37 PM cehteh: avr's have internal diodes for protection, they are very small but should handle it
02:37 PM enhering: I appreciate all your suggestions. When integrated they will make a tougher system. And not just a flight controller. Modules can be designed for many other purposes.
02:37 PM cehteh: but for outputs you may need something else, if you want to go that far
02:37 PM cehteh: maybe just some logic gate as driver
02:37 PM enhering: hum
02:38 PM enhering: more critical backplanes can be designed for more critical applications.
02:38 PM cehteh: or .. just dont overengineer this stuff make it working as simple as possible first
02:38 PM cehteh: just keep in mind what could be done later
02:38 PM enhering: This is what I'm doing now, cehteh. Almost ready to flight
02:38 PM cehteh: and well i already saiued i'd make the backplane completely passive and simple
02:39 PM cehteh: fuses on the modules as well
02:39 PM enhering: I decided to keep a module feature list. The main module will call it on initialization and, instead of asking who he is, it will ask what is the module payload.
02:40 PM cehteh: i would think about a way that there is no 'main' module :D
02:40 PM enhering: I need a master in the SPI bus.
02:40 PM enhering: This is the communications module.
02:40 PM cehteh: well then make it the least important module
02:40 PM enhering: This is a critical one.
02:41 PM cehteh: com yes, but if it fails then sensors and stabilization still work
02:41 PM enhering: They still work, but cannot talk to each other
02:41 PM enhering: COM takes care of internal information transfer
02:41 PM cehteh: ok
02:41 PM enhering: that is whay I made a backup of it
02:42 PM cehteh: then dont care about all that faisafe stuff, because the chain is as weak as the weakest link
02:42 PM enhering: with a mux to connect one of them to the others
02:42 PM cehteh: fix that first, before you improve on other parts
02:42 PM enhering: ok
02:42 PM cehteh: spi failover, any module can become master? dunno
02:42 PM enhering: the schematic i pastd above has a proposal for fixing this
02:43 PM cehteh: i havent looked closely :D
02:43 PM cehteh: (not my project :D)
02:43 PM enhering: the COM should send a heartbeat to the second COM.
02:43 PM enhering: If the heartbeat is missing, the second COM siwtches the mux to make it primary
02:44 PM enhering: and raises a emergency condition on the software
02:44 PM cehteh: i go on with my stuff :D
02:44 PM enhering: ok
02:44 PM enhering: Thanks a lot for your suggestions
02:45 PM cehteh: if you want some documentation system for your stuff http://git.pipapo.org/?p=pipadoc;a=blob_plain;f=pipadoc.html;hb=2c0c8a6c37a53e0871cbe8e20672f34bfa4ebf29
04:12 PM Jartza: evening
04:24 PM Lambda_Aurigae: morning
04:24 PM Lambda_Aurigae: I'm BACH!
04:36 PM antto: bach once again with the renegade mastah
04:42 PM Emil: God damn
04:42 PM Emil: coded the whole day
04:42 PM Emil: But made nice progress
04:42 PM Emil: It's quite a lot of spaghetti but :D
04:51 PM xentrac: you can rewrite it cleanly once you know what you're doing
04:52 PM Emil: true
04:52 PM Emil: But I would still save tremendous amounts of time just by designing it in a block diagram first :D
04:52 PM xentrac: I'm trying to unravel some spaghetti Python with the debugger
04:52 PM xentrac: only if your block diagarm is right
04:57 PM Emil: Well
04:57 PM Emil: if you can't design block diagrams
04:57 PM Emil: you shouldn't code
04:57 PM Emil: so I'd say they save time in all situations
05:22 PM Lambda_Aurigae: UML modeling!
05:22 PM Lambda_Aurigae: coding by drawing flowcharts.
05:22 PM cehteh: eek :D
06:09 PM Jartza: Lambda_Aurigae: I feel like mozart with this asm code
06:09 PM cehteh: Jartza: http://mozart.github.io/
06:09 PM Jartza: really need to do some strange composing to spread out the "functions" so that the -64..+63 instrution jump is enough
06:38 PM tpw_rules: https://twitter.com/Laughing_Mantis/status/883142018372739072
07:21 PM Lambda_Aurigae: Jartza, I'm more of a Picasso.
07:21 PM Lambda_Aurigae: it looks like crap but it works.
07:26 PM Jartza: :)
07:44 PM Jartza: Lambda_Aurigae: not sure if this is gonna be pretty either, haha
07:44 PM Jartza: OPV on steroids
07:44 PM Lambda_Aurigae: offshore patrol vessel?
07:45 PM Lambda_Aurigae: or
07:45 PM Lambda_Aurigae: oral polio vaccine?
07:48 PM Jartza: octapentaveega :)
07:49 PM Jartza: what I'm trying to do is to get scrolling working during vblank
07:49 PM Jartza: so no more those nasty tearing effects
09:17 PM BulletBob_ is now known as BulletBob
10:13 PM Emil: 2017-07-10 03:11:53 +0300 <Guest94170> hi
10:13 PM Emil: 2017-07-10 03:11:57 +0300 <Guest94170> asl plz
10:13 PM Emil: :DDDDDDDDDDDDDDDDD
10:13 PM Emil: Since fucking when
10:51 PM Chillum is now known as HighInBC
10:55 PM JanC_ is now known as JanC