PlanetCNC is an innovative CNC control system company from Europe. Years of research and development have resulted in cost-effective and user-friendly USB CNC Controllers for versatile applications, a simple to use yet powerful control software and a number of accessories and features inspired by our customers needs.
Sometimes you need to execute line(s) of g-code in a loop while evaluating specific condition. When condition evaluates to false, program will exit loop. This comes useful for e.g. repetitive motion sequences, parameter manipulation etc…
O-word loop commands consist of: O-do – Begin loop block O-while – End loop block [or condition evaluation] O-endwhile – End loop block O-break – Exit loop block immediately O-continue – Skip to next condition evaluation of the while condition
You can use two types of loops: While – Endwhile or Do – While.
While – Endwhile:
Evaluates condition on the beginning of loop and then executes the lines of code inside the loop.
Do – While:
First executes the lines of code inside the loop and then evaluates condition at the end of loop.
Example of Do – While loop:
#1 = 1
#1 = [#1+1]
o100 while[#1 LE 10]
The content of the loop will repeat for as long as while condition at the end will remain true. Which means that as soon as parameter #1 exceeds value of 10, program will exit the loop and print
Example of While – Endwhile loop:
#1 = 1
o100 while [#1 LE 10]
#1 = [#1+1]
The content of the loop will repeat for as long as while condition at the beginning will remain true. Which means that as soon as parameter #1 exceeds value of 10, program will exit the loop and print
The content of the loop will repeat for as long as input 1 of controller is not active and while condition at the end remains true. Which means that as long as input 1 remains un-active, counter will count to 10 and program will exit the loop normally and print:
As soon as input becomes active during counting, program will exit loop and print:
You will get almost 2GB large file named “NOOBS_v2_8_2.zip”
2. You need to format SD card. We suggest that you use “SD Memory Card Formatter 5.0” which you can get here:
– Download “SD Memory Card Formatter 5.0”.
– Follow the instructions to install the software.
– Insert your SD card into the computer or laptop’s SD card reader and make a note of the drive letter allocated to it, e.g.
– In SD Memory Card Formatter, select the drive letter for your SD card and format it.
3. Extract files from NOOBS zip file to CD card.
Your SD card contents should look like this:
4. When this process has finished, safely remove the SD card and insert it into your Raspberry Pi. Connect monitor, mouse and keyborad and power up Raspberry Pi.
After few moments selection dialog will appear.
Select “Raspbian (full desktop version)” and click install. Confirm overwriting SD card and wait for Raspbian to be installed. It might take a while.
Another tutorial for Raspbian installation using NOOBS is here:
5. When installation is finished you will get nice welcome screen and Raspbian will ask you to set country, time zone and password.
You do not have to set password if you do not want it.
If connected to internet it will download and install updates. If not then skip this step.
When finished it will ask to reboot.
After reboot you are ready to install PlanetCNC TNG.
PlanetCNC - Installing TNG to RaspberryPi 3 - YouTube
6. First we will modify “config.txt” file.
– Open terminal.
– Type “sudo nano /boot/config.txt”
– GNU nano will apear. Scroll to bottom of file and type:
– If you have black border on your monitor then locate line “disable_overscan=1” and uncomment it.
– When done exit GNU nano by clicking Ctrl+X and confirm saving modified buffer.
7. Reboot Raspberry Pi
7. After reboot we will install PlanetCNC TNG. Create subdirectory “PlanetCNC” in your HOME directory.
8. Download or copy ‘PlanetCNCPi-TNG_(version).tar.gz’ tarball to subdirectory.
PlanetCNC controllers offer digital outputs for external equipment control. Digital outputs of controller are usually used with output board for spindle control.
To expand number of outputs, you can use ExtOut board with 8 relays. This board comes useful when you need to control many external devices such as vacuum pumps, various actuators, selenoid pneumatic valves (ATC).
-ExtOut board can be used only with Mk3 controller
-ExtOut board is connected with Mk3 controller trough ExtIn board.
-ExtOut board requires external power supply, 12VDC , min. 200mA
Ext Out board:
ExtIn and ExtOut board are connected via 5wire cable(included with ExtOut board):
ExtIn board is then connected with controllers I/O EXT header via 10pin ribbon cable:
This tutorial will help you configure MPG pendant related settings in PlanetCNC TNG software.
MPG settings are located under File/Settings/Control/Jogging -> Handwheel
Enables use of encoder for purposes of jogging when using MPG pendant(used with Mk3 MPG adapter) or standalone encoder. For more info regarding controllers encoder inputs please read Mk3 and Mk3/4 controller user manual.
Note: These settings apply to encoder connected to controller header CTRL pins: EN1A and EN1B
Enter PPR value (parts per revolution) of your MPG encoder. Usually around 100PPR.
Reverses direction of jogging when MPG encoder is used for jogging.
Step Mode 0-6:
You can configure seven modes of jogging when using MPG pendant with PlanetCNC TNG. To select between modes you use MPG hardware switch(x1, x10, x100).
Each step mode can be configured either as Speed Factor or as Step Distance.
If radio button is left unchecked Speed Factor mode will be used, if you enable radio button , Step Distance mode will be used.
Encoder wheel will be translated into motion using Speed Factor value.
Inserted value is speed factor which can behave as prescaler or multiplication of MPG encoder wheel rotation.
For example, Speed Factor of value 0.1 is used when you need fine tuning of axis motion.
Rotation of encoder will jog machine for distance that is set with Step Distance.
With PlanetCNC MPG pendant hardware switch you can select only between Step Mode 1, Step Mode 2 and Step Mode 3.
So when you are using using PlanetCNC MPG pendant, configure only Step Modes 1,2 and 3.