Machsupport Forum

Third party software and hardware support forums. => dspMC/IP Motion Controller => Topic started by: TomL21 on March 29, 2013, 02:13:57 PM

Title: Need Help! DSPMC Setup
Post by: TomL21 on March 29, 2013, 02:13:57 PM
Setting up a DSPMC with Delta servos and drives.  I have the drives set to speed control mode with ±10V input.  X Y and Z are wired to Ch0, 1, 2 respectively.  Differential encoder outputs from the drives wired to their respective inputs on the DSPMC.  I'm having trouble getting the DSPMC to arm.  I gives me a constant Estop signal in Mach regardless of the position of the estop button.  I can see the estop input turn on and off as it should on the diagnostics page.  The limits/home switches are also set properly.  Everytime I hit the reset button it flashes and jumps back into the reset mode.  The dros/encoder counts jump a little and the servos do move some.  I must be missing something, probably something simple I'm sure.  I'm going to head out to re-check all the connections...again.  And review the servo parameters again.  Any help would be greatly appreciated.

Thank you

TOM
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support on March 29, 2013, 02:52:39 PM
hi Tom,

I think you need to connect the earth ground and a good power connection between the breakout board and the DSPMC.  attached is a hand drawn wiring diagram.   we will include a cleaner version in the user guide soon.

also make sure the signal ground on the servo drives is connected to J2 common and earth ground.

regards,
Rufi


Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on March 29, 2013, 04:28:22 PM
Thank you Rufi for the prompt response.

I have good earth grounds to the DSPMC and also both the 5v and 24v external power supplies.  My set up is a bit different than you drawing.  I have a 7535N, 5v power from the exernal supply, for my digital i/o and standard db25 bobs for j2, j6 and j7.  Everything going through the 7535N is working properly.  The encoder inputs in j6 and j7 seem to be working properly, I can see the movement in Mach and it does appear to be correct distances.

The message bar in Mach says "estop button pressed", the physical button clearly is not and the input led agrees.
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on March 29, 2013, 04:36:56 PM
double checked the 10v and ground signals to the servo drive and they are good.  ground has a good connection to earth.
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support on March 29, 2013, 05:31:57 PM

well, then follow the 7535 J8  to DSPMC J2 wiring as shown in the drawing.  It is extremely important.  I think you are missing a solid common ground connection between your 5v external power supply and DSPMC.  You really don't need an external 5v supply for 7535 breakout.  DSPMC has enough current on 5v power.

regards,
Rufi

Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on March 29, 2013, 05:56:51 PM
J2 goes to a standard bob not a 7535.  The signal grounds on J2 have a solid connection to earth ground according to my meter.  The 5v supply was already in there so I just wired it up, it's closer to the bobs.  The 5v supply has a solid connection to earth ground as well.
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support on March 29, 2013, 06:35:02 PM
Ok let me say it differently.  take a 18 gauge or so wire and connect it between 7535 J8 negative terminal and DSPMC J2 pin 17.  also connect DSPMC J2 pin 17, 7, 22 and 25 to the negative of your 24v and 5v power supply.  Let me know how that works.

-rufi





 
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on March 29, 2013, 06:37:27 PM
I will be back at the machine tomorrow am.  Will give it a shot and report back.
Title: Re: Need Help! DSPMC Setup
Post by: TOTALLYRC on March 30, 2013, 06:42:51 AM
Setting up a DSPMC with Delta servos and drives.  I have the drives set to speed control mode with ±10V input.  X Y and Z are wired to Ch0, 1, 2 respectively.  Differential encoder outputs from the drives wired to their respective inputs on the DSPMC.  I'm having trouble getting the DSPMC to arm.  I gives me a constant Estop signal in Mach regardless of the position of the estop button.  I can see the estop input turn on and off as it should on the diagnostics page.  The limits/home switches are also set properly.  Everytime I hit the reset button it flashes and jumps back into the reset mode.  The dros/encoder counts jump a little and the servos do move some.  I must be missing something, probably something simple I'm sure.  I'm going to head out to re-check all the connections...again.  And review the servo parameters again.  Any help would be greatly appreciated.

Thank you

TOM

Hi Tom,
A couple of things jump out at me.
1. I would consider running the drives in torque mode. I don't recall exactly why but that is what I do and the way I have seen it done on many machines.
2. What are you getting for an error message in the Mach3 message bar? It could be that your servos are tripping out due to a following error.
3. Have you been able to tune the servos from the Mach3 plugin setup page?


