# Robot module configurations : general handling of movement G-codes and slicing into moves
-arm_solution kossel # delta selection
+arm_solution linear_delta # delta selection
arm_length 370.00 # this is the length of an arm from hinge to hinge
arm_radius 203.00 # this is the horiontal distance from hinge to hinge when the effector is centered
# Arm solution configuration : Cartesian robot. Translates mm positions into stepper positions
-arm_solution kossel # selects the kossel arm solution
+arm_solution linear_delta # selects the delta arm solution
alpha_steps_per_mm 100 # Steps per mm for alpha stepper
beta_steps_per_mm 100 # Steps per mm for beta stepper
gamma_steps_per_mm 100 # Steps per mm for gamma stepper
#include "arm_solutions/BaseSolution.h"
#include "arm_solutions/CartesianSolution.h"
#include "arm_solutions/RotatableCartesianSolution.h"
-#include "arm_solutions/RostockSolution.h"
-#include "arm_solutions/JohannKosselSolution.h"
+#include "arm_solutions/LinearDeltaSolution.h"
#include "arm_solutions/HBotSolution.h"
#include "StepTicker.h"
#include "checksumm.h"
#define cartesian_checksum CHECKSUM("cartesian")
#define rotatable_cartesian_checksum CHECKSUM("rotatable_cartesian")
#define rostock_checksum CHECKSUM("rostock")
+#define linear_delta_checksum CHECKSUM("linear_delta")
#define delta_checksum CHECKSUM("delta")
#define hbot_checksum CHECKSUM("hbot")
#define corexy_checksum CHECKSUM("corexy")
if(solution_checksum == hbot_checksum || solution_checksum == corexy_checksum) {
this->arm_solution = new HBotSolution(THEKERNEL->config);
- } else if(solution_checksum == rostock_checksum) {
- this->arm_solution = new RostockSolution(THEKERNEL->config);
-
- } else if(solution_checksum == kossel_checksum) {
- this->arm_solution = new JohannKosselSolution(THEKERNEL->config);
-
- } else if(solution_checksum == delta_checksum) {
- // place holder for now
- this->arm_solution = new RostockSolution(THEKERNEL->config);
+ } else if(solution_checksum == rostock_checksum || solution_checksum == kossel_checksum || solution_checksum == delta_checksum || solution_checksum == linear_delta_checksum) {
+ this->arm_solution = new LinearDeltaSolution(THEKERNEL->config);
} else if(solution_checksum == rotatable_cartesian_checksum) {
this->arm_solution = new RotatableCartesianSolution(THEKERNEL->config);
-#include "RostockSolution.h"
+#include "ExperimentalDeltaSolution.h"
+
#include <fastmath.h>
-#include "checksumm.h"
#include "ConfigValue.h"
+#include "libs/Kernel.h"
+#include "libs/nuts_bolts.h"
+#include "libs/Config.h"
+#include "checksumm.h"
+
+#define arm_length_checksum CHECKSUM("arm_length")
+#define arm_radius_checksum CHECKSUM("arm_radius")
+
+#define alpha_angle_checksum CHECKSUM("alpha_angle")
+#define beta_relative_angle_checksum CHECKSUM("beta_relative_angle")
+#define gamma_relative_angle_checksum CHECKSUM("gamma_relative_angle")
#define PIOVER180 0.01745329251994329576923690768489F
-RostockSolution::RostockSolution(Config* config)
+// NOTE this currently does not work, needs FK and settings
+ExperimentalDeltaSolution::ExperimentalDeltaSolution(Config* config)
{
float alpha_angle = PIOVER180 * config->value(alpha_angle_checksum)->by_default(30.0f)->as_number();
sin_alpha = sinf(alpha_angle);
arm_length_squared = powf(arm_length, 2);
}
-void RostockSolution::cartesian_to_actuator( float cartesian_mm[], float actuator_mm[] ){
+void ExperimentalDeltaSolution::cartesian_to_actuator( float cartesian_mm[], float actuator_mm[] ){
float alpha_rotated[3], rotated[3];
if( sin_alpha == 0 && cos_alpha == 1){
actuator_mm[GAMMA_STEPPER] = solve_arm( rotated );
}
-void RostockSolution::actuator_to_cartesian( float actuator_mm[], float cartesian_mm[] ){
+void ExperimentalDeltaSolution::actuator_to_cartesian( float actuator_mm[], float cartesian_mm[] ){
// unimplemented
}
-float RostockSolution::solve_arm( float cartesian_mm[]) {
+float ExperimentalDeltaSolution::solve_arm( float cartesian_mm[]) {
return sqrtf(arm_length_squared - powf(cartesian_mm[X_AXIS] - arm_radius, 2) - powf(cartesian_mm[Y_AXIS], 2)) + cartesian_mm[Z_AXIS];
}
-void RostockSolution::rotate(float in[], float out[], float sin, float cos ){
+void ExperimentalDeltaSolution::rotate(float in[], float out[], float sin, float cos ){
out[X_AXIS] = cos * in[X_AXIS] - sin * in[Y_AXIS];
out[Y_AXIS] = sin * in[X_AXIS] + cos * in[Y_AXIS];
out[Z_AXIS] = in[Z_AXIS];
--- /dev/null
+#ifndef EXPERIMENTALDELTASOLUTION_H
+#define EXPERIMENTALDELTASOLUTION_H
+
+#include "BaseSolution.h"
+
+class Config;
+
+class ExperimentalDeltaSolution : public BaseSolution {
+ public:
+ ExperimentalDeltaSolution(Config*);
+ void cartesian_to_actuator( float[], float[] );
+ void actuator_to_cartesian( float[], float[] );
+
+ float solve_arm( float millimeters[] );
+ void rotate( float in[], float out[], float sin, float cos );
+
+ private:
+ float arm_length;
+ float arm_radius;
+ float arm_length_squared;
+
+ float sin_alpha;
+ float cos_alpha;
+ float sin_beta;
+ float cos_beta;
+ float sin_gamma;
+ float cos_gamma;
+};
+
+
+
+
+
+
+#endif // EXPERIMENTALDELTASOLUTION_H
-#include "JohannKosselSolution.h"
+#include "LinearDeltaSolution.h"
#include <fastmath.h>
#include "checksumm.h"
#include "ConfigValue.h"
#define SQ(x) powf(x, 2)
#define ROUND(x, y) (roundf(x * 1e ## y) / 1e ## y)
-JohannKosselSolution::JohannKosselSolution(Config* config)
+LinearDeltaSolution::LinearDeltaSolution(Config* config)
{
// arm_length is the length of the arm from hinge to hinge
arm_length = config->value(arm_length_checksum)->by_default(250.0f)->as_number();
init();
}
-void JohannKosselSolution::init() {
+void LinearDeltaSolution::init() {
arm_length_squared = SQ(arm_length);
// Effective X/Y positions of the three vertical towers.
DELTA_TOWER3_Y = DELTA_RADIUS;
}
-void JohannKosselSolution::cartesian_to_actuator( float cartesian_mm[], float actuator_mm[] )
+void LinearDeltaSolution::cartesian_to_actuator( float cartesian_mm[], float actuator_mm[] )
{
actuator_mm[ALPHA_STEPPER] = sqrtf(this->arm_length_squared
- SQ(DELTA_TOWER1_X - cartesian_mm[X_AXIS])
) + cartesian_mm[Z_AXIS];
}
-void JohannKosselSolution::actuator_to_cartesian( float actuator_mm[], float cartesian_mm[] )
+void LinearDeltaSolution::actuator_to_cartesian( float actuator_mm[], float cartesian_mm[] )
{
// from http://en.wikipedia.org/wiki/Circumscribed_circle#Barycentric_coordinates_from_cross-_and_dot-products
// based on https://github.com/ambrop72/aprinter/blob/2de69a/aprinter/printer/DeltaTransform.h#L81
cartesian_mm[2] = ROUND(cartesian[2], 4);
}
-bool JohannKosselSolution::set_optional(const arm_options_t& options) {
+bool LinearDeltaSolution::set_optional(const arm_options_t& options) {
arm_options_t::const_iterator i;
return true;
}
-bool JohannKosselSolution::get_optional(arm_options_t& options) {
+bool LinearDeltaSolution::get_optional(arm_options_t& options) {
options['L']= this->arm_length;
options['R']= this->arm_radius;
return true;
-#ifndef JOHANNKOSSELSOLUTION_H
-#define ROSTOCKSOLUTION_H
+#ifndef LINEARDELTASOLUTION_H
+#define LINEARDELTASOLUTION_H
#include "libs/Module.h"
#include "BaseSolution.h"
class Config;
-class JohannKosselSolution : public BaseSolution {
+class LinearDeltaSolution : public BaseSolution {
public:
- JohannKosselSolution(Config*);
+ LinearDeltaSolution(Config*);
void cartesian_to_actuator( float[], float[] );
void actuator_to_cartesian( float[], float[] );
float DELTA_TOWER3_X;
float DELTA_TOWER3_Y;
};
-#endif // JOHANNKOSSELSOLUTION_H
+#endif // LINEARDELTASOLUTION_H
+++ /dev/null
-#ifndef ROSTOCKSOLUTION_H
-#define ROSTOCKSOLUTION_H
-#include "libs/Module.h"
-#include "libs/Kernel.h"
-#include "BaseSolution.h"
-#include "libs/nuts_bolts.h"
-
-#include "libs/Config.h"
-
-#define arm_length_checksum CHECKSUM("arm_length")
-#define arm_radius_checksum CHECKSUM("arm_radius")
-
-#define alpha_angle_checksum CHECKSUM("alpha_angle")
-#define beta_relative_angle_checksum CHECKSUM("beta_relative_angle")
-#define gamma_relative_angle_checksum CHECKSUM("gamma_relative_angle")
-
-class RostockSolution : public BaseSolution {
- public:
- RostockSolution(Config*);
- void cartesian_to_actuator( float[], float[] );
- void actuator_to_cartesian( float[], float[] );
-
- float solve_arm( float millimeters[] );
- void rotate( float in[], float out[], float sin, float cos );
-
- float arm_length;
- float arm_radius;
- float arm_length_squared;
-
- float sin_alpha;
- float cos_alpha;
- float sin_beta;
- float cos_beta;
- float sin_gamma;
- float cos_gamma;
-};
-
-
-
-
-
-
-#endif // ROSTOCKSOLUTION_H