Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. jazbaatbadalgaye
    3. Posts
    • Profile
    • Following 2
    • Followers 0
    • Topics 27
    • Posts 74
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by jazbaatbadalgaye

    • RE: Extrusion value for any XYZ coordinate within a move?

      @alankilian That makes sense but shouldn't the extrusion be more while acceleration, linear during the constant speed phase and less during the deceleration phase, to get uniform extrusion throughout the move? If its linear during accel. and decel wouldn't it cause under-extrusion and over-extrusion respectively? Hope I am making sense.

      posted in General Discussion
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • Extrusion value for any XYZ coordinate within a move?

      Let us assume that we start at 0,0,0. When I give G0 X5 Y5 command via YAT, I can see the total extrusion value for that move through the DDA debug output. Now what I am interested in is the extrusion value at any arbitrary coordinate within that move. i.e. what would be the extrusion value when, say x = 3 y = 4. How can I get that value?

      posted in General Discussion
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: DDA output not showing over serial communication with Rpi?

      @jazbaatbadalgaye Just commenting in case anyone runs into the same issue.

      The C code was working fine, void DDA::DebugPrint in DDA.cpp was the culprit. The debugPrintf() function in void DDA::DebugPrint did not output to the serial (at least in C, it worked fine in Python). So I declared variables in Platform.h, set values in DDA.cpp and used debugPrintf() in Platform.cpp to print all the values to serial. I have no idea why it works and I have no idea why the debugPrintf() function in void DDA::DebugPrint doesn't work in C. Maybe need to sacrifice a goat to the C Gods.

      Note : All this is not required if using python to read serial data. For python, just print values using debugPrintf() function in void DDA::DebugPrint. Those values will show up on the serial.

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • DDA output not showing over serial communication with Rpi?

      I am trying to capture the DDA output over serial on a Raspberry Pi. However the only data I am able to read over serial is the heater warning.

      Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
      

      I am able to read the DDA output when I use a python script for serial communication but I am only getting the warning when I use C for serial communication.

      The expected output i.e. the output from the python script is as follows :

      N 0.500000 174.949997 112.449997 0.300000 0.000000 0.000000 0.000000 41926.273438 0.000000 41926.273438 83852 0.0000e+0 1.1926e-5 0.0000e+0 1 0.500000
      
      N 15.100006 174.949997 112.449997 0.300000 15.100006 0.000000 0.000000 53037.558594 917231.625000 970269.187500 970269 0.0000e+0 1.6000e-5 1.6000e-5 1 1.265568
      
      Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
      
      N 15.100006 190.050003 112.449997 0.300000 0.000000 15.100006 0.000000 0.000000 943750.375000 943750.375000 943750 1.6000e-5 1.6000e-5 1.6000e-5 1 1.265663
      
      N 6.769390 169.649002 108.239998 0.300000 5.300995 4.209999 0.000000 96530.593750 0.000000 96530.593750 193061 0.0000e+0 7.0127e-5 0.0000e+0 1 0.000000
          
      N 0.500000 174.949997 112.449997 0.300000 0.000000 0.000000 0.000000 41926.273438 0.000000 41926.273438 83852 0.0000e+0 1.1926e-5 0.0000e+0 1 0.500000
          
      N 15.100006 174.949997 112.449997 0.300000 15.100006 0.000000 0.000000 53037.558594 917231.625000 970269.187500 970269 0.0000e+0 1.6000e-5 1.6000e-5 1 1.265568
      
      Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
          
      N 15.100006 190.050003 112.449997 0.300000 0.000000 15.100006 0.000000 0.000000 943750.375000 943750.375000 943750 1.6000e-5 1.6000e-5 1.6000e-5 1 1.265663
      

      i.e. a line starting with N and followed by some numerical values and occasionally get some warnings about the heater.

      However, the output I am getting is

      Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
       
      Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
       
      Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
       
      Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
       
      Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
      

      The c code that I am using is

      #include <stdio.h>
      #include <string.h>
      #include <unistd.h>
      #include <fcntl.h>
      #include <errno.h>
      #include <termios.h>
      
      int main(int argc, char ** argv) {
        int fd;
      
        // Open the Port. We want read/write, no "controlling tty" status, and open it no matter what state DCD is in
        fd = open("/dev/ttyACM0", O_RDWR | O_NOCTTY | O_NDELAY);
        
        struct termios SerialPortSettings;
        
        cfsetispeed(&SerialPortSettings,B115200);
        cfsetospeed(&SerialPortSettings,B115200);
      		
        tcsetattr(fd, TCSAFLUSH, &SerialPortSettings);
      
          
        if (fd == -1) 
        {
          perror("open_port: Unable to open /dev/ttyACM0 - ");
          return(-1);
        }
      
        // Turn off blocking for reads, use (fd, F_SETFL, FNDELAY) if you want that
        fcntl(fd, F_SETFL, 0);
      
        // Write to the port
      
      
        // Read up to 255 characters from the port if they are there
      
        char buf[255];
        
        while (1)
        {
          ssize_t k = read(fd, buf, sizeof(buf)-1);
          if (k < 0) 
          {
            perror("Read failed - ");
            return -1;
          } 
          else if (k == 0) 
          {
            printf("No data on port\n");
          }
          else 
          {
            buf[k] = '\0';
            printf(buf);
            
          }
        }
        
        close(fd);
        return 0;
      }
      

      I have used the same code to get some values from an accelerometer so I am confident that the code works, albeit bad code, but works. Does anyone have any idea why am I not able to read the numerical data but able to read the heater warnings?

      Here is the python code which works properly :

      import serial
      import time
      import subprocess
      
      LINUX = 1
      
      output = subprocess.check_output("python -m serial.tools.list_ports", shell=True) # sending command to terminal 
      output = output.decode('utf-8') # the output is of type b'somestring' This removes that
      output = output.splitlines() # so we can access the COM part
      
      if LINUX:
          temp = output[0].split()
          port = temp[0]
      else:
          port =  output[0]
          
      data = open("Input.txt", "w")
      ser = serial.Serial(port, 115200, timeout=30)
      print("Serial Port opened on : " + ser.name)
      
      counter = 0
      while (1):
          response = ser.readline().decode('utf-8')
          print(response)
          data.write(response)
          if response == "":
              break
      
      time.sleep(1)
      data.close()
      
      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Output x,y,z tool position from DWC to serial?

      @phaedrux I am capturing motion during movement. I just want to intercept the values that being sent to the DWC tool position

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Output x,y,z tool position from DWC to serial?

      @phaedrux I want to store the to X, Y, Z tool positions (displayed at top right-ish in DWC) in a text file.

      Screenshot (26).png

      I will later use these positions to generate a 3D model so I can check how well does my control algorithm works. Currently, I am generating the X,Y,Z values using the DDA output (accel stop time, steady time, decel start time, start velocity, end velocity, total distance moved etc) but I'm sure there's a bug somewhere because I get a deformed model

      Deforemd.png

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • Output x,y,z tool position from DWC to serial?

      Which files should I modify to output the x,y,z tool position (as shown in DWC) to the serial so I can store in a txt file?

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • 3.4 version compilation issues

      I am trying to build the firmware from source but I am getting the following error

      17:02:55 **** Incremental Build of configuration Duet2 for project RepRapFirmware ****
      make -j8 all 
      Building file: ../src/Platform/Platform.cpp
      Invoking: Cross G++ Compiler
      arm-none-eabi-g++ -std=gnu++17 -D__SAM4E8E__ -DRTOS -DDUET_NG -D_XOPEN_SOURCE -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70\SAM4E" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70\asf\common\utils" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\arm\CMSIS\5.4.0\CMSIS\Core\Include" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70\asf\sam\utils\cmsis\sam4e\include" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70\asf" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70\asf\sam\utils" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70\asf\sam\utils\preprocessor" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70\asf\sam\utils\header_files" -I"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\src\SAM4S_4E_E70\asf\sam\drivers" -I"C:\Users\Ashley\Documents\GitHub\Modified\RepRapFirmware\src" -I"C:\Users\Ashley\Documents\GitHub\Modified\RepRapFirmware\src\Hardware\SAM4E" -I"C:\Users\Ashley\Documents\GitHub\Modified\RepRapFirmware\src\DuetNG" -I"C:\Users\Ashley\Documents\GitHub\Modified\RepRapFirmware\src\Networking" -I"C:\Users\Ashley\Documents\GitHub\Modified\DuetWiFiSocketServer\src\include" -I"C:\Users\Ashley\Documents\GitHub\Modified\FreeRTOS\src\include" -I"C:\Users\Ashley\Documents\GitHub\Modified\FreeRTOS\src\portable\GCC\ARM_CM4F" -I"C:\Users\Ashley\Documents\GitHub\Modified\RRFLibraries\src" -Os -Wall -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fexceptions -nostdlib -Wundef -Wdouble-promotion -Werror=return-type -Wsuggest-override -fsingle-precision-constant "-Wa,-ahl=Platform.s" -fstack-usage -MMD -MP -MF"src/Platform/Platform.d" -MT"src/Platform/Platform.o" -o "src/Platform/Platform.o" "../src/Platform/Platform.cpp"
      Finished building: ../src/Platform/Platform.cpp
       
      Building target: Duet2CombinedFirmware.elf
      Invoking: Cross G++ Linker
      arm-none-eabi-gcc -L"C:\Users\Ashley\Documents\GitHub\Modified\CoreN2G\SAM4E_SDHC_USB_RTOS" -L"C:\Users\Ashley\Documents\GitHub\Modified\RRFLibraries\SAM4E_RTOS" -L"C:\Users\Ashley\Documents\GitHub\Modified\FreeRTOS\SAM4E" --specs=nosys.specs -Os -Wl,--gc-sections -Wl,--fatal-warnings -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -T"C:\Users\Ashley\Documents\GitHub\Modified\RepRapFirmware\src\Hardware\SAM4E\sam4e8e_flash.ld" -Wl,-Map,"C:\Users\Ashley\Documents\GitHub\Modified\RepRapFirmware\Duet2/Duet2CombinedFirmware.map" -o "Duet2CombinedFirmware.elf" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group  ./src/libcpp/eh_alloc.o ./src/libcpp/vterminate.o  ./src/libc/memcmp.o ./src/libc/memcpy.o ./src/libc/memmove.o ./src/libc/memset.o ./src/libc/nano-mallocr.o ./src/libc/strptime.o  ./src/bossa/Applet.o ./src/bossa/BossaFlash.o ./src/bossa/Device.o ./src/bossa/EefcFlash.o ./src/bossa/Flasher.o ./src/bossa/Samba.o ./src/bossa/WordCopyApplet.o ./src/bossa/WordCopyArm.o  ./src/Tools/Filament.o ./src/Tools/Spindle.o ./src/Tools/Tool.o  ./src/Storage/CRC16.o ./src/Storage/CRC32.o ./src/Storage/EmbeddedFiles.o ./src/Storage/FileInfoParser.o ./src/Storage/FileStore.o ./src/Storage/MassStorage.o  ./src/PrintMonitor/PrintMonitor.o  ./src/Platform/Heap.o ./src/Platform/Logger.o ./src/Platform/OutputMemory.o ./src/Platform/Platform.o ./src/Platform/PortControl.o ./src/Platform/RepRap.o ./src/Platform/Roland.o ./src/Platform/Scanner.o ./src/Platform/Tasks.o  ./src/ObjectModel/GlobalVariables.o ./src/ObjectModel/ObjectModel.o ./src/ObjectModel/Variable.o  ./src/Networking/W5500Ethernet/Wiznet/Internet/DHCP/dhcp.o  ./src/Networking/W5500Ethernet/Wiznet/Ethernet/W5500/w5500.o  ./src/Networking/W5500Ethernet/Wiznet/Ethernet/WizSpi.o ./src/Networking/W5500Ethernet/Wiznet/Ethernet/socketlib.o ./src/Networking/W5500Ethernet/Wiznet/Ethernet/wizchip_conf.o  ./src/Networking/W5500Ethernet/MdnsResponder.o ./src/Networking/W5500Ethernet/W5500Interface.o ./src/Networking/W5500Ethernet/W5500Socket.o  ./src/Networking/ESP8266WiFi/WiFiInterface.o ./src/Networking/ESP8266WiFi/WiFiSocket.o ./src/Networking/ESP8266WiFi/WifiFirmwareUploader.o  ./src/Networking/FtpResponder.o ./src/Networking/HttpResponder.o ./src/Networking/Network.o ./src/Networking/NetworkBuffer.o ./src/Networking/NetworkInterface.o ./src/Networking/NetworkResponder.o ./src/Networking/TelnetResponder.o ./src/Networking/UploadingNetworkResponder.o  ./src/Movement/StepperDrivers/DriverMode.o ./src/Movement/StepperDrivers/TMC22xx.o ./src/Movement/StepperDrivers/TMC2660.o ./src/Movement/StepperDrivers/TMC51xx.o  ./src/Movement/Kinematics/CoreKinematics.o ./src/Movement/Kinematics/FiveBarScaraKinematics.o ./src/Movement/Kinematics/HangprinterKinematics.o ./src/Movement/Kinematics/Kinematics.o ./src/Movement/Kinematics/LinearDeltaKinematics.o ./src/Movement/Kinematics/PolarKinematics.o ./src/Movement/Kinematics/RotaryDeltaKinematics.o ./src/Movement/Kinematics/RoundBedKinematics.o ./src/Movement/Kinematics/ScaraKinematics.o ./src/Movement/Kinematics/ZLeadscrewKinematics.o  ./src/Movement/HeightControl/HeightController.o  ./src/Movement/BedProbing/Grid.o ./src/Movement/BedProbing/RandomProbePointSet.o  ./src/Movement/AxisShaper.o ./src/Movement/DDA.o ./src/Movement/DDARing.o ./src/Movement/DriveMovement.o ./src/Movement/ExtruderShaper.o ./src/Movement/Move.o ./src/Movement/MoveSegment.o ./src/Movement/RawMove.o ./src/Movement/StepTimer.o  ./src/Libraries/sha1/sha1.o  ./src/Libraries/sd_mmc/ctrl_access.o ./src/Libraries/sd_mmc/sd_mmc.o ./src/Libraries/sd_mmc/sd_mmc_mem.o ./src/Libraries/sd_mmc/sd_mmc_spi.o  ./src/Libraries/Fatfs/diskio.o ./src/Libraries/Fatfs/fattime_rtc.o ./src/Libraries/Fatfs/ff.o ./src/Libraries/Fatfs/ffunicode.o  ./src/InputMonitors/InputMonitor.o  ./src/Heating/Sensors/AdditionalOutputSensor.o ./src/Heating/Sensors/CpuTemperatureSensor.o ./src/Heating/Sensors/CurrentLoopTemperatureSensor.o ./src/Heating/Sensors/DhtSensor.o ./src/Heating/Sensors/LinearAnalogSensor.o ./src/Heating/Sensors/RemoteSensor.o ./src/Heating/Sensors/RtdSensor31865.o ./src/Heating/Sensors/SensorWithPort.o ./src/Heating/Sensors/SpiTemperatureSensor.o ./src/Heating/Sensors/TemperatureSensor.o ./src/Heating/Sensors/Thermistor.o ./src/Heating/Sensors/ThermocoupleSensor31855.o ./src/Heating/Sensors/ThermocoupleSensor31856.o ./src/Heating/Sensors/TmcDriverTemperatureSensor.o  ./src/Heating/FOPDT.o ./src/Heating/Heat.o ./src/Heating/Heater.o ./src/Heating/HeaterMonitor.o ./src/Heating/LocalHeater.o ./src/Heating/RemoteHeater.o ./src/Heating/TemperatureError.o  ./src/Hardware/SharedSpi/SharedSpiClient.o ./src/Hardware/SharedSpi/SharedSpiDevice.o  ./src/Hardware/SAM4E/Devices.o ./src/Hardware/SAM4E/Main.o  ./src/Hardware/ExceptionHandlers.o ./src/Hardware/I2C.o ./src/Hardware/IoPorts.o ./src/Hardware/NonVolatileMemory.o ./src/Hardware/SoftwareReset.o  ./src/GPIO/GpInPort.o ./src/GPIO/GpOutPort.o  ./src/GCodes/GCodeBuffer/BinaryParser.o ./src/GCodes/GCodeBuffer/ExpressionParser.o ./src/GCodes/GCodeBuffer/GCodeBuffer.o ./src/GCodes/GCodeBuffer/StringParser.o  ./src/GCodes/GCodeException.o ./src/GCodes/GCodeFileInfo.o ./src/GCodes/GCodeInput.o ./src/GCodes/GCodeMachineState.o ./src/GCodes/GCodeQueue.o ./src/GCodes/GCodes.o ./src/GCodes/GCodes2.o ./src/GCodes/GCodes3.o ./src/GCodes/GCodes4.o ./src/GCodes/ObjectTracker.o ./src/GCodes/RestorePoint.o ./src/GCodes/StraightProbeSettings.o ./src/GCodes/Trigger.o  ./src/FilamentMonitors/Duet3DFilamentMonitor.o ./src/FilamentMonitors/FilamentMonitor.o ./src/FilamentMonitors/LaserFilamentMonitor.o ./src/FilamentMonitors/PulsedFilamentMonitor.o ./src/FilamentMonitors/RotatingMagnetFilamentMonitor.o ./src/FilamentMonitors/SimpleFilamentMonitor.o  ./src/Fans/Fan.o ./src/Fans/FansManager.o ./src/Fans/LedStripDriver.o ./src/Fans/LocalFan.o ./src/Fans/RemoteFan.o  ./src/Endstops/Endstop.o ./src/Endstops/EndstopsManager.o ./src/Endstops/LocalZProbe.o ./src/Endstops/RemoteZProbe.o ./src/Endstops/StallDetectionEndstop.o ./src/Endstops/SwitchEndstop.o ./src/Endstops/ZProbe.o ./src/Endstops/ZProbeEndstop.o  ./src/DuetNG/DueXn.o ./src/DuetNG/Pins_DuetNG.o ./src/DuetNG/SX1509.o  ./src/Display/Lcd/ST7920/Lcd7920.o  ./src/Display/Lcd/ST7567/Lcd7567.o  ./src/Display/Lcd/Fonts/glcd11x14.o ./src/Display/Lcd/Fonts/glcd7x11.o  ./src/Display/Lcd/Lcd.o  ./src/Display/Display.o ./src/Display/Menu.o ./src/Display/MenuItem.o ./src/Display/RotaryEncoder.o  ./src/Comms/AuxDevice.o ./src/Comms/FirmwareUpdater.o ./src/Comms/PanelDueUpdater.o  ./src/ClosedLoop/ClosedLoop.o  ./src/CAN/CanInterface.o ./src/CAN/CanMessageGenericConstructor.o ./src/CAN/CanMotion.o ./src/CAN/CommandProcessor.o ./src/CAN/ExpansionManager.o  ./src/Accelerometers/Accelerometers.o ./src/Accelerometers/LIS3DH.o  ./src/RepRapFirmware.o   -lCoreN2G -lRRFLibraries -lFreeRTOS -lsupc++ -Wl,--end-group -lm
      c:/program files (x86)/gnu tools arm embedded/7 2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: Duet2CombinedFirmware.elf section `.ARM.exidx' will not fit in region `rom'
      c:/program files (x86)/gnu tools arm embedded/7 2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: region `rom' overflowed by 3880 bytes
      collect2.exe: error: ld returned 1 exit status
      makefile:94: recipe for target 'Duet2CombinedFirmware.elf' failed
      make: *** [Duet2CombinedFirmware.elf] Error 1
      
      17:02:58 Build Failed. 4 errors, 0 warnings. (took 2s.980ms)
      

      This only happens when the build configuration of RepRapFirmware is Duet2. It complies just fine if the build configuration is Duet2_SBC. Furthermore, the wiki says to use CoreN2G for version 3.4 but later says to use SAM4E8E configuration. However CoreN2G does not have SAM4E8E configuration but CoreNG does. This is how my working directory looks like :

      Screenshot (20).png

      How can I build version 3.4?

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • Usual Minimum Prepared Time calculation?

      How is the following statement evaluated to 100ms?

      uint32_t UsualMinimumPreparedTime = StepTimer::StepClockRate/10;				// 100ms
      

      If the step clock rate is 1MHz (1000000), the step clock time should be 10^-6 sec, hence the UsualMinimumPreparedTime should evaluate to 10^-5 sec i.e. 0.01 ms or 10us. Am I missing something?

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Where did MoveSegment go in the 3.3 version?

      @oliof That's weird. I don't have one

      Screenshot (15).png

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • Where did MoveSegment go in the 3.3 version?

      I came across the Movement in RepRapFirmware document which mentions MoveSegment in quite a few places. However upon searching for MoveSegment in the firmware gave me no results. Has MoveSegment has been replaced with something else or is it juts called move now? If not then is there an updated documentation? If not then is there any plan for releasing an updated document? It would be immensely helpful for noobs like me who would like to tinker with the firmware.

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • Deceleration calculated next step time negative?

      I wrote a snippet to verify if I understand how the next step time is generated for acceleration and deceleration phase. I am getting sensible values when I print values out for acceleration but when I print values for deceleration, I am getting negative values. I have set up some dummy values for the variables and my best guess is some of those values might be incorrect. Any help is appreciated

      #DECELERATION
      ####################################################
      #Move G0 X5
      totalsteps=400
      totaldistance=5
      stepsPerMm = totalsteps/totaldistance
      topSpeed=500
      requestedSpeed=400
      deceleration=1500
      endSpeed=0
      startSpeed = 300
      StepClockRate = 937500
      acceleration = 2000 
      compensationTime = 0.3
      shiftfactor = 3 
      nextStep = 200 #no of steps done 
      
      stepsTillRecalc = (1 << shiftfactor)-1 #store number of additional steps to generate
      compensationClocks = compensationTime*StepClockRate
      decelDistance= ((requestedSpeed**2) - (endSpeed**2))/(2*deceleration)
      decelStartDistance = totaldistance - decelDistance
      accelDistance = ((requestedSpeed)**2 - (startSpeed)**2)/(2*acceleration)
      steadyTime = (decelStartDistance -accelDistance)/topSpeed
      accelStopTime = (topSpeed - startSpeed)/acceleration
      decelStartTime = accelStopTime + steadyTime
      fTwoCsquaredTimesMmPerStepDivD=StepClockRate*StepClockRate*2/(stepsPerMm*deceleration)
      print(fTwoCsquaredTimesMmPerStepDivD)
      topSpeedTimesCdivDPlusDecelStartClocks=(topSpeed*StepClockRate)/deceleration + decelStartTime*StepClockRate 
      adjustedTopSpeedTimesCdivDPlusDecelStartClocks = topSpeedTimesCdivDPlusDecelStartClocks - compensationClocks
      print(adjustedTopSpeedTimesCdivDPlusDecelStartClocks)
      nextCalcStep = nextStep + stepsTillRecalc
      temp = fTwoCsquaredTimesMmPerStepDivD * nextCalcStep
      print(temp)
      fTwoDistanceToStopTimesCsquaredDivD =((topSpeed*StepClockRate)/deceleration)**2+ ((2*decelStartDistance*StepClockRate*StepClockRate)/deceleration)
      if temp < fTwoDistanceToStopTimesCsquaredDivD:
          nextCalcStepTime=adjustedTopSpeedTimesCdivDPlusDecelStartClocks - (fTwoDistanceToStopTimesCsquaredDivD - temp)**0.5
      else:
          nextCalcStepTime =  adjustedTopSpeedTimesCdivDPlusDecelStartClocks
      print(nextCalcStepTime)
      
      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RepRap execution flow questions

      From my understanding this is how the firmware works :

      1. Read the move G codes (String Parser)

      2. Store basic moves in buffer

      3. ReadMove() reads all the moves stored in the buffer and performs segmentation

      4. Moves are put in the move queue where the move has acc, dec segments describing the DDA

      5. Input shaping

      6. Attach a DM to DDA for each set of local drive.

      7. Step time calculations are performed and total no of steps, initial direction, time of first step measured are calculated

      8. DMs are attached to DDA in a time step manner

      9. Interrupt is scheduled for the time at which the first step is required as indicated by the first DM

      10. ISR iterates through all the DMs at the start of the linked list and generates time steps for the due drives

      11. For each of those DMs, the next step due time is calculated and inserts them in correct place to maintain the step time order of the linked list

      Q1. Assuming cartesian printer having axes X Y Z, what is a single move and how many DMs will be associated with each DDA? i.e. for a move eg G0 X4 Y4 Z3 will there be 3 DMs associated with the DDA? I am led to believe so due to the following statement :

       For each DM the total number of steps, initial direction, and time of the first step measured from the move start time are calculated
      

      Why will there be multiple dms for a single move if my above interpretation is incorrect?

      Q2. What does ISR iterates through the DMs at the start of the linked list mean in the following statement?

      When the interrupt occurs, the ISR iterates through the DMs at the start of the linked list to identify the ones for which a step is due or almost due
      

      Does it mean that ISR will iterate through all the DMs associated with the current DDA? i.e. for a move G0 X4 Y4 Z9, the ISR will iterate through the X,Y and Z DMs and arrange them in step time order?

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Heater Fault

      @dave-parry Did you put the jumper on the erase pins? As the name suggests, it is going to erase the board so proceed with caution.

      posted in General Discussion
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Heater Fault

      Idk if it will work but make a copy of the contents of your SD card, then flash a stable binary using Bossa, perferably 3.3. Then generate the config files according to the printer and place those folders in the sd card. Then replace the bin in firmware folder with the version you want to flash. Go to YAT and run M997.

      Also are you pressing the reset button before you try to flash the firmware? I have noticed that even if your all files are in correct directories, YAT gives .bin file not found unless you reset the board

      posted in General Discussion
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Duet 2 disconnects after running a custom M command

      @dc42 okay changing it to LF did the trick! Thanks a bunch.

      Faulted at:
      .text._ZN3DDA11StepDriversER8Platformm
                      0x00425e74      0x148 ./src/Movement/DDA.o
                      0x00425e74                DDA::MoveInsert(unsigned char, unsigned long, unsigned int)
      Error is at offset: 0x4
      

      So I can see that the the MoveInsert is giving me an error as suspected.

      How to interpret the

      Error is at offset: 0x4
      

      I have the DDA.s which I believe is the assembly file (?). So I look for the 5th byte in the assembly file?

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Duet 2 disconnects after running a custom M command

      @dc42 Yes, I am using the same mapfile named Duet2combinedfirmware.map. I just renamed it after copying. I will try giving it the absolute path

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Duet 2 disconnects after running a custom M command

      @jazbaatbadalgaye

      //in move.cpp
      
      void Move::insertmymove(uint8_t simMode, uint32_t input, size_t axis) //insert my move 
      {
      	mainDDARing.prepmoves(simulationMode, input, axis);  //prepmoves
      }
      
      
      //in DDARing
      
      void DDARing:prepmoves(uint8_t simMode, uint32_t input,size_t axis) noexcept
      {
      	addPointer2->MoveInsert(simMode, input,axis); 
      }
      

      This is what I have in DDARing and Move.cpp.

      // in DDA.cpp
      
      void DDA::MoveInsert(uint8_t simMode, uint32_t input,size_t axis) noexcept
      {
      	debugPrintf("Sim mode : %d \n" , simMode);
      	debugPrintf("Input : %" PRIu32 "\n" , input);
       
      	Platform& platform = reprap.GetPlatform();
      	PrepParams params;
      	AxesBitmap additionalAxisMotorsToEnable, axisMotorsEnabled;
       
      	int32_t delta = input*80 - prev->endPoint[axis];
      	if (delta != 0)
      	{
      		platform.EnableDrivers(axis);
      		if (platform.GetDriversBitmap(axis) != 0)				
      		{
      			DriveMovement* const pdm = DriveMovement::Allocate(axis, DMState::accel0);
      			pdm->totalSteps = labs(delta);
      			pdm->direction = (delta >= 0);
      			if (pdm->PrepareCartesianAxis(*this, params))
      			{
      				pdm->directionChanged = false;
      				if (reprap.Debug(moduleDda) && pdm->totalSteps > 1000000)
      				{
      					DebugPrintAll("pr");
      				}
      				InsertDM(pdm);
      			}
      			else
      			{
      				pdm->state = DMState::idle;
      				pdm->nextDM = completedDMs;
      				completedDMs = pdm;
      			}
      		}
      		axisMotorsEnabled.SetBit(axis);
      		additionalAxisMotorsToEnable |= reprap.GetMove().GetKinematics().GetConnectedAxes(axis);
      	}
       
      	const DDAState st = prev->state;
      	afterPrepare.moveStartTime = (st == DDAState::executing || st == DDAState::frozen)
      					? prev->afterPrepare.moveStartTime + prev->clocksNeeded			
      						: StepTimer::GetTimerTicks() + AbsoluteMinimumPreparedTime;
       
      	if (flags.checkEndstops)
      	{
      		platform.EnableAllSteppingDrivers();
      		CheckEndstops(platform);									
      	}
       
      	if (reprap.Debug(moduleDda) && reprap.Debug(moduleMove))		
      	{
      		DebugPrintAll("pr");
      	}
       
      	if (state != completed)
      	{
      		state = frozen;					
      	}
      }
      

      This is what I have in DDA.cpp

      case 840:	// insert move 
      {
      	for (size_t axis = 0; axis < numVisibleAxes; ++axis)
      	{
      		if (gb.Seen(axisLetters[axis]))
      		{
      			const uint32_t ipval = gb.GetUIValue();
      			//reply.catf("input given is  : %.3f \n",(double)ipval);
      			reprap.GetMove().insertmymove(simulationMode, ipval, axis);
      		}
      	}
      }
      break;
      

      And this what I have in GCodes2.cpp

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye
    • RE: Duet 2 disconnects after running a custom M command

      @dc42 So i am copying the output given to me by the M122 command and saving it as logM122.txt. I copied both files (mymapfile.map file + m122 output) into ../../stackanalyzer/win and run the follwing command

      stackanalyzer -m122 logM122.txt -mapFile mymapfile.map
      

      But I don't see any output on the terminal. Is there a separate file or something that is created by stackanalyzer?

      posted in Firmware developers
      jazbaatbadalgayeundefined
      jazbaatbadalgaye