Mike
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on March 30, 2013, 07:40:57 AM
I was able to tune out some of the drift in the drive.  The servo drives are not faulting out.  So the drifting issue is gone.  I can try torque mode, but would like to get the system up before making other changes.  I pulled a different motion controller out to put the dspmc in.  The servos are unchanged, just changed input settings and switched from step/dir to analog.

 have not been able to tune them in the plugin, i can't get mach out of the reset state.  The message bar says the estop is pushed.  The physical button is not and the estop led on the diagnostics page is off.  As far as I can tell the estop circuit itself works as it should.
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on March 30, 2013, 09:59:29 AM
Ok,  now supplying 5v to the 7535 on J4 from pin 14 of J2.  Using pin 22 on J2 as ground (17 is already being used).  That ground is also connected directly to earth ground via the green/yellow wire.  The Dspmc is also connected directly to earth ground via the green/yellow wire.  Still showing the same issue.  Emailing pictures to you guys, the forum keeps giving me errors trying to attach photos.  Sorry if a dozen or so posts pop up here eventually...

The z axis in on the home switch, as seen on the diagnostics page, i jogged it up with the manual jog on the servo drive.  I still have not been able to get motion from mach/dspmc.  I had the same issue before i did this so i do not believe it is contributing to this problem of mine.  I'm sure this is something simple staring me right in the face, just not seeing it.

Just an off the wall question, does the dspmc need a signal from the charge pump or anything of the sort?  I didn't see anything in the manual about it.
Title: Re: Need Help! DSPMC Setup
Post by: TOTALLYRC on March 30, 2013, 09:58:26 PM
The DSPMC does not use a charge pump.
If you set the e-stop to 0,0 like you currently have, you should be able to clear the e-stop by clicking reset on the screen. If it doesn't work then you may have to change the active high to active low.
Mike
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on March 30, 2013, 11:04:19 PM
Temporarily set it to 0:0 and I can't clear it, even changing the active hi/low setting.  The estop circuit isn't causing the estop state, has to be something in the plugin/dspmc.  The only way to clear it is to remove the plugin, but that obviously isn't going to help me much....
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support on March 30, 2013, 11:36:12 PM
hi Tom,

can you email the xml profile and the message log of mach3.

do you have the debug window open?  that will help to isolate the problem.  you can also email the contents of debug window.

also what is the version numbers it reports on the status screen?

rgds
Rufi
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 05, 2013, 01:13:20 PM
After a plug-in and firmware update all is well in the estop world.  I have the X Y and Z axes running pretty well.  Z still needs a little fine tuning, but very close.

Two hurdles left to jump.

First, the Z axis brake.  With the servo drives set to torque mode they apply zero torque with no input signal.  This is bad news when the Z axis brake is the only thing that holds the Z axis up and it's reaction is delayed.  It seems that when Mach is reset, the PID goes down before the outputs, so when the enable signal goes off to the drive the Z is already on it's way down.  Moving the Z to an output from the dspmc has not helped, it has solved the problem of the servo drive not activating the brake in estop tho.  Currently I don't see a way around this one...suggestions from anyone are very much appreciated.

Second, the spindle. The spindle needs to run as both a spindle and a rotary axis.  As I understand the dspmc is capable of this.  I have the spindle defined as gcode axis with index 5, or same as the C axis.  I also have the C axis set up to use Machxx as an input and DAC Ch 5 and Encoder Ch 5 as inputs.  I can see the encode input working well.  I have also added a button and an M Code (both effectively push button 255) to deactivate the C axis as this is necessary to use it as a spindle, then reactivate to use as an axis.  I've made several attemps to get a voltage signal or some movement as an axis with no luck so far.  I did get a voltage signal when I switched the Spindle to 0-10v with index 7.  The manual states that to use it as a G Code axis it needs to be 0-5 tho.  This is kind of an important function as the spindle indexes the tool changer.  As before, any help from anyone is greatly appreciated.

Thank you,

TOM
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support on April 05, 2013, 07:38:17 PM
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

Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 05, 2013, 08:55:26 PM
The spindle drives the tool changer carousel.  There is a gear on the face of the spindle that engages gear on the toolchanger.  Then the spindle is used to index to the next tool.  In the system I ripped out I had to change parameters and settings in the vfd via modbus and drive it with step and direction signals from mach.  Sounded like it would be much easier with the dspmc and the spindle as gcode axis setting.  This afternoon I was able to run the spindle set as 0-10v, and also get some positioning using a (ch3) axis.  Tomorrow going to try the spindle as gcode thing some more.  One question, in the motor outputs tab of the ports and pins window, are values required in the step/dir port and pin for each axis?  The manual dhows a pic of numbers in x thru a, which I copied into mine.  Just curious if these being all 0 for the c axis could have anything to do with my not being able to get it to work on that one.
Title: Re: Need Help! DSPMC Setup
Post by: TOTALLYRC on April 06, 2013, 04:30:47 AM
After a plug-in and firmware update all is well in the estop world.  I have the X Y and Z axes running pretty well.  Z still needs a little fine tuning, but very close.

