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
2016-04-03 17:55:36 +01:00
.absdata More trivial text cahnages... 2014-05-12 11:25:40 +01:00
.metadata This commit DOESN'T WORK. Use the next one or the previous one. This is an intermediate commit done merely to facilitate the moving of files between machines. 2014-02-20 21:22:25 +00:00
.settings * copy dev branch to master 2016-04-03 17:55:36 +01:00
ArduinoCorePatches/sam Allow network requests to span multiple TCP pkts 2014-06-01 10:51:33 +01:00
Data Making master branch the same as the duet branch. 2013-12-14 12:03:25 +00:00
Flash Various changes relating to zprobe and non-volatile data 2014-02-24 14:17:11 +00:00
Libraries * copy dev branch to master 2016-04-03 17:55:36 +01:00
network Merged in zpl's changes for FTP and Telnet 0.65k) 2014-06-28 18:21:01 +01:00
Release * copy dev branch to master 2016-04-03 17:55:36 +01:00
RemoteSystemsTempFiles This commit DOESN'T WORK. Use the next one or the previous one. This is an intermediate commit done merely to facilitate the moving of files between machines. 2014-02-20 21:22:25 +00:00
SD-image * copy dev branch to master 2016-04-03 17:55:36 +01:00
src * copy dev branch to master 2016-04-03 17:55:36 +01:00
.cproject * copy dev branch to master 2016-04-03 17:55:36 +01:00
.gitattributes * copy dev branch to master 2016-04-03 17:55:36 +01:00
.gitignore * copy dev branch to master 2016-04-03 17:55:36 +01:00
.gitignore.BACKUP.5284.gitignore Incorporating some of dc42's enhancements. This compiles BUT IT HASN'T BEEN TESTED. Use with extreme caution. 2014-04-07 22:15:19 +01:00
.gitignore.BASE.5284.gitignore Incorporating some of dc42's enhancements. This compiles BUT IT HASN'T BEEN TESTED. Use with extreme caution. 2014-04-07 22:15:19 +01:00
.gitignore.LOCAL.5284.gitignore Incorporating some of dc42's enhancements. This compiles BUT IT HASN'T BEEN TESTED. Use with extreme caution. 2014-04-07 22:15:19 +01:00
.gitignore.REMOTE.5284.gitignore Incorporating some of dc42's enhancements. This compiles BUT IT HASN'T BEEN TESTED. Use with extreme caution. 2014-04-07 22:15:19 +01:00
.project * copy dev branch to master 2016-04-03 17:55:36 +01:00
BuildInstructions.txt * copy dev branch to master 2016-04-03 17:55:36 +01:00
Changes in dc42 fork.txt * copy dev branch to master 2016-04-03 17:55:36 +01:00
Configuration.h Merged in zpl's changes for FTP and Telnet 0.65k) 2014-06-28 18:21:01 +01:00
GCodes.cpp Version 0.65i 2014-06-21 14:01:23 +01:00
GCodes.h More bug fixes 2014-06-21 22:53:27 +01:00
Heat.cpp Various bug fixes and enhancements (version 0.59a) 2014-05-14 22:04:14 +01:00
Heat.h Merged RepRapRro's 0.65e version in 2014-06-04 17:39:36 +01:00
LICENCE First commit - some work remains... 2012-11-20 17:23:07 +00:00
Move.cpp Merged RepRapRro's 0.65e version in 2014-06-04 17:39:36 +01:00
Move.h Merged RepRapRro's 0.65e version in 2014-06-04 17:39:36 +01:00
Network.cpp Merged in zpl's changes for FTP and Telnet 0.65k) 2014-06-28 18:21:01 +01:00
Network.h Merged in zpl's changes for FTP and Telnet 0.65k) 2014-06-28 18:21:01 +01:00
Notes on dc42 fork of RepRapFirmware.odt * copy dev branch to master 2016-04-03 17:55:36 +01:00
Notes on dc42 fork of RepRapFirmware.pdf * copy dev branch to master 2016-04-03 17:55:36 +01:00
Platform.cpp Fixed FTP bug and added binary (version 0.65k-dc42) 2014-07-05 15:47:45 +01:00
Platform.h Fixed FTP bug and added binary (version 0.65k-dc42) 2014-07-05 15:47:45 +01:00
README * copy dev branch to master 2016-04-03 17:55:36 +01:00
Reprap.h Merged RepRapRro's 0.65e version in 2014-06-04 17:39:36 +01:00
RepRapFirmware.cpp Merged in zpl's changes for FTP and Telnet 0.65k) 2014-06-28 18:21:01 +01:00
RepRapFirmware.h Merged in zpl's changes for FTP and Telnet 0.65k) 2014-06-28 18:21:01 +01:00
RepRapFirmware.ino Making master branch the same as the duet branch. 2013-12-14 12:03:25 +00:00
t Incorporating some of dc42's enhancements. This compiles BUT IT HASN'T BEEN TESTED. Use with extreme caution. 2014-04-07 22:15:19 +01:00
Tool.cpp Merged RepRapRro's 0.65e version in 2014-06-04 17:39:36 +01:00
Tool.h Merged RepRapRro's 0.65e version in 2014-06-04 17:39:36 +01:00
Webserver.cpp Fixed FTP bug and added binary (version 0.65k-dc42) 2014-07-05 15:47:45 +01:00
Webserver.h Merged in zpl's changes for FTP and Telnet 0.65k) 2014-06-28 18:21:01 +01: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  

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:

  https://reprappro.com/documentation/commissioning-introduction/maintenance-duet/#Installation_8211_Flashing_the_Firmware

For details of how to compile the source code, see below.


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

As of version 057r-dc42 the tick interrupt (which is set up by the Arduino core) is also used to set up ADC conversions,
read the result of the last conversion, and shut down heaters when temperature errors are detected.

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

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

Compiling from Source

See separate file BuildInstructions.txt.

Licence: GPL