markniu / PandaPi

3d printer firmware run on raspberry pi directly
215 stars 30 forks source link

unused PWM output signal #42

Open GHubensG opened 2 years ago

GHubensG commented 2 years ago

hello, i can't find a forum to ask my question so i put it here.

im thinking about implementing the PandaPi 2.9 for my lasercutter because my SKR board with a 32bit proccesor can't handle the amount of gcode i'm trying to send when lasering an image in grayscale.

The laser needs a PWM signal for control. i saw in the marlin file pins_PANDA_PI.h a Servo pin on pin 255// 0xBE (this was not writen down in the documentation)

is it possible to use this pin? (if 'yes' where is it located). Or is there another way i can get an analog output? i don't want to use a fan pin because this will get limited by the STM32 processor i think.

is it also possible to control the RPI-marlin by usb cable? without octopi in between?

my setup: 2 Nema23 steppers with TB6600 drivers in CoreXY setup with 4 proximity sensors for XY-min&max. i'm Controlling the laser with M3 S1-S255 and M5 S0 commands from marlin on the servo pin of my SKR E3 DIP V1.1.

rndsumgen commented 2 years ago

I was looking through the same file for the same thing for the same reasons. Noticed it missing curious for a response. Would love to see/hear about it having the ability to work on CNC/Laser/Extruder all out of the box. https://marlinfw.org/docs/configuration/2.0.9/laser_spindle.html goes into details about setting it up but PandaPi seems different.

I'm guessing pin 255 is probably a software defined PWM pin? That's not normal in marlin.

#define HEATER_1_PIN     255
#define HEATER_BED_PIN   255
#define TEMP_0_PIN       255
#define TEMP_1_PIN       255
#define TEMP_BED_PIN     255
#define TEMP_BOARD_PIN   255

#define FAN_PIN         255
#define FAN1_PIN         255
#define FAN2_PIN         255
#define FAN3_PIN         255

#define CASE_LIGHT_PIN 255

https://github.com/markniu/PandaPi/blob/master/Marlin2.x/pandapi/pins_PANDA_PI.h

markniu commented 2 years ago

The Pins of heating ,Fans and PWM are controlled by the stm32 not raspberry pi, so we need to let RPI-marlin ignore these pins by define them as 255.

markniu commented 2 years ago

we can use microUSB to send gcode to control Rpi-marlin and do not forget to plugin one jumper on the P2 which beside the microUSB image

markniu commented 2 years ago

do not know if we can set the gpio of raspberry pi as PWM, but I think use the gpio on stm32 as PWM pin should be better .

GHubensG commented 2 years ago

do not know if we can set the gpio of raspberry pi as PWM, but I think use the gpio on stm32 as PWM pin should be better .

But then the amount of gcodes that is send to control my laser is limited by de STM32, that is why i wanted to use the RPI..