Cable Robot using Repetier

edited February 2019 in Motor Control
Hello everyone,

I'm trying to get repetier working with a cable robot like this one but instead of using 2 motors and 2 counterweights, I want to use 4 motors. 

I defined a new DRIVE_SYSTEM and defined the kinematics in motion.cpp. 

As it is a nonlinear system, I looked at the definition of the Delta kinematics and expanded it by a fourth motor, so now I have Tower_A, Tower_B, Tower_C and Tower_D.

______________________________________________

                  #elif DRIVE_SYSTEM == CABLE_ROBOT
                  a_steps = cartesianPosSteps[X_AXIS];
                  b_steps = cartesianPosSteps[Y_AXIS];


                  corePosSteps[A_Tower] = sqrt((a_steps) ^ 2 + (b_steps)^2);
                  corePosSteps[B_Tower] = sqrt((X_MAX_LENGTH - a_steps) ^ 2 + (b_steps) ^ 2);
                  corePosSteps[C_Tower] = sqrt((a_steps) ^ 2 + (Y_MAX_LENGTH - b_steps) ^ 2);
                  corePosSteps[D_Tower] = sqrt((X_MAX_LENTH - a_steps) ^ 2 + (Y_MAX_LENGTH - b_steps) ^ 2);

_______________________________________________

I already adjusted the defines for the towers, so that it is compiling at this stage.

Now to my questions:

(1) Which other parts of the FW do I need to adapt? 

(2) How do I define, which uC Pins will be used for my new Tower_D? Or is there a better way to implement a system with 4 motors?

(3) In repetier.h, I want the FW to recognize the cable robot as a nonlinar system, so I modified the following lines: 

_______________________________________________

                  #if DRIVE_SYSTEM==DELTA || DRIVE_SYSTEM==TUGA || DRIVE_SYSTEM==BIPOD || defined(FAST_COREXYZ) || defined(CABLE_ROBOT) 
                  #define NONLINEAR_SYSTEM 1
                  #else
                  #define NONLINEAR_SYSTEM 0
                  #endif
_______________________________________________


Now I get an error when compiling:" 'xMaxStepsAdj' was not declared in this scope".

From these lines in Printer.cpp:
_______________________________________________
                  #if !NONLINEAR_SYSTEM || defined(FAST_COREXYZ)
                  int32_t Printer::xMinStepsAdj, Printer::yMinStepsAdj, Printer::zMinStepsAdj; // adjusted to cover extruder/probe offsets
                  int32_t Printer::xMaxStepsAdj, Printer::yMaxStepsAdj, Printer::zMaxStepsAdj;
                  #endif
_______________________________________________
I assume, that xMaxStepsAdj is only used in a not-nonlinear system. Can you hint me, where I need to look for the error? Is ne NONLINEAR_SYSTEM not set or do I need to change something in printer.cpp?



If I can get this to work, I'll be happy to put it in a state, where it can be implemented in the general FW, so it can be used by others as well. 

Thank you for your time and Help!

Jagi

Comments

  • You should better optimize parts used several times like 
    (X_MAX_LENTH - a_steps) ^ 2
    by storing them into a temporary variable. These processors are not that fast that we want to add avoidable delays.

    Next thing is 4 motor control is a problem since we only have 3 axes for motion plus extruder motor which is always a bit of a special case, but if you have no need for it you could use extruder axis instead.

    Adding new systems to V1 firmware is a bit of a pain as there are so many things to consider. A much better solution would be to directly start with V2 firmware. There each motion system consists of an extra .h/.cpp file defining one class and adding a #if case to include the right motion system. So it is much easier to adapt. 

    What also makes it easier is that it has native support for up to 7 motors. If you look into the dual x printer you see that it uses x,y,z and a motor for the transformation.

    Only drawback of V2 is that it requires at the moment a 32 bit due based board like RADDS board. But it makes developing your plotter much easier.
  • Thank you for the answer. Since I want to use Due+RADDS anyway, this will be no Problem. I'll continue with your advice and will report back, when I face problems or have a working solution.

    Best Firmware with the best developpers! So nice to have this support :)
Sign In or Register to comment.