No description
This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2013-12-30 17:25:38 +00:00
.settings Fixed path to Arduino 1.5.4 2013-10-08 20:49:31 +01:00
Data M84 added for Pronterface compatibility. 2013-11-23 17:17:59 +00:00
network One ether bug (starting the ether after reading config.g) fixed owing to Tony's brilliant debugging persistence. It still hangs if the ether is unplugged, so that's next on the list. 2013-11-26 21:04:25 +00:00
Release Workround added for bug in Pronterface (it sends 2 M24 commands on second file print). M24 is now ignored if a file 2013-12-30 17:25:38 +00:00
SD-image Added more efficient canned cycle for when all three axes are being homed. 2013-12-23 21:25:40 +00:00
.cproject File list implemented. Also M201 to set axis accelerations via USB. 2013-10-08 16:33:10 +01:00
.gitignore Bug whereby heaters would not restart after an M0 is received fixed. 2013-12-17 23:28:57 +00:00
.gitignore.BACKUP.5284.gitignore Synchronising duet branch with the mastr branch. 2013-12-27 15:02:04 +00:00
.gitignore.BASE.5284.gitignore Synchronising duet branch with the mastr branch. 2013-12-27 15:02:04 +00:00
.gitignore.LOCAL.5284.gitignore Synchronising duet branch with the mastr branch. 2013-12-27 15:02:04 +00:00
.gitignore.REMOTE.5284.gitignore Synchronising duet branch with the mastr branch. 2013-12-27 15:02:04 +00:00
.project Fixed path to Arduino 1.5.4 2013-10-08 20:49:31 +01:00
Configuration.h Workround added for bug in Pronterface (it sends 2 M24 commands on second file print). M24 is now ignored if a file 2013-12-30 17:25:38 +00:00
GCodes.cpp Workround added for bug in Pronterface (it sends 2 M24 commands on second file print). M24 is now ignored if a file 2013-12-30 17:25:38 +00:00
GCodes.h Synchronising duet branch with the mastr branch. 2013-12-27 15:02:04 +00:00
Heat.cpp Dud temperature count now has to reach 6 (about a second) before a heater trips out (Ian's request). Also heater reset M code (M562) added. Use that with great caution. 2013-12-11 14:11:51 +00:00
Heat.h Dud temperature count now has to reach 6 (about a second) before a heater trips out (Ian's request). Also heater reset M code (M562) added. Use that with great caution. 2013-12-11 14:11:51 +00:00
LICENCE First commit - some work remains... 2012-11-20 17:23:07 +00:00
Move.cpp Added more efficient canned cycle for when all three axes are being homed. 2013-12-23 21:25:40 +00:00
Move.h Homeing after bed transform applied bug fixed in the duet branch. The master branch will be updated after some further testing. The problem was the X endstop. If X is homed, that stop is triggered. Homeing Y then only moves Y, and so only the Y endstop is tested. But when the transform is applied X moves slightly when Y is homed (as it should) and the X endstop stoped the movement prematurely. You will need to update the files on the SD card as well as the firmware to activate the fix. 2013-12-21 16:46:42 +00:00
Platform.cpp Synchronising duet branch with the mastr branch. 2013-12-27 15:02:04 +00:00
Platform.h All axis homing now done with canned cycle files. 2013-12-23 18:07:16 +00:00
README This time with correct version number and date... 2013-12-06 20:59:58 +00:00
Reprap.h Working on the ether/USB problem. The network can now be disabled (#define NETWORK in Configuration.h). With it disabled the USB works with or without a network cable plugged in. With it enabled the USB only works with a network cable plugged in too. You have to wait for the ether to reinitialise (ether socket lights go out for a couple of secs, then come on, then the green one starts flashing) before trying to talk via the USB. The ether is initialised before config.g is run, so the IP is the one defined in platform.h. The network is disabled in this commit. The heaters are set on by 0, not 1 (i.e. Duet board v0.6 or later). To change this see #define HEAT_ON in platform.h 2013-11-26 13:38:23 +00:00
RepRapFirmware.cpp Emergency stop added to the web interface (and Home All taken away, as you almost never want to home Z with the other two.) SD files tidied. 2013-12-04 15:36:26 +00:00
RepRapFirmware.h Temperature range checking added (see Configuration.h). If temps repeatedly 2013-11-10 21:55:44 +00:00
RepRapFirmware.ino Setting up latest Due code to work on the Duet. 2013-08-28 16:36:38 +01:00
t Fixed a bug whereby long extrudes simultaneous with short XY moves were constrained by the XY upper velocity and acceleration limits, rather than those for extrusion. Normally you want extrusion to be subservient to XY. But (typically when a retraction is being recovered during an XY move) the extrusion limits should constrain the XY move, not the other way round. 2013-10-27 16:21:21 +00:00
Webserver.cpp Emergency stop added to the web interface (and Home All taken away, as you almost never want to home Z with the other two.) SD files tidied. 2013-12-04 15:36:26 +00:00
Webserver.h Upload of reprap.htm implemented (M560). The file must end "<!-- **EoF** -->" without the quotes. 2013-11-20 22:13:23 +00:00

This firmware is intended to be a fully object-oriented highly modular control program for
RepRap self-replicating 3D printers.

It owes a lot to Marlin and to the original RepRap FiveD_GCode.

This is the version for the RepRap Duet: 

  http://blog.think3dprint3d.com/2013/12/Duet-Arduino-Due-compatible-3DPrinter-controller.html  

To edit and compile this you will also need the libraries in this repository:

  https://github.com/jmgiacalone/Arduino-libraries

A complete uploadable executable version is in the directory Release/RepRapFirmware.bin in this
repository.  For details of how to flash it to a Duet see here:

  http://www.reprappro.com/documentation/RepRapPro_Firmware#Flashing_the_Firmware


General design principles:

  * Control by RepRap G Codes.  These are taken to be machine independent, though some may be unsupported.
  * Full use of C++ OO techniques,
  * Make classes hide their data,
  * Make everything except the Platform class (see below) as stateless as possible,
  * No use of conditional compilation except for #include guards - if you need that, you should be
       forking the repository to make a new branch - let the repository take the strain,
  * Concentration of all machine-dependent defintions and code in Platform.h and Platform.cpp,
  * No specials for (X,Y) or (Z) - all movement is 3-dimensional,
  * Except in Platform.h, use real units (mm, seconds etc) throughout the rest of the code wherever possible,
  * Try to be efficient in memory use, but this is not critical,
  * Labour hard to be efficient in time use, and this is  critical,
  * Don't abhor floats - they work fast enough if you're clever,
  * Don't avoid arrays and structs/classes,
  * Don't avoid pointers,
  * Use operator and function overloading where appropriate.


Naming conventions:

  * #defines are all CAPITALS_WITH_OPTIONAL_UNDERSCORES_BETWEEN_WORDS
  * No underscores in other names - MakeReadableWithCapitalisation
  * Class names and functions start with a CapitalLetter
  * Variables start with a lowerCaseLetter
  * Use veryLongDescriptiveNames


Structure:

There are six main classes:

  * RepRap
  * GCodes
  * Heat
  * Move
  * Platform, and
  * Webserver

RepRap:

This is just a container class for the single instances of all the others, and otherwise does very little.

GCodes:

This class is fed GCodes, either from the web interface, or from GCode files, or from a serial interface,
Interprets them, and requests actions from the RepRap machine via the other classes.

Heat:

This class implements all heating and temperature control in the RepRap machine.

Move:

This class controls all movement of the RepRap machine, both along its axes, and in its extruder drives.

Platform:

This is the only class that knows anything about the physical setup of the RepRap machine and its
controlling electronics.  It implements the interface between all the other classes and the RepRap machine.
All the other classes are completely machine-independent (though they may declare arrays dimensioned
to values #defined in Platform.h).

Webserver:

This class talks to the network (via Platform) and implements a simple webserver to give an interactive
interface to the RepRap machine.  It uses the Knockout and Jquery Javascript libraries to achieve this.



When the software is running there is one single instance of each main class, and all the memory allocation is
done on initialization.  new/malloc should not be used in the general running code, and delete is never
used.  Each class has an Init() function that resets it to its boot-up state; the constructors merely handle
that memory allocation on startup.  Calling RepRap.Init() calls all the other Init()s in the right sequence.

There are other ancillary classes that are declared in the .h files for the master classes that use them.  For
example, Move has a DDA class that implements a Bresenham/digital differential analyser.


Timing:

There is a single interrupt chain entered via Platform.Interrupt().  This controls movement step timing, and
this chain of code should be the only place that volatile declarations and structure/variable-locking are
required.  All the rest of the code is called sequentially and repeatedly as follows:

All the main classes have a Spin() function.  These are called in a loop by the RepRap.Spin() function and implement
simple timesharing.  No class does, or ever should, wait inside one of its functions for anything to happen or call
any sort of delay() function.  The general rule is:

  Can I do a thing?
    Yes - do it
    No - set a flag/timer to remind me to do it next-time-I'm-called/at-a-future-time and return.

The restriction this strategy places on almost all the code in the firmware (that it must execute quickly and
never cause waits or delays) is balanced by the fact that none of that code needs to worry about synchronization,
locking, or other areas of code accessing items upon which it is working.  As mentioned, only the interrupt
chain needs to concern itself with such problems.  Unlike movement, heating (including PID controllers) does
not need the fast precision of timing that interrupts alone can offer.  Indeed, most heating code only needs
to execute a couple of times a second.

Most data is transferred bytewise, with classes' Spin() functions typically containing code like this:

  Is a byte available for me?
    Yes
      read it and add it to my buffer
      Is my buffer complete?
         Yes
           Act on the contents of my buffer
         No
           Return
  No
    Return

Note that it is simple to raise the "priority" of any class's activities relative to the others by calling its
Spin() function more than once from RepRap.Spin().

-------------

Version 0.3n beta

Started: 2012-11-18
This README dated: 2013-12-06

Adrian Bowyer
RepRap Professional Ltd
http://reprappro.com

Licence: GPL