Two hurdles left to jump.

First, the Z axis brake.  With the servo drives set to torque mode they apply zero torque with no input signal.  This is bad news when the Z axis brake is the only thing that holds the Z axis up and it's reaction is delayed.  It seems that when Mach is reset, the PID goes down before the outputs, so when the enable signal goes off to the drive the Z is already on it's way down.  Moving the Z to an output from the dspmc has not helped, it has solved the problem of the servo drive not activating the brake in estop tho.  Currently I don't see a way around this one...suggestions from anyone are very much appreciated.
Hi Tom,
The way I handled the brake on my servos was to use an enable signal from Mach3 to the servo drive. Set up an output on the servo drive so that it controls the brake. When the enable signal drops out the drive applies the brake automatically.

Quote
Second, the spindle. The spindle needs to run as both a spindle and a rotary axis.  As I understand the dspmc is capable of this.  I have the spindle defined as gcode axis with index 5, or same as the C axis.  I also have the C axis set up to use Machxx as an input and DAC Ch 5 and Encoder Ch 5 as inputs.  I can see the encode input working well.  I have also added a button and an M Code (both effectively push button 255) to deactivate the C axis as this is necessary to use it as a spindle, then reactivate to use as an axis.  I've made several attemps to get a voltage signal or some movement as an axis with no luck so far.  I did get a voltage signal when I switched the Spindle to 0-10v with index 7.  The manual states that to use it as a G Code axis it needs to be 0-5 tho.  This is kind of an important function as the spindle indexes the tool changer.  As before, any help from anyone is greatly appreciated.

Thank you,

TOM

This might be a good place for a dspmc macro.

Mike
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 06, 2013, 05:28:01 AM
That's how I initially had the brake set up, but it seems like the pid of the dspmc shuts down before the outputs, so torque goes to zero then the enable line goes down, this order of things allows the z to drop.  Didn't have this problem when the drives were step/dir because they held position on they're own, but torque mode it doesn't work.

 Will look into the dspmc macros for the toolchanger issue.
Title: Re: Need Help! DSPMC Setup
Post by: TOTALLYRC on April 06, 2013, 06:08:45 AM
Tom,
That is good info. When I get back to it I will have to seeif I have the same issue.

Mike
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 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.
Title: Re: Need Help! DSPMC Setup
Post by: TOTALLYRC 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
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 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.
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 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?
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 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.
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support 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
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 12, 2013, 08:39:48 PM
Oh.  Mis understood that then.  Either way it works good!
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 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)
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support 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

Title: Re: Need Help! DSPMC Setup
Post by: TomL21 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
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 25, 2013, 04:28:41 PM
Still get the Z Axis drop.  Some one out there has to have experienced this before, anybody?!?!

Rufi, the servo drive usually has a setting to advance or delay the on/off of the brake output with respect to the servo being on or off.  On these deltas the offset can be as much as 1 sec.  Is there any way that there can be an output selected to be a "brake" or otherwise special output that turns off with a set advance of the pid loop.  Or add an option to have the PID loop shut off a bit late compared to the outputs in an estop/reset/error event?  This would solve the issues.  It could even be only on one axis, doesn't have to be all 8, or a selectable number of axes.  I don't know what this would entail in the plugin/firmware, I'm sure its not as easy as it sounds, but I'd think would make for a better solution.

Should I not have the servos in torque mode as was suggested earlier?  I had a much harder time getting any motion in speed mode, but I wonder if that would work better as the Z shouldn't drop as it would be trying to maintain zero speed rather than zero torque.  Thoughts/experiences on this?
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support on April 25, 2013, 04:30:12 PM
are you using output 44 or 43 for the brake?

this will turn the brake on when PID is OFF:

while(1)
     SetDSPData(44, NOT(GetDSPData(35)) )
wend


This version will turn the brake on when PID is ON:

while(1)
     SetDSPData(44, GetDSPData(35) )
wend

dont know what polarity is needed in your setup.

