Marlin Surface scanning on a Delta 3D printer - help

Alright, doesn’t sound too bad, ill look into them, ill let you know once i install your firmware!
How much compiling do I need to do, change stepper drivers, board, dimensions of the machine etc. right?

µCNC should install on your board just fine. It’s a basic level firmware at the level of grbl, so LCD, SD card and wifi will not work. Just the USB connection.
As far as trinamic drivers, I don’t have that implemented (yet) so the will run with the configuration as other basic drivers without special configuration commands.
I have made also a boardmap file for your board but I’m still checking somethings and haven’t uploaded it yet. Maybe I will be able to have it running tomorrow.

The other thing I don’t know is if your board has any vanilla bootloader. If it comes with marlin I’m assuming yes. If so after I upload the boardmap to your board the only thing you will have to do is open Arduino IDE, compile the code and uploaded (I’ll instruct you on the options for that later).

Does uCNC support the surface mapping? Or is bCNC going to have to handle that?

1 Like

µCNC currently does not support surface mapping. Maybe in a near future. For now that would be handled by bCNC, OpenCNCPilot or any other Grbl flavor protocol talking program that has that feature.
I only have experience with OpenCNCPilot. It’s very intuitive.
You set a matrix. It scans the surface then sends the modified gcode to the grbl controller (in this case µCNC that uses the exact same message protocol).

2 Likes

Ok I’ve uploaded the boardmap for your board. Just a few questions.
Have you ever uploaded any firmware to your delta?
Have you used Arduino IDE?
If so do you have the STM32 boards library?

EDIT: It looks like the MKS Robin uses a modified marlin version and custom bootloader. So tell me if you ever uploaded any firmware to the board and what software or tool did you used.

EDIT2: A second look and it seems marlin also suports it. So forget that silly comment

1 Like

Wow, thank you for putting the work in!
Ive uploaded firmware before, marlin, through the micro sd card. Tried once or twice with serial through VSC but didn’t manage. Im sure that ill manage with IDE

Ive used Arduino IDE before but for simple uno projects, although i saw a couple of videos and i guess it works like VSC pretty much even when it comes to more complex projects.

No STM32 library at the moment, but i can find it np :slight_smile:

Worked on the end effector part of the project these couple of days, ill get back on firmware etc tonight and ill let you know!

1 Like

According to this your board has a bootloader of it’s own that loads the firmware placed in a SD card. So you wont be able to load it via Arduino IDE.
I’ve made a specific branch and compiled a bin with the firmware with the stated 0x7000 offset.
You can access the bin file here.

Before uploading the file via SD some precautions:
Do you have a STLink to be able to reprogram your firmware if any thing goes bad? I thing I’ve inserted the correct offsets and all should work but you never know…

EDIT: I’ve deleted the bin file. Do not use it. I must do another modification. I’ve spotted a problem in the way the emulated EEPROM is implemented on stm32. I’ll fix it and reupload the bin.

Shouldn’t the bootloader handle the offsets?

I would expect the bootloader will protect itself, so I don’t see any added risk to this vs. any other firmware.

I may be wrong. I am not an embedded SWE.

1 Like

I don’t know about overwriting the bootloader, but I’m sure the reset vectors will be pointing at the wrong place, so the firmware would not work.
I’ll do a quick test in my Arduino Zero board and I’ll let you know if the bootloader is affected.

EDIT: As I suspected the bootloader is not affected but the firmware won’t run.

But I’ve spotted a problem in the firmware that might damage the bootloader. I’ll do a quick fix.

EDIT2: After reviewing the code the bootloader would be ok…but it would cause problems to the firmware itself. I’m currently working on this issue.

1 Like

Re-uploaded the binary for you to test.
I actually had to redo part of the FLASH EEPROM emulation on the µCNC.
µCNC is small much like Grbl (in the case of your board that uses an external USB driver it is about ~36Kb). I had the FLASH EEPROM @ address 0x0800FC00 (63Kb from the start). It was enough for flashing even with the Arduino bootloader (Maple) taking some space at the beginning of the FLASH memory @ address 0x08000000.

