Welcome! Log In Create A New Profile

Advanced

newbee to platformio, need initial startup to configure for board only in imports file.

Posted by WOWElectronics 
I spoke too soon. first "home all" appears to work but a g1x35 y35 z0.2 misses the bed screw by 50mm y to the rear, and 20mm x left of the screw. A g28 issued from there results in x moving at call a surveyor and set stakes speed. If it finds the switch and goes on to y, the motion is spastic and angular and in either case homing fails, requiring a Power down reset. the g28 after the tems are reached in a file, always fails homiing even if its sitting a mm from the switches.

There is also a TMC COM error reported at power up. That is likely the important thing. Do I have the socket jumpers in wrong? I have lots of tmc2209's and they all seem to act the same. There is not a bed sensor other than the one at the top of the right hand rail. All sockets are jumpered alike, the ejector I think is acting normal.

Thanks Bob.

Cheers, Gene
YES!!!

"project init command" - I have no idea what that is. Is it a VSCode thing?

I took your ZIP file and unpacked it. I then took the ..\Marlin-2.1.1\Marlin\configuration.h file and modified it (the modified version is attached to my last post). I then opened a shell window, navigated to the directory ...\Marlin-2.1.1 and issued the platformio run -e mks_robin_nano_v3_1 command. No "project init command" involved.

I'm REALLY surprised that the touch screen worked. Usually there is a serial port that is used to communicate between the motherboard and the touch screen. As far as I can tell only the USB port is enabled. What touch screen do you have? How is it connected to the motherboard?

"5 point bed leveling" - I don't think that is a Marlin thing. You'll have to read the docs as to what leveling options are available in Marlin.

Do you have a bed leveling probe (such as a BLTouch)? Most of the advanced Marlin bed leveling options uses a matrix of probed points. Filling the matrix in manually is a real pain so a bed leveling probe is soon on the upgrade list.
Re: newbee to platformio, need initial startup to configure for board only in imports file.
December 31, 2022 01:31AM
[docs.platformio.org]

Marlln is not a new project, all of this is already done
Re: newbee to platformio, need initial startup to configure for board only in imports file.
December 31, 2022 01:34AM
Has #define MKS_TS35_V2_0 with #define TOUCH_SCREEN

Is a spi screen, under marlin control.
not a serial touch screen

Edited 2 time(s). Last edit at 12/31/2022 01:51AM by Dust.
Re: newbee to platformio, need initial startup to configure for board only in imports file.
December 31, 2022 01:49AM
TMC COM error has many causes.

1) power, these drivers need 12/24v before or at same time as logic voltage. So powering the board just over USB will cause this error.

2) board pins are not set correctly

TMC UART moder set
     O O O  M0
     O O O  M1
     O=O O  M2
     O O 
  MKS TMC2209, MKS TMC2225, MKS TMC2208 plug in to use UART mode directly

3) some tmc stepper driver have a jumper to set what pin is used for uart communications. Or the stepper driver uses a different pin than the motherboard is expecting (common issue if using miss matched brands of components)

You should send a M122 to the controller, it will tell you if it is all tmc stepper drivers of just 1.

Edited 1 time(s). Last edit at 12/31/2022 01:51AM by Dust.
Quote
[email protected]
YES!!!

"project init command" - I have no idea what that is. Is it a VSCode thing?

I took your ZIP file and unpacked it. I then took the ..\Marlin-2.1.1\Marlin\configuration.h file and modified it (the modified version is attached to my last post). I then opened a shell window, navigated to the directory ...\Marlin-2.1.1 and issued the platformio run -e mks_robin_nano_v3_1 command. No "project init command" involved.

I'm REALLY surprised that the touch screen worked. Usually there is a serial port that is used to communicate between the motherboard and the touch screen. As far as I can tell only the USB port is enabled. What touch screen do you have? How is it connected to the motherboard?

TFT35 that I cut the knob and pot off of so it would fit the existing window in the printers base, The versioi 1.2 board had a 40 pin ribbin cable to connct them, the newer board uses two 20 pin cables on normal header connectors.

"5 point bed leveling" - I don't think that is a Marlin thing. You'll have to read the docs as to what leveling options are available in Marlin.

That is one of the options for g29, but its a build time option, one of at least 6 ways to do it from what I've read.
I have now tried all 3 versions of the jumpers inside the driver sockets, with affecting the TMC COMMUNICATIONS ERROR at boot time. None of the three will run the motors properly. It turns out thaat I have 4 of the TMC2225's, aparently from the old board, and 5 of the TMC2209's that came with the new board kit. Supposedly interchangeable but the error at power up remains, X moves extremely slow but it the right directoin, Y moves fitfully stopping while x moves right. an Z tries to go around 10,000, stalling, and all will now generate a home error, please reset msg. So something is still fubar.

