Giter VIP home page Giter VIP logo

smoothieware / smoothieware Goto Github PK

View Code? Open in Web Editor NEW
1.3K 1.3K 991.0 53.07 MB

Modular, opensource, high performance G-code interpreter and CNC controller written in Object-Oriented C++

Home Page: http://smoothieware.org/

License: GNU General Public License v3.0

Perl 0.08% Ruby 0.28% Makefile 0.98% C++ 56.14% C 40.66% Shell 0.31% Python 0.21% HTML 0.96% JavaScript 0.15% Batchfile 0.13% GDB 0.08%

smoothieware's Introduction

Overview

Smoothie is a free, opensource, high performance G-code interpreter and CNC controller written in Object-Oriented C++ for the LPC17xx micro-controller ( ARM Cortex M3 architecture ). It will run on a mBed, a LPCXpresso, a SmoothieBoard, R2C2 or any other LPC17xx-based board. The motion control part is a port of the awesome grbl.

Documentation can be found here : http://smoothieware.org/

NOTE it is not necessary to build Smoothie yourself unless you want to. prebuilt binaries are available here: recent stable build

Quick Start

These are the quick steps to get Smoothie dependencies installed on your computer:

  • Pull down a clone of the Smoothie github project to your local machine.
  • In the root subdirectory of the cloned Smoothie project, there are install scripts for the supported platforms. Run the install script appropriate for your platform:
    • Windows: win_install.cmd
    • OS X: mac_install
    • Linux: linux_install
  • You can then run the BuildShell script which will be created during the install to properly configure the PATH environment variable to point to the required version of GCC for ARM which was just installed on your machine. You may want to edit this script to further customize your development environment.

Building Smoothie

Follow this guide... http://smoothieware.org/compiling-smoothie

In short... From a shell, switch into the root Smoothie project directory and run:

make clean
make all

To upload you can do

make upload

if you have dfu-util installed.

Alternatively copy the file LPC1768/main.bin to the sdcard calling it firmware.bin and reset.

Filing issues (for bugs ONLY)

Please follow this guide https://github.com/Smoothieware/Smoothieware/blob/edge/ISSUE_TEMPLATE.md

Contributing

Please take a look at : 

Contributions very welcome !

Donate

The Smoothie firmware is free software developed by volunteers. If you find this software useful, want to say thanks and encourage development, please consider a Donation

License

Smoothieware is released under the GNU GPL v3, which you can find at http://www.gnu.org/licenses/gpl-3.0.en.html

smoothieware's People

Contributors

adamgreen avatar arthurwolf avatar bgamari avatar bouni avatar briand avatar cilynx avatar douglaspearless avatar errolt avatar fredmurphy avatar garikdan avatar gestalt73 avatar hakalan avatar jesperkrogpoulsen avatar jnjackins avatar logxen avatar lordofhyphens avatar michael-moore0 avatar minad avatar oskarlinde avatar petteriaimonen avatar powertomato avatar qharley avatar skarab42 avatar sorki avatar topherman avatar triffid avatar unlimitedbacon avatar wolfmanjm avatar wuflnor avatar zaaphod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smoothieware's Issues

Refactor : Remove on_gcode_execute

Planned refactor.

We would stop storing gcodes amongst with blocks. Instead, modules would read gcodes in on_gcode_received, transform those into a ModuleData storage thingie, that would be attached to blocks.

class ModuleData { Module* owner; }; .... class TemperatureControlBlob : public ModuleData { ... }; .... class Block { ... vector or whatever <ModuleData*> data; }

Command G28 does not reset axis position

When initiating the homing sequence, i.e. for the X axis, the position returned by M114 is not set to zero.

M114
C: X:0.000 Y:0.000 Z:0.000 
ok
G01X700
ok
M114
C: X:700.000 Y:0.000 Z:0.000 
ok
G28X
move done X
test a
test b
axis X 
test c
move done X
ok
M114
C: X:700.000 Y:0.000 Z:0.000 
ok

