reading Pokeys pins

C Scripting questions and answers
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

That seemed to fix it...

I wish I didn't come up with the bright idea to swap the probing direction's with button's and  led's
seems like I had to make a lot of changes to the probing code, but did get it to work with inside bore probing, round and Square/Ret..
Now on to the rest of the scripts..

I see what a pain it could be for you to hunt bug's down..

I did finally dig into visual studio C++ a little and wrote my first program to calculate the X and Y values for the 3 corners of a delta printer based on the print radius.
I got lazy every time I had to recalibrate the printer I had to try and figure out the math again... not any more..

Thanks for you help, hopefully I won't run into anymore glitches..

Gary 
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

>>I did finally dig into visual studio C++ a little and wrote my

  lol, you want to take care, while free, Visual Studio can swallow you whole.
If one were to ask me the best program ever written, it would be Visual Studio..
warts and all.

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Yes I found the code hard to follow, but got it going after some hours of messing around, it's not fancy but works for me, maybe I will zip it up and post it your 3d printer section.. never had anyone test it out yet or not sure if needed..

I was finding with my delta printer when I was doing the auto bed leveling I wasn't getting good prints, so went back to manual and things were a lot better..
but I guess most people are using the auto leveling..

Gary
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Depends on the printer really. I haven't tuned mine or leveled in years..thing just works, typically.
Many futz with various settings over time, 3dprinting is more hobby than device. :)

Art

User avatar
Mooselake
Old Timer
Posts: 522
Joined: Sun Dec 26, 2010 12:21 pm
Location: Mooselake Manor

Re: reading Pokeys pins

Post by Mooselake »

I've never auto leveled my 3D printers, two of them (Plywood Printrbot Plus and new Ender 3 Pro) don't have auto leveling, and my Thingybot Delta has a probe but it requires swapping out the hot end module for it.  Level all of them with screw or dial twiddling...

Only the Plus had issues, and that was after replacing the allthread with TR8-8, so little friction the carriage would drift down while setting and tilt, once I learned that a quick setup with a sheet of paper before powering it up eliminated the problem.  Otherwise it only needed leveling (we all know it's not really leveling...) on rare occasions.    I leveled it with a digital dial gauge to within 0.01mm on a double strength window glass bed.

The E3P is too soon to tell (only had it a few days), it got the stiffer spring mod.  It's included aluminum pcb sandwich MK3 bed isn't that great, and the highly touted magnetic (polymer on car sign magnet) print surface is mostly a bust, will be swapping that out for a pair of glass pallets soon.  Still usable but it has to cool off to remove prints or the flexy bed warps them

Kirk
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »


We should most likely move this to the 3d printer subject..
Can they be moved art?.

Gary
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Beats me, I try to play with the forum as little as possible. Its under server control so I cant do
real maintenance. Nothing too valuable so far in terms of information on the topic, you might just
reopen it under 3d printers....

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Ok for forum..

I was wondering if you had added any thing in the script's to be able to read the Probe Polarity, to see if it's set to true or false?

Gary
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

I dont think I did, I will check though to see if the variable for the base polarity is available in script.,
comparing that to probeinvert would indicate the actual state of the logic..

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Ok Thanks, i was looking to see how it's set in the planer/config true or false, i would like to be able to set the probhit led to the same state as my probes, on my touch plate i have it set to false and on the probe to true
and that make's the led  on when not hit  then off when hit, or  if true off when not triggered and on when hit.. i would like to keep them the same.. make sense?.

Gary
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Have a question X=Engine.GetAxisPos(1);

if i run this
X=Engine.GetAxisPos(1);
print(X);
and have the X dro set to .199999
it will print .199999
then if i Zero the Axis now set to 0 and rerun
it prints -6.10352e-008

It only seems to happen after a Engine.GCode move..

am i doing something wrong or miss interpreting things

Gary
Last edited by gburk on Sun Dec 15, 2019 6:12 am, edited 1 time in total.
User avatar
Mooselake
Old Timer
Posts: 522
Joined: Sun Dec 26, 2010 12:21 pm
Location: Mooselake Manor

Re: reading Pokeys pins

Post by Mooselake »

Art can answer this way better than me, but it looks like floating point roundoff error. -0.000000061 looks pretty darn close to zero.

Kirk
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Yup, Kirk has it right. Thats a number so small it is zero. But I'll note to add a line to kill it if its
less than .0000001 or something..


Art
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

As of next release..should be withing a couple days, you can get the
planner setting for probe level by asking for the global variable
"ProbeSetupLevel"

  You cannot set this, it is read only. It can be set only in the config.

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

"ProbeSetupLevel" sounds good. Don't thing i need to set it at least for now.

I thought the number may have been a float, i tried a few conversions on it be same affect...

So question is if i am getting this value back after setting the axis to 0, Engine.SetAxisPos(0.null,null,null);
how much if any problem's will i have if i use the value for example to send the X axis to the returned value, of X =  Engine.GearAxisPos(1); Enging.Gcode("G01 X"+X); is say X axis is at .200 before the GCode move.

update
I tried this, last_pos = format("%.5f",(Engine.GetAxisPos( 1 ))); and i seem to always get the number 0 now after resetting setting the dro X axis to 0.. good way or bad?

Thanks
Gary
Last edited by gburk on Sun Dec 15, 2019 1:17 pm, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests