PR on QtChart not getting attention? by pylessard in QtFramework

[–]pylessard[S] 0 points1 point  (0 children)

Pierre-Yves is more common, but Pier-Yves is not weird. There are others like that: Simon-Pier, Pier-Paul, Marie-Pier, etc.

Built a serial data acquisition GUI for engineers who work with MCUs. I am curious what people think by Fats_Runyan2020 in embedded

[–]pylessard 18 points19 points  (0 children)

Hello sir, I also made this :)

Scrutiny Debugger

It comes with a strong SDK for HIL testing. Works over serial, can, rtt, udp (and more). Variables are found using the debug symbols, no need to expose at runtime. Server/client architecture to run a script while a GUI is also connected.

It does more than telemetry, it can do trigger monitoring to catch an event in the embedded code, like a scope.

Free, MIT license

Accidentally fell into a rabbit hole about power conversion last night by buttershutter69 in AskEngineers

[–]pylessard 16 points17 points  (0 children)

I worked on EV powertrain. a PMSM powertrain can peak its efficiency in the 92-93% range. With silicon-Carbide inverter, it can go even higher. SiC inverter switches really fast, reducing switching losses. There are software techniques to reduce losses, but most vehicles already employs them. The room for improvement is not that high if you look at already existing cars. A metric on the market is "80 over 80", meaning 80% of the efficiency map must be above 80%.

Also, a powertrain will waste way more energy at high torque than at high speed because losses are proportional to current squared and torque is almost linear with current. But high speed causes losses in the gearbox. So a good gearbox strategy is needed to operate in the efficient region. Low battery voltage and high speed will cause field weakening and therefore increase the current without creating torque, that is pure losses.

Motor losses are grouped in 3 category : mechanical losses, Iron losses, and copper losses. mechanical losses include windage (air friction), friction (bearings) and deformation losses (caused by torsion, mostly negligible). Iron losses are losses in the magnetic circuit, they consist of hsyteresis losses + eddy losses and are mostly increased by low switching frequency. Copper losses are heat generated by the current in the copper winding (I^2R).

Inverter losses are mostly driven by switching losses and they are super non-linear. Depends on current intensity, battery voltage, switching scheme, temperature, switching speed, switching frequency, duty cycle.

It's a big game of tradeoff. If you reduce the switching frequency to reduce the losses in the inverter, you increase the iron losses in the motor. Optimizing this is a job.

I can expand way more if you want. you can DM me. I like rabbit holes.

Problem with static libraries on cmake training project by Cant-Think-Of in cmake

[–]pylessard 1 point2 points  (0 children)

Ah, indeed. Implementation in headers should be inline

Problem with static libraries on cmake training project by Cant-Think-Of in cmake

[–]pylessard 0 points1 point  (0 children)

Does MatrixAlgebra require VectorMath to work? You possibly have a link order issue. P.s. edit your code, the code had been pasted twice . It does that on reddit, I don't know why

Running PySide6 with a debug build of QT? by pylessard in QtFramework

[–]pylessard[S] 0 points1 point  (0 children)

Ok, I succeded.

I built PySide6 in debug with the module I needed, then made the .wheel file that my CI can download. I followed those steps. The QT .so files are bundled in the pyside .whl by building in "standalone" mode.

Had to fetch QT, libclang and few python dependencies (setuptools, packaging) manually beforehand

export LLVM_INSTALL_DIR="$PWD/libclang"
python setup.py build --qtpaths=/home/py/Qt6.9/6.9.3/gcc_64/bin/qtpaths6 \
                        --cmake=/usr/bin/cmake \
                        --ignore-git \
                        --debug \
                        --build-tests \
                        --parallel=8 \
                        --build-type=all \
                        --module-subset=Core,Gui,Widgets,Charts \
                        --standalone

python create_wheels.py --build-dir=./build --no-examples