Would expect the output of M114 to be:

M114
C: X:0.000 Y:0.000 Z:0.000 

after homing the X axis, but I'm not sure if this is a bug or feature.

Reach epic speeds

arthur-> eventually it'd be nice to have an option in the makefile that tells us if it's 68 or 69, and default it to 69
arthur-
> so we have 120mhz by default
arthur-> not sure how practical that'd be
adamgr> The easiest way is to create a new 1769 target in the mbed SDK, configure it for 120MHz and then use the DEVICES variable in the makefile to build for both.
adamgr> YOu then get a LPC1768 and LPC1769 output directory.
arthur-
> that sounds good
arthur-> wouldn't building for both take double the time ?
adamgr> The way the makefiles work today…yes.
adamgr> But could be optimized I think.
arthur-
> adamgr: there is no emergency but at some point I'll ask you how to do that :)

G04 g-code support required

Please add the G04 Dwell Pxx command support to Smoothie.

Pxx is usually defined as xx milliseconds.

Typical uses:

  • with a milling spindle when the tool is turned on, to give it time to get up to speed (2 - 3 seconds)
  • after a Z axis move down when drilling or milling to give time for the spindle to actually penetrate the material (some spindles, though driven down, are actually free floating and don't always drill down at the same rate the motor drives the spindle down).

A way to set pin as "not present"

in the case where axes may share an enable pin (eg it makes sense for XYE to share an enable pin on repraps) and we don't want E to turn off XY when we do a travel move.

the Pin object should remain valid, but silently ignore any attempts to set pin state and return success.

include a method to positively set a pin as 'not present' via config-set/config-get over serial, just in case

Segfault/Stack-Corruption after repeatedly playing the same file

Steps to reproduce:

  1. open the USB-terminal (couldn't reproduce it on the UART-Terminal, but that may be a coincidence)
    edit: it was coincidence
  2. repeatedly type "play /sd/gcode/hw.gcode"
  3. you'll get a crash after a random number of plays

Dump and the file that caused trouble: https://gist.github.com/powertomato/5506303

As GDB wasn't very helpfull I tracked it down to this line using "printfs" (it doesn't get further than that):
https://github.com/arthurwolf/Smoothie/blob/edge/src/modules/utils/player/Player.cpp#L62

Speed for delta bot seems to be capped

Regardless of what setting is in the config file the top speed the delta/rostock seems to be 6,000mm/min, in any axis.

I cannot see why this should be I followed the logic in Robot and Planner and it looks good except where this->max_allowable_speed(-this->acceleration,0.0,block->millimeters); passes in 0.0 as the second parameter which looks like it will always return 2 * acceleration*distance, not sure if that is correct.

Fix Extruder

Extruder still uses the mbed libs, must be replaced with config options and Pin modules.

Unused analog lines should be grounded on LPC1768-based hardware

The LPC1768 has a notoriously unstable ADC. The mbed community has had a bit of experience dealing with this and have a few tricks to mitigate the problem. In addition to digital filtering (which we already do), they recommend that any unused analog inputs are grounded. An easy way to do this is to configure them as digital outputs and drive them low. It may be a good idea for Smoothie to do this, although it's unclear how this can be achieved in a hardware-independent manner.

References

on_idle and non-blocking SD playing

Must add the ON_IDLE event, that gets called both in the main loop, and when waiting is done in that main loop.

And while we are at it, make the sd card player in SimpleShell not say new commands if the queue is nearly full, so that commands can still be sent from Serial

laser module stuff

  • Module not loading when enabled...
  • Please make the max laser intensity adjustable (besides the speed adjusted intensity)

edge: fatal error: modules/robot/Player.h: No such file or directory

Smoothie $ git log | head -n6
commit 0eb11a0
Author: Arthur Wolf [email protected]
Date: Wed Nov 23 10:41:46 2011 +0100

First seemingly working Extruder module

Smoothie $ make
arm-none-eabi-g++ -O2 -gdwarf-2 -mcpu=cortex-m3 -mthumb -mthumb-interwork -fshort-wchar -ffunction-sections -fdata-sections -fpromote-loop-indices -Wall -Wextra -Wimplicit -Wcast-align -Wpointer-arith -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align -fno-exceptions -I./src// -I./src//libs/ -I./src//modules/ -I./src//modules/communication/ -I./src//modules/communication/utils/ -I./src//modules/robot/ -I./src//modules/robot/arm_solutions/ -I./src//modules/tools/ -I./src//modules/tools/extruder/ -I./src//modules/tools/laser/ -I./src//modules/utils/ -I./src//modules/utils/pauser/ -I./src//modules/utils/simpleshell/ -I./gcc4mbed/external/mbed -I./gcc4mbed/external/mbed/LPC1768 -I./gcc4mbed/external/FATFileSystem -DTARGET_LPC1768 -c gcc4mbed/src/gcc4mbed.c -o gcc4mbed/src/gcc4mbed.o
arm-none-eabi-g++ -O2 -gdwarf-2 -mcpu=cortex-m3 -mthumb -mthumb-interwork -fshort-wchar -ffunction-sections -fdata-sections -fpromote-loop-indices -Wall -Wextra -Wimplicit -Wcast-align -Wpointer-arith -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align -fno-exceptions -I./src// -I./src//libs/ -I./src//modules/ -I./src//modules/communication/ -I./src//modules/communication/utils/ -I./src//modules/robot/ -I./src//modules/robot/arm_solutions/ -I./src//modules/tools/ -I./src//modules/tools/extruder/ -I./src//modules/tools/laser/ -I./src//modules/utils/ -I./src//modules/utils/pauser/ -I./src//modules/utils/simpleshell/ -I./gcc4mbed/external/mbed -I./gcc4mbed/external/mbed/LPC1768 -I./gcc4mbed/external/FATFileSystem -DTARGET_LPC1768 -c gcc4mbed/src/syscalls.c -o gcc4mbed/src/syscalls.o
arm-none-eabi-g++ -O2 -gdwarf-2 -mcpu=cortex-m3 -mthumb -mthumb-interwork -fshort-wchar -ffunction-sections -fdata-sections -fpromote-loop-indices -Wall -Wextra -Wimplicit -Wcast-align -Wpointer-arith -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align -fno-exceptions -I./src// -I./src//libs/ -I./src//modules/ -I./src//modules/communication/ -I./src//modules/communication/utils/ -I./src//modules/robot/ -I./src//modules/robot/arm_solutions/ -I./src//modules/tools/ -I./src//modules/tools/extruder/ -I./src//modules/tools/laser/ -I./src//modules/utils/ -I./src//modules/utils/pauser/ -I./src//modules/utils/simpleshell/ -I./gcc4mbed/external/mbed -I./gcc4mbed/external/mbed/LPC1768 -I./gcc4mbed/external/FATFileSystem -DTARGET_LPC1768 -c src//main.cpp -o src//main.o
In file included from src//libs/Kernel.h:11:0,
from src//main.cpp:9:
./src//libs/Config.h: In member function 'ConfigValue* ConfigValue::by_default(double)':
./src//libs/Config.h:60:46: warning: declaration of 'value' shadows a member of 'this'
arm-none-eabi-g++ -O2 -gdwarf-2 -mcpu=cortex-m3 -mthumb -mthumb-interwork -fshort-wchar -ffunction-sections -fdata-sections -fpromote-loop-indices -Wall -Wextra -Wimplicit -Wcast-align -Wpointer-arith -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align -fno-exceptions -I./src// -I./src//libs/ -I./src//modules/ -I./src//modules/communication/ -I./src//modules/communication/utils/ -I./src//modules/robot/ -I./src//modules/robot/arm_solutions/ -I./src//modules/tools/ -I./src//modules/tools/extruder/ -I./src//modules/tools/laser/ -I./src//modules/utils/ -I./src//modules/utils/pauser/ -I./src//modules/utils/simpleshell/ -I./gcc4mbed/external/mbed -I./gcc4mbed/external/mbed/LPC1768 -I./gcc4mbed/external/FATFileSystem -DTARGET_LPC1768 -c src//libs/Kernel.cpp -o src//libs/Kernel.o
src//libs/Kernel.cpp:21:34: fatal error: modules/robot/Player.h: No such file or directory
compilation terminated.
make: *** [src//libs/Kernel.o] Error 1

Separate origin and home positions

My setup has a Z-axis end stop at the top instead of bottom. Consequently, my homing procedure moves the tool to 0,0,200, not 0,0,0. However, the origin is at 0,0,0, meaning my home and origin are not the same thing.

(i won't go into reasons for having it set up like this - suffice it to say that it's easier to adjust Z0 in software than fiddling with the endstop position)

With most Atmel/Arduino based firmwares, it's possible to choose the homing direction on a per axis basis, as well as the min and max coordinates for each axis, so homing towards max will reset the position for that axis to the max coordinate specified. It would be nice to have that in Smoothie.

My C++ is (more than) a bit rusty, but i might try and hack something up when my current work chaos subsides, unless someone else tackles this in the meantime.

speed and distance calculation is incorrect for delta/rostock type bot

The millimeters_of_travel is not correctly calculated in the case of a delta style bot.

This line
https://github.com/arthurwolf/Smoothie/blob/edge/src/modules/robot/Robot.cpp#L242

Caculates the distance but consider the case of a delta moving in Z, All three axis will move but the actual distance travelled will be Z not the sqrt of the square of all three.

I think the millimeters of travel calculation needs to be moved into the arm solution.

Gcodes always return "ok"

Gcodes always return "ok" no matter what happened.

A mean should be provided to modules to say that something went wrong.

Also something should be done if the gcode was not recognised as valid ( error or warning ).

Will require adding flags/counters to the gcode objects, and methods for modules to say if things went well or not.

Make HEAP_TAGS work with newlib nano.

My current implementation of HEAP_TAGS works in newlib but not newlib nano. Letting the Smoothie project kick the tires on newlib nano for a bit before I port this functionality over.

Thermistor safety detect

We should be able to detect when the thermistor is taken off the hotend and the temperature starts to drop, or the thermistor is disconnected, and act accordingly ( emergency stop ).

Switch Module

Add a module ( pbrier stated a basic working one using the mbed libs ) to turn on and off gpio pins.
Do that with a pool like temperaturecontrol, and config-based.

Disconnected thermistors return "inf" via M105

It makes sense as a way of signaling something is wrong, but unfortunately, clients like Pronterface choke on it.

Pronterface in particular tries to convert it into integer and errors out trying to refresh the temperature widgets (causing slight weirdness in Windows and major UI weirdness on Mac).

TemperatureControl should use PID

[12:49] pid?
[12:49] pid is Proportional, Integral, Derivative. a control algorithm used for tempcontrol in some repraps. http://en.wikipedia.org/wiki/PID_controller and a nice Arduinotutorial can be found at http://goo.gl/vWQpE -- Marlin can now auto tune your PIDparameters. First run M303, your bot will heat up to 150, let it cycle several times, marlin willprint out increasingly accurate pid values. Use M301 Px Ix Dx to enter new values and M500 to store

3dprinting on Mbed

Hi
I want to use smoothie as a 3dprinter firmware on an mbed. When I connect to the device via a serial-termial, (115200, 8N1) it just echoes garbage back(bytes like: C1 FF). Can you give me a hint how I can solve this problem or could there be a problem in the code?
Thank you

Command to enter MRI mode

I just created a wiki page for Smoothie project which give some information on how to connect GDB, etc. https://github.com/arthurwolf/Smoothie/wiki/Debugging
Also linked to it from wiki home page.
adamgr: is it ok if I move that to the wiki at http://smoothieware.org/ ?
or maybe I can just link to it ...
adamgr: awesome !!!!!!!!!!!!!!!!!!!!!!!!
omg awesome
Do with it as you see fit :)
adamgr: thank you a ton, that will help a lot
no problem.
Hope it helps
it will
I think you have seen, with the amount of mri talk there is on this channel :)
it's even useful to me :)
adamgr: can I manually enter MRI mode from smoothie code ?
like enter_mri() ?
yep
#include "mri.h"
__debugbreak()
I need to implement a command for that
making that a ticket

