Welcome! Log In Create A New Profile

Advanced

reprappro firmware: getting probe values into a spreadsheet

Posted by shadowphile 
reprappro firmware: getting probe values into a spreadsheet
February 10, 2016 12:11AM
This is about my 300mm bed delta and ongoing efforts to improve accuracy.
I would like to densely probe my bed in order to plot a contour map of ups and downs. Is there a way or command I can use to do a G30 S-1 then print out the result in the command line where I can cut and paste it in one column?

Also, DC42, how level is your bed? I have shimmed and squared as much as I can and after autocal I get about 0.3mm height difference from one side of the bed to the other. My autocal deviation is about .050. This is one of the reasons I want to profile my bed with more detail, possibly see from the hilly pattern where the errors are originating. I suspect the carriages are warping too much under the omnidirectional loads. Has anybody seen success using teflon sliding surfaces for the carriages?
Re: reprappro firmware: getting probe values into a spreadsheet
February 10, 2016 02:20AM
How many points do you want to probe.

One Way I can think to get that data is to copy your bed.g file replacing the Sx in the final G30 line with S-1 this will print out the heights at each probe point without making any adjustment you would however be limited to 16 points.

I suppose you could generate multiple Bed.g files in the same fashion to increase the total number of probes and run them sequentially (Obviously they would need different names)

Then you could plough the figures into dave online Cal tool?

HTH Doug

Maybe Dave will confirm the above would work or not.
Re: reprappro firmware: getting probe values into a spreadsheet
February 10, 2016 02:42AM
I will look at increasing the number of probe points supported when I get time. I've also been meaning to look into having the firmware generate its own grid of points, although you wouldn't then be able to make corrections using the H parameter.

If your deviation is 0.05mm but you are getting nozzle height differences of 0.3mm across the bed, that suggests to me that you have significant trigger height differences over the bed surface, probably caused by effector tilt, that you haven't compensated for using the H parameter.

Have you checked that the directions that the carriages face in are 120 degrees apart? It's quite easy to get an error here, for example if they are printed and they warped during printing. If the lines between each pair or bearings on the carriages are not parallel to the lines joining the corresponding bearing pairs on the effector, then the effector has to tilt to resolve the difference, and the tilt will vary with XY position.

I bought a mini spirit level to help me check for effector tilt. Unfortunately I really need to remove the hot end from the effector to use it.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: reprappro firmware: getting probe values into a spreadsheet
February 10, 2016 05:35AM
runhaskell genProbePoints.hs > probe.gcode

genProbePoints.hs is below:
import System.Random

xyRange :: Int
xyRange = 96

xyInc :: Int
xyInc = 12

radiusSq :: Int
radiusSq = 124*124

speed :: Int
speed = 90*60

height :: Int
height = 14

probeCmd :: String
probeCmd = "G30 S-1"

main :: IO ()
main = mkBgn >> go (shuffle 0 points)
 where
  go [] = return ()
  go ((x,y):rest) =
    if x*x + y*y > radiusSq then go rest else do
    putStrLn $ mkG0 x y
    putStrLn probeCmd
    go rest

  mkBgn = mapM_ putStrLn
    [ "G28"
    , "G0 X0 Y0 Z" ++ show height ++ " F" ++ show speed ]

  mkG0 x y =
    showString "G1 X" $ shows x $ showString " Y" $ shows y $ showString " Z" $ show height


points :: [(Int,Int)]
points =
  let range = [0-xyRange, xyInc-xyRange .. xyRange] in
  concat $ map (\r -> zip range (repeat r)) range


shuffle :: Int -> [a] -> [a]
shuffle seed lst =
  let ll = length lst in
  if ll < 2 then lst else
  pick lst $ mkRandomSeq (ll-1) (randomRs (0, ll-1) $ mkStdGen seed) ll


pick :: [a] -> [Int] -> [a]
pick rv@[] _ = rv
pick rv@[_] _ = rv
pick _ [] = undefined
pick lst (p:ps) =
  let (prefix, x:sufix) = splitAt p lst in
  x : pick (prefix ++ sufix) ps


mkRandomSeq :: Int -> [Int] -> Int -> [Int]
mkRandomSeq maxRandomNumber randomNumbers rvLength = go randomNumbers rvLength
 where
  go [] _ = []
  go _ 0 = []
  go (r:rs) cnt =
    let upperLimit = cnt * ((maxRandomNumber+1) `div` cnt) in
    if r >= upperLimit then go rs cnt else
    (r `rem` cnt) : go rs (cnt-1)

Modify the constants at the top of genProbePoints.hs as you wish.
The example (as posted) has (96/12 * 2 + 1)^2 = 289 probe points.
Re: reprappro firmware: getting probe values into a spreadsheet
February 10, 2016 06:27PM
I feel misunderstood. I just want to probe an arbitrary set of points and not have to copy them one by one from the position display. I am thinking a 10x10 grid if I want to get crazy (and have the patience).
Easiest solution would be to have the G30 command (not S-1) report the the x, y and z value. The P parameter would not matter because there is no intent to run a transform.
Run a bunch of those with a macro then cut and paste the entire log output into Excel (easy to extract and format the data in Excel).
I could probably add my own print to stdio code if I decided to set up compiling...but I already have about 4x more projects tha I can handle at this time!
Re: reprappro firmware: getting probe values into a spreadsheet
February 11, 2016 02:54AM
Send me a PM in a few days from.now when my new office should be more organised, and I will add it to the firmware improvements list.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Sorry, only registered users may post in this forum.

Click here to login