Posted on 2 Comments

Smoothieware – MKS Sbase – Controller Basics and Intro

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:

  1. Connect and install
    1. Connecting USB
    2. Installing firmware
  2. Configuring Smoothieware compared to Marlin
  3. Obvious difference from Marlin
    1. Less obvious differneces
    2. Firmware and Config file(s)
    3. Configuring firmware
    4. Comments
  4. Firmware Step 1: Default feed rate
    1. 1/32 Multistepping
    2. Connecting Motors
    3. External Motor Controllers
  5. Firmware Step 2: Cartesian axis speed limits, pins and current
    1. Pins
    2. Current
  6. Firmware Step 3: LCD, SD and Extruder
    1. LCD and SD
    2. Extruder Setup
    3. Delta driver current
  7. Firmware Step 4: Hotend temperature control configuration
    1. Thermistor Type
    2. PID Tuning
    3. Hotend Thermistor – Physical Layout
    4. Hotend Heater Pins – Physical Layout
  8. Firmware Step 5: Heated bed temperature control configuration
    1. Thermistor Type
    2. Temperature Control Bed BANG-BANG
    3. Heated bed thermistor – Physical Layout
    4. Heated bed heater pins – Physical Layout
  9. Firmware Step 6: Configuring Endstops
    1. Homing direction
    2. Disable unused endstops
    3. Define axes size
    4. Reversing endstop output
    5. Fast and slow homing rates
  10. Firmware step 7: Network Settings
  11. Step 8: What’s next?
    1. More advanced setup?
    2. Using Switches

Step 1: 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

  1. Firmware from MKS are just and old copy of Smoothieware, so we always just want to use the newest version from Smoothieware.
    1. In other words: always use firmware from Smoothieware.
    2. If you can’t find config.txt file from original smoothieware, just use the one from MKS.
  2. 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)
    1. 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.
  3. 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.
    1. If not, you need to make sure you have the Drivers installed.
  4. 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.
    1. 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.
    2. I have changed nothing on my win10. And nothing bad has happened the past year.
  5. The D7 lights up, shortly after D1 follows. D2, D3, D4 blinks and then D4 turns steady while D2 and D3 continues blinking.
    1. At this point, the firmware.binchanged had changed to firmware.cur file on the SD card
  6. 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.

Step 2: 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:

  1. 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.
  2. 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

Step 3: 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.

Step 4: 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

Step 5: 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.

Step 6: 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.

  1. TH1 is P0.23 – Heated bed
  2. TH2 is P0.24 – Hotend
  3. TH3 is P0.25 – Unassigned
  4. 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.

  1. Hot-bed is P2.5 – Heated bed
  2. Heater1 is P2.7 – Hotend01
  3. Heater2 is P2.6 – Hotend02
  4. FAN is P2.4 – FAN

Step 7: 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

  1. Hot-bed is P2.5 – Heated bed
  2. Heater1 is P2.7 – Hotend01
  3. Heater2 is P2.6 – Hotend02
  4. FAN is P2.4 – FAN

Heated bed is default set as bang_bang which is fine for large areas like a heated bed.

Step 8: 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.

Step 9: 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.

Step 10: 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.

2 thoughts on “Smoothieware – MKS Sbase – Controller Basics and Intro

  1. Dear,
    Can you tell how to use mosfets at pint 1.22 and 1.23, there r no outputs (12/24v) as pint 2.4->2.7 with this board.

    1. You need to assign the pins to the function you want them to do.

      If we want to use 1.22 as hotend we need to set the hotend.heater_pin to 1.22 from 2.7

      temperature_control.hotend.heater_pin 1.22

      This way it will activate this pin when it turns the heater on. I’m using Mosfet boards for these things. So using the signal from 1.22 to activate the mosfet, which opens for the voltage you have attached to the boards DC input.

      I’ve written a small instructables on using a mosfet board on an UM2 to use automatic 5v signal to turn on a 24v fan. This is same functionality as here:
      https://www.instructables.com/id/Ultimaker-2-Use-5v-Controlled-Fan-to-Also-Get-a-24/

      I’m using this model of mosfet boards https://www.ebay.co.uk/sch/i.html?control+MOS+FET+switch+control+panel.TRS0&_nkw=DC+control+MOS+FET+switch+control+panel&_sacat=0 but there are other links in the above instructables as well.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.