reset position after move

Whenever I issue a G-code command, Smoothie doesn't store current position. The current position after G0, G1 command becomes new zero coordinate.
On the other hand, DIR works correctly.

unsmooth moves

On a 3-axis cnc machine, moves longer than 20mm are not smooth.

This happens when manually entering gcode in a console, or when playing a gcode file.

Moves 20mm or less are smooth and working as expected.

Smooth moves:

Unsmooth moves:

Breadboard & Config

PID values from config

The PID values entered into my config file are not read by the smoothie firmware. The config entries are

temperature_control.hotend.p_factor 73.4
temperature_control.hotend.i_factor 0.515
temperature_control.hotend.d_factor 131

temperature_control.bed.p_factor 66.5
temperature_control.bed.i_factor 0.134
temperature_control.bed.d_factor 413

Fixed point counters are not big enough

Originally in :
#9

The fixed point counters in Stepper are 32bits, which is not good enough for long linear moves, and can cause bugs.
A temporary solution is to reduce mm_per_line_segment.

But the bitmath of this should be changed.

Serial HAL

Currently SerialConsole uses hardware directly, but this should be done through a hal in libs/ like pins.h or adc

PwmOut HAL

Currently Laser uses hardware directly, but this should be done through a hal in libs/ like pins.h or adc

