@jay_s_uk Thanks! That worked like a charm however I had to include CoreESP8266 and LwipESP8266 in the working directory. @dc42 mentioned in another thread that those files are required if you're building DuetWiFiSocketServer but it gave me errors when I was trying to build CoreN2G-3.4-dev. The build errors were mitigated when I included CoreESP8266 and LwipESP8266 in working directory.
Best posts made by jazbaatbadalgaye
-
RE: How to compile the version 3.4 input shaping?
Latest 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.
-
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?
-
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
inDDA.cpp
was the culprit. ThedebugPrintf()
function invoid DDA::DebugPrint
did not output to the serial (at least in C, it worked fine in Python). So I declared variables inPlatform.h
, set values inDDA.cpp
and useddebugPrintf()
inPlatform.cpp
to print all the values to serial. I have no idea why it works and I have no idea why thedebugPrintf()
function invoid 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 invoid DDA::DebugPrint
. Those values will show up on the serial. -
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()
-
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
-
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.
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
-
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?
-
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 :
How can I build version 3.4?
-
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?
-
RE: Where did MoveSegment go in the 3.3 version?
@oliof That's weird. I don't have one