Do you have a bed leveling probe (such as a BLTouch)? Most of the advanced Marlin bed leveling options uses a matrix of probed points. Filling the matrix in manually is a real pain so a bed leveling probe is soon on the upgrade list.

This printer was w/o but was stable enough once the knobs were set, that it Just Worked, for about 2 weeks. I do have some prox sensors, but they don't work that well on glass beds, A bltouch is a pita, +- half a mm at times.and is the first change I made to the Ender5+, replacing it with a steel bed sheet and a prox sensor which worked much better than the bltouch. I bought the wrong prox though so had to make a transistor invertor to make the ender5+ think it was a bltouch.

if, instead of the TMC modules, I plug in three of the stepper/servo's, they seem to behave themselves much better just laying on the table, but plug in the drivers, and it doesn't seem to drive them correctly although its trying to be a corexy.

I should see if I can rig a home switch on those servo's and see if it actually homes them. I have moved the TMC2209's around but the trouble stays with the socket.

But it getting late here, nearly 2am, so I'llsign off for the night.

Thanks bob.

Cheers, Gene.
Quote
Dust
TMC COM error has many causes.

1) power, these drivers need 12/24v before or at same time as logic voltage. So powering the board just over USB will cause this error.

2) board pins are not set correctly

TMC UART moder set
     O O O  M0
     O O O  M1
     O=O O  M2
     O O 
  MKS TMC2209, MKS TMC2225, MKS TMC2208 plug in to use UART mode directly

unforch its 2 am here, and all sockets are currently set for spi, I'll change them bsack to uart in the morning and report, right now all 5 are "error:low"

Thanks dust, back in the morning.

3) some tmc stepper driver have a jumper to set what pin is used for uart communications. Or the stepper driver uses a different pin than the motherboard is expecting (common issue if using miss matched brands of components)

You should send a M122 to the controller, it will tell you if it is all tmc stepper drivers of just 1.
Dust is correct. #define MKS_TS35_V2_0 and #define TOUCH_SCREEN are enabled. My memory is getting worse by the day!

Make sure the DIAG jumpers have been removed. This could interfere with the endstops.

Use the M119 command to see the status of the endstops. Manually trigger the endstops and use M119 to verify proper operation.
Checked diags, none installed. Got rid of the TMC COMM error by putting all 5 drivers in uart mode. Plugged a drive into the 5th socket to see if it used the old way of stealing extruder 2 to drive Z2, and it is, so I moved the z2 motor cable to that last driver.
Then found the z motors were no longer locked by the timing belt that couples them together inside the bottom. Found another missing grub screw and put a short 4mm cap screw in the hole and tightened it. Tried to tighten the other 3 grub screws, Pile of allen wrenches from several printers, only 1 was as big as 2mm, 2.5 way too big, 2 slips, very poor quality screws, got them semi tight and annointed the shaft to coupler, with superglue. wash, rinse, repeat on top side motor to screw couplers. I can home each axis in the usual xyz order, but it loses home if any axis is moved again, making the position data blink. Go back and try autohome, z drops 4mm for safety, x moves at 1% of normal search speed and homing fails about 95% of the time.

So lets figure out why I can't build it. First I want en,step,dir mode so get rid of the TMC UART option. But for starters I will put your Configure.h in the Marlin/config directory. And nuke all others. This is in the SP-5_3.1 kit they sent me, contains Marlin-2.1.1.

Now it builds! Go get card, mount it. Copy Robin_nano_v3.bin (after I found it) to card. sync, Umount it, put in SP-5, updates at power up. And it will repeatedly run at normal search speeds and do an autohome 3 times in a row! Now to see if I can adjust bed and print something!

More later, late breakfast time.

Thanks, if I can remember all that. At 88 yo, that's (short term memory) is beginning to be a problem.

Another question re these $15 stepper/servo's, if anybody has played with them yet, they can be addressable for uart address's, does the e# address in their menu correspond to the driver socket they are plugged into, I've not found docs on these beasties that explain that yet. I also took a strong lite and looked at the bottoms of the old cards drivers, and they were not TMC2209's, but TMC2225-SA's. They look to be interchangeable.


Later with more questions, probably.
If you're still having homing issues you may want to disable VALIDATE_HOMING_ENDSTOPS in configuration.h That setting results in the printer resetting if homing fails.

"position data blink" indicates that the position data may not be valid. It should blink before homing. After that it shouldn't blink until the steppers timeout. The fear is that the axis may move (especially Z) when power is removed from the steppers. The timeout can be set in configuration_adv.h. Search for DISABLE_INACTIVE to find the timeout section.

