Foam Cutter, how to control ESC

New Home Forum Mostly Printed CNC – MPCNC Advice – MPCNC Foam Cutter, how to control ESC

This topic contains 2 replies, has 3 voices, and was last updated by  Ben 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #88535

    Chris
    Participant

    Hey, i have just finished building my MPCNC, and im looking to attach a foam cutter needle with a brush less motor and ESC Controlling it, does anybody know if theres a way to control the speed of the ESC using the ramps board output and gcode. instead of me attaching a servo tester inline and manually controlling the speed?

     

    I know the ESC takes pulses, i thought about using the servo outputs, just unsure if this has been done somehow.

    Cheers

     

    #88604

    thesfreader
    Participant

    Hi, I’m working on something that will do that in he future : a Foam Cutter Speed Controller.

     

    It takes 2 inputs : a servo tester’s output, and rotation  sensor (inductive sensor for now), and uses a PID loop to ensure a “constant” — that is once I’ve found the correct PID parameters– running speed (like V1PID).

    I plan on adding a third input (switched from the Servo tester) switch so that it can take the same outputs as done with the M3/M5 S (or O) parameters from the RAMPS, but I’ll need to see how to configure it.

    I’ll probably have to check all configurations threads which concern the LASER/Spindle commands. One small hurdle is I see the LASER/Spindle option is conditional on not using servos, whereas I use one for ZHoming/Bed Levelling

     

    There should be 3 modes at the end : pure Servo tester (or pot when I get one), PID from tester/pot, and  command from RAMPS.

     

    #108336

    Ben
    Participant

    This maybe helpful. I wrote this up after I was able to control my ESC:

     

    My needle cutter: https://youtu.be/iOU6zelXMo8 has worked great for me since I ordered the hardware, printed the parts and assembled it about a year ago. I’ve been using the servo tester method to start and stop the needle, like most other people. But, I’ve always wanted it to be able to turn off and then end of a sheet of foam board. I’ve tried to figure it out myself without success. I’ve waited patiently for someone else to post how they successfully did it. Finally, I’ve figured it out and feel I need to help others because I’ve seen others with this same request in multiple locations. Here’s how I did it:

     

    My setup:

    MPCNC with a Needle cutter used for DTFB (purchased through V1Engineering)

    RAMBO Board with Dual End Stops

    Firmware Version:  Marlin-MPCNC_Rambo_T8_16T_LCD_DualEndstop based on bugfix-2.0.x

     

    Firmware Edit:

    Uncomment line 2122 in Configuration.h and upload to RAMBO board.

    From: //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command

     

    To: #define NUM_SERVOS 1 // Servo index starts with 0 for M280 command

     

    Hardware:

    The V1Engineering’s discussion on laser’s, spindle speed, and pwm wasn’t working for me, but they gave me valuable clues.

    https://www.v1engineering.com/forum/topic/laser-spindle-control/

    https://www.v1engineering.com/mini-rambo-1-3/

    I looked up the pinout locations for servos in the /src/pins/pins_RAMBO.h file. I didn’t change any of the pin callouts. The RAMBO board says:

    //

    // Servos

    //

    #define SERVO0_PIN         22 // Motor header MX1

    #define SERVO1_PIN         23 // Motor header MX2

    #define SERVO2_PIN         24 // Motor header MX3

    #define SERVO3_PIN          5 // PWM header pin 5

     

    I decided to use Servo 0 to connect to my ESC. Now, I searched for PIN 22 in the pinout schematic.

    Pinout Schematic: https://github.com/ultimachine/RAMBo-1.4/blob/1.4/Project%20Outputs/Schematic%20Prints_RAMBo_1.4a.PDF

     

    I had never really looked at these kind of schematics before, but deciphered that pin 22 was the middle of 5 pins on MX1. 

     

    So, I wired the ESC ground pin to the ground on MX1 and the signal pin on PIN 22 of MX1 (the middle pin on MX1). [My ESC main power leads are wired directly to the 12V mains].

    image10-1

    Edited Gcode: 

    M280 instructions: http://marlinfw.org/docs/gcode/M280.html

     

    Added this Gcode to my programs. I use Estlcam (which has worked great for me.)

     

    At Program Start:

     

    M280 P0 S040 ; Give low PWM signal for ESC to boot up

    G04 S3 ; Pause 3 seconds for ESC to turn on 

    M280 P0 S080 ; PWM signal for Needle cutter. Change S<value> to required PWM signal

     

    At Program End:

     

    M400 ; Pause and wait for all moves to complete

    M280 P0 S040 ; Turn off Needle Cutter

    Attachments:
    3 users thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.