The bootloader on your board is gigantic (the offset 0x7000). This means that the firmware will only start 28Kb after the start of the flash. Well 28K + 36K = 64K. And this would not work.

Although your MCU has 512Kb I’ve configured your boardmap to place the EEPROM @ address 126K
Has @jeffeb3 mentioned it should be safe for you to try it. But having an st-link with you would not harm.

EDIT: Just a couple of notes. I’ve compiled µCNC with option ENABLE_SETTING_EXTRA_CMDS enabled.
This does 2 things.
Editing settings in µCNC is the same has in Grbl. The difference is that with this option they are not stored in flash immediately. you can tinker around with the settings and then to actually store them you do an extra command $SS.
One other thing. For the delta printer only to extra settings you need to add:
$106= is the length of your delta arms and $107= is radial difference between the tower/arm joints and the effector/arms joints. Oh and ser $27= to 0 Homing pull-off, mm

EDIT2: I keep forgetting things :rofl: :rofl:. It also adds an additional Grbl style command. By sending $P it will print the states of the configured pins. This is useful to debug any issue. You can read more about it here and the list of pins is here

Hey, thanks again for putting in all this work!
I read your comments again and I got the bin, ready to upload.
No st-link at the moment but yolo :smile: I guess that if something goes wrong ill get one…:open_mouth:

I barely understand anything youre writing, as I said im a bit of a pleb in these matters.
Going to open your .bin with IDE and compile it with my specs!

Ill let you know if I dont know how to do smth, very likely that Ill need a bit of a walkthrough

EDIT 1: Trying opening it, cant open bin files with IDE it says…I really dont know anything about all this :sweat_smile:

EDIT 2: Okok, I assume I need to download all the package, with config etc and open that in IDE.

The .bin file is for you to put on the sd card and insert the sd card on your printer and power up the printer. That’s it. I don’t know that bootloader but my guess is it Will ask you if you want to install the firmware on the sd card. You don’t needs to compile anything… Unless you want to change firmware settings.

You should then connect your delta printer usb connection to your PC. Then use any grbl software and connect to the Com port of your printer. Choose a grbl software to work with. I recommend OpenCNCPilot. Super easy. On connect you should see a bunch of Green messages showing on the low right corner of the window (they fade way after a few second).

If you never used grbl go check the wiki. Don’t forget to configure you delta settings (like the towers steps per mm, etc…) with the $ grbl commands. In the case of your printer you should enable Hard limits and homing. Beware… That was a quick a dirty implementation of delta kinematics so it Will allow you to move the printer without homing and you could move it to places were the delta geometry can’t go… But I guess that’s a bit like any cnc when you send your machine beyond it’s limits. You should home before moving the printer.

1 Like

Ok so,
Added the bin to the sd, sd to the printer and turned on, screen said TFT updating/uploading, reached 100% and got stuck there.
Waited a couple of minutes then turned off.
Put my sd in the computer and said files were compromised, had to format, stupidly I didnt save a copy of my files…anyways.

Added the bin once again to the sd and then the printer, turned on, screen displays “booting…” but doesnt get past it.

Downloaded OpenCNCPilot, selected my port and pressed connect. Says its connected but wont home the axis or anything.
If its because I havent configured my printer setttings then ill do that now, otherwise not sure what could be wrong!

EDIT 1:
When I plug my sd in my computer it only has one file, ROBIN_NANO.CUR

Also, before adding the firmware I changed the name to Robin_nano.bin , instead of Robin_nano_uCNC.bin, one of the printer forums mentioned that it was the correct format for the bootloader, I previously used it with marlin.

Hummm…
So first things first. when you connect the USB cable to your PC adds another COM port right? You should look on your PC Device Manager. Assuming that it does…are you connected to that port right?
On OpenCNCPilot turn on debug messages to see the message exchange responses:


If nothing is happening try to reinstall Marlin like you did once. Or in alternative reinstall the original Robin Nano firmware.

If the bootloader somehow got corrupted you will need to reaploaded with an ST-Link although that should not be the case. The boot loader wright the firmware to a safe position and the Flash eeprom is far way from all that.

Let me know how it went.

1 Like

Indeed I was connected to the correct serial port, in this case COM5, shows up both on Device manager and OpenCNCPilot.

Opened the debug console, but nothing happened, I noticed at the top middle it says disconnected instead of idle like yours.

Re-booted with the stock firmware on the sd, bootloader worked just fine, atm stock firmware is installed and running like before.

EDIT 1: When your firmware was on, I Sent a homing commmand and clicked that disconnected button, both showed up on the console at the right but nothing happened

EDIT 2: With the stock firmware I can connect to OpenCNCPilot, shows me green info at the bottom, but no homing, I guess it doesnt recognize the $ language

1 Like

Ok.
That means the firmware either didn’t install correctly (you could try to re-uploaded it) or isn’t working correctly on your board.

I’ll take a look at it and check if I missed some thing.

By the way… With your original firmware… . On the left side of opencnc there is a bunch of boxes… One of them says manual… You can send commands through there. Try sending a homing command from there (if you have a marlin flavored machine it’s G28).
Then try to do a probing command like G38.3 Z-10 or something like that. To see of open pilot recognizes the protocol…

I might have got the linker script wrong so that’s probably why it did not do anything. I’ve uploaded a new bin file called Robin_nano_uCNC_align4.bin and has you can see it’s nearly half the size.
Try that one and see if it works.

With Marlin

When I connent this is what shows up at the bottom right:

image

If I click one of the boxes on the left under manual, zero (g10)… , the command is loaded but nothing happnens. But if I write it in the box space, G128 for example, it works!!

image

Lowered the arms to see at what speed it would do the homing and if any stepper motor noise occurs and the homing works smoothly.

G38.3 and G38.3 Z-10 seem to be unknow commands

Now with the new bin file:

Put it on the sd: booted, TFT updating gets stuck on 100%
Trying a G28 in OpenCNCPilot, nothing happens

Switch off and on again, screen is stuck in booting…
Trying a G28 in OpenCNCPilot, nothing happens once again unfortunately

When I connect with OpenCNCPilot, no green text appears on the bottom right

Tried once more with the new bin and same results

That’s odd. See this
EDIT: My bad you should have set the feed rate also…like G38.3 Z-10 F100

With the check on message debug if the protocol is not exchanging messages there is no point in going on. You can always go to manual command and send a question mark ? to see if it replies… but if it doesn’t forget it.

Ok so 2 conclusions…

  1. OpenCNCPilot will not work with Marlin.
  2. Either MKS Bootloader has more tricks up it’s sleeve or I’m doing something wrong. But I replicate this same procedure with my SAMD21 board and Bossa (the tool that sends the bin to the bootloader) and all goes well. Maybe the bootloader is expecting some detail I’m unware.

I’ll try to figure it out by googling for some answers. For now you have two options left:

  • Either get and alternative board and move your drivers, motors and switches to that board. µCNC supports AVR boards like UNO and MEGA, SAMD21 boards like Arduino M0 and Arduino Zero, and STM32F1 like Bluepill and yours, and the respective shield for hosting the stepper drivers and switch connections (for example for MEGA there is RAMPS). If you decide to go this way my advice is to choose a 32bit board. The extra power will come in handy to deal with delta kinematics forward/inverse transformations.
  • the cheaper solution is for you to get and ST-Link and take a chance in reprogramming the ST chip in your board (that would erase your bootloader. You could reupload it later but there is always risks if you are not comfortable with the operation).
1 Like