# Specific 3D Printers, Scanners, & Hardware > Peachy Printer Forum >  Software suggestions and requests

## Aztecphoenix

I started this thread so that people could have a place to help better the software for the PeachyPrinter.

the first request I have is the ability to import our own STLs into the print library instead of it just having the test prints (I think it would be nice to have our own private "Thingiverse" complete with 3D previews of our prints)

----------


## Anuvin

Neat idea, I like it. I currently have a stl folder that serves as a library, but 3d preview would be nice.

----------


## rylangrayston

I agree as well ... but something like this will take quite some time to develop. 
Rest assured we do plan to do alot more with the "Print Library" 

For now its just a great way to avoid the learning curve needed for your first few prints, and a great way to find out when bugs are inherent to a  "Stl --> slicer --> gcode --> Peachy Printer" work flow.

----------


## 3Dmonkey

What about makeing a slim version of the peachy printer software entirely in command line/terminal based useing Python.

That would eliminate trouble with GUI's

----------


## rylangrayston

> What about makeing a slim version of the peachy printer software entirely in command line/terminal based useing Python.
> 
> That would eliminate trouble with GUI's


This is nearly done already.. the GUI is here:
https://github.com/PeachyPrinter/peachyprinter
This GUI is like a separate program that just makes calls to the peachyprinterTools api: 
which is found here:
https://github.com/PeachyPrinter/peachyprintertools

It would be rather easy to set things up so that we can just use a terminal to call peachyPrintertools to do things... Just need to write a CLI that talks to the peachyprinterTools API.

----------


## CescoAiel

Copied over from another thread, because this would be a better place for it:

Having the possibility to control a pump would be great, because then  you can control the rise rate, and I am already thinking of (and  experimenting a bit with) possibilities to do a low-cost peristaltic  pump... 