I believe disabling HOME_AFTER_DEACTIVATE in configuration.h will stop the "position data blink" after a stepper timout.
That is another thing that does not seem to work. A huge amount of the time after a power up, the y is not powered, while x and z are locked up tight. Some moves, y in particular, are spastic, moving x instead as if the y motors en pin is being noised.
I've given up for the day, and I will wait for the board from Two Trees to arrive. Maybe goto the garage and make 3 more screws this week. Just to keep me out of the bars since you can get stuff in a bar they used to have pills for.
I finally did get a .bin built that had the 5 point bed level activated, but the screen clicks do not correspond to the next step, so only the front 2 work So I went back to the Marlin gui, where it did a 9 step mesh build. G28 worked after until octoprint sent a g28, at which point it moved x so slow it timed out. I swore a while and shut off the lights. loose grub screws to tighten killed 3 hours today and I may not have found all of them yet.

Thanks Bob.

Cheers & have a better 2023, Gene
This is probably the longest thread ever.

So this morning I decided to start from scratch with fresh downloads of bugfixed 2.1.2 and matching Configurations.
Following directions from the wiki, I set the platformio.ini default to "default_envs = mks_robin_nano_v3_1"
then located in boards.io the mks_robin_nano_v3_1 Configuration.h and placed it in the Marlin subdir of the 2.1.2 bugfixed tree
ditto the default Configuration_adv.h
then edited the stuff the wiki said I should. I had to fool with the LCD stuff, it was double defined
and COREXY wasn't, so I set that and for the display boards I have that were sold as pairs with the robin nano v3.1,

an MKS_TS35 V2.0.

