Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions and chit-chat #12

Closed
leptun opened this issue Apr 7, 2020 · 72 comments
Closed

Questions and chit-chat #12

leptun opened this issue Apr 7, 2020 · 72 comments

Comments

@leptun
Copy link
Collaborator

leptun commented Apr 7, 2020

Hi @vintagepc
Thank you for inviting me to this project. I've read what you wrote so far in readme.md. I have a few questions:
How do you propose that we communicate after you push the first usable source code?
Are there others involved in the project?

@vintagepc
Copy link
Owner

You're welcome!
Right now it's just you and me (I invited wavexx as well).

I don't have anything in particular lined up for comms, I figured that with a small number of folks we could probably just use issues like a forum thread for notifications and discussion.
Certainly once we get going we can look at alternatives (slack, etc) for casual discussion.

As this is a private github repo I'm currently limited to 3 invites, so I'm playing it by ear. If you have suggestions for other folks that might be able to contribute I'm happy to hear. The private nature is only temporary though - mostly because it's in the early stages of bring-up and many of the tasks are serial in nature. Once the firmware at least boots, we can "fan out" and it's easier for multiple people to work on tasks like implementing a piece of hardware without either duplicating efforts or stepping on each others' work.

I don't have any expectations on contributions or anything - I invited folks out of interest in the project and not because I had expectations they would contribute :)

In terms of status I'm hoping to spend a bit of time each evening this weekend some of the weekend to see how far I get, and to clean up what I've got into something consistent and maintainable to push it.

@leptun
Copy link
Collaborator Author

leptun commented Apr 7, 2020

@vintagepc yes, Wavexx just also saw your invite. I’m thinking that maybe 3d-gussner could also be interested in this. I’ll ask him later.

I’m really curious about the stepper implementation. Imagine emulating MK3 hardware completely. What I mean by this is creating actual “hardware” limits for tmc drivers and loading a custom MBL matrix for testing the code and stuff like that.
Also, the UVLO can be tested in an environment that is much more controlled than cutting power.

@vintagepc
Copy link
Owner

vintagepc commented Apr 7, 2020

Absolutely! Once we get this going there's very little we won't be able to do in terms of poking and prodding to set up test cases.

I'm also happy to invite 3d-gussner if he's interested. I contemplated dracer as well but I don't have a good sense of whether he'd be interested this early since he's got other priorities.