thanks



Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 25, 2013, 04:32:51 PM
Output energized is brake off.  So the second one is what I did.  43 is actually the brake, I was using 44 to test the macros as nothing is attached to it, less risk :)
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support on April 25, 2013, 04:36:20 PM
so this one then:

while(1)
     SetDSPData(44, GetDSPData(35) )
wend


this is going to energize and de-energize the output within couple of milliseconds at most.  is that not fast enough?  may be there is delay in your brake mechanism.  the controller I believe is doing it right.

rgds
Rufi
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 25, 2013, 05:01:02 PM
Right.

And I don't think the controller is doing it wrong, just not the way I need it to.  The drive electronics allow for an adjustment of overlap time to compensate for latency in the relay and the brake itself.  With the current setup there is no overlap, which allows the z axis to drop.
Title: Re: Need Help! DSPMC Setup
Post by: TOTALLYRC on April 25, 2013, 05:57:01 PM
When setting up the brake it would be nice if the brake would stay on just a little after the drive enable comes on and if the brake would come on instantly the moment the drive enable goes off/estop/limit switchkicks in.

The question I have is when an e-stop condition is detected, is there a time lag between the PID drop out and the drive enable drop out?

Mike
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 25, 2013, 07:15:05 PM
When setting up the brake it would be nice if the brake would stay on just a little after the drive enable comes on and if the brake would come on instantly the moment the drive enable goes off/estop/limit switchkicks in.

The question I have is when an e-stop condition is detected, is there a time lag between the PID drop out and the drive enable drop out?

Mike

It seems that it is nearly instantaneous off and on.  On doesn't seem to be an issue, I need a bit of time from output off to pid off.  Would be nice to have either option as I can see both being needed.  Hopefully it's something doable in the firmware, otherwise I'll have to find another way.
Title: Re: Need Help! DSPMC Setup
Post by: Vital System Support on April 25, 2013, 08:37:15 PM
ideally you need a time parameter to say how long to keep PID active when axis enable is dropped by mach3.   may be per axis parameter setup.   I will check if we can add this.  can't promise right now but I see it may be doable.

rgds
Rufi

Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 25, 2013, 09:52:28 PM
If it's doable that would be perfect!!
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on April 26, 2013, 11:34:50 AM
Update:

Moved the brake control back to the servo drive.  Switched the servo drives over to speed control vs torque control.  I'm actually getting much better motion now, I can have less following error at higher accelerations and velocities, very good!  And because the servo is in speed control mode a zero signal means zero speed, so the drive will essentially maintain position without input from the dspmc.  This also provides some overlap with the brake and servo power so the z axis doesn't drop 2 inches when Reset is hit.  The only issue now is why when estopped the servo drive holds the brake output on (which means brake is off) cause the z to descend in an estop condition.  For now I just won't estop the drive, the servo enable signal from mach/dspmc kills the servo in that state anyways.  I have an email into delta on that one.

So, with that hurdle hopefully tackled, onto getting this tool changer program working!

I still think that being able to delay the PID loop in the dspmc is a great option to have tho, if it's capable of it.
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on July 26, 2013, 11:49:19 AM
Machine is almost rockin!  X Y and Z are fantastic.  Had to get some modbus comms working to talk to the VFD and swap some parameters to get the thing to work as a servo and a spindle.  So now I have excellent spindle control up to 6k rpm and can swap it into a C axis and have full rock solid position control.  Even got the tool change working in the MDI mode....that's where the fun ends.

In the toolchange macro I enable the C axis and change the parameters in the VFD then turn on the output to set the vfd into run mode (position control enabled).  The next thing is to home the spindle to get the orientation correct, using DoOEMButton(1027).  This bit is not allowed when running a program.  If I don't home it, then the C axis has to "unwind" (even with mach set to roll over at 360 Degrees) to get to position after running as a spindle.

Need a way to home the C axis in a program, by passing the OEM button 1027.
Title: Re: Need Help! DSPMC Setup
Post by: BR549 on July 27, 2013, 07:27:21 PM
Have you thought about using an alternate method of setting USER zero in C other than ref home?

(;-)tp
Title: Re: Need Help! DSPMC Setup
Post by: TomL21 on July 27, 2013, 07:54:44 PM
Yea...tried a couple other ways, but thanks to Marc at Vital System the dspmc now has a way to start the home sequence using NotifyPlugin () instead of the oem button.  Will get back to it monday/tuesday and hopefully all will be well!

An alternative would be to find the nearest position yhat is a multiple of 360 move there and call a g92.