but in this machine, the pot on this display is superfulous (I need a speal chucker here so that's phonetic spelling) no matching hole in the panel, so its been nipped off and removed, it is a touch screen.

"platformoi run -e mks_robin_nano_v3_1"

runs for around 20 seconds, failing on :

Linking .pio/build/mks_robin_nano_v3_1/firmware.elf
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/mks_robin_nano_v3_1/src/src/HAL/STM32/sdio.cpp.o: in function `SDIO_ReadWriteBlock_DMA(unsigned long, unsigned char const*, unsigned char*)':
/home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:324: undefined reference to `HAL_SD_GetCardState'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:332: undefined reference to `HAL_SD_WriteBlocks_DMA'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:337: undefined reference to `HAL_SD_ReadBlocks_DMA'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/mks_robin_nano_v3_1/src/src/HAL/STM32/sdio.cpp.o: in function `SDIO_ReadWriteBlock_DMA':
/home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:363: undefined reference to `HAL_SD_GetCardState'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/mks_robin_nano_v3_1/src/src/HAL/STM32/sdio.cpp.o: in function `SDIO_IRQHandler':
/home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:163: undefined reference to `HAL_SD_IRQHandler'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/mks_robin_nano_v3_1/src/src/HAL/STM32/sdio.cpp.o: in function `go_to_transfer_speed()':
/home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:189: undefined reference to `SDIO_Init'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/mks_robin_nano_v3_1/src/src/HAL/STM32/sdio.cpp.o: in function `SD_LowLevel_Init()':
/home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:266: undefined reference to `SDIO_PowerState_ON'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/mks_robin_nano_v3_1/src/src/HAL/STM32/sdio.cpp.o: in function `SDIO_Init()':
/home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:282: undefined reference to `HAL_SD_Init'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:293: undefined reference to `HAL_SD_ConfigWideBusOperation'
/home/gene/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /home/gene/src/Marlin-bugfix-2.1.x/Marlin/src/HAL/STM32/sdio.cpp:302: undefined reference to `HAL_SD_Init'
collect2: error: ld returned 1 exit status
*** [.pio/build/mks_robin_nano_v3_1/firmware.elf] Error 1
============================================================= [FAILED] Took 22.36 seconds =============================================================

Environment Status Duration
------------------- -------- ------------
mks_robin_nano_v3_1 FAILED 00:00:22.364
======================================================== 1 failed, 0 succeeded in 00:00:22.364 ============================================================

So obviously something is still wrong. The question is what?

The extra socket, mounted vertically between the regular usb printer style "D" socket and the u-sd socket is blocked by the lack of a cutout in the case, so I think that is turned off ack the instructions in the .h files. That supposedly leaves the u-sd card socket active (I assume, see the very well known rule on that)

I have built with 2.1.1, quite a few times, and it works, but from the way the printer reacts when it been reflashed. the pins.h file for a v3.0 board its using is still wrong.

Thank you all.
Here are the Config files for my last post.
Attachments:
open | download - Configuration_adv.h (174.4 KB)
open | download - Configuration.h (124.5 KB)
Re: newbee to platformio, need initial startup to configure for board only in imports file.
January 03, 2023 04:43PM
Your have
#define SDIO_SUPPORT


Does this controller support SDIO?

not according to the circuit diagram, it just has regular SPI SD support

Disable this
And that was it, it built.

Only one minor problem reported that didn't stop the build.

Compiling .pio/build/mks_robin_nano_v3_1/src/src/lcd/fontutils.cpp.o
Marlin/src/inc/Warnings.cpp:199:6: warning: #warning "Note: Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)" [-Wcpp]
199 | #warning "Note: Auto-assigned Z2 STEP/DIR/ENABLE_PINs to unused En_STEP/DIR/ENABLE_PINs. (Define NO_AUTO_ASSIGN_WARNING to suppress this warning.)"
| ^~~~~~~
Marlin/src/inc/Warnings.cpp:731:6: warning: #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" [-Wcpp]
731 | #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)"

There are no diag jumpers in place. And I cant find that define to enable it. The only pdf I have that shows how to jumper it, is bas ackwards, the drawing is of the bottom of the board, not the top. confusing as can be.

Now to see if it works. And that IDK, I've lost the touch reception. Now I'm getting some response but the action is not the icon touched. So it hammered x against the stops quite noisily,, then ran y to the center of x, and then hammered the z switch for about 4 seconds each before reporting homing failed, but I had hit X+, not the homeall icon.

Which options need to be on for a MKS TS35 version 2.0 w/o its encoder? I found the Configuration.h I got from the boards.h link was a default for a 200 by 200 by 200 bed slinger. I raised that to 300x3, and set COREXY, but what else might be fubar for a Two Trees SP-5, aka a Sapphire 5 plus IDK.

I've re-attached Configuration.h, the other adv.h has not been touched.

Thank you, a lot.
Attachments:
open | download - Configuration.h (124.5 KB)
Try M995 to calibrate the touch screen.
I assume from octoprints terminal screen? I'll give that a shot tomorrow.

Is it self guided? With an m500 to save it?

Thanks Bob.

Now its early tomorrow, Wed the 4th here. m995 gives me warning about Marlin bugfix 2.1.2 being a development branch with a lot of stuff disabled.
M995 gives me a series of Plus signs in the corners to click on, but when I do, it reports calibration failed. But it responded to every touch on the + it showed me. So something (m500 eeprom) is disabled.
Found that, turned it on, m995 failed 3 times, then did an m500 next m995 worked.
Now homing is way off, motion for z for instance is about 10x whats commanded. Like microstepping is way off. And m350 is unk command.Where do I enable that?
Z motion was 4000, too much. set at 400, even more wrong.

TMC2209 driver sockets all set for en,step,dir.

I cannot find an about screen.

Next?

Thank you.
addendum: set for COREXY, X an Y are interchanged, an x move actually moves y and vice-versa. cables are correctly plugged in.
Re: newbee to platformio, need initial startup to configure for board only in imports file.
January 04, 2023 07:36AM
Core xy 101:

Two steppers A and B control X and Y together

when A and B move in the same direction X moves
when A and B move in opposite directions Y moves

One of you steppers is inverted to flip X and Y

Your have

#define INVERT_X_DIR false
#define INVERT_Y_DIR true


Try both set to false.
I had to set XYZ all true to get the correct move directions. x and y seem to be near the correct scale, but z, is moving meters for a 1mm move. running into stops very noisily. I'm thinking I should turn the motor currents
down to protect the machine. They are at 800ma and running into the stops is noisy, like its going to break something.

Selecting X home from the menu moves Z build plate down about 50mm at a quite high speed, then stops, repeat, z moves down again.
y is trapped between the switch and the software limits, Y home gets a bump to the rear, backs off a mm, will not move -, will move + depressing the switch again.

A Z home moves about 50 mm down and stops. repeat Z home, moves another 50mm down, never up.
Some of this I can probably sort, but why a Z move for X home? That makes zero sense.

Thanks Dust.
Well, I'm back to 2.1.1 because thats what Two Tree's sent me, supposedly ready to build for this machine... I got a zip of their whole SP-5_V3.1 tree.
But I had to reset the first serial port to -1 before octoprint could talk to it. So other than that change, its the stock Configurations, attached.
Now it appears to auto home ok, but the manual mesh creator is nutzo. The first point at the left front, runs x at a lickity fast speed to the front of the bed, hits the frame or something and hammers the steppers for another 2 seconds. click for next and x moves right to about 20mm left of the beds right edge. click next and x move right to the stops and hammers the steppers for an additional 3 or 4 seconds. auto home or one at a time homing is at obviiously slower speeds with a retouch at much slower.

Its like the /16 microstep isn't working for the manual mesh positioning. This did work very well with the original v1.2 card, and it had Marlin 2.0.9 on it I think.
To me, the leveling code with all its variations is a bowl of well cooked pasta.

So, how do I restore the original manual, adjust the wheels at the 4 spots above the screws method, which doesn't generate a mesh but levels is mechanically? That actually worked quite well.
Attachments:
open | download - Configuration.h (124.5 KB)
open | download - Configuration_adv.h (172.9 KB)
Sorry, only registered users may post in this forum.

Click here to login