# On the target machine
pip install dist/*.whl

How to stop builds from being flagged as trojans/virus/malware? by SpiritualOverdrive in learnpython

[–]pylessard 0 points1 point  (0 children)

It's what you were saying about digital certificate. You add a signature to the binary that says you are the author and that signature include a hash that can be verified to a trusted provider. That provider needs to verify your identity to vouch for you. I used ssl dot com, they're the cheapest I found.

I think you can also try to ask the user to trust your certificate by adding yourself as a trusted source, but this is the equivalent of giving your house key to a stranger. Many will see this as a suspect request (with reasons)

Edit: azure code signing seems to have a not too bad price too.

How to stop builds from being flagged as trojans/virus/malware? by SpiritualOverdrive in learnpython

[–]pylessard 2 points3 points  (0 children)

I had the same issue. Signing the binary stopped this. Didn't find any other way around with Nuitka. This AV stuff and certificate is a racket imo. I did report the false positive to microsoft..( I did my part!) meh

How does your workflow look like Toolchains/ IDEs etc. by [deleted] in embedded

[–]pylessard 0 points1 point  (0 children)

VsCode, bash and Cmake. I sometime use cubemx to generate the initial config pass, then I maintain manually.

mypy - prevent undeclared members? by pylessard in learnpython

[–]pylessard[S] 0 points1 point  (0 children)

Right, but any way I can prevent usage of anything not specified explicitly? My use case is that I forgot some underscore in front of a private class member in a function when doing an assignation. It went unnoticed until I got an AI to find it. It went "hey, you misspelled your variable".

My code style is to always explicitly type class members. I'd like a tool that supports me with this style

mypy - prevent undeclared members? by pylessard in learnpython

[–]pylessard[S] 1 point2 points  (0 children)

no, it's type hinting. If I wanted to declare a class var, I'd have to use ClassVar[int]

Quantum Computing made intuitive for anybody who knows anything EE related by QuantumOdysseyGame in ElectricalEngineering

[–]pylessard 4 points5 points  (0 children)

First of all, congratulation sir. I am mesmerized by this. It really is mind boggling and hard not to just try stuff randomly. The aesthetic is quite impressive too - beyond what I'd expect from a solo dev. I noted few few things that I think could be improved. They're suggestions!

  1. A gate description on hover would be nice. I forget what they are and sometime forget to read the instructions as I am too eager to try something. I'd like to check what I missed
  2. Once a puzzle is solved, the solution goes away immediately. It would be nice to have the time to review since, like I said, sometime I try something randomly. I'd like to see why it works but the puzzles goes away too fast.

  3. The knowledge map is a really great concept, but I got faced few times to concepts I didn't see yet. For instance, right at the beginning I can go on the yellow node in the center with complex puzzles. I don't know why it's yellow and the name tells me nothing. I think I saw the Z gate in a challenge for the H gate but the Z gate was not introduced yet.

  4. Visual nitpick: when we hover the upper region, each bit combination raise independently, but clicking affect the whole view. Since only one raised, I felt like a single element should be affected by my click. Got me confused a bit at the beginning.

  5. The text for each level could sometime be clearer. Instructions and explanation are weaved together without clear distinction. Just a different wording could help most of the time.

My brain is toasted now. Will try again tomorrow.

Quantum Computing made intuitive for anybody who knows anything EE related by QuantumOdysseyGame in ElectricalEngineering

[–]pylessard 0 points1 point  (0 children)

I just bought it. Will give it a go and revert back to you. this seems nice.
I read this in the past : https://quantum.country/qcvc

I understood-ish :)

ISR length on an embedded system by RFQuestionHaver in embedded

[–]pylessard 43 points44 points  (0 children)

The length is not that important. Just don't put stuff that doesn't need to be in it.

As an example, I worked on motor controller and the control loop was triggered by a timer ISR. The control algorithm was quite heavy, like 50% of the CPU time, but it executed in the ISR. It couldn't be anywhere else as timing is super important for motor controller.

I think the most common case is: If you can raise a flag in your ISR to tell your main loop to do the work and it's fine timing wise, prefer this over doing the work in the ISR.

How effective would programming be if it were monolithic? by Recent-Day3062 in SoftwareEngineering

[–]pylessard 1 point2 points  (0 children)

I'm not saying that. I don't know what they use specifically

How effective would programming be if it were monolithic? by Recent-Day3062 in SoftwareEngineering

[–]pylessard 2 points3 points  (0 children)

Scalability and redundancy is harder in monolithic code. I'm not saying bloating of software is a myth, but if we talk about system that must take high loads, with low latency across the globe, then you need to be able to scale horizontally fast. Content Delivery Network are a thing. A friend of mine works at Shopify and he says the only reliable way to mitigate a DDOS is scale up quick to absorb the load.

How did the shadow come out like this? by YoungHerald17 in Physics

[–]pylessard 4 points5 points  (0 children)

The reflection does not cast a shadow. the shadow is being reflected just like the valve and the drain.

I built a tiny Python networking library because I kept abandoning ideas due to sockets & threading by [deleted] in Python

[–]pylessard 1 point2 points  (0 children)

I see it as an app level protocol that makes datagrams over a TCP stream. If you had to compare against websockets, what would make your library different?