Hello Guest it is March 28, 2024, 12:32:50 PM

Author Topic: Need Help! DSPMC Setup  (Read 34283 times)

0 Members and 1 Guest are viewing this topic.

Re: Need Help! DSPMC Setup
« Reply #20 on: April 06, 2013, 06:15:01 AM »
I don't know what kind of mill you have, but if it's a knee mill or something with a light z you may not even notice it.  On this little vmc tho the z drops like a rock without a brake or servo to hold it.
Re: Need Help! DSPMC Setup
« Reply #21 on: April 06, 2013, 06:37:56 AM »
It is also a small VMC and the spindle will drop if the brake is off with no pid. Right know it is in pieces as I do some other stuff but hopefully it will be back together this decade. LOL

Mike
We never have the time or money to do it right the first time, but we somehow manage to do it twice and then spend the money to get it right.
Re: Need Help! DSPMC Setup
« Reply #22 on: April 06, 2013, 06:58:50 AM »
Haha...sounds about right.

 Need to look through the servo params again see if there is anything that can help hold at a zero input.  In speed control mode I can clamp the servo rpm at zero below a certain input, then the z doesn't drop.  May try switching back to speed control instead of torque.
Re: Need Help! DSPMC Setup
« Reply #23 on: April 06, 2013, 07:39:46 AM »
hi Tom,  why you have to run the spindle as open-loop spindle or rotary axis?  what kind of application is it.  I am looking into the issue here and I should have an update for you to email soon.

regards,
Rufi



Would it be possible to define a digital ouput as a brake output that could be adjusted to turn on after the pid is turned on and turned off before the pid is turned off?
Re: Need Help! DSPMC Setup
« Reply #24 on: April 12, 2013, 07:03:50 PM »
After an update from Vital Sytems the spindle is noe running as both a spindle and a rotary axis.  Once the tuning is better on the axis I'll try some tool changes.  As of now tho it is looking pretty awesome.  The C axis needs to be disabled (mach3 oembutton 255 i think) to run it as a spindle so i just added a couple lines to the m3 and m4 macros to make sure it was disabled.  I added an m13 that enables the C and homes it to get ready for positioning commands, m15 kicks it out of positioning mode.  Would be happy to share these, as simple as they are, if anybody is doing the same thing.

Still working on the z axis brake.  After a talking with Rufi on the phone we think a dspmacro may be the cure.  Unfortunately the computer has been without internet access for a few years and needs to be updated for the macro loader to work.  Will post back with updates.
Re: Need Help! DSPMC Setup
« Reply #25 on: April 12, 2013, 08:38:27 PM »
Tom,  

I think based on the info you told me, you don't need to disable any axis by using DoOemButton(), because looks like the spindle can always run in active feedback control mode.   you can do gcode or m3/m4/m5 on the spindle while the encoder feedback and PID is always enabled.

you need to  disable the axis only in case you want some specific analog voltage output on the DAC channel.  To do m3/m4/m5, no need to disable axis because you always have encoder feedback available.


hope this helps

rgds
Rufi
« Last Edit: April 12, 2013, 08:41:43 PM by vitalsystem »
Re: Need Help! DSPMC Setup
« Reply #26 on: April 12, 2013, 08:39:48 PM »
Oh.  Mis understood that then.  Either way it works good!
Re: Need Help! DSPMC Setup
« Reply #27 on: April 25, 2013, 03:13:42 PM »
Getting closer now, had to take a break from the machine for a bit due to changes in my day job.  Back at it now.  I'm getting closer with the axis tuning, but still not quite perfect.  The spindle working as an axis is buttery smooth, I love it.

Still working on this Z axis brake issue.  Trying to write a DSPMacro to turn the output on when the pid is on and the output off when the pid is off.  It does not seem to be working for me though.  I tried simple and best I could get was a flash on the output led when I hit the Run/Stop button in the macro loader.  I've gotten a little more complicated in the macro and can get the output to stay on but only when I hit the Run/Stop button.  With the autorun on I get no changes in state of the output when I hit reset in Mach or arm/disarm the pid like I would expect to see.  Looking for some suggestions from seasoned DSPMacro users.

This is what I currently have loaded in the dspmc:

SetDSPData(44, 0) :REM Turn off brake output
1000
IF GetDSPData(35) = 0 Then GOTO 1000 :REM PID State
 SetDSPData(44, 1) :REM Turn on brake output
 Print "Brake output on"
1001
IF GetDSPData(35) = 1 Then GOTO 1001


Here is another version that I tried:

PID = GetDSPData(35)
If PID = 0 Then GOTO 2000 :REM PID State
1000
SetDSPData(44, 1) :REM Turn on brake output
Print "Brake output on"
GOTO 3000
2000
SetDSPData(44, 0) :REM Turn off brake output
Print "Brake output off"
3000
Print "Output State = "; GetDSPData(44)
Re: Need Help! DSPMC Setup
« Reply #28 on: April 25, 2013, 04:09:51 PM »
Hello Tom,

I think you should enclose your code in a non-terminating while loop. You can use the NOT() function to invert the value of GetDSPData(35).


while(1)
     SetDSPData(44, NOT(GetDSPData(35)) ) :REM brake output is the inverse of pidON
wend

« Last Edit: April 25, 2013, 04:11:30 PM by vitalsystem »
Re: Need Help! DSPMC Setup
« Reply #29 on: April 25, 2013, 04:13:08 PM »
Ok, will try that.

Just had this one in and working, basically the same thing using an If statement.  I still get the Z axis drop when the pid goes off tho, not good.

1000
If GetDSPData(35) = 1 Then SetDSPData(43, 1) Else SetDSPData(43, 0)
GOTO 1000
« Last Edit: April 25, 2013, 04:17:38 PM by TomL21 »