Loading...

Follow Planet CNC on Feedspot

Continue with Google
Continue with Facebook
or

Valid

You can use loop o-words with PlanetCNC TNG.

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
 o100 do
 (print, #1)
 #1 = [#1+1]
 o100 while[#1 LE 10]
 (print,loop finished)
 %

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

loop finished
Example of While – Endwhile loop:
%
#1 = 1
o100 while [#1 LE 10]
 (print, #1)
 #1 = [#1+1]
o100 endwhile
 (print,loop finished)
%

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

loop finished
Example of break used in a Do – While loop:
%
#<A> = [2**0]
#<B> = 0
#1 = 0
o100 do
 (print, #1)
 #1 = [#1+1]
 G04 P1
 o200 if [AND[#<A>, #<_hw_input>]]
  #<B> = 1
  o100 break
 o200 endif
o100 while[#1 LE 10]

o300 if [#<B> EQ 0]
 (print,loop finished)
 o300 else 
 (print,preemptive loop break)
o300 endif
%

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:

loop finished

As soon as input becomes active during counting, program will exit loop and print:

preemptive loop break

The post Using o-words with PlanetCNC TNG software: Loop blocks appeared first on Planet CNC.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

You will need:
– Raspberry Pi 3 Model B (or B+)
– Monitor with HDMI cable
– Mouse and Keyboard
– Power supply
– 8GB SD card (16GB and 32GB should also work, 64GB or more will not work)

We used NOOBS version 2.8.2 in this tutorial but it should also work with newer versions.

1. Download NOOBS from here:


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:
https://www.sdcard.org/

– 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:
https://projects.raspberrypi.org/en/projects/noobs-install

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:
gpu_mem=128
dtoverlay=vc4-kms-v3d

– 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.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

With Mk3 and Mk3/4 controller you can use external jogging keyboard:

Jogging keyboard is connected to controllers JOG header via 16pin ribbon cable.

MK3 JOG header:

Mk3/4 JOG header:

Jogging keyboard connection with Mk3 controller:

Jogging keyboard connection with Mk3/4 controller:

Please read tutorial on how to configure jogging keyboard in PlanetCNC TNG software:

The post Using jogging keyboard with PlanetCNC controllers appeared first on Planet CNC.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

This tutorial will help you configure ExtOut board related settings in PlanetCNC TNG software.

ExtOut board settings are located under File/Settings/Input&Output/I2C,TX,Enc,RC.

Under Ext section insert value 10000 for Frequency and enable Invert option for SEL1 Pin:

Related g-codes:

M64 – Output ExtOut

Usage: M64 H Q <L>

– H = ExtOut SSEL value (1 or 2)
– Q = data send to ExtOut
– L (optional) = number of bytes send to ExtOut

M64 H Q E <L>

– H = ExtOut SSEL value (1 or 2)
– Q = parameter number of first data location
– E = data count
– L (optional) = number of bytes send to ExtOut

M64 H P Q <L>

– H = ExtOut SSEL value (1 or 2)
– P = bit position
– Q = zero for Off, otherwise On
– L (optional) = number of bytes send to ExtOut

M64 H L0

– H = ExtOut SSEL value (1 or 2)
– L = zero bytes send to ExtOut

Examples:

In PlanetCNC TNG install folder locate and open Samples folder. Open Tutorials folder and locate files: M64ex1.txt, M64ex2.txt, M64ex3.txt, M64ex4.txt, M64ex5.txt, M64ex6.txt

These sample g-code programs describe various uses of M64 g-code and ExtOut board.

The post Using ExtOut board with PlanetCNC TNG software appeared first on Planet CNC.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

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).

Please note:
-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 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:

The post Using ExtOut board with PlanetCNC controller appeared first on Planet CNC.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

With Mk3 controller you can use MPG pendant. MPG is connected with MK3 controller via MPG adapter board.

 

First connect MPG adapter board with controller using controllers CTRL header. Then connect MPG to adapters DB25 connector:

Please read this tutorial on how to use MPG with PanetCNC TNG software:

The post Using MPG pendant with PlanetCNC controller appeared first on Planet CNC.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

With Mk3 and Mk3/4 controller you can use external jogging keyboard:

Jogging keyboard is connected to controllers JOG header via 16pin ribbon cable.

MK3 JOG header:

Mk3/4 JOG header:

Jogging keyboard connection with Mk3 controller:

Jogging keyboard connection with Mk3/4 controller:

Please read tutorial on how to configure jogging keyboard in PlanetCNC TNG software:

The post Using jogging keyboard with PlanetCNC controllers appeared first on Planet CNC.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
For purposes of machine jogging, user can use on screen jogging keys, PC keyboard keys or external jogging keyboard.
On-screen jogging keys:
Click the cross button next to jogging speed window:
 
Cloud with jogging keys will appear:
Jogging keys can appear permanently on main screen if you set:
File/Settings/User Interface/Jog Panel -> enable “Fixed”. You can choose among XY Cross, UV cross or default keys layout.:

Default keys layout:

XY Cross layout:

PC keyboard keys:
PC keyboard keys used for jogging  need to be configured in settings File/Settings/User Interface/Shortcuts -> under Jog chapter. Under Code, set keyboard keys you wish to use:
External jogging keyboard:

First under IO tab observe which jogging keyboard keys activate which JOG input.
Then in File/Settings/User Interface/Shortcuts -> under Jog and Pin set designated jog input pins:

Jog1 (X-),Jog2 (X+),Jog3 (Y-),Jog4 (Y+),Jog5 (Z-),Jog 6(Z-)
Since external jogging keyboard also supports Shift key, which in combination with any other jogging key initiates step Jog motion, you should set these shortcuts also:

The post Machine jogging with PlanetCNC TNG software appeared first on Planet CNC.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

This tutorial will help you configure MPG pendant related settings in PlanetCNC TNG software.

MPG settings are located under File/Settings/Control/Jogging -> Handwheel

Parameter description:

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

PPR:
Enter PPR value (parts per revolution) of your MPG encoder. Usually around 100PPR.

Reverse:
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.

Speed Factor:
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.

Step Distance:
Rotation of encoder will jog machine for distance that is set with Step Distance.

Please note:
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.

The post Using MPG pendant with PlanetCNC TNG software appeared first on Planet CNC.

Read Full Article
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 
For purposes of machine jogging, user can use on screen jogging keys, PC keyboard keys or external jogging keyboard.
On-screen jogging keys:
Click the cross button next to jogging speed window and cloud with jogging keys will appear.
 
 
Jogging keys can appear permanently on main screen if you set: File/Settings/User Interface -> Jog Panel -> enable “Fixed”. You can choose among XY Cross or default keys layout.
PC keyboard keys:
PC keyboard keys used for jogging  need to be configured in settings File/Settings/User Interface/Shortcuts -> under Jog chapter and Code, set keys you wish to use.
External jogging keyboard:

First under ShowIO panel observe which jogging keyboard keys activate which JOG input.
Then in File/Settings/User Interface/Shortcuts -> under Jog and Pin set designated jog input pins:

Jog1 (X-),Jog2 (X+),Jog3 (Y-),Jog4 (Y+),Jog5 (Z-),Jog 6(Z-)

The post Machine jogging with PlanetCNC TNG software appeared first on Planet CNC.

Read Full Article

Read for later

Articles marked as Favorite are saved for later viewing.
close
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Separate tags by commas
To access this feature, please upgrade your account.
Start your free month
Free Preview