SLS printer motor control
Hello everbody,
I am building a selective laser sintering printer (SLS).
And looking to use Repetier as firmware.
The printer has 7 motors, a laser and a preheated bed:
2 stepper motors on Core XY to move the laser head
1 Z-stepper motor
1 A-stepper motor to drive the spreading carriage
1 B-stepper motor to drive a roller on the spreading carriage
1 C-stepper motor connected to a transport screw in a tube to transport the powder above the bed
1 servo motor to open the transport tube and deposit the powder on the bed
1 40W Co2 laser with his own controllor
Preheated bed with his own Arduino, heaters, probes and pid control.
The process order I want to use is.
Powder depositing
Motor Z -Rotate the Z axis down(lowering the powder bed)
Motor C - rotate x amount of steps (filling the transport tube)
Servo - rotate +x degrees (open the transport tube)
Motor C - Rotate -x amount of steps (pushing the powder out )
Servo - rotate +x degrees(close the tube)
Motor B - rotate at a certain speed x steps/s (backward rotating the roller)
Motor A - Rotate x amount of steps forward (moving the backward rotating roller over the bed)
Motor B - stop rotating
Motor Z - Rotate the Z-axis up (raising the powder bed)
Motor B - Rotate at a certain speed y steps/s (forward rotating the roller to (same rotation direction lower speed))
Motor A - Rotate -x amount of steps backward (moving the forward rotating roller back over the bed to compact the powder)
Motor B - stop rotating
Check the temperature, if correct start sintering else wait to heat up.
Sintering
Motor X and Y - move the laser head over the bed
Laser- Putting the laser on and controlling the power trough a PWM signal and sintering the object.
Repeat powder depositing
Temperature check.
The temperature is controlled by a separate Arduino and sends the temperature to the main Arduino.
Using the X,Y,Z axis won't be a problem i guess.
But for the laser I am not sure to use the PWM of Extruder 0 or the another signal
and what to use for the other motors I am not sure. I saw it is possible to control extra motors trough num_motor_drives, but then the speeds are fixed. Or is it possible to change them trough G codes ?
It would be nice to hear if my idea is possible with Repetier or wich changes or custom code i have to make to make it work
Already thank you for your time!
Kind regards,
Qongon
I am building a selective laser sintering printer (SLS).
And looking to use Repetier as firmware.
The printer has 7 motors, a laser and a preheated bed:
2 stepper motors on Core XY to move the laser head
1 Z-stepper motor
1 A-stepper motor to drive the spreading carriage
1 B-stepper motor to drive a roller on the spreading carriage
1 C-stepper motor connected to a transport screw in a tube to transport the powder above the bed
1 servo motor to open the transport tube and deposit the powder on the bed
1 40W Co2 laser with his own controllor
Preheated bed with his own Arduino, heaters, probes and pid control.
The process order I want to use is.
Powder depositing
Motor Z -Rotate the Z axis down(lowering the powder bed)
Motor C - rotate x amount of steps (filling the transport tube)
Servo - rotate +x degrees (open the transport tube)
Motor C - Rotate -x amount of steps (pushing the powder out )
Servo - rotate +x degrees(close the tube)
Motor B - rotate at a certain speed x steps/s (backward rotating the roller)
Motor A - Rotate x amount of steps forward (moving the backward rotating roller over the bed)
Motor B - stop rotating
Motor Z - Rotate the Z-axis up (raising the powder bed)
Motor B - Rotate at a certain speed y steps/s (forward rotating the roller to (same rotation direction lower speed))
Motor A - Rotate -x amount of steps backward (moving the forward rotating roller back over the bed to compact the powder)
Motor B - stop rotating
Check the temperature, if correct start sintering else wait to heat up.
Sintering
Motor X and Y - move the laser head over the bed
Laser- Putting the laser on and controlling the power trough a PWM signal and sintering the object.
Repeat powder depositing
Temperature check.
The temperature is controlled by a separate Arduino and sends the temperature to the main Arduino.
Using the X,Y,Z axis won't be a problem i guess.
But for the laser I am not sure to use the PWM of Extruder 0 or the another signal
and what to use for the other motors I am not sure. I saw it is possible to control extra motors trough num_motor_drives, but then the speeds are fixed. Or is it possible to change them trough G codes ?
It would be nice to hear if my idea is possible with Repetier or wich changes or custom code i have to make to make it work
Already thank you for your time!
Kind regards,
Qongon
Comments
What you want is V2 firmware which is modular and easy to extend. It already supports 7 axis out of the box also for better hardware (e.g. STM32F4 boards like RUMBA32). Has speed dependent PWM with gamma correction for laser if connected to hardware pwm output.
What you need to add is some logic or a extra gcode for powder depositioning. But with the concept it is possible to easily add own functions to firmware. You can also add extra checks to prevent special error cases. You need some c++ skills to understand the module system and to be able to add the extra code, but it should not be much code you require. Mainly calling high level functions to execute your operations or something for refilling, maintaining, ...
Could an Arduino Due work ? Because all stepper divers we use are external so we only have to send, en,dir and step signals.
At 100000 HZ only one motor of the corexy moves.
This problem I also had with the V1 version but then i had to use stepper_high_delay 2
so I put the frequency to 50000HZ and now both motor move but for x+/- and Y+/- they move only the axis in one direction and much less mm.
The signal the motors requires are
and my config file is:
as https://docfirmwarev2.repetier.com/config/motors says,
#define SLOW_DIRECTION_CHANGE 1 // Set 1 when driver need some settle time when direction changes
will change dir and wait till next interrupt to execute next step if you need settle time for direction. SO I would set
#define STEPPER_FREQUENCY 100000 // Maximum stepper frequency.
with slow direction change. That should give required delays up to 50 khz.
Steps per mm might be off by factor 1.414 or 2.0 compared with V1 due to how V1 is implementing corexy.
now i have an other problem, when using manual control my x motor rotates only in one direction. The dir pin stays high for + and - x and in Cartesian and Corexy mode but turns low when moving y in Cartesian mode.
Made my own pin file see below:
Also added the config files:
Checkt all motors and drivers and the are working fing with a arduino mega and simple script.
drivers are TB6600
and ISHV57 intergraded motor and drive
problem occurs at both
CONFIGFILE
CONFIG_IO
so you can on updates just copy your file and all is good.
When y move changes x dir pin you likely have the x dir pin as one of
since these get used/changed on pure y move. Did you compare number with your test program? Also make sure no other function is using pin 39 (x dir) - that might overwrite what you do in stepper driver.
and then using the pins defined in the RADDS file.
But when I copy the code to userpins and set the board to MOTHERBOARD_USER_DEFINED_DUE I am getting this error:
In file included from src\boards/pins.h:80:0,
Another problem I am facing is that when I want to home the axis in the Repetier host it doesn't move and just set the X value to the home value. Tried IO_INPUT, IO_INPUT_INVERTED and IO_INPUT_PULLUP.
And every time I connect the printer via Repetier host V2.2 i am getting a I2C communication error and have to reset with m999. I only have connected 3 axis and 2 end stops. And the program often crashes /is not responding
is more likely the problem. You say no x min and for xmax you say it is a min end stop (false at the end), see
https://docfirmwarev2.repetier.com/config/endstops#push_signal
I2C ist most likely from trying to read eeprom. Due has no eeprom, but radds has a extra eeprom chip thatis configured here:
does your board have an eeprom chip at that address? Otherwise set
#define EEPROM_AVAILABLE EEPROM_SDCARD or EEPROM_NONE
then it does not try to reach a non existent eeprom.
The Y axis is moving and homing.
The X axis does not move at all.
When I use
IO_INPUT_PULLUP(IOEndstopXMin, ORIG_X_MAX_PIN)
ENDSTOP_SWITCH_HW(endstopXMin, IOEndstopXMin, X_AXIS, false)
Then the X-axis is moving away from the end stop this is logical because the end stop is at the end of the axis
what is the solution for this ?
M111 S70
and check if it correctly triggers when being pushed.
Also check M119 to show end stops correctly.
Move direction is defined by homing direction. 1 -> max, -1 -> min
If end stops are reported triggered the move stops immediately.
But for the B motor I want to put it on with a certain speed when the carriage is moving.
What is the best way to do this?
It is needed to perform this step:
Powder depositing
Motor Z -Rotate the Z axis down(lowering the powder bed)
Motor C - rotate x amount of steps (filling the transport tube)
Servo - rotate +x degrees (open the transport tube)
Motor C - Rotate -x amount of steps (pushing the powder out )
Servo - rotate +x degrees(close the tube)
Motor B - rotate at a certain speed x steps/s (backward rotating the roller)
Motor A - Rotate x amount of steps forward (moving the backward rotating roller over the bed)
Motor B - stop rotating
Motor Z - Rotate the Z-axis up (raising the powder bed)
Motor B - Rotate at a certain speed y steps/s (forward rotating the roller to (same rotation direction lower speed))
Motor A - Rotate -x amount of steps backward (moving the forward rotating roller back over the bed to compact the powder)
Motor B - stop rotating
I tried to use m42 to set a pwm frequency for pins 53,44 and 6, but they only turn on or off tried it with a led to see intensity difference.
I tried m42 p53 s30.
What is the correct way to set a pwm output ? Or how do i configurate it as a pwm output.