Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Roland.h « src - github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3412e77067a8ede8aba0233975375288df5d900f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/****************************************************************************************************

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 "RepRapFirmware.h"
#include "Core.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