Spindle control with repetier

Hi,

I would like to run my CNC router spindle with the firmware, I have an AtMega2560 board with ramps 1.4. I would like to use one of the pins on the board like D9 or one of the servo pins. There will be a relay to turn spindle on and off. Is there a way to turn spindle on and off from the LCD display or should it get the G-code command like M3/M4? 

Comments

  • You need gcode M3/M4/M5 to turn it in/off. Be sure to be in cnc mode so the right pin is used.

    With RAMPS also watch yout to disable fan control as fan normally also uses D9 so that would be a conflict.
  • M3 S100 sets spindle speed to 100, I see maximum it can set is 6500 suppose its 16bits.
    if I then send M3 S200 , the speed doesnt change, I have to send M5 and then M3 S200.
    S200 is also not interpreted as a stand alone command.

    All this is in menus on the FullGraphicsSmartController, 

    Is there any documentation which pins are allocated in the configuration tool
    Enable/Direction/PWM
    I would like the Spindle PWM to go out on the Rumba HE2 PWM channel.

    ? is the physical implementation a future enhancement? Repetier is just getting the variables in place? 
  • I have mapped all the pins, cross referenced Arduino/CPU/Rumba/Repetier there seem to be some discrepancies with the Temp Sensor pins and Heater Control Channels in the Repetier pin definitions
    PIN Port  Rumba     Repetier
    6 INT4 2 HE0 HE0

    7 INT5 3 HE1 HE2
     
    15 PH3 6 HE2 HE3
     
     
    18 PH6 9 HB HE1
     
     
    82 PK7 15 T0/E0 TEMP0_PIN
    83 PK6 14 T1/E1 TEMP2_PIN
    84 PK5 13 T2/E2 TEMP3_PIN
    85 PK4 12 T3/E3
    86 PK3 11 T4/THB TEMP1_PIN
  • edited April 2018
    Arduino/CPU/Rumba/Repetier Cross Reference
  • Currently it is only on/off with the standard drivers programmed. It is only already prepared that drives get these speed values so you can change speeds. But you need to write your driver to take the values.

    In V2 we at least have a general purpose PWM so we will have default drivers which can use these pwm drivers as input. But that is not finished.
  • Repetier said:
    Currently it is only on/off with the standard drivers programmed. It is only already prepared that drives get these speed values so you can change speeds. But you need to write your driver to take the values.

    In V2 we at least have a general purpose PWM so we will have default drivers which can use these pwm drivers as input. But that is not finished.
    Thank you I got mine working with very little problems on RUMBA, I used the THERMO pin and just fed the spindleSPeed instead of the  temp sensor, for HE2, I unfortunately had to change one line in EXTRUDER.CPP, which is not desirable, also the CNC interpretation in drivers is 'incomplete' or buggy, i have put a notice on for that, there is no need for a pin once the PWM work, if people wantt a simple on off for the spindle they can put a relay on the PWM.

    Congratulations on a wonderful piece of software I will make regular contributions "EUR", 
    I see you starting to cross the 3D CNC boundary, of course its not a true CNC machine , but most hobbyist are happy with 2 1/2 axis  , something between an engraver / router / cnc drill.
    On the graphics screen you already have Xw,Yw,Zw which is the last missing piece as I need to home in on the top of a workpiece for CNC work, Obv a button/code is needed to tell the part thickness, as the 3D axis are not allowed to go negative so the workpiece origin needs to be something like Xjogged/Yjogged/Zthickness of workpiece...
    I am reluctant to code for two reasons, I am not good at it and it is not good to mess with a well structured program.

  • For the z problem we have modified G30

    - G30 P<0..3> - Single z-probe at current position P = 1 first measurement, P = 2 Last measurement P = 0 or 3 first and last measurement

    - G30 H<height> R<offset> Make probe define new Z and z offset (R) at trigger point assuming z-probe measured an object of H height.

    Assuming you have a method to measure z height of the tool like these switches you hit from top or some users also use just a current going through the tool. Then the second G30 helps you define the bottom and current position as well.
Sign In or Register to comment.