I will post the steps I take to learn and install the MKS SBASE v1.2 controller using the latest Smoothieware firmware.....even the fumbles!!!
Up front I will admit I did not know SBASE was a clone of the Smoothieboard from Mark Cooper. Since I was a member of the OpenPilot community I understand the impact of cloned hardware so my BIG apology to Mark. I think there is a new hardware version coming from Smoothieware.org so I will be on the look out for that.
The first order of business was to understand how to communicate with the board so I decided to use the 'screen' command on my Mac. This just a quick a dirty tool that I use quite often when I just need a serial comm to "figure things out." You can also use Zterm or picocom (linux)
screen /dev/tty.usbmodem1431 115000
is the command to get a serial comms going... if you are not familiar with serial comms on a Mac.... make sure the usb cable is connected to the serial port on the SBASE board then enter the following command:
You should see /dev/ttyusb.something ......If not you have a hardware issue or you need to reboot your Mac..
Below is a screenshot showing the response upon connecting and my commands. I also entered the "version" and "mem" command to get an idea of capacity and firmware version. (Please note you will not see your typing entered in the terminal window using my method....like I said quick and dirty!!)
The SBASE board came loaded with an older version of Smoothie from 2014 so I know I needed to update the firmware as a first step. A quick google search lead me to this page:
Installing is as simple as downloading the firmware (a file called firmware.bin) on to an micro SD card. Then inserting the SD card into the SD slot on the board. Next reset the board. Within 10 seconds the board boots, loads the next firmware and renames it to firmware.cur
I downloaded the zip file from github
After copying the firmware.bin file and rebooting...Connect via the screen command and type "version"
You should see the new version of Smoothieware loaded. Now type "help" and will see a list of commands available in the firmware.
An explanation of the Smoothie commands can be found here...I did not mess around with these too much:
After learning about the serial interface I decide to download Pronterface. This is something that is covered on the Smoothieware web page.
After reading the page you will learn that there are several ways to connect to the printer via serial or Ethernet. I decided to learn the serial method first and tackle Ethernet later on. What is really neat about using Pronterface is that you can send the same commands I covered above using the "@" as a prefix. In addition you can also send G-Code commands!
Download Pronterface and enter "@help" in the field next to the button.
Now enter "M119" and press enter.....nothing happens! Thats because at this point you have only uploaded the firmware.bin (which was converted to firmware.cur) and it is NOT configured. There is one more file that you need to copy to the /sd directory on the SD card it is called config.txt. If you downloaded the zip file locate the "CodeSamples" directory and copy the config.txt file the SD card and reset the board.
Now enter the M119 command and press enter...you should get a response similar to this:
min_x:1 min_y:1 min_z:1 max_x:1 max_y:1 max_z:1
don't worry if your 1's are 0's...what is important is that your G-code M119 is responding. DO NOT ISSUE any other G-CODE commands other than the one instructed here. You now need to configure the travel direction, speed and distance for your x, y, and z.
Now its very important for you to read the 3d printer guide before continuing. Also you need to understand your build very well....which rail and motor is x, y, and z.
Next I started working to understand the config.txt info and layout. There are many configuration settings available in the config.txt file. One the things that was apparent was how hard it was to read so I used comments with "######" to create sections. In my option this is very important since you will be making adjustments in a "sea" of parameters...one mistake and you could damage your hardware!
Below is screenshot of the header section for temperature adjustments and the syntax I used for recording the adjustment. Some of the parameters will have a "#" in front of the parameter name. To enable the parameter simply remove the "#". It is best practice to add a note above the line where you make your changes. This allows you to review any previous changes in the event "something strange or odd" starts happening during your prints!
My edits are recorded between "---->" and "<----" with a date and any relevant info needed.
The first thing I changed in the config.txt file was to prevent any thermal "runs aways" from happening. To do this I uncommented (removed the #) for the parameter called temperature_control.hotend.max_temp You can see this change in the screenshot above with commented date and change note. 300 Celsius is the default setting.
Next I need to understand how the thermistors (hot end and heat bed) were assigned to the board and referenced in the firmware. Below is a picture of the connections for my thermistors. The green wires are connected to the hot end thermistor and the white wires are connected to the heat bed thermistor.
So the thermistors are connected to the following ports:
TH1 = Hot End Thermistor (Green Wires)
TH2 = Heat Bed Thermistor (White Wires)
Since the SBASE is a Smoothie board clone the ports are label a little different. Here is the mapping:
Smoothie T0 = SBASE TH1
Smoothie T1 = SBASE Th2
This mapping is important to understand since the Smoothie firmware references "T" as the thermistor identifier. Here is a picture of my setting to enable the TH1 on the SBASE board.
There can be two hot ends so I made sure I sectioned each one to keep things straight in the config.txt file. Next I saved the file, uploaded it to the board, and reset.
You will also need to make sure you have the correct thermistor model referenced in the config.txt for the parameter temperature_control.hotend.thermistor. The default setting matched my thermistor from Folgertech so I did not have to make any changes.
!*********** IMPORTANT SAFETY STEP HERE!!!!! ***********!
Now is a good time to make sure you have setup a way to kill the power to your PSU in the event you need to do an emergency stop. From this point on you will be issuing commands which will turn on very hot devices or turn on very powerful motors!! In the event where something unexpected happens you need to execute an EMERGENCY STOP. To do this it is as simple as putting you power strip next to your work area with easy access and within reach. Below is a picture of my setup... please do this now as it can help prevent damage to your hardware or damage to yourself!!!!
With this note once you have your motors connected please take a moment and careful feel the temperature of the motor with your hand of a thermal laser. Wait about 10 minutes and check the again. If any of them feel like they are heating up you need to adjust the current settings in the config.txt file. Instructions on how to do this are list further down in this tutorial. Or you can disconnect the motor in order to move forward to the next step.
In Pronterface I connected to the board and noted that the temperature of the hot end was showing up in the graph.
The blue Ex0 is the value coming from the thermistor reading on the hot end. If you are not getting a reading double check your connections and make sure the thermistor is good with a meter. There is not much that can go wrong up to this point.
Next I tested the ability to change the temperature and get a reading from the thermistor. At this point I am not concerned about accuracy. Calibration will come later in the setup. To do a quick test I used the graphical interface in Pronterface. I set the temp to 185 and click on Set.
Once I confirm the thermistor was heating up and that there was a reading I turned it off by clicking on the Off button. You should see the target drop to 0 and the Ex0 reading eventually start to level off and begin to drop.
Now that we can control and monitor the temperature of the hot end its time to make sure the temperature can be maintained consistently. This can be done using a G-Code auto-tune command called M303. Its important to know what temperature you will be running your hot end for proper extrusion. To get me going I will be doing all of my calibrations and test printing with Hatchbox PLA. A decent temperature for this filament is 190 Celsius. Your needs may be different so remember to make this step part of your setup routine as you try different filaments and different prints. This step of calibration is called "Tuning your PID" for the hot end. And thats what the command M303 does for us! The command I entered was:
M303 E0 S190
E0 is the thermistor identifier for the hot end and S190 is the temperature to calibrate as a target temperature. Enter the command and watch as the temperature is increased and decreased. This step will take some time so plan accordingly so that you do leave your printer unattended.
Below is the result of a completed auto-tune command:
After the PID Autotune is completed you need to enter and save the calculated PID values in the configuration file and upload/reset the board. Below is a picture of my settings and comments:
With well tune PIDs your the temperature of the hot end should remain constant and not vary much at all. Below is the graph of my hot end with a target of 190 Celsius.
The Heat Bed does not require as much accuracy as the hot end so I just took the default for the bed parameters. See screenshot below. You will want to test the Heat Bed using the graphical interface in Pronterface to make sure everything is functioning correctly.
My next task was to get the x, y, and z motors working correctly along with the alpha, beta, and gamma drivers. Greek letter are used to identify the stepper drivers - x = alpha, y = beta, and z = gamma. One of the things I do that I think is really important for doing fine detail prints to make sure all of my wires are twisted or braided. This helps prevent any EMI from interfering with with the control operation of the motor. Below are some pictures on the braided wires. If you cannot braid, twisting will work just fine.
The wires should be twisted all the way to the MKS SBASE board and connected to the assigned ports:
Now that the motors are connected its time to make sure each one can be controlled. I did this using graphical interface in Pronterface:
(PLEASE REMEMBER TO CHECK FOR MOTORS HEATING UP DURING THIS STEP)
This interface makes it easy to get started with controlling you motors since you don't need to know the G-Code commands. I will use G-Code commands later on but for now I am concerned with confirming control of the motors.
The first thing to test out is to make sure you have a good connection and that the board is communicating with motor(s). However I ran into a problem with not knowing which way my motors would move. To eliminate the risk of damaging something I decided to work with the alpha(x) motor first and move it to the middle of the rail with my hand. I also lower the heat bed by hand.
Doing this allowed me to move the motor in any direction without damaging the hardware. Pronterface has a control for x, y, z with each layer of the concentric circle moving the motors a the indicated distance of .1mm, 1mm, 10mm, 100mm. I started my testing using the 1mm layer.
Below is a video of the first tests on ALPHA clicking on the 1mm layer. I clicked on -x five or six times and then I clicked on the +x....take note of the direction when watching the video:
Its important to note here that I wanted my HOME position to be in the rear right corner of the heat bed. So that means the direction for ALPHA is backwards. In order to correct this I needed to make a change in the config.txt file. Per the instructions on the Smoothieware.org website you can add an "!' to the parameter called alpha_dir_pin and this will reverse the direction. Below is a screenshot of the change I made to ALPHA:
I had the same direction problem with BETA(y) and GAMMA(z) so I added an "!" to those parameters as well. Remember to save, upload, and reset to make these changes effective.
My extruder motor (DELTA) was also turning in the wrong direction so I added a "!" to the following parameter extruder.hotend.dir_pin
OUCH!!! ALPHA MOTOR HEATING UP!!!!
While working to correct the direction of my motors I just happen to notice that my ALPHA motor was really hot...so hot it burned me! Ouch!. I immediately did an emergency stop and let it cool down. I sure sure it was damaged since it took a good 30 minutes to cool down. After doing some research it appeared that my setting the for current (AMPS) was too high. The parameter for this setting is called alpha_current (there is one for each motor). The value for alpha_current was set to 1.5 AMPS. This was too high but I did not know what the correct setting should be. After doing some research I concluded that the rating on my motors (42SHD0217-24B) was TOTAL AMPS. These motors have two phases (circuit) that are powered on/off in order to more the shaft incased on a magnet. My motors are Hybrid Bi-polar Stepper Motors. This means each phase has a max of .75 AMPS.
(Admittedly I did not find conclusive information on this but all of the documentation on the motor listed 2 Phases at 1.5AMPS) and since I have micro stepping enable both phase are getting power at the same time)
In the config.txt file there is a parameter that allows you to control the current provided to each phase. The parameter is called alpha_current. Through trial and error I found that .7 was perfect for my alpha driver which is about half of 1.5 AMPS.
Calibrating the extruder is really important to get decent prints going on the FT-5. I used this video below from Tom to calibrate my extruder. Its pretty simple to follow
You now should be setup to print with your MKS SBASE running Smoothieware. By the time I completed this tutorial a new version of Smoothieware was release that provides some awesome safety features. I will be posting my work on that as well. I hope this tutorial proves helpful for someone.