If the software and hardware included basic support for that feature  from the get-go (i.e. 2 pins for controlling the pump and a setting to  steer those pins by both # of pulses *and* timing per pulse and pulse  interval), one could have a very simple control of many a pump model...


_EDIT: Made a mockup for clarity..._

* With this setup one could both do a single pulse of ex. 5s to control a  simple DC motor driven pump, or use a simple pulse-to-step converter  board to drive a stepper motor pump, or anything in between...
** Any more than that would be much easier to implement, as the basic  control logic would be there already, so the modders need only modify  the steering code bit!

----------


## DoulosDS

Peristaltic pumps have a lot of advantages, but one big disadvantage we would need to work around:  they do not produce a uniform flow rate over time.  The flow is pulsed or interrupted when the rotor releases pinching the tube during a rotation.  As the tube resumes it's circular cross section, it draws fluid back from the outlet, reducing the output, if not reversing the flow.  The flow is uniform during the interval between pulses, after the tube has fully recovered.  If the pump is driven by a stepper motor, perhaps software could compensate for the pulses.  That might simply be a lookup table with a drip count equivalent volume displacement for each step of the motor during a complete rotation of the pump at a given speed.  If the pump is being used to raise and lower the resin level between laser slice scans, the motor could be commanded to do an integer number of rotations, half rotations, or one-third rotations, depending on how many lobes the pump rotor has.  Reversing the motor by the same number should return the resin to the precise level, plus whatever increase is due to the drip system.  If the pump is used to replace the drip system, a solenoid valve could divert the flow during the pulses, shunting the non-uniform flow back into the brine reservoir, and adding brine to the print tank during the uniform flow intervals between pulses.

----------


## amoose136

The simpler method is to use a pump with two tracks whose rollers are 90 out of phase and then follow that with a permanently trapped bubble.  Imma draw a shitty paint thing to illustrate.

----------


## CescoAiel

The amount of 'drawback' is IMHO negligible, as it will be an extremely tiny amount compared to how much is needed to raise the fluid level...

----------


## DoulosDS

> The amount of 'drawback' is IMHO negligible, as it will be an extremely tiny amount compared to how much is needed to raise the fluid level...


You are probably right, however, any periodic irregularity becomes glaringly obvious when viewing the surface quality of a smooth print; e.g. the rocket.  Let me crunch some numbers before I conjecture further...

Assume the pump tube has an inner diameter of 0.25" which has an area of 0.049 in2.  If the pump roller pinches a section of tube 0.5" long, beginning and ending at 100% open and pinched entirely closed in the middle,  we could estimate the displaced volume of the pinch as half the volume normally enclosed by the unpinched tube, or 0.25" x 0.049 in2 = 0.0123 in3.  Converting to Canadian units:  201.56 mm3.  If the print tank is approximately 3" in diameter or 75 mm, the area is 4418 mm2, and the pinch results in a Z error of 0.0456 mm.  A fine human hair is approximately 0.04 mm to 0.06 mm in diameter.  

Yeah, that might be negligible, especially in a larger print tank.  One way to avoid any error is to force the model slicer to use an integer number of motor turns, divided by the number of lobes in the pump (assuming direct drive by a stepper motor) per slice.  The pump should be started and stopped about halfway between pinches.  That would eliminate the drip counting system, and the pump could speed up the printing process.  If the surface tension and viscosity of the resin is a limiting factor, the pump could transfer sufficient extra brine to ensure all the areas printed previously are covered with fresh liquid resin, then remove the excess brine leaving only the amount required by the slice Z increment.  A pause before printing the next layer would allow any resin flow to cease.   

I hope the pump and motor can be implemented for less than half the cost of the printer...  anybody know where to get an inexpensive peristaltic pump?

----------


## DoulosDS

Amoose136,
Thanks for your suggestion and drawing.  I think the alternating rollers would reduce the error by half, but the accumulator only smooths the dynamic flow.  Once the pump stops, if a roller is engaged in releasing a pinch (between 100% and 0% pinched), the pressure would equalize and any error would be transferred to the print tank.  However, it is all probably moot, based on my back-of-the-napkin analysis.  And, if we can hack the slicing software, we can stop the pump at regular intervals between pinches and eliminate the problem entirely.  See my reply to CescoAiel.

----------


## CescoAiel

Additionally, it is not a recurring error that keeps impacting... It s something that may be recurring as a repeated event, but it is not going to grow progressively larger every time it happens! And as DoulosDS said already: if we can make the pump stop just before it releases the roller-clamped section, we can avoid it altogether... That can be as simple as putting in a sensor that stops it at set locations, or otherwise leaves it running until it reaches that point. (Which would be every 1/nth rotation, where n=number of rollers)

The simplests and cheapest option for that would be a normal motor, and a circuitboard disc with as many interruption lines etched in to it as there are rollers on the roller-body, and a drag-contact on it... As long as the contact touches copper, the motor keeps running, when it gets to an etched section it stops... All you need to do then is modify the contact's position to make it stop in the right place...
If you go the stepper motor route, it is as simple as counting steps!   :Smile:

----------


## DoulosDS

Peristaltic Pump Amazon.JPG Found this pump on Amazon for $12, free shipping.  I was thinking I would need to replace the motor with a stepper, but I don't think that's necessary.  I can add an optical sensor to detect the rotor arms as they pass (looks like there are 3).  The software can count them and run the motor forward and reverse as needed to adjust the resin level.  If the flow rate and RPM specs are accurate, it should transfer 0.2 ml per 1/3 revolution.  Conveniently, that is the same volume I calculated for Z-axis error due to tube pinch displacement in my previous post.  So, if the print tank is approximately 3" in diameter or 75 mm, the area is 4418 mm2, and 1/3 rotation of the pump results in a Z-axis increment of 0.0456 mm.  That's not great resolution, but it means the maximum resin level adjustment rate is only 13.5 mm/min or 0.228 mm/sec.  I think that a second pump could run in parallel with this one, maybe with a higher flow rate.  Both pumps could pump extra brine to overcome resin surface tension and viscosity issues, ensuring all the previous layer is covered with fresh, liquid resin.  Then remove all but the increase for the current slice, within a few seconds.

----------


## DoulosDS

Peristaltic Pump Ebay.JPG Here is the best inexpensive peristaltic pump I could find with a relatively high flow rate:  500 ml/min for $30 and free shipping.  It doesn't provide much info on specs, like rotor RPM, number of rollers (3? 4?), and tubing inner diameter.  It does say the in/out hose barbs are for 1/4" tubing, so I expect the pump tube is 1/4" ID also.  It may be possible to soup it up with thinner wall tubing, or speeding up the rotor.  Regardless, at 500 ml/minute, it could speed up printing.

----------


## CescoAiel

> So, if the print tank is approximately 3" in diameter or 75 mm, the area is 4418 mm2, and 1/3 rotation of the pump results in a Z-axis increment of 0.0456 mm.  That's not great resolution, but it means the maximum resin level adjustment rate is only 13.5 mm/min or 0.228 mm/sec.


0.045mm is a good enough resolution for most prints (0.05 is considered typical layer thickness for laser based printing), and can be doubled (ie rise halved) to 0.0225mm by increasing the tank diameter to 8,5 cm, and almost tripled (approx 0.015mm) by going to 10cm.
Of course that also decreased the max rise speed, but then again, how many filament 3D printers complete a 0.2mm (standard thickness for those printers) layer in 1 sec?
Also faster pumps usually also mean less accuracy...   :Wink:

----------


## harpo99999

cescoaiel, in my limited experience with fff printers a 0.3mm layer height is poor res, a 0.1mm layer height is ok, a 0.03mm is very fine (note all of these are on FFF printers), and the peachy should be able to get into the 0.003mm layer height(depending upon the container size and drip speed) so should be able to produce prints that would please almost anybody that can accept a single colour object with the ability to add dyes to the resin to colour it

----------


## CescoAiel

> cescoaiel, in my limited experience with fff printers a 0.3mm layer height is poor res, a 0.1mm layer height is ok, a 0.03mm is very fine (note all of these are on FFF printers), and the peachy should be able to get into the 0.003mm layer height(depending upon the container size and drip speed) so should be able to produce prints that would please almost anybody that can accept a single colour object with the ability to add dyes to the resin to colour it


First off, I had a typo which I corrected (0.5mm -> 0.05mm), secondly these are pretty small containers he used for the calculations, so you can work with bigger containers to decrease the layer height accordingly (a doubling of the size, reduces the height increase by 75% (ie leaves it at 25% of the original), as we're talking squared (to the power of 2) increase of volume when we're increasing the surface area of the container...
Additionally, the smaller the inside diameter of the tube in the peristaltic pump, the smaller the per-segment volume. The more rollers on the main body, the smaller the per-segment volume... So there's a lot of variables that have NOT yet been considered in DoulosDS's calculations. A bigger body with more rollers may be able to provide both higher precision as well as higher max volumes...
Nobody said this would be easy!   :Wink: 

PS: 0.2mm is typical layer height for a filament based 3D printer, although many can actually do 0.1mm, and some even 0.05... The peachy's higher Z-resolution is a great premise to start from, but we'll need to see in practice what Z-resolution will be the most practical...

----------


## DoulosDS

> 0.045mm is a good enough resolution for most prints (0.5 is considered typical layer thickness for laser based printing)...


I was searching the whole forum for this info; then I found in on my own thread!  I'm glad to hear my $12 PS pump can meter out one slice per 1/n revs in the smallest print tank I expect to use, and could slice it a lot thinner in the largest tank I envision.  And, how much faster can the pump move a slice volume of brine than the drip system?  This could speed things up a lot.  

As for accuracy, the peristaltic pump hose degrades gradually over time, but that change should be negligible during a print.  If the pump is run at high speed, the rate of relaxation of the pinched tube may cause an error relative to running at slower speed.  If the tube is unable to resume the full, unpinched volume before the next roller pinches it off, the volume between pinches will vary with pump speed.  If two pumps are used:  one low flow rate for slice volume, and one high flow rate for displacing the resin to cover the previous slice, I think there's no problem.  The slicer pump can run slowly, and the displacement pump can run at a uniformly high speed in both forward and reverse.  If there is any reduction in pinched volume due the speed of the pump, it should be cancelled out.  Of course, the displacement pump would run an equal number of revolutions in both directions and stop between pinches.  

!!! Whoa !!!  I just enlarged the image of the motor label for the high displacement PS pump on eBay... it says the flow rate at 24 VDC is 4500 ml/min!  (editing:  WRONG!  That's a typo on the label.)  That's 75 ml/sec or 7,500 mm3/sec.  In the previous example of a 7.5 cm diameter print tank, that is a Z rate of 1.7 mm/sec.  That should be plenty fast for displacement, even in a larger tank, or the pump can be run at a slower, but uniform speed.  I have sent the seller a question whether the pump listed is the same as pictured, and can it run on 12 VDC at 1/5 the flow rate.

----------


## CescoAiel

Note there was a typo in that quote... There was a 0 missing:



> 0.045mm is a good enough resolution for most prints (0.05 is considered typical layer thickness for laser based printing)

----------


## DoulosDS

> I have sent the seller a question whether the pump listed is the same as pictured, and can it run on 12 VDC at 1/5 the flow rate.


No, the pump is NOT as pictured.  It is a 12 VDC pump with 500 ml/min max flow rate.  It has 3 rollers on the rotor.  I have asked the seller if he has any more of the 24 VDC pumps left...  I will let you know what he says.

----------


## DoulosDS

> ..... I have asked the seller if he has any more of the 24 VDC pumps left...  I will let you know what he says.


He says the 24 VDC pump does NOT pump 4500 ml/min but only 450 ml/min... the label was misprinted (then why use it to illustrate the 12 VDC pump?) and he didn't say whether he still had them for sale (if anyone is wanting one.).

----------


## DoulosDS

Another comment on peristaltic pump accuracy:  those driven by DC motors, rather than stepper motors, have gear trains to provide the necessary torque.  The $12 pump I found on Amazon has a maximum rotor speed of 100 RPM, but the motor is rated at 5000 RPM (probably no-load speed), so I am guessing there's a planetary gear system between the motor and the pump.  If there can be a sensor on the motor shaft, the precision of the pump output can be multiplied by the gear ratio.  Assuming a gear ratio of 36:1, that would make the slice thickness accuracy much better.  Given the torque load of the pump rotor, I expect the motor doesn't coast very long after the power is shut off, maybe one revolution or less.  Instead of a sensor on the shaft, it may be possible to detect the motor armature transitions in the motor current or voltage.  Depending on the number of segments in the armature, that would provide even greater precision.

----------


## DoulosDS

Anybody know how to get precise control of a DC motor?  I'm thinking a microcontroller with a hall effect sensor on the motor shaft counting full turns.  An A/D input would monitor the current or voltage and count the armature pulses during the revolution to determine angular position.  Then it should apply a reverse voltage pulse for rapid stopping.

----------


## CescoAiel

> Anybody know how to get precise control of a DC motor?  I'm thinking a microcontroller with a hall effect sensor on the motor shaft counting full turns.  An A/D input would monitor the current or voltage and count the armature pulses during the revolution to determine angular position.  Then it should apply a reverse voltage pulse for rapid stopping.


Or a conductive disk turning around with the axle with a drag-contact and a non-conductive area... Ofc. that won't help much if it turns too fast...   :Wink:

----------


## CescoAiel

> Another comment on peristaltic pump accuracy:  those driven by DC motors, rather than stepper motors, have gear trains to provide the necessary torque.  The $12 pump I found on Amazon has a maximum rotor speed of 100 RPM, but the motor is rated at 5000 RPM (probably no-load speed), so I am guessing there's a planetary gear system between the motor and the pump.  If there can be a sensor on the motor shaft, the precision of the pump output can be multiplied by the gear ratio.  Assuming a gear ratio of 36:1, that would make the slice thickness accuracy much better.  Given the torque load of the pump rotor, I expect the motor doesn't coast very long after the power is shut off, maybe one revolution or less.  Instead of a sensor on the shaft, it may be possible to detect the motor armature transitions in the motor current or voltage.  Depending on the number of segments in the armature, that would provide even greater precision.


True, but you'd still need to keep in mind the number of rollers squeezing the pump-tube and their relative position to the end of the housing (ie where it stops pinching and allows the tube to return to normal diameter)

----------


## DoulosDS

> Or a conductive disk turning around with the axle with a drag-contact and a non-conductive area... Ofc. that won't help much if it turns too fast...


Hall effect is much more reliable and I expect a less noisy signal...  as well as able to handle higher RPMs.

----------


## DoulosDS

> True, but you'd still need to keep in mind the number of rollers squeezing the pump-tube and their relative position to the end of the housing (ie where it stops pinching and allows the tube to return to normal diameter)


Right; the motor controller would just keep the pump stopping point from drifting or dithering.  The pump would always turn an integer multiple of 1/n for n lobes.  My idea of sensing the pump lobe position optically would allow too much slice-to-slice variation.  If the armature modulation counter goes over the number of armature bars, the controller could report an error or even correct an error if somehow the motor revolution counter lost count.

----------


## oninoshiko

> Hall effect is much more reliable and I expect a less noisy signal...  as well as able to handle higher RPMs.


Hall effect sensors are also cheap. I'm doing some experimenting with MLX90363 units, but you really wouldn't even need something that complex for what you're proposing. something like a US1881 (which sparkfun carries) should work.

----------


## DoulosDS

I suspect the most likely problem will be how to attach a magnet to the motor shaft.  The photos don't give me much hope at the commutator end of the motor, unless the magnet were very small and could be glued to the end of the shaft with a droplet of epoxy.  I'll have to open it up to see if the gear train provides a better magnet mounting opportunity.  Maybe the gear on the output shaft will have a suitable spot.  It will be a few weeks before the pump arrives here from China, so I won't know until early May.

----------


## CescoAiel

> I suspect the most likely problem will be how to attach a magnet to the motor shaft.  The photos don't give me much hope at the armature end of the motor, unless the magnet were very small and could be glued to the end of the shaft with a droplet of epoxy.  I'll have to open it up to see if the gear train provides a better magnet mounting opportunity.  Maybe the gear on the output shaft will have a suitable spot.  It will be a few weeks before the pump arrives here from China, so I won't know until early May.


Depending on the stator/rotor confuguration (and whether it is brushless or not) you may even be able to sense the rotor rotation from the outside, without attaching any magnets... Something you could test before even attempting to open it and attach a magnet anywhere...

----------


## DoulosDS

> Depending on the stator/rotor confuguration (and whether it is brushless or not) you may even be able to sense the rotor rotation from the outside, without attaching any magnets... Something you could test before even attempting to open it and attach a magnet anywhere...


From the photos, I'm pretty sure it has brushes and permanent stator magnets.  I have no idea whether the rotor magnetic fields can be detected outside the motor, but I doubt it, with the steel casing and stator magnets shielding them.  Maybe a hall effect sensor could be located inside the motor as close to the rotor as is practical; that might be able to count the passing rotor lobes, however many there are.  That might be easier than dealing with the noise in the power circuit.

----------


## CescoAiel

> From the photos, I'm pretty sure it has brushes and permanent stator magnets.  I have no idea whether the rotor magnetic fields can be detected outside the motor, but I doubt it, with the steel casing and stator magnets shielding them.  Maybe a hall effect sensor could be located inside the motor as close to the rotor as is practical; that might be able to count the passing rotor lobes, however many there are.  That might be easier than dealing with the noise in the power circuit.


Agreed, but it's worth a try to save on time dealing with dis- and re-assembly...   :Wink: 

Since you're experimenting with peristaltic pumps, I've let that go. I'm now thinking about cheap ways to make a movable platform with sufficient resolution instead...  :Wink:

----------


## DoulosDS

I'd bet we could print everything but the tube and motor for under $1.  The tube can be silicone fuel line from a RC hobby shop or site, and the motor can be salvaged from a car mirror adjuster.  A project for my spare time in the future... LOL!

----------


## oninoshiko

> I'd bet we could print everything but the tube and motor for under $1.  The tube can be silicone fuel line from a RC hobby shop or site, and the motor can be salvaged from a car mirror adjuster.  A project for my spare time in the future... LOL!


Heck, you could print a large chunk of the motor too, just need some wire and magnets.

----------


## harpo99999

I had spotted one in ebay with a stepper moter included, BUT it is A$52 and from hong kong

----------


## DoulosDS

OK, I received my $12 PS pump, and I am impressed with its simplicity.  The motor shaft serves as the sun "gear," though it is smooth; the 3 rollers are the planetary "gears," driven by contact with the motor shaft, and press the tube against the U-shaped housing.  The rollers have a circular plate with an axis for each to keep them aligned with the motor shaft and tube.  I have attached photos and a sketch of the geometry:
PS2.jpgPS3.jpgPS4.jpgPS5.jpgPSP Geom.JPG

I made the shaft and roller (0.435 in.) measurements with a micrometer and a digital caliper, and the outer diameter is derived from them.  Calculating the motor shaft turns per 1/3 rotor turn:  Given C = Pi D, 1/3 Pi 0.96 = x Pi 0.09, x=0.32/0.09 =3.56  I clamped a vice grip pliers onto the motor shaft end and rotated the pump housing 4 times, resulting in approximately 1/3 rotation of the rotor.  Perhaps the difference is due to the compressed tubing at the outer circumference.

 I will have to put sensors on the motor shaft and rotor to experimentally determine the precise "gear ratio" between motor turns and rotor turns.  Because the smooth motor shaft has the potential to "creep" with respect to the rotor position, unlike gears, counting motor revolutions alone may eventually allow errors due to stopping the pump during a pinch transition (non-constant flow) instead of between pinches.  I doubt the "creepage" would be enough to cause significant errors when counting motor turns to provide integer multiples of 1/3 rotor revolutions, but, the software should have a sensor input on the rotor as well, and have a self-correcting algorithm to ensure the rotor position is known within a turn of the motor shaft.  I'm assuming the Hall effect sensor on the rotor will be accurate, but not very precise, especially when trying to stop at the same position running forward vs. reverse.  Conversely, a sensor on the motor shaft would be more precise, but less accurate due to "creepage."  

An optical sensor disc could unambiguously locate the rotor within a fraction of a turn.  If the disc supporting the roller axis were installed inversely, opposite the motor rather than between the motor and the rollers, the optical disc pattern could be printed on the outer face of the disc and the optical sensor array could "view" the disc through a slot in the pump housing.

----------