Invalid file name for Windows NTFS in edge branch

when I'm trying to switch to the edge branch, I get following error:

error: unable to create file
config-smoothieboard-copy_me_to_sd_card_and_rename_as_"config" (Invalid argument)

As I understand on NTFS git cannot create file with " in the file name.

Please remove " from file name.

something in new build system prevents smoothie writing to uart via mbed serial

Data sent via kernel->streams does not come out of the uart (replies to commands, start message). Data sent by plain printf (DFU messages, MRI gdb string) does. Smoothie successfully receives data from the uart.

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
85ce043 "Move files in preparation for new build system."
172d42d "Update to new build system."
We cannot bisect more!

this bug created mostly as a placeholder for discussion, will dig soon

PID Autotune can run endlessly.

With a 12v Prusa PCB heated bed, PID autotune (M303 S1 P100) runs endlessly, because the starting voltage of 6v is insufficient to heat the bed above 80c.

The Autotune code should detect when its test voltage is insufficient, and restart the test with a higher voltage.

usbconsole requests/responses out of sync

Testing usb console on latest edge (with briands usb fixes) gives me odd results

There seems to be a buffer of the commands sent as the response from console/printer is delayed compared to what has been sent
[23:05] arthur-_ wait what's the symptom exactly ?
[23:05] arthur-_ do you get an answer to "ls" ?
[23:05] geektopia e.g.. If I connect to the usb console /dev/ttyACM0, and sent the following here.s what happens
[23:05] geektopia ls : nothing happens
[23:05] geektopia ls : nothing happens
[23:06] geektopia ls : (third time) I get output
[23:06] geektopia If instead I send gcodes mixed with consol commands I get confused e.g.
[23:06] arthur-_ geektopia: is that right after a reset ? it's possible after reset there is a delay before the usb starts being responsive
[23:08] geektopia ls: (nothing), M105: (nothing), G0 X10 :(output of ls), ls: (output of M105) etc...
[23:08] arthur-_ oh that's weird
[23:08] geektopia and pronterface can't connect, he aboce is through cutecom
[23:08] geektopia above
[23:08] arthur-_ ok thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.