Also,
PROGRESS! (I traced #11 down to an issue with the serial IO handling. Disabling it in the firmware... it boots!

image

image

@leptun
Copy link
Collaborator Author

leptun commented Apr 7, 2020

@vintagepc Would it be better if we started smaller? I also want the target to be MK3/S, but maybe it would be easier if we started with MK2.5/S and worked our way up to the other printers.

@leptun
Copy link
Collaborator Author

leptun commented Apr 7, 2020

@vintagepc Also, is anything in the emulator persistent?
After a "reboot", do you still have the same EEPROM contents?
And as for the W25X20CL flash, I'd make sure that doesn't erase itself every time we change anything in the code.

And @3d-gussner would also like to join this project.

@vintagepc
Copy link
Owner

Maybe - though I get the impression the main part is soon going to be just getting hardware modules online and I think that after the initial layout learning curve that should go pretty quick for things in our areas of expertiese, where each bit is a relatively straightforward component. At least in my case my frame of reference is the MK3S and I'm not intimately familiar with the MK2.5S and its bits/pieces. I have more visibility right now since I'm looking at the interfaces and code and mapping it out in my mind, but I think this'll get clearer once I push it up for you guys too.

I'm definitely not opposed to that though, far from it.

Any memory is easily made persistent. The program memory is already - for faster testing turnaround I have it reload the firmware/bootloader each time but that can be disabled. The contents are stored as a .bin file on disk (easily hexdumped for inspection) (you could theoretically program it with objcopy -I hex <firmware.hex> -O binary <flash.bin>

I've been conservative with my estimates on timing, progress has been progressing faster than I anticipated so I may push something up sooner rather than later.

Side note, I think this bringup will also reveal some interesting things in the firmware codebase as well, for example prusa3d/Prusa-Firmware#2582 - Not necessarily things that are broken, but just something that someone should take a second look at.

I sent 3d-gussner an invite. I'm actually really excited for where this is going given I tossed it out as a casual idea; the mind still boggles that I even managed to get it to boot to the main marlin menu in the span of a few days. 👀

@vintagepc
Copy link
Owner

Also I think it would be ultra-cool if we could get this wired up enough to the point we could even graphically simulate a print. Would Prusa be the first to have a fully virtual 3d printer? Might even have implications for something like P'licer giving you a toolpath or print animation!

Lofty goals, I know. So many ideas, so little time!

@vintagepc vintagepc changed the title Questions Questions and chit-chat Apr 7, 2020
@leptun
Copy link
Collaborator Author

leptun commented Apr 7, 2020

I was also thinking about that, but I think it is a bit too early to even start thinking about those implementations. I agree with you that a live 3D model of the "printer" would be quite useful for some functions.
Btw, what's the performance of the emulation? Is it horribly slow?
In my case, the fans ramp up to max as soon as I start the hd44780 example in the simAvr source...

@vintagepc
Copy link
Owner

Yeah, that's definitely a looooooooooooong way off.
On my laptop (from 2013) it feels a bit more laggy than the real thing, but I often have program counter logging on since I'm still debugging early boot stages.

I'm pretty sure the examples are not well optimized, I think the display one basically has a while(true) with no sleep cycles in it somewhere... Also, that example enables VCD traces by default so it's logging a ton of data every 10 usec, IIRC)

@leptun
Copy link
Collaborator Author

leptun commented Apr 7, 2020

You say it feels a bit more laggy... Would it even be possible in the future to speed up the runtime for generating some of the weirder bugs that don't happen instantly? (Aka fast-forward)

@vintagepc
Copy link
Owner

I think so. I'm almost certain some of the lag comes from unoptimized things like display draws, I am definitely not a GL expert, I think it updates anytime there's a display write, for example. No reason that couldn't be changed to delay slightly in order to aggregate several character writes.
Once we get a proof of concept I think we should be able to get improvements. I haven't gotten to the point of trying to profile stuff yet.

@leptun
Copy link
Collaborator Author

leptun commented Apr 7, 2020

@vintagepc Just saying, when the LCD buffer will get merged into the MK3 branch, we could make it even more lightweight. Just read the buffer in memory for the characters. Only the custom characters should be a bit more interesting.
Btw, in my latest push to that PR I also created a "banking" implementation for the custom characters (since we have 11 chars that must fit in 8 cells). With the new implementation, each and every custom character has a dedicated uint8_t value. This means that we could even just edit the font of the drawing program to have our custom characters in the 0x00-0x0F range.

@vintagepc
Copy link
Owner

Oh, cool! I contemplating implementing the custom character upload to-spec on the reference display. But as noted in #4 there are some issues with the stock implementation to address first with regards to framing/memory locations.

@3d-gussner
Copy link
Collaborator

Thanks for inviting me.
I am Waldi aka 3d-gussner.

@vintagepc
Copy link
Owner

Welcome aboard!
BTW, if folks have any particular issues/hardware they are interested in working on then please feel free to comment on or claim them. I'm hoping to get my exploratory hackery cleaned up in the next few days and then we'll be off to the races!

@leptun
Copy link
Collaborator Author

leptun commented Apr 8, 2020

@vintagepc I’m a bit new to coding outside embedded platforms... How exactly do you make it “run”. I know that is a basic thing, but I’d like to have a basic understanding of what is going on. After that, I can begin to understand how your code works and move on to the W25X20CL task.

@vintagepc
Copy link
Owner

Ah, sure. Let me finish pushing up the rest of my assortment of stuff. I just finished templating a basic SPI dummy class to see if I could get it to print out the bytes it's receiving from the AVR.
I'll follow up with a readme.

@vintagepc
Copy link
Owner

I've bumped up what I have so far along with a few readmes and whatnot.
Let me know if you have any questions/issues getting started!

@vintagepc
Copy link
Owner

Observation: Partway through the TMC2130 work I think that's part of what's causing it to be sluggish. It's constantly detecting crashes and trying to rehome (even if I cancel the setup wizard)

@vintagepc
Copy link
Owner

Github now has unlimited collaborators on private repos - so if you can think of other folks that should be invited to preview/contribute to the project, please don't hesitate to let me know!

@wavexx
Copy link
Collaborator

wavexx commented Apr 15, 2020

What about @dracer :)

