[2.0.x] MKS SBASE Trinamic examples/support#11402
[2.0.x] MKS SBASE Trinamic examples/support#11402thinkyhead merged 4 commits intoMarlinFirmware:bugfix-2.0.xfrom forkoz:mks_trinamic
Conversation
Put some pins that should work and successfully compile without giving up too much functionality. Should help a few peeps.
should we add all these to all platforms instead of making people hunt the libraries down? they're only a few KB and I'm already downloading libraries for LCDs I'll never use....
|
The LPC176x platform is not Arduino compatible, so any Arduino library that does work is just a fluke or in the case of (some of) TeemuAtLUTs libraries specifically made compatible. So we limit what is available to the build on purpose (also disable the auto library find feature), it's nice to know that the TMC2208 library is building and hopefully functional. |
|
So the other platforms with HALs would also be incompatible in the same vein and would have to be tested? This should be functional as another user is rocking 2208s right now. |
|
The other platforms are all built on top of preexisting Arduino Cores so "should" be generally compatible with Arduino libraries, but looking at the amount of ignored libraries in their builds I'm pretty sure they also have issues, rather than ignore libraries I turned the LDF off for the LPC176x build. |
|
@forkoz mine does not work yet for some reason enabling TMC2208 for testing purpose only on X and using your mks branch leads to firmware freeze on boot. Motor driver configuration |
|
Remember, I don't have the HW. I have DRVs right now and LVs to use when I get the breakout boards and feel like wiring it all up. These are pins that make sense for the requirements. Do you have anything else on J8? You have to make sure those functions are off. for instance, in your config you have which would use pins on J8 with custom cable. On sBase there are simply not enough pins and you have to chose. We do have 1 easy hardware serial on aux1 connector where I think you have MKS tft? Library issues could be a problem as was mentioned above. But if it works on 1 set of pins it should work on others. **Also.. P0_27/28 are both interrupt capable. Try Pin 2.11 and 2.12 as X and see if it works. |
|
@forkoz You are correct I have MKS TFT32 on AUX1, nothing else yet, EXP1 and EXP2 are free as extra pins. |
|
Did you try 2 interrupt capable pins? That SDSupport is only for SD on LCD thru EXP connectors. Having 2 functions on 1 pin even disconnected causes hangs like that. EXP1/2 all the 0.X pins should be interruptible. |
|
Yes I have looked on schematic but weird is it freeze even without y cable connected to pins, my best bet w/o proper debug is that smth is bad on TMC2208Stepper lib. |
|
You can set it up as HW serial in place of MKS tft, wonder if that works. |
|
@forkoz HardwareSerial looks like it "works" https://pastebin.com/9epZqERY |
|
I think you need TTL level serial adapter for this since its 3.3v serial. I figured the HW serial would work. port3 - sdcard |
|
I plan for this board a diamond hotend with 3 extruder, I want TMC 2208 only for X/Y for the rest I have some TL-Smoothers and dumpers, it will silence the 8825 enough imho... |
|
Yea, I don't know why it wouldn't work after boot. It really must be due to the library. For now I'll just add back 3 hardware serials on this one. |
|
Our LPC176x software serial has no relation to smoothiewares implementation, I can't say why they have that problem, they will also not be using the TMC2208 Arduino Library.
Not really clear, but I think you mean the hardware serial caused a watchdog reset? the board will appear as a smoothieware device because the bootloader takes control on watchdog reset. Does the software serial cause watchdog reset or freeze? |
|
Can we not use more than 2 serial ports yet for peripherals? I also notice that if you only define 1 port, port 2 takes serial0 always. No way to have only 1 or > 2. |
|
This is an optimisation that was necessary to only create the serial objects if they are used by Marlin, (for gcode) to save RAM, didn't matter as the platform isn't compatible with Arduino libraries anyway ;) and was an easy fix for the problem. My branch at https://github.com/p3p/Marlin/tree/pr_bf2_pulloutlpcframework using my new external framework implements the Hardware Serial in a more Arduino compatible way, having Serial(0-3) always available, .. assuming the branch works at all (it's my working branch using an experimental framework and build platform). |
|
This is good if you are using these pins for say TMC drivers... but what if you are using the USB, AUX1, EXP1 for something else? |
|
I'm not sure what you mean, |
|
If uart 1, 2, 3 is active and LCD is hooked up in EXP1 there will be a conflict, would there not? |
|
No that's not an issue if the Serial objects are never used they are not linked into the firmware and the pins are free to be used |
|
Looking at the datasheet for the TMC2208 it seems it is possible to just use a single TX output to talk ro multiple devices and set all of the driver operating parameters in one go (assuming you want them all to be the same). Obviously this means that you are not able to read status information back from the driver, but given that the TMC2208 does not support things like stallguard is this really an issue? Would it be possible to use this single wire mode with Marlin? I assume that if the status reports are not required then just a single pin would be required per driver to allow different parameter settings. It would not be possible to verify that the settings have been accepted, but I guess you could send the setting commands multiple times which should ensure they are received ok. Would operating the tmc2208 in this mode work? What what be lost from not having the status information available? |
|
When I set default pin for MKS Sbase and define /**
* Specify Stepper Driver types
* The options are used to determine driver pulse timings as well as more advanced functionality.
* Stepper timing options can be overridden in Configuration_adv.h
*
* Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
* TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE,
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
* TMC5130, TMC5130_STANDALONE
* :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE']
*/
#define X_DRIVER_TYPE A4988
#define Y_DRIVER_TYPE A4988
#define Z_DRIVER_TYPE A4988
#define X2_DRIVER_TYPE A4988
#define Y2_DRIVER_TYPE A4988
#define Z2_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE A4988
#define E1_DRIVER_TYPE A4988
#define E2_DRIVER_TYPE A4988
#define E3_DRIVER_TYPE A4988
#define E4_DRIVER_TYPE A4988It's OK? I use TMC2130 for SPI. |
|
Try: #define X_DRIVER_TYPE TMC2130
#define Y_DRIVER_TYPE TMC2130
#define Z_DRIVER_TYPE TMC2130
. . .
#define E0_DRIVER_TYPE TMC2130
. . . |
|
Maybe TMC2208Pilot can be used until we have an easy to test library for soft serial thing, then once in working state we can see where is the problem in Marlin.. |
Sure. Of course, you can do whatever you like with your own board, and assign any pin to any function you need. |
Description
Trinamic steppers are not easy to set up. This might help a few people in the future. Full disclosure I don't have any but read up on what they need.
Benefits
People using this stepper won't have to suffer as much configuring it.
Related Issues
Should we pull all stepper libraries for all platforms? eg. this one had 2130s but not 2208s. they are small. Already use a lot of LCD libs everywhere.