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.
reprapfirmware-dc42/Roland.h
David Crocker f5c4bdc770 Version 1.09r
Added timeout to output buffers destined for USB
Fixed bugs in thermocouple code
Reallocated thermocouple pin numbers
Made Roland mill and inkjet support conditional and normally disabled
Fixed issue with thermocouple code messing up the timekeeping system,
which was suspected of causing the network to be unreliable
Added support for M577 (thanks chrishamm)
2016-01-16 23:10:36 +00:00

73 lines
1.7 KiB
C++

/****************************************************************************************************
RepRapFirmware - Roland
This class can interface with a Roland mill (e.g. Roland MDX-20/15) and allows the underlying hardware
to act as a G-Code proxy, which translates G-Codes to internal Roland commands.
-----------------------------------------------------------------------------------------------------
Version 0.1
Created on: Oct 14, 2015
Adrian Bowyer
Licence: GPL
****************************************************************************************************/
#ifndef ROLAND_H
#define ROLAND_H
#if SUPPORT_ROLAND
// This class allows the RepRap firmware to transmit commands to a Roland mill
// See: http://www.rolanddg.com/product/3d/3d/mdx-20_15/mdx-20_15.html
// http://altlab.org/d/content/m/pangelo/ideas/rml_command_guide_en_v100.pdf
#include "Arduino.h"
#include "Platform.h"
const float ROLAND_FACTOR = (1.016088061*100.0/2.54); // Roland units are 0.001"
const size_t ROLAND_BUFFER_SIZE = 50;
class Roland
{
public:
Roland(Platform* p);
void Init();
void Spin();
bool ProcessHome();
bool ProcessDwell(long milliseconds);
bool ProcessG92(float v, size_t axis);
bool ProcessSpindle(float rpm);
bool RawWrite(const char* s);
void GetCurrentRolandPosition(float moveBuffer[]);
bool Active();
void Activate();
bool Deactivate();
private:
void ProcessMove();
void Zero(bool feed);
bool Busy();
Platform* platform;
float longWait;
float move[DRIVES+1];
float coordinates[AXES+1];
float oldCoordinates[AXES+1];
float offset[AXES+1];
char buffer[ROLAND_BUFFER_SIZE];
int bufferPointer;
StringRef *sBuffer;
bool active;
};
#endif
#endif
// vim: ts=4:sw=4