Issues with can interference? / Turning off signal to servos?



  • I have 6 continuous rotation servos connected to 2x SAMMYC21 and powered by a 24v-->5V step-down module. The SAMMYC21s are powered separately by the 5v output of a 3HC which is powered from the same 24v supply as the step-down.

    When previously using servos connected to a the 6HC mainboard, I had issues with the servos jittering/moving etc when Y steppers were moving, I assumed due to the wires being in close proximity.

    So I figured that controlling them via an expansion board located near the servos would help... but no.
    The problem now is that when moving the Y axis (steppers attached to 6HC) several of the servos still jitter and move. Servos are on the opposite side of a 1.5m wide machine from the stepper and mains wires. The 6HC and 3HC use separate 24v power supplies.

    Can bus wires still run next to mains and stepper wires, but no other can-based functionality is affected by Y movement. Servo wires are very short (150mm) and only run next to 24v and can wires.

    How can this still be happening?

    Another solution I thought of was to somehow stop generating any PWM signal, except when I need the servos to move as there is no static load on them (driving pumps). Which I can't find any idea of how to do.

    Any help appreciated,
    T


  • Moderator

    Can you provide your config.g and the results of M122 and M122 B1?

    Standalone or SBC mode?

    Wiring diagram? Photos?


  • administrators

    First, make sure that you are not commanding the servos beyond their physical endstops. It is normal for servos to jitter if you do that. It also wears them out quickly.

    The jitter may be caused by variation in the 5V power to the servo. So try using a separate 5V PSU to power the servo.

    To command the servo to move and then stop commanding it, use the following:

    M280 Pn Snnn
    G4 P200
    M280 Pn S0

    You can adjust the G4 delay amount to find a good value. You will need at least P50.



  • @tristanryerparke said in Issues with can interference? / Turning off signal to servos?:

    6 continuous rotation servos

    @dc42 said in Issues with can interference? / Turning off signal to servos?:

    make sure that you are not commanding the servos beyond their physical endstops.

    Usually it makes sense what dc42 said about servos, but not this time. Just wanted to point it out for future readers.

    @tristanryerparke One question about the servos: are they reliably working with 3.3V PWM signals? Or is there a level-shifter?


  • administrators

    Ah OK, I missed that they are continuous rotation servos when I wrote that bit.



  • Sorry I didn't put these in before:

    Running SBC mode.

    config.g:

    ;CNC Mode
    M453
    ;Name
    M550 P"tristan-painting-machine"
    ;Brake Pins
    M950 P2 C"out8"
    M950 P1 C"out7"
    ;Drivers Main Board
    M569 P0.0 S0  I1
    M569 P0.1 S0  I1
    M569 P0.2 S1  I1
    M569 P0.3 S0  I1
    M569 P0.4 S0  I1
    ;Drivers Expansion Board
    M569 P1.0 S0 I1
    M569 P1.2 S0 I1
    ;Drivers Tool Board
    M569 P121.0 S1 I1
    ;Driver Mapping
    M584 X0.3 Y0.1:0.2 Z0.0 U1.2 V1.0 A0.4 B121.0 P7
    M584 C0.2 D0.5 P7
    ;Current
    M906 X2000 Y3750 C3750 Z2000 A1750 B1500 U1000 V3500 I100
    ;Microstepping
    M350 X16 Y16 C16 Z16 A16 B16 U16 V16  I1 
    ;Steps Per MM
    M92 X80 Y80 Z80 C80 A46.1062140618 B26.6666 U400 V8.888866 
    ;Instantaneous Speed Change
    M566 X500 Y500 Z500 C500 A500 U50 V500 
    ;Max Speeds
    M203 X13000 Y13000 Z13000 C6000 A40000 B40000 U5000 V8000 
    ;Max Acceleration
    M201 X750 Y750 Z500 C750 A2000 B2000 U300 V2000 
    ;Disable Idle Current Reduction
    M84 S0    
    M917 Y100
    ;Probe
    M558 P9 C"!^121.io0.in" H200 F400 T2000 I1
    ;Limits
    M208 X0 Y-1362 Z-145 A-72000 B-120 V-72000 U0 S1 
    M208 X1275 Y0 Z0 A72000 B230 V72000 U109 S0 
    ;Endstops Main
    M574 C1 S1 P"!io6.in"
    M574 Y1 S1 P"!io1.in"
    M574 X1 S1 P"!io8.in"
    M574 Z1 S1 P"io7.in"
    M574 A1 S1 P"io0.in"
    ;Endstops Expansion
    M574 V1 S1 P"1.io2.in"
    M574 U1 S1 P"1.io1.in"
    ;Endstops Tool
    M574 B1 S1 P"121.io2.in"
    
    ;PAINT MIXING
    ;Servos left
    M950 S4 C"124.pa06" ;Initialize 1st left servo.
    M950 S5 C"124.pa04" ;Initialize 2nd left servo.
    M950 S6 C"125.pa12"	;Initialize 3rd left servo.
    ;Servos right
    M950 S7 C"125.pa06" ;Initialize 1st right servo.
    M950 S8 C"124.pa12" ;Initialize 2nd right servo.
    M950 S9 C"125.pa04" ;Initialize 3rd right servo.
    ;Real Tools
    ;Tool 0
    M563 P0 S"Inductive Sensor"
    ;Tool 1
    M563 P1 S"Mixing Stick"
    ;Tool 2
    M563 P3 S"5/8 Flat Brush"
    ;Tools used as number storage:
    M563 P10 S"cup_data"
    G10 P10 X-1 Y-1 Z-1 U-1 V1 A-1 B-1
    M563 p11 S"cup1"
    G10 P11 X0 Y0 Z0 U0 V0 A0 B0
    M563 p12 S"cup2"
    G10 P12 X0 Y0 Z0 U0 V0 A0 B0
    M563 p13 S"cup3"
    G10 P13 X0 Y0 Z0 U0 V0 A0 B0
    M563 p14 S"cup4"
    G10 P14 X0 Y0 Z0 U0 V0 A0 B0
    ;Set movement queue length
    M595 P100
    ;Recall Values
    M501
    ;Allow Movement
    M564 S0 H0
    

    M122:

    === Diagnostics ===
    RepRapFirmware for Duet 3 MB6HC version 3.3beta1 running on Duet 3 MB6HC v0.6 or 1.0 (SBC mode)
    Board ID: 08DJM-956L2-G43S8-6J9D6-3S46R-KU2AD
    Used output buffers: 1 of 40 (18 max)
    === RTOS ===
    Static ram: 148196
    Dynamic ram: 62672 of which 0 recycled
    Never used RAM 123484, free system stack 200 words
    Tasks: Linux(ready,173) HEAT(delaying,357) CanReceiv(notifyWait,946) CanSender(notifyWait,373) CanClock(delaying,351) TMC(notifyWait,54) MAIN(running,1266) IDLE(ready,20)
    Owned mutexes: HTTP(MAIN)
    === Platform ===
    Last reset 00:02:23 ago, cause: software
    Last software reset at 2021-02-19 01:02, reason: User, none spinning, available RAM 122676, slot 0
    Software reset code 0x0012 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0044a000 BFAR 0x00000000 SP 0x00000000 Task Linu Freestk 0 n/a
    Error status: 0x00
    Aux0 errors 0,0,0
    Aux1 errors 0,0,0
    MCU temperature: min 46.1, current 46.2, max 46.7
    Supply voltage: min 24.1, current 24.1, max 24.2, under voltage events: 0, over voltage events: 0, power good: yes
    12V rail voltage: min 12.1, current 12.1, max 12.1, under voltage events: 0
    Driver 0: position 0, standstill, reads 19408, writes 14 timeouts 0, SG min/max 0/0
    Driver 1: position 0, standstill, reads 19406, writes 16 timeouts 0, SG min/max 0/0
    Driver 2: position 0, standstill, reads 19403, writes 19 timeouts 0, SG min/max 0/0
    Driver 3: position 0, standstill, reads 19408, writes 14 timeouts 0, SG min/max 0/0
    Driver 4: position 0, standstill, reads 19409, writes 14 timeouts 0, SG min/max 0/0
    Driver 5: position 0, standstill, reads 19412, writes 11 timeouts 0, SG min/max 0/0
    Date/time: 2021-02-19 01:05:14
    Slowest loop: 0.44ms; fastest: 0.04ms
    === Storage ===
    Free file entries: 10
    SD card 0 not detected, interface speed: 37.5MBytes/sec
    SD card longest read time 0.0ms, write time 0.0ms, max retries 0
    === Move ===
    DMs created 125, maxWait 0ms, bed compensation in use: none, comp offset 0.000
    === MainDDARing ===
    Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
    === AuxDDARing ===
    Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
    === Heat ===
    Bed heaters = -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1, chamberHeaters = -1 -1 -1 -1
    === GCodes ===
    Segments left: 0
    Movement lock held by null
    HTTP* is doing "M122" in state(s) 0
    Telnet is idle in state(s) 0
    File is idle in state(s) 0
    USB is idle in state(s) 0
    Aux is idle in state(s) 0
    Trigger* is idle in state(s) 0
    Queue is idle in state(s) 0
    LCD is idle in state(s) 0
    SBC is idle in state(s) 0
    Daemon is idle in state(s) 0
    Aux2 is idle in state(s) 0
    Autopause is idle in state(s) 0
    Code queue is empty.
    === CAN ===
    Messages queued 738, send timeouts 0, received 22, lost 0, longest wait 1ms for reply type 6018, peak Tx sync delay 6, free buffers 49 (min 48)
    === SBC interface ===
    State: 4, failed transfers: 0
    Last transfer: 1ms ago
    RX/TX seq numbers: 5066/5066
    SPI underruns 0, overruns 0
    Number of disconnects: 0, IAP RAM available 0x2d410
    Buffer RX/TX: 0/0-0
    === Duet Control Server ===
    Duet Control Server v3.2.2
    Code buffer space: 4096
    Configured SPI speed: 8000000 Hz
    Full transfers per second: 35.70
    Maximum length of RX/TX data transfers: 4379/620
    

    Rough wiring diagram of the components in question:

    Please excuse the current messy setup, this is a prototype machine, not everything is polished yet.
    Also let me know if the diagram is readable.

    diagram_1.jpg

    Photos:
    Whole machine:
    whole_machine.jpg

    Servo location and box:
    Contains buck converter and both SAMMYC21, servos are above the box.

    servo box location.jpg
    servo box close up.jpg

    3HC and power supply:
    3hc.jpg

    Main control box:
    main_box.jpg

    @dc42 About turning off the servos I use the M280 Pn S0 to run the servos forward (S90 to stop S180 for reverse) using G4 S1 to G4 S30 as time intervals for fluid extrusion start/stop.

    Would the G4 P200 method still work in this case?

    I don't know too much about mediating electrical interference.
    But it still seems strange that the servos would jitter when their power comes from a separate PSU as the steppers that are moving.
    I hope this isn't too much to process, but would really like to get the servo issue figured out.
    Cheers,
    T


Log in to reply