Closed xorkrus closed 2 years ago
GPIO.22 (Probe) has a R/C filter of unknown value. R/C filters should generally not be used with PWM signals.
I have had good luck with 3.3V on Analog and Digital RC Servos.
to MitchBradley:
rst:0xc (SW_CPU_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:12812
load:0x40080400,len:3032
entry 0x400805e4
[MSG:INFO: FluidNC v3.5.0]
[MSG:INFO: Compiled with ESP32 SDK:v4.4.1-1-gb8050b365e]
[MSG:INFO: Local filesystem type is SPIFFS]
[MSG:INFO: Configuration file:DLC32XYZ.yaml]
[MSG:INFO: Machine DrawBotDLC32]
[MSG:INFO: Board MKS-DLC32 V2.1]
[MSG:INFO: I2SO BCK:gpio.16 WS:gpio.17 DATA:gpio.21]
[MSG:INFO: SPI SCK:gpio.14 MOSI:gpio.13 MISO:gpio.12]
[MSG:INFO: SD Card cs_pin:gpio.15 detect:NO_PIN]
[MSG:INFO: Stepping:I2S_static Pulse:4us Dsbl Delay:0us Dir Delay:1us Idle Delay:0ms]
[MSG:INFO: Axis count 3]
[MSG:INFO: Shared stepper disable I2SO.0]
[MSG:INFO: Axis X (0.000,325.000)]
[MSG:INFO: Motor0]
[MSG:INFO: stepstick Step:I2SO.1 Dir:I2SO.2 Disable:NO_PIN]
[MSG:INFO: Neg Limit gpio.36]
[MSG:INFO: Axis Y (0.000,220.000)]
[MSG:INFO: Motor0]
[MSG:INFO: stepstick Step:I2SO.5 Dir:I2SO.6:low Disable:NO_PIN]
[MSG:INFO: Neg Limit gpio.35]
[MSG:INFO: Axis Z (-5.000,0.000)]
[MSG:INFO: Motor0]
[MSG:INFO: rc_servo Pin:gpio.22 Pulse Len(1000,2000)]
[MSG:INFO: macro0_pin gpio.33:low:pu]
[MSG:INFO: Kinematic system: CoreXY]
[MSG:INFO: Using spindle NoSpindle]
[MSG:INFO: Connecting to STA SSID:xopkland]
[MSG:INFO: Connecting.]
[MSG:INFO: Connected - IP is 192.168.1.40]
[MSG:INFO: WiFi on]
[MSG:INFO: Start mDNS with hostname:http://fluidnc.local/]
[MSG:INFO: SSDP Started]
[MSG:INFO: HTTP started on port 80]
[MSG:INFO: Telnet started on port 8080]
Grbl 3.5 [FluidNC v3.5.0 (wifi) '$' for help]
Try stepping/idle_ms:255
With idle_ms at 0, the system disables all the motors, thus killing the servo position pulse.
I recommend using GPIO 25 and picking it up from pin 7 of the EXP1 connector (LCD_CS). That signal is driven via a 5V driver, without any filtering.
I used pin 25. Nothing changes. G53 G0 Z5 and G53 G0 Z5 only move the servomotor in one direction. At the same time, it does not look like a step-by-step movement, but like a jamming-jerk.
Try G53G0Z0 and G53G0Z-5
Is the servo locked in position or free to manually rotate?
Z-5 the same - only forward not a step back... Position free if idle_ms=0 and still work if idle_ms=255
Your answer is unclear. Is it locked or free to rotate with idle_ms:255.
Please send a picture of the connections to the controller and make sure we can see the servo.
Answer - as is. On idle_ms:255, servo don't stop until i enter commands $stepping/idle_ms=0 and G53... pic
At the same time, it does not look like a step-by-step movement, but like a jamming-jerk.
What do you expect? A 5 mm movement at z/max_rate_mm_per_min: 5000 takes 1/1000 of a minute, or 1/17 of a second. At a 50 Hz servo pulse rate, that is less than three servo updates, and certainly much less that human perception of smooth movement.
Furthermore, with your z settings of max_travel_mm:5, mpos_mm:0, positive direction:true, the range of travel is -5..0, consistent with [MSG:INFO: Axis Z (-5.000,0.000)]
, so G53 G0 Z5 is outside the range of motion and G53 G0 Z0 (which I assume that you meant when you said G53 G0 Z5
twice, is also at the very limit of the motion, the same limit as Z5.
No information that you have provided is consistent with motion inside the configured limits.
If you want the range to be 0..5, set positive_direction:false so that mpos_mm:0 is at the negative end of the travel range. Set max_rate_mm_per_min to something more reasonable, or use G1 moves with an explicit feedrate that corresponds to the speed that you want, considering the 50 Hz max update rate of a hobby servo.
I duplicated your setup with a MKS DLC32 V1.1, connecting the servo to EXP1 pins 7 (signal), 9 (gnd), 10 (5V). It worked as expected, using motions like G1 Z-5 F100
and G1 Z0 F100
.
OK. Maybe my English is too bad and I didn't explain well. Here's a video. With any max_travel and speed settings, the servo behaves like in the video. And it turns under any conditions only in one direction. Turning the servomotor in the other direction is possible only when pvm_hz is set to "1" or "2". if normal 50hz - only one direction. At the same time, as you can see in the video, the movement of the servomotor is non-uniform and a jerk occurs at the end.
https://discord.com/channels/780079161460916227/882732763126583326/995800097470304356 shows it working for me. The config file is as attached; it is the same as what you posted above, except:
The board is MKS DLC32 v1.1 because that is the closest that I have.
The servo is connected to the EXP1 header, pins 7 (signal), 9 (GND), and 10 (5V).
The WCO for G54 is 0,0,0, so the coordinates entered in GCode are the same as MPos.
The operating range is -5 mm to 0 mm as specified in the config file and confirmed by [MSG:INFO: Axis Z (-5.000,0.000)]
I do not observer any unexplained or strange behavior.
In your video, it appears that the MPos coordinates differ from what you enter as GCode. That makes me think that you have a work coordinate offset. mks.yaml.txt
Controller Board
MKS DLC32 V2.01
Help From Board Vendor
Machine Description
Simple drawing machine (pen plotter)
Configuration file
Startup Messages
User Interface Software
WebUI
What happened?
I connect chinese servo TowerPro SG90 on IO35 (default this a "Probe" pin). Didn't respond to any commands. I recompile firmware with wifi and change PWM resolution to 12bit instead of 16bit.
const int SERVO_PWM_RESOLUTION_BITS = 16;
in file FluidNC/src/Motors/RcServoSettings.h The servo has started to work and respond to commands, but nothing can make the servo move in the opposite direction. Only setting PWM_HZ to "1" or "2" gives some jerk in the opposite directionOther Information
No response