Configuring MKS Sbase V1.x 32-bit Controller Basics and Intro to Smoothieware.
by dintid in Workshop > 3D Printing
225510 Views, 227 Favorites, 0 Comments
Configuring MKS Sbase V1.x 32-bit Controller Basics and Intro to Smoothieware.
Prolouge
I'm really pleased to see how this basic intro into Smoothieware and the MKS Sbase 1.x controller have gotten so much attention, and really hope it's going to help people get started or decide not to.
What this is about:
This Instructables is about finding our way around and Configuring the MKS Sbase 1.x 32-bit controller Card basics and intro to Smoothieware. It can be used for Smoothieboards as well in most regards.
I am going to explain and set it up to work as a new controller in my Ultimaker 2 clone with a single extruder.
What this is not going to be:
I am not going to go into the hardware of the board, aside from the need to connect relevant cables.
I am not going to do anything advanced in the firmware/configuration
Table Of Contents:
- Connect and install
- Connecting USB
- Installing firmware
- Configuring Smoothieware compared to Marlin
- Obvious difference from Marlin
- Less obvious differneces
- Firmware and Config file(s)
- Configuring firmware
- Comments
- Firmware Step 1: Default feed rate
- 1/32 Multistepping
- Connecting Motors
- External Motor Controllers
- Firmware Step 2: Cartesian axis speed limits, pins and current
- Pins
- Current
- Firmware Step 3: LCD, SD and Extruder
- LCD and SD
- Extruder Setup
- Delta driver current
- Firmware Step 4: Hotend temperature control configuration
- Thermistor Type
- PID Tuning
- Hotend Thermistor - Physical Layout
- Hotend Heater Pins - Physical Layout
- Firmware Step 5: Heated bed temperature control configuration
- Thermistor Type
- Temperature Control Bed BANG-BANG
- Heated bed thermistor - Physical Layout
- Heated bed heater pins - Physical Layout
- Firmware Step 6: Configuring Endstops
- Homing direction
- Disable unused endstops
- Define axes size
- Reversing endstop output
- Fast and slow homing rates
- Firmware step 7: Network Settings
- Step 8: What's next?
- More advanced setup?
- Using Switches
Connect and Install
In order to install the drivers for MKS Sbase v1.x (opens shop on Aliexpress) board on our computer we first need to go and download the necessary drivers from the makerbase makerbase-mks on Github.com
Note: You do not want to use MKS firmware as it is redacted. Always use firmware from Smoothieware. If confused about the name "Repository", then just look at it as a folder of files.
Click the file and click the Download in Github and save it somewhere on your computer, then extract it to a folder.
Conencting USB
Plug in USB to the board and look at the LEDs at the upper left corner.
Immediately the D7 led lights up. After a bit D1 also starts lightning while D2 and D3 blinks rapidly.
Open device manager and update drivers for the new Smoothie/Seriel USB device with the signed drivers you just downloaded from Github located in the easy to find folder:
\MKS-SBASE\MKS-SBASE\Driver\smoothieware-windows-signeddriver-v1.0
Mine installed fine on Windows 10 x64 pro.
Installing firmware
- Firmware from MKS are just and old copy of Smoothieware, so we always just want to use the newest version from Smoothieware.
- In other words: always use firmware from Smoothieware.
- If you can't find config.txt file from original smoothieware, just use the one from MKS.
- Download official firmware from Smoothiewares firmware page which is a subpage on their own Github page (you might want to download their full github repository (folder) in order to find their config.txt file)
- Start by using the Stable version. When everything is working fine, you can use the Nightly version instead. It is the newest version, but not fully tested yet, and considered as beta/test.
- Insert the SD Card into the MKS Sbase board and plug in the USB Cable. Your SD Card is now going to show in your file-Explorer.
- If not, you need to make sure you have the Drivers installed.
- If you can't find the config.txt file from Smoothieware, just locate the config.txt in \MKS Sbase\MKS-SBASE-master\MKSSBase-firmware and copy it to your SD Card.
- Smoothieware suggest disabling auto-Mount on the SD when connecting to USB. Especially when using a MAC, as MAC OSX tends to do funky stuff at strange times.
- I have changed nothing on my win10. And nothing bad has happened the past year.
- The D7 lights up, shortly after D1 follows. D2, D3, D4 blinks and then D4 turns steady while D2 and D3 continues blinking.
- At this point, the firmware.bin changed had changed to firmware.cur file on the SD card
- After successful updated, the file name will turn into firmware.cur.
Changing or Updating firmware
Just delete the firmware.cur file from your SD, or rename to firmware.cur.old or similar, and copy on the new firmware.bin file to your SD. Powercycle your printer (also unplug USB) and you can see your new firmware.cur file on your SD card.
Note: After making any changes to your config.txt file in the future, you need to power-cycle your controller, meaning disconnect both power (if in use) and USB. You can send a reset command, but only through true terminal use and not through Printrun/Pronterface or similar.
You can use the edge firmware which is eseentially a realease candidate, which has more features, but also might contain some errors. This goes beyound this Instructables.
Configuring Smoothieware Compared to Marlin
I've been using Marlin firmware on Arduino+Ramps for a long while, same as the majority of 3D people, so I'll use Marlin as comparative source for configuring firmware.
Obvious difference from Marlin
Configuring Smoothieware is done in a single config.txt file which is saved directly to the SD card, using notepad instead of a big program like Arduino IDE. The firmware settings are updated by power-cycling the printer or sending a reset command to it. This compared to Marlin with a very large amount of sketches (files) we need to keep track of and modify - see Photo for settings the printer I'm actively upgrading here!
Less obvious differneces
There are some less obvious differences between Marlin and Smoothieware, where the most notable are:
- Speeds are rather confusingly listed as a scattering of mm/sec and mm/min in Smoothieware and Marlin, so have to be aware of this. No clear pattern is in place.
- The axes in Marlin are listed as XYZ and Extruder while the axes in Smoothieware is listed as Alpha, Beta, Gamma and Delta/E0 and E1
Firmware and Config file(s)
As you might have gathered, the Smoothieware firmware is based on 2 files. A firmware.bin and a config.txt file. There is a base config.txt file and a bunch of preconfigured configuration files present in the repository from MKS, located in a subfolder. The Config file can also be named without the .txt extension.
Note: This is a template and not just something to put in and use.
You can pick the one that most resemble your printer, like Delta or Cartesian. I'm just going with the basic Config.txt file.
Configuring firmware
First make a backup of your config.txt file, then open config.txt using notepad. Disable "Word wrap" as it might confuse you some.
Note: Smoothieware warns against Notepad++.
Also remember to take your microstepping multiplier into account. My setup here is based on 1/32 multistepping to take advantage of the build in DRV8825 drivers. Multistepping jumper is placed in upper right corner. (1)
Comments
You can make your own comments by writing # at the start of your line and then your text. This is very usefull to remember what something is about.
I'm adding a line to the start of the file: # Ultimaker 2
Firmware Step 1: Default Feed Rate
I have 300mm/sec in Marlin, which translates to 18000mm/min, so I'll change the preconfigured 4000 to 18000. My Ultimaker is very well tuned, so you might have much lower setting - or higher if using a Delta.
Default_feed is translated to DEFAULT_MAX_FEEDRATE in Marlin.
alpha_steps_per_mm and beta_steps_per_mm needs to be changed to 160 while gamme_steps_per_mm is changed to 800.
acceleration is changed to 300 and z_acceleration to 80
1/32 multistepping
All of the above are 1/32 multistepping. In order to use 1/32 you also need to set the correct jumper on your Controller. It is located almost at the upper right corner with 16|32 next to it. The pins are named J3.
Note: Do not change any jumper with power on. Including connected USB cable
Connecting Motors
There is really not much to it. You need to have some 4 pin XH 2.54 4-pin connectors. You can use dupont as well, but they tend to fall out.
The Controller board is clearly labeled X (Cm2_M2), Y (Cm3_M3), Z (Cm2_M4), E0 (Cm2_M1) and E1 (Cm3_m5).
External Motor Controllers
If you need to hook up some external motor controller, you can do it using the pins just below the big heatsink over the drivers.
The pin-outs are labeled Jc_M2, Jc_M3, Jc_M4, Jc_M1 and Jc_M5 listed in order of above motor conenctors.
Firmware Step 2: Cartesian Axis Speed Limits, Pins and Current
Defaults are 10000mm/min which translates to 166mm/sec (to keep reference to Marlin users) which is enough for many printers. Note how I write down defaults/current value in notes after the setting. This is a good idea in case (when) you need to make changes.
I have 300mm/sec on my Ultimaker 2 though, so I'll put in 18000 for XY and 4800 for my Z axis.
Pins
I'm not changing any pins at the moment, but we have to type in the _max_rate for each axis, which on a cartesian printer i the same as _axis_max_speed. This is not the case for Delta printers.
So for alpha_max_rate and beta_max_rate I enter 18000 and for gamma_max_rate I enter 4800.
Take note of the ! listed after each _dir_pin - this denotes the direction of an axis, which means you can remove or add ! if your axes is going the wrong way.
Go back and modify this later as needed instead of swapping around the cables, which you can't do, if you use the proper connectors in any case.
Current
My XYZ Nema motors are rated at 3.2 voltage and 1.7amp.
If I wanted to feed my motors max current, I'll set the _current to 1.7 amp, but the motors would run rather hot then, so I'll try out using the 1 instead which should be plenty.
I have set my Z-motor to 0.8 amp as it really isn't doing much Work, translating to: gamma_current 0.8
Firmware Step 3: LCD, SD and Extruder
LCD and SD
I'm not going to change anything regarding LCD and SD.
Extruder setup
I am not using the original extruder, so my numbers will be different here!.
I have uncommented two settings here: extruder.hotend.retract_length and extruder.hotend.retract_feedrate but I must admit I do not know wheter this is necessary or not, since we configure this in our slizer in any case.
Delta driver current
One thing of note here is the current for our delta driver, which translates to our Extruder 01 motor.
My Extruder motor is rated at 2.5amp. I want to give it some juice, but not running it too hot, so I'll put it at 1.5amp. I am running a 5.1 geared extruder, so I do not really need to pressure it. 1.5amp is probably too much as well.
Firmware Step 4: Hotend Temperature Control Configuration
I'm not changing the pins or connector we use, but stick to the default.
Thermistor type
I do change the type of thermistor used. I am using E3D hotend, which comes with a Semitec thermistor, so I need to change that.
To find the correct thermistor, we look at: http://smoothieware.org/temperaturecontrol#toc5
PID tuning
We do need to configure this, but we cant really do it at this stage since we need everything setup first.
When you are ready to do it, the command is slightly different than with Marlin firmware.
In Smoothiware the command is M303 E0 S60 to test at 60c. I did a test at 60 and then Again at 200 with new values.
Hotend thermistor - physical layout
In order to actually connect our thermistor we take a look at our pins image to figure out where we connect it.
Default connector for hotend thermistor is the one named TH2 on the board.
- TH1 is P0.23 - Heated bed
- TH2 is P0.24 - Hotend
- TH3 is P0.25 - Unassigned
- TH4 is P0.26 - Unassigned
I have made a small comment in the config.txt file to remind me that 0.24 is TH2
Hotend heater pins - physical layout
Control.hotend.heater.pin 2.7 is the screw-terminals labeled Heater1 on the board
Below chart looks rather unorderly, but is listed as left to right on the controller-board. It is listed on the board itself, which makes it not as bad as it might seem.
- Hot-bed is P2.5 - Heated bed
- Heater1 is P2.7 - Hotend01
- Heater2 is P2.6 - Hotend02
- FAN is P2.4 - FAN
Firmware Step 5: Heated Bed Temperature Control Configuration
There was no comment to clearly state the start of the heated bed section, so I made a start comment #Heated bed temperature control configuration to match the start of hotend section.
Thermistor Type
You might need to change the Thermistor to the appropriate type for your setup. Nothing else to it really.
To find the correct thermistor, we look at: http://smoothieware.org/temperaturecontrol#toc5
Temperature Control Bed BANG-BANG
I am running my heated bed through a SSR (Solid State Relay) which is not very good at handling PID, which uses higher PWM signals. I could do it by turning signals down to 20 (according to smoothiewares site), but I honestly don't know how to do a PID tuning of my Heated-bed?
If I wanted to specify my frequency for the bed, it would be like this:
temperature_control.bed.pwm_frequency 20
I uncomment and change the setting for temperature_control.bed.bang_bang to true and also uncomment the next line temperature_control.bed.hysteresis
Heated bed thermistor - Physical Layout
Here we once Again take a look at our pins image to figure out where we connect the thermistor.
Default connector for heated bed thermistor is the one named TH1 on the board.
- TH1 is P0.23 - Hot-bed
- TH2 is P0.24 - Hotend
- TH3 is P0.25 - Unassigned
- TH4 is P0.26 - Unassigned
I have made a small comment in the config.txt file to remind me that 0.23 is TH1
To find the correct thermistor, we look at: http://smoothieware.org/temperaturecontrol#toc5
Heated bed heater pins - Physical Layout
temperature_control.bed.heater_pin 2.5 is the HOT-BED screw-terminals. This is the large screw-terminal right next to power input.
Below chart looks rather unorderly, but is listed as left to right on the controller-board
- Hot-bed is P2.5 - Heated bed
- Heater1 is P2.7 - Hotend01
- Heater2 is P2.6 - Hotend02
- FAN is P2.4 - FAN
Heated bed is default set as bang_bang which is fine for large areas like a heated bed.
Firmware Step 6: Configuring Endstops
This sections looks very confusing at first glance, but it really not bad, when you first figure out how it is ordered.
Smoothieware source: http://smoothieware.org/endstops
Homing direction
Lets setup homing direction for our Ultimaker style printer. We know it homes to X min, Y max and Z max. This translates to:
- alpha_homing_direction home_to_min
- beta_homing_direction home_to_max
- gamma_homing_direction home_to_max
Disable unused endstops
We do not use X max, Y min and Z min endstops, so lets disable those, by typing nc, which translates to Not Connected.
- alpha_max_endstop nc
- beta_min_endstop nc
- gamma_min_endstop nc
Define axes size
We need to define the size of our printer. This translates to Software endstops in Marlin.
- alpha_max 213
- beta_max 179
- gamma_max 195.8
Reversing endstop output
Test output by issuing a M119 command to it. This looks different than when using Marlin, so instead of triggered, you get an 1 if the endstop is signalling a hit.
If you get a false positive you need to revert the endstop signal by adding an ! after the pin number.
You can see how I removed the ! from my alpha_min_endstop and how it changed the output when issuing M119 command.
Hint: Just don't focus on 1.24, 1.27 or 1.29 which are the pin numbers, but just look at the !
Fast and slow homing rates
Homing rate transfers directly to move speed mm/sec.
I upped the _fast_homing_rate for X and Y to 100 and Z to 20. The Ultimaker 2 homes to Z max and it really just takes ages for it to home if you keep it at its default.
I actually had double this in Marlin, but want to test it out a bit, before raising it, since I just changed my heated bed to something heavier.
When hitting the endstop the axes retracts a bit, where the distance i defined in _homing_retract_mm, and then moves slowly back. This is defined by _slow_homing_rate some. I upped these well, especially for my Z axes.
Firmware Step 7: Network Settings
If you are going to use the networked option you can go with automatic setup, where you enabled DHCP and your printer is given an IP from your router/DNS server.
If you want to configure your printer with a static address instead, you simply type in the IP address and subnet mask here.
I have changed it to something fitting for my subnet. Yours might be looking different.
I can now connecto to the printer using both a standard internet browser or using Pronterface.
Using an Explorer we get a simplified Pronterface GUI for our use.
I have kept telnet enabled as I want to see what options it gives me.
Note: Do disable any networking service you do not use, aa it will open a security breach where people might take over your machine. Especially disable Telnet if you do not use it.
What's Next?
This is it for now!
I hoped it helped you get started, or helped you decide wheter to make the leap for Smoothie-type boards and Smoothieware or stay away.
I believe I have fullfilled the purpose of this Instructables by getting started using the Sbase 1.2 controller and using Smoothieware.
We should by now have a functional printer, albit some tuning is stillneeded.
More advanced setup?
I allready did setup a Hotend Temperature and -fanswitch (2 switches), which I will cover in an upcoming Instructables.
Using switches
1) Fanswitch :: Be able to turn on/off my fan used to cool my hotend heatsink - I do not want it ON all the time unless it is needed, as it can be rather noisy.
2) A switch that polls the temperature for our hotend and then use the fanswitch to turn on the fan at temperatures at or above 50c and then off again, when temperature gets below 50.