reading Pokeys pins

C Scripting questions and answers
Post Reply
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Thx, that points to the error, I must not be resetting the planner after the scripted Axis position
set. Ill fix that up. Thx for your tests, when I wrote Auggie I put in a lot of code that has never
been tested, I added it just in case. Much of this problem seems related to simply being
untested code.  Comes from writing a controller in a year. :)

Ill let you know when the fix is online.

Art
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Ok thanks

Hopefully you have some code to read the encoder pins13  I would like to be able to setup the pin for spindle index  1 rev per if possible.
and also be able to  use pin17 for pwm output 0-10v for the spindle speed  control.. but first things first lets get probing going first..

I know I keep bring this up but is there a way to get the global script running so I don't have to run it first in the script edit then use the button.

Thanks gary
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  I believe you can poll the encoder counts from the pokeys, but I dont think you can
the index. Ill have to look up what information the pokeys sends back on that.

  You can use any PWM channel you like. Examples of that are in the laser control
library as I use that library to control pwm power for the lasers.

As to the problem with the script having to be run before the button call to it will
function, Im still not sure whats going on there. I'll take a look to see how one of mine
works and perhaps we can figure why yours doesn't mimic it..

Art
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

I don't own a laser so that Greek to me right now...

I did look at the laser lib didn't see anything for pwm only turning on and off relays for air blow?

looked in the gcode lib that had some on pwm spindle speed don't look like its functional and looks like you need a real high spindle speed over 25000 to get it to return a value other than 0 not sure on how you are sending the pwm pulse. I'm used to just sending m3 s3600, or similar. right now I do have m3 and m8 working for turning on the spindle relay and coolant and m5 and m9 to turn off relays.

I thought I read some where that you are using motor 8 for laser control, I may be wrong.

I think pin17 is just a pwm pin for 0 to 10 v output I tried setting pin17 but haven't any luck changing the voltage output...

But this is a later problem  :-\

One thing at a time first probing, we are almost there, just a couple things not quite right, but I know you will get it...

Gary
 
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Just uploaded a new Auggie that should rest the planner after you use SetAxisPos so that
subsequent moves do not overrun. Let me know if this fixes the current script problem.

I use motor channel 8 for realtime pwm control, but this isn't how you'd do it for a spindle,
in that case youd call the PWM script calls to set up a channel , a base frequency and an output
level. We'll go into that after this probing is all settled..

Art
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Ok will test it out

I think the PWM channel is 5 if I'm reading things right but after probing is going...

Gary
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

Here is some numbers I am getting all are with g31 x-3 and retract after probe is hit I set the axis to .250,  then do a g00 x1

Probe run started at 0  - hit at -.3955  reset to .250 retracted to  0.6255          - started at positive hit at negative ended at positive
Probe run started at .6455  - hit at -.3802  reset to .250 retracted to  1.2758    - started at positive hit at negative ended at positive
Probe run started at 1.2758 - hit at -.2863  reset to .250 retracted to  1.8120    - started at positive hit at negative ended at positive
Probe run started at 1.1820 - hit at +.5002  reset to .250 retracted to  1.5681  - started at positive hit at positive ended at positive

Seems close to before I think is there a way to tell if the version of auggie has changed....

I thought I left a message last night about this but don't see it, that's a good thing I was having all kinds of problems last night
estop getting triggered off every time I had the line to setaxispos(.250) in the code, if I removed it all was good, now decided to try again tonight and I don't seem to be having the problem maybe I was having a computer gulch …

looked at the way I have mach4 setup for my spindle I am using ob5(10) step/dir and ob5(10) set to motor5 with the smoothstepper


Thanks gary

ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Thx, I neglected to update the version number. Ill have to do some checking to see why its the same.
Ill be away though until a week from Monday getting some sun. Ill fix this up when I return;
It does look like nothing changed.. which is odd as I reset the last position during any SetAxisPos call..

Sorry for the delay on this reply, I didn't get a message on this post for some reason.

Sounds like your driving your spindle with step pulses from Mach3, if so we'll set it on
an axis and use the FreeAxis calls to simply set a frequency. That can be added into
the spindle off and on calls as far as making the spindle work at any frequency. The FreeAxis
axis ( 4 of them) can be used individually at any frequency output and can be left as simply
frequency instead of step counts.

Art
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Ok Thanks

Your coming to the sun i'd like to get out of the sun, been getting way to hot for me in the summer and winter! down here in Florida can't even work in the garage most of the time.

have a great trip...

gary
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Im freezing..  .. Be back in a week..

Art
Post Reply