terjeio / grblHAL

This repo has moved to a new home https://github.com/grblHAL
231 stars 90 forks source link

mist on ramps_1.6 #300

Closed arlimbad222 closed 2 years ago

arlimbad222 commented 3 years ago

drivers/SAM3X8E/grblHAL_Due/src/ramps_1.6_map.h

I can't find the mist output pin on this file anyone can help me. I want to build CNC with Arduino due so I am using ramps_1.6.

terjeio commented 3 years ago

Looks like analog pin 10 can be used. Add this to the map file:

#define COOLANT_MIST_PORT   PIOB
#define COOLANT_MIST_PIN    19  // Due Analog Pin 9
#define COOLANT_MIST_BIT    (1<<COOLANT_MIST_PIN)

There are numerous other pins that could be used as well, even heater outputs for driving a solenoid or relay directly. AFAIK there is no established convention for which pin to use for mist - it is a 3D printer board after all. Please correct me if I am wrong.

arlimbad222 commented 3 years ago

hi @terjeio

actually, currently, I am using mega2560 so I make one custom PCB design for the mega 2560, and most of the pins are configured as ramps_1.4 so is it possible to change the pin for different inputs and outputs. I am not a programming guy so I have no experience with programming can you please give an example of how to change pins.

thank you for your response have a good day my friend.

terjeio commented 3 years ago

No programming needed for changing pins (some like the spindle PWM output is limited to a few). Edit the relevant map file and change port and pin assignments before recompiling:

#define COOLANT_MIST_PORT   PIOB
#define COOLANT_MIST_PIN    19  // Due Analog Pin 9
#define COOLANT_MIST_BIT    (1<<COOLANT_MIST_PIN)

If you look at the board layout you can see shorthand processor pin names, for the one above B.19, this means PIOB is the port to assign and 19 is the pin in that port. If you want to use Arduiono digital pin 09 then this is processor pin C.21 (taken from [09] C.21 in the board layout), the #defines for that then becomes:

#define COOLANT_MIST_PORT   PIOC
#define COOLANT_MIST_PIN    21
#define COOLANT_MIST_BIT    (1<<COOLANT_MIST_PIN)
arlimbad222 commented 3 years ago

Hi @terjeio

Thanks for your response. i order the board when it arrives I start testing as soon as possible so give me some time I will taste that code and get back here.

arlimbad222 commented 3 years ago

hi @terjeio

the board arrives tomorrow by morning and I have a keypad-related question where can I find the keypad pin mapping like I want to jog my machine via a physical button is that possible.

terjeio commented 3 years ago

The keypad interface is I2C based and there are definitions for the I2C port in driver.h:

https://github.com/terjeio/grblHAL/blob/9f405bae810fa42c60ebaf2c21c2ff553e46a049/drivers/SAM3X8E/grblHAL_Due/src/driver.h#L133-L149

A third pin is required for a strobe (interrupt) signal and I have not added that to the Ramps map as I have not checked where the I2C pins are routed.

One or two users has attempted to write I2C keypad code in addtion to my take. Search issues and/or discussions to find those.

Another option would be to write a plugin that takes advantage of the many free pins on the Due. The current keypad plugin could be used as a template.

Finally, I have started to rewrite my MPG & DRO controller code for the Pi Pico (RP2040), this too could become an option when completed.

arlimbad222 commented 3 years ago

hi @terjeio

okay, thanks for the details I am not a coding guy so I'll wait for MPG & DRO controller and again thanks for the response have a nice day....

MARIOBASZ commented 3 years ago

hello @ arlimbad222 Are you getting a shield for Due? can you share a file? Greetings.

arlimbad222 commented 3 years ago

Hi @MARIOBASZ

I made one prototype pcb for due and grbl hal but currently i am working on it and my project is in testing stage so whenever it was finished, i will share sketch and PCB designs for due.

Have a good day