@leptun
Copy link
Collaborator Author

leptun commented Apr 15, 2020

@DRracer not @dracer

@wavexx
Copy link
Collaborator

wavexx commented Apr 15, 2020

Yeah sorry :)

@vintagepc
Copy link
Owner

Invite sent!

@leptun
Copy link
Collaborator Author

leptun commented Apr 15, 2020

@wavexx I've done this mistake in the past. The only way I noticed the mistake was that the text wasn't capitalized automatically.
RIP @dracer for the spam he probably gets whenever someone mistypes @DRracer's name

@vintagepc
Copy link
Owner

"Who the hell are all these random people mentioning me on 3d printing stuff? " 🤣

@DRracer
Copy link
Collaborator

DRracer commented Apr 15, 2020

oh, now I understand ;) . Thanks for inviting me into the simulator.

@vintagepc
Copy link
Owner

Welcome aboard!

@DRracer
Copy link
Collaborator

DRracer commented May 27, 2020

@vintagepc please contact me via email, we'd like to send you some present for your work on FW 3.9.0.

@vintagepc
Copy link
Owner

How do folks feel about an expanded private beta now that all of the tasks in "Functional MK3S" are complete? Anyone specific come to mind?

@3d-gussner
Copy link
Collaborator

I think this would be a great tool for Scott from the Marlin team.
And Gina from Octoprint, not sure if she has the time but could imagine that she would know some developers who would be very interested in this.

@wavexx
Copy link
Collaborator

wavexx commented Jun 23, 2020 via email

@leptun
Copy link
Collaborator Author

leptun commented Jun 23, 2020

Isn’t it better when you surprise people with a finished project? That’s what I would personally do. (Hint for a project I’m working on)

@vintagepc
Copy link
Owner

Yes on the last point... I've seen that more general users often lose interest if you share a project too early because they don't have time to deal with the constant updates or things being not functional yet.

I'll reach out to Scott and Gina :-)

@wavexx
Copy link
Collaborator

wavexx commented Jun 23, 2020

It's a good point. I generally simply don't announce it ;)

@vintagepc
Copy link
Owner

vintagepc commented Jun 23, 2020

Welcome aboard to @foosel 😄 🐙

@foosel
Copy link
Collaborator

foosel commented Jun 23, 2020

Hi there! Will have to give this a test soon, looks awesome!

@3d-gussner
Copy link
Collaborator

@foosel moin moin, I used it very often to troubleshoot things and used Octoprint for communication. We could troubleshoot few issues in the Prusa Firmware with Octoprint.
Nice thing is that @vintagepc made it better and better.
New boards that are used on different printers are now possible and this opens a new world for testing and development.

@wavexx
Copy link
Collaborator

wavexx commented Jun 24, 2020

Btw, I know on linux simavr creates a tty. I have zero experience on windows, but does it create a virtual com port?
AKA, can you attach octoprint to it? ;)

@vintagepc
Copy link
Owner

vintagepc commented Jun 24, 2020

You have to build it with Cygwin on windows. I imagine that if you were to make a virtual COM port in Win you could pipe it through to the PTY to get a connection. I think the project (and simAVR, more importantly) use too much underlying linux stuff to ever be able to build a native windows version.

@vintagepc
Copy link
Owner

Welcome aboard to @thinkyhead!

@vintagepc
Copy link
Owner

I know I've been saying this for a while but I think we've got all the major functionality out of the way... I think we are in good shape to flip the switch to public in the very near future once we wrap up the MK3 variant work! 🎉

vintagepc added a commit that referenced this issue Jul 25, 2020
@vintagepc
Copy link
Owner

We are public!

Note this decoupled the previous fork(s) you may have had to private repos, so you will need to create a new fork and/or rebase your changes onto the current repo.

@leptun
Copy link
Collaborator Author

leptun commented Jul 25, 2020

Wonderful news! Where are you planning to make a post about the project?

@vintagepc
Copy link
Owner

vintagepc commented Jul 25, 2020

I haven't thought that far ahead, I figure I might just let it gain its own momentum. I might post about it in the PR forums.

(I don't do social media like reddit etc, so my exposure avenues are somewhat limited).

Who knows, maybe someday we'll get featured on a Prusa livestream or blog post... 🤣

@DRracer (wink wink nudge nudge)

@DRracer
Copy link
Collaborator

DRracer commented Jul 26, 2020

@vintagepc great news! I'll talk to our Content team about the (now public) MK3SIM, in fact I already got some questions about its state and whether it will get public one day.
The best timing to promote your huge effort is with FW 3.9.1 and largely repaired Linear Advance 1.5, which wouldn't be possible without the SIM and direct insight into what is going on in the algorithms during printing. @wavexx , what do you think?

@DRracer
Copy link
Collaborator

DRracer commented Jul 26, 2020

@vintagepc - a short notice:

  • cloned with submodules
  • apt install libelf-dev libsdl-dev freeglut3-dev
  • opened CMakeLists.txt in QtCreator 4.13b1
  • compiled like a charm with gcc-10.1.0 ;)
    It runs, however I'm still having problems with the boot process taking about a minute. The "P" and "E" letters are rotating, but nothing is happening. It is standing at pBoard->WaitForFinish(); and some other threads are possibly waiting for UART. At least I can debug it nicely with full comfort in QtCreator ;) . I'll let you know if I discover something (if @leptun isn't faster as always :) ).

@vintagepc
Copy link
Owner

vintagepc commented Jul 26, 2020

@vintagepc - a short notice:

  • cloned with submodules
  • apt install libelf-dev libsdl-dev freeglut3-dev
  • opened CMakeLists.txt in QtCreator 4.13b1
  • compiled like a charm with gcc-10.1.0 ;)
    It runs, however I'm still having problems with the boot process taking about a minute. The "P" and "E" letters are rotating, but nothing is happening. It is standing at pBoard->WaitForFinish(); and some other threads are possibly waiting for UART. At least I can debug it nicely with full comfort in QtCreator ;) . I'll let you know if I discover something (if @leptun isn't faster as always :) ).

Interesting, please feel free to start a separate issue thread so we can debug this without other messages getting interleaved.

(You did load a firmware to flash at least once with a -f flag or PS/avrdude, right? Otherwise you might just be bootlooping the bootloader. Don't think this is the case though, sounds like it does eventually finish the boot process)

The wait state sounds about as expected, WaitForFinish() is basically a thread_join that returns when the AVR shuts down. Most of the other threads are indeed just serial helpers.

It might be useful in this case to inspect the avr->pc value while it's bootlooping and reference that back to an objdump of the .afx file to see in what function it's stuck. (Board.h::RunAVR()). See FirmwareDebug.md for info how to make the dump)

@DRracer
Copy link
Collaborator

DRracer commented Jul 26, 2020

@vintagepc sorry, my bad, no firmware (parameter -f). Now it runs well, thanks for your hint.

@vintagepc
Copy link
Owner

No worries. I added a note to the README to that extent, you weren't the first, and won't be the last ;)

@wavexx
Copy link
Collaborator

wavexx commented Jul 27, 2020 via email

@3d-gussner
Copy link
Collaborator

@vintagepc
Copy link
Owner

Heh, that explains the giant spike in traffic yesterday 😁

@vintagepc
Copy link
Owner

I've enabled a wiki for the project, seems like a useful addition as a place to document technical info as required.

Feel free to add/edit as you see fit, hopefully it will morph into something with a clearer direction as we find uses for it. :)

@vintagepc
Copy link
Owner

Welp, I posted about it in the forums.
Time to brace for the masses 🤣

Repository owner locked and limited conversation to collaborators Mar 7, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

6 participants