Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. PieTorque
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 9
    • Best 1
    • Controversial 0
    • Groups 0

    PieTorque

    @PieTorque

    1
    Reputation
    1
    Profile views
    9
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    PieTorque Unfollow Follow

    Best posts made by PieTorque

    • Additional axis to a hangprinter

      Hello everybody!

      Me and my team are working on a hangprinter with an extra twist. Instead of one d axis we basically have two, and the other d axis has slightly different kinematics. I've tried to stab the code by just adding one more axis in hangprinterkinematics.cpp and hangprinterkinematics.h which has lead to a small machine uprising incident (aka weird results) but everything is under control now (I changed the code back to what it was).

      My question is how would one add the other d axis in the reprapfirmware code?

      Thank you for you help!

      posted in Firmware developers
      PieTorqueundefined
      PieTorque

    Latest posts made by PieTorque

    • RE: Two arduinos between Duet2 wifi and BLtouch

      @oliof I'll definately look into it. Thanks mate!

      @zapta We might go for another solution later on. But for now we're trying this one 🙂

      posted in Duet Hardware and wiring
      PieTorqueundefined
      PieTorque
    • RE: Two arduinos between Duet2 wifi and BLtouch

      @cncmodeller Hello,

      Thank you for responding so briefly. I have not considered it, not yet atleast. Something I'll definately look into since we're planning on migrating to duet3 at some point 🙂

      posted in Duet Hardware and wiring
      PieTorqueundefined
      PieTorque
    • Two arduinos between Duet2 wifi and BLtouch

      Hello,

      Me and my team are building a giant cable driven 3d printer. A modification of the hangprinter. I've run into a problem with the zprobe.

      The distance from the end effector to duet is over 15 meters. We have and arduino nano on the endeffector and Mega next to duet that are communicating through rs485.

      Our plan was was to get the zprobe commands from duet transferred to mega then from mega to nano. Then nano proceeds to use the BLtouch and sends the data back to mega which sends it to duet. I wonder if it's possible to get it working like this? I can see a possible problem atleast from the delays in the data transfer.

      Also despite my efforts I have not found what kind of data is coming from duet to BLtouch so I have no idea how to pass it through between the arduinos. Also I'd need to know in what form should the data go back to duet?

      Could I for example shove the data into an uint16_t using bitwise operator and transfer it back to duet?

      Anyway, if somebody with more knowledge on the subject could tell if this idea is a fools errand or actually a doable I'd highly appreciate it!

      Best Regards,
      PieTorque

      posted in Duet Hardware and wiring
      PieTorqueundefined
      PieTorque
    • Transferring temperature from arduino to duet using SPI

      Hello everybody!

      I was wondering how it would be possible to transfer the temperature data from the thermocouples from arduino to the duet board using the spi channel instead of having the thermocouple directly in contact with the board.

      There's some explanation in ThermocoupleSensor31855.cpp about how the bits should be organized but so far I haven't been able to get anything understandable from duets end.

      the code in arduino looks like this

      #include <SPI.h>
      
      long data2 = 233832944;
      
      union {
        long data;
        byte bytes[4];
      } sender;
      
      void setup (void)
      {
        Serial.begin (115200);   // debugging
        
        // turn on SPI in slave mode
        SPCR |= bit (SPE);
      
        // have to send on master in, *slave out*
        pinMode(MISO, OUTPUT);
        
        // get ready for an interrupt 
       
        process_it = false;
      
        // now turn on interrupts
        SPI.attachInterrupt();
      
      }  // end of setup
      
      
      // main loop - wait for flag set in interrupt routine
      void loop (void)
      {
        sender.data = 233832944;
        digitalWrite(SS, LOW);    // SS is pin 10
      
        // send test string
        for(int i = 0; i < 4; i++){
          SPI.transfer(sender.bytes[i]);  
        }
       
        //SPI.transfer(data2);  does not work either
        
        
      
        // disable Slave Select
        digitalWrite(SS, HIGH);
          
      }  // end of loop
      

      I derived the 233832944 by looking at the order that was instructed in ThermocoupleSensor31855.cpp and putting test values on bits on supposedly their right place.

      If I understood correctly the sequence consists of 4 bytes or 32 bits, the first three bits are reserved for SVG faults, the fourth bit is just reserved? After that comes 12 bits for reference temperature, then one bit for fault indicator and then one bit reserved. The rest of the bits are for the actual temperature.

      The room temperature should be divided by 0.0625 and the thermocouples temp should be divided by 0.25.

      If we give some test numbers the room temp would be (int)(22.3 / 0.0625) = 3 568 and the sensor temperature would be (int)(124 / 0.25) = 496. in binary these numbers would be: 110111110000 and 111110000

      assigning this to the 32 bit message would be:

      0000|110111110000|00|00000111110000

      I divided everything into sections so it's easier to read. This sequence converts into an integer of 233832944. I've tried to transfer it as a whole and in four bytes on byte at the time when you look at the temperatures in duet they show really crazy numbers. I don't have much experience in data transfer so there's probably whole lot that I'm missing. Is there anyone who would have the expertise to help me tackle this problem?

      Best regards,
      PieTorque

      posted in Firmware developers
      PieTorqueundefined
      PieTorque
    • RE: Additional axis to a hangprinter

      Hello Tobben!

      Thank you for checking the code. I know it's a mess right now with the typos and all. For now all the debugprintfs are just something we had needed for our testing. I'm most likely going to remove all of them and think it through intensely what kind of printf's I will be adding that would be actually helpful to everyone.

      You're right that the kinematics can't be the same as the D axis, I will be copying one of the A B or C. But if the HANGPRINTER_AXES is 5, and I've added all the proper kinematics in the hangprinterkinematics.cpp is that all I need to do in order for the F_axis to work? Or is there something else that needs adjusting somewhere else? For example other files like kinematics.cpp or you name it?

      Best regards
      PieTorque

      posted in Firmware developers
      PieTorqueundefined
      PieTorque
    • RE: Additional axis to a hangprinter
      // some variables
      
      constexpr float DefaultAnchorA[3] = {    0.0, -1437.13, 392.0};
      constexpr float DefaultAnchorB[3] = { 1244.59,  718.56, 392.0};
      constexpr float DefaultAnchorC[3] = {-1244.59,  718.56, 392.0};
      constexpr float zOffset = 392.0;
      //constexpr float DefaultAnchorDz = 3574.5906 - zOffset;
      constexpr float DefaultAnchorDz = 3312.4019;
      constexpr float DefaultAnchorFz = 3574.5906;
      constexpr float DefaultPrintRadius = 1500.0;
      
      // and the function  I've tinkered with
      
      bool HangprinterKinematics::CartesianToMotorSteps(const float machinePos[], const float stepsPerMm[], size_t numVisibleAxes, size_t numTotalAxes, int32_t motorPos[], bool isCoordinated) const
      {
      	float squaredLineLengths[HANGPRINTER_AXES];
      	squaredLineLengths[A_AXIS] = LineLengthSquared(machinePos, anchorA);
      	squaredLineLengths[B_AXIS] = LineLengthSquared(machinePos, anchorB);
      	squaredLineLengths[C_AXIS] = LineLengthSquared(machinePos, anchorC);
      	squaredLineLengths[D_AXIS] =
      		(
      			fsquare(machinePos[X_AXIS])
      			+ fsquare(machinePos[Y_AXIS])
      			+ fsquare(anchorDz - machinePos[Z_AXIS])
      		);
      	squaredLineLengths[F_AXIS] =
      			(
      				fsquare(machinePos[X_AXIS])
      				+ fsquare(machinePos[Y_AXIS])
      				+ fsquare(anchorFz - machinePos[Z_AXIS])
      			);
      
      	char* axixes[5] = {"A axis", "B axis", "C axis", "D axis", "F axis"};
      	float linePos[HANGPRINTER_AXES];
      	for (size_t i = 0; i < HANGPRINTER_AXES; ++i)
      	{
      		linePos[i] = sqrtf(squaredLineLengths[i]) - lineLengthsOrigin[i];
      		if(i < 3){
      			debugPrintf("Lineposition %s : %f\n", axixes[i], linePos[i] + 1441,03);
      		} else {
      			debugPrintf("Lineposition %s : %f\n", axixes[i], linePos[i]);
      		}
      
      	}
      
      	if (squaredLineLengths[A_AXIS] > 0.0 && squaredLineLengths[B_AXIS] > 0.0 && squaredLineLengths[C_AXIS] > 0.0 && squaredLineLengths[D_AXIS] > 0.0 && squaredLineLengths[F_AXIS] > 0.0)
      		{
      			motorPos[A_AXIS] = lrintf((float)linePos[A_AXIS] * (float)stepsPerMm[A_AXIS]);
      			motorPos[B_AXIS] = lrintf((float)linePos[B_AXIS] * (float)stepsPerMm[B_AXIS]);
      			motorPos[C_AXIS] = lrintf((float)linePos[C_AXIS] * (float)stepsPerMm[C_AXIS]);
      			motorPos[D_AXIS] = lrintf((float)linePos[D_AXIS] * (float)stepsPerMm[D_AXIS]);
      			motorPos[F_AXIS] = lrintf((float)linePos[F_AXIS] * (float)stepsPerMm[F_AXIS]);
      			return true;
      		}
      	for (size_t i = 0; i < HANGPRINTER_AXES; ++i){
      		debugPrintf("Motor positions: %s, %f\n", axixes[i] , motorPos[i]);
      	}
      
      
      
      	// if (squaredLineLengths[A_AXIS] > 0.0 && squaredLineLengths[B_AXIS] > 0.0 && squaredLineLengths[C_AXIS] > 0.0 && squaredLineLengths[D_AXIS] > 0.0)
      		// {
      		// 	motorPos[A_AXIS] = lrintf(k0[A_AXIS] * (sqrtf(spoolRadiiSq[A_AXIS] + linePos[A_AXIS] * k2[A_AXIS]) - spoolRadii[A_AXIS]));
      		// 	motorPos[B_AXIS] = lrintf(k0[B_AXIS] * (sqrtf(spoolRadiiSq[B_AXIS] + linePos[B_AXIS] * k2[B_AXIS]) - spoolRadii[B_AXIS]));
      		// 	motorPos[C_AXIS] = lrintf(k0[C_AXIS] * (sqrtf(spoolRadiiSq[C_AXIS] + linePos[C_AXIS] * k2[C_AXIS]) - spoolRadii[C_AXIS]));
      		// 	motorPos[D_AXIS] = lrintf(k0[D_AXIS] * (sqrtf(spoolRadiiSq[D_AXIS] + linePos[D_AXIS] * k2[D_AXIS]) - spoolRadii[D_AXIS]));
      		// 	return true;
      		// }
      
      	return false;
      }
      

      This is pretty much that I've done. We call the additional d axis "F axis". I also changed the array lengths in the hangprinterkinematics.h and added the AnchorFz there as well. Basically the F axis should just have different lengths, and the spool size is different.

      I tried to get it working with same kinematics as the regular d axis so that the kinematics is the same but drive would be different (Not sure if I use the word drive correctly I'm little new with the vocabulary. But you know the channel where each motor is controlled). With this we got some unexpected results, we're still looking into it, it might be some other issue.

      posted in Firmware developers
      PieTorqueundefined
      PieTorque
    • Additional axis to a hangprinter

      Hello everybody!

      Me and my team are working on a hangprinter with an extra twist. Instead of one d axis we basically have two, and the other d axis has slightly different kinematics. I've tried to stab the code by just adding one more axis in hangprinterkinematics.cpp and hangprinterkinematics.h which has lead to a small machine uprising incident (aka weird results) but everything is under control now (I changed the code back to what it was).

      My question is how would one add the other d axis in the reprapfirmware code?

      Thank you for you help!

      posted in Firmware developers
      PieTorqueundefined
      PieTorque
    • How to build rrf v2-dev branch in 2020?

      Hello,

      I've been trying to build the v2-dev for quite some time now. I've tried plenty of different commit combinations but there's always errors. I did manage to build the master branches without an issue so I must've gotten something right.

      Usually the problems are tied to some method or header file missing or not found.

      The recent errors that occured are as follows:

      ../src/Storage/MassStorage.cpp:393:8: error: 'const class StringRef' has no member named 'Truncate'
      
      src/Storage/subdir.mk:27: recipe for target 'src/Storage/MassStorage.o' failed
      make: *** [src/Storage/MassStorage.o] Error 1
      
      

      Does anybody know if it's something with the compatibleness of branches, or do I need to get some things right in the ArmGccPath or somewhere else in compilation settings?

      Also in the https://github.com/Duet3D/RepRapFirmware/blob/v2-dev/BuildInstructions.md it tells you to make sure there's a copy of make.exe in your path, does this mean it should be in the eclipse ide build variables? Or in system enviroment variables?

      Thank you for your answers beforehand!

      posted in Firmware developers
      PieTorqueundefined
      PieTorque
    • Errors in building RepRapFirmware-2-dev

      Hello,

      I'm new to this firmware building business and I'm trying to get the tobbelobb hangprinter rrf built in the following branch: https://github.com/tobbelobb/RepRapFirmware/tree/v2-dev_hangprinter

      I've tried building it and I can't get it working. However while I was comparing the files together I noticed that what comes closest to this would be this: https://github.com/Duet3D/RepRapFirmware/tree/v2-dev

      I tried building this different ways, but as I said I'm new to all of this and I have no idea how to move forwards. I keep getting errors.

      The CoreNG is the master version so is FreeRtos And RRFLibraries.

      I'm not sure if it matters which build setting I should choose from the list. The one that has: DUET085, DUET085_RTOS, PCCB_X5 and many others.

      The errors in the log looks like this:

      23:38:30 **** Incremental Build of configuration Duet085 for project RepRapFirmware ****
      ./src/Movement/Kinematics/ZLeadscrewKinematics.cpp:233:47: error: invalid conversion from 'floatc_t* {aka float*}' to 'size_t {aka unsigned int}' [-fpermissive]
      
      ../src/Movement/Kinematics/HangprinterKinematics.cpp:424:48: error: invalid conversion from 'floatc_t* {aka float*}' to 'size_t {aka unsigned int}' [-fpermissive]
      
      ../src/Movement/Kinematics/LinearDeltaKinematics.cpp:321:48: error: invalid conversion from 'floatc_t* {aka float*}' to 'size_t {aka unsigned int}' [-fpermissive]
      
      23:38:32 Build Failed. 10 errors, 0 warnings. (took 2s.318ms)
      
      src/Movement/Kinematics/subdir.mk:54: recipe for target 'src/Movement/Kinematics/ZLeadscrewKinematics.o' failed
      make: *** [src/Movement/Kinematics/ZLeadscrewKinematics.o] Error 1
      make: *** Waiting for unfinished jobs....
      
      src/Movement/Kinematics/subdir.mk:54: recipe for target 'src/Movement/Kinematics/HangprinterKinematics.o' failed
      make: *** [src/Movement/Kinematics/HangprinterKinematics.o] Error 1
      
      src/Movement/Kinematics/subdir.mk:54: recipe for target 'src/Movement/Kinematics/LinearDeltaKinematics.o' failed
      make: *** [src/Movement/Kinematics/LinearDeltaKinematics.o] Error 1
      

      I noticed that if I locate these from the script : ../src/Movement/Kinematics/LinearDeltaKinematics.cpp:321:48: error: invalid conversion from 'floatc_t*

      ...and change the solution variable into int(solution) it stops warning about the problem, but I have no idea whether or not it's a bad practise and something I should not do?

      Anyways if I'd be so grateful if you could help me with this since I'm really struggling.

      Also if someone has any idea how to get the tobbelobbs v2-dev_hangprinter built please, please let me know.

      Thank you beforehand of your reply!

      posted in Firmware developers
      PieTorqueundefined
      PieTorque