Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Encoder Loss on MACRO
I am converting our 3-PPMAC machine into a single PPMAC CPU/5E3 with accessories in MACRO16 stations.

I have motor nodes and IO nodes configured and working and now I am working my way through all the extra bits our code relies on.

We currently have the following where the acc24e2x is on the same backplane as the PPMAC.

ptr Encoder00OK->$D00040.13.1;

To look directly at the encoder loss bit in the partdata.

How do I get this info across the MACRO ring where the encoder is coming back in a motor node? (it doesn't look like it is in the status register)
The encoder loss bit addresses at the MACRO Station are at the following:
// 1st ACC-24E2, base address $8000 (SW1-3: ON-ON-ON)
Y:$88C8,5 // Channel 1 Encoder Loss Bit
Y:$88C9,5 // Channel 2 Encoder Loss Bit
Y:$88CA,5 // Channel 3 Encoder Loss Bit
Y:$88CB,5 // Channel 4 Encoder Loss Bit
// 2nd ACC-24E2, base address $8040 (SW1-3: OFF-ON-ON)
Y:$88CC,5 // Channel 5 Encoder Loss Bit
Y:$88CD,5 // Channel 6 Encoder Loss Bit
Y:$88CE,5 // Channel 7 Encoder Loss Bit
Y:$88CF,5 // Channel 8 Encoder Loss Bit
// 3rd ACC-24E2, base address $9000 (SW1-3: ON-ON-OFF)
Y:$98C8,5 // Channel 9 Encoder Loss Bit
Y:$98C9,5 // Channel 10 Encoder Loss Bit
Y:$98CA,5 // Channel 11 Encoder Loss Bit
Y:$98CB,5 // Channel 12 Encoder Loss Bit
// 4th ACC-24E2, base address $9040 (SW1-3: OFF-ON-OFF)
Y:$98CC,5 // Channel 13 Encoder Loss Bit
Y:$98CD,5 // Channel 14 Encoder Loss Bit
Y:$98CE,5 // Channel 15 Encoder Loss Bit
Y:$98CF,5 // Channel 16 Encoder Loss Bit

You want to map local M variables, on the MACRO16 Station, to these bits. You can download the code below into the MACRO16 in ASCII mode using (paste into) telnet. Currently, the IDE does not support ASCII download(s). You go into ASCII mode by issuing MacroStation1 (i.e. for station number 1). And get out of ASCII mode by issuing MacroStationClose.
MM9-> Y:$98C8,5    

Now, on the Power PMAC side, you want to copy those to local M variables/pointers. This can be done in a background PLC, using MacroSlaveRead commands.
PTR Ch1EncLoss->*;
PTR Ch2EncLoss->*;
PTR Ch3EncLoss->*;
PTR Ch4EncLoss->*;

PTR Ch5EncLoss->*;
PTR Ch6EncLoss->*;
PTR Ch7EncLoss->*;
PTR Ch8EncLoss->*;

PTR Ch9EncLoss->*;
PTR Ch10EncLoss->*;
PTR Ch11EncLoss->*;
PTR Ch12EncLoss->*;

PTR Ch13EncLoss->*;
PTR Ch14EncLoss->*;
PTR Ch15EncLoss->*;
PTR Ch16EncLoss->*;



You can obviously delete the channels which you are not using. Remember to issue a save (MacroSlaveSave0) on the macro station to retain the assignments. Same on the PMAC side.
Thanks for the quick response.

I am probably missing something here but I struggled to get the ASCII mode to work.

I assume by in telnet you mean start a gpascii session first. I do this and try the MacroStation command on different station numbers getting:

stdin:4:1: error #50: MACRO COM TIMEOUT: MacroStation1

MacroStation Closed
stdin:5:1: error #0: Msg 0: MacroStation0

I found another post which included the following:

I11=1 (or STN=1)
// You should then see MacroStation Closed Error #0. This is normal
// Now you can talk to the first Macro Station through MacroStation1
// Using MacroStation1, set MI996=$FC00C, enabling nodes 2 and 3

I have no idea what this is doing but it appeared to work. I could then follow your instructions and got the MM vars to detect the encloss perfectly, thanks!

However, I am worried there is a potential problem with this method as I issued the commands to get the readings in the IDE (as one command):

MacroSlaveRead0,MM1,p1 MacroSlaveRead0,MM1,p2 MacroSlaveRead0,MM1,p3 MacroSlaveRead0,MM1,p4 MacroSlaveRead0,MM1,p5 MacroSlaveRead0,MM1,p6 MacroSlaveRead0,MM1,p7 MacroSlaveRead0,MM1,p8 MacroSlaveRead0,MM1,p9 MacroSlaveRead0,MM1,p10 MacroSlaveRead0,MM1,p11 MacroSlaveRead0,MM1,p12 MacroSlaveRead0,MM1,p13 MacroSlaveRead0,MM1,p14 MacroSlaveRead0,MM1,p15 MacroSlaveRead0,MM1,p16
Command: MacroSlaveRead0,MM1,p1 MacroSlaveRead0,MM1,p2 MacroSlaveRead0,MM1,p3 MacroSlaveRead0,MM1,p4 MacroSlaveRead0,MM1,p5 MacroSlaveRead0,MM1,p6 MacroSlaveRead0,MM1,p7 MacroSlaveRead0,MM1,p8 MacroSlaveRead0,MM1,p9 MacroSlaveRead0,MM1,p10 MacroSlaveRead0,MM1,p11 MacroSlaveRead0,MM1,p12 MacroSlaveRead0,MM1,p13 MacroSlaveRead0,MM1,p14 MacroSlaveRead0,MM1,p15 MacroSlaveRead0,MM1,p16 Response 0 chars in 17.7664 msec

I need to check whether 18ms is acceptable as we use these flags for safety to kill motors (if an encoder feedback channel breaks we have seen a motor fly off out of control, this could injure someone at the wrong place in our machine). I guess I would actually have to poll these at a reduced rate to avoid flooding the comms so I am fairly sure this will be unacceptable.

Am I right in thinking (if ASCII comms was working) I could maybe write a MACROPLCC to combine the flags into a word and then define a MACRO transfer (MI21 etc) to transfer the word to a register in an IO node (we have 3 registers spare). I am quite new to MACRO... I will try...

Thanks for your assistance
I tried writing a MACROPLCC but I failed. Typing in "open macplcc" gave "ERR003". Are there tutorials on this?
Page 59 of the MACRO 16 SRM gives some description about the MACPLCC. Keep in mind that you have to be communicating with the MACRO Station via MACRO ASCII first before you can issue this command (e.g. issue MacroStation1 for Macro Station 1 MACRO ASCII).
I had assumed that your station number was 1 (I11), but you did not have it numbered. MacroStation255 establishes ASCII with any station down the line that has not been assigned a station number.

I agree, that is a long time... Let me look into an alternatives.

Yes, I actually did that for Turbo initially then remembered that you are on Power PMAC. But unfortunately you currently can't send a PLCC to a MACRO station with Power PMAC. Maybe, you can load the PLCC using your Turbo PMAC and save it. attached, is what I did for Turbo.

I am going to have a talk with our firmware designers to find out what is the hold up on PLCCs and downloading ASCII files. We apologize for the inconvenience.

Attached Files
.pdf   How to access encoder loss bits from MACRO16.pdf (Size: 31.3 KB / Downloads: 11)
You could just use the compile only option of the PMAC executive (PRO2 Suite) to compile your MACPLCC to a.56K file and send that file over directly through the serial port (with HyperTerminal or equivalent) on the MACRO16 CPU (default BAUD is 38.4K with E3=no jumper, use a straight through DB9F to DB9M cable). You will need to edit the .56K file generated to remove all comments. I have tested this and it works well.

See picture below for tab in General Setup and Options, check Do not download:

Thanks for all the help. I have written a MACRO PLCC to combine the flags in one 16-bit word and downloaded successfully from a Turbo. Then I set up a node transfer of that word. It all works very nicely now it is set up.

I think until the PPMAC IDE can fully support talking to the MACRO card I can use this method. We have plenty of Turbo dev racks around to use.

It does however make the PPMAC rather disjointed and I would obviously prefer to be able to set up the MACROs from within the main project. I am currently setting up all the nodes and transfers in PLCs (using 'cmd "MacroSlave0, I21 = $65B810E9C0A4"' etc) and it would be nice to put this stuff there too (or a file in the project, but with targeting to particular stations...).

Hello Richard,

I'm detect Enc loss bit of ACC24E2A in MACRO16 with UMAC,and learning "How to access encoder loss bits from MACRO16.pdf ",Would you give me some detail operation of acheve Enc lost detect on MACRO16?

Because I had a problem of download of the MM varables and macroplcc,i had try something such as send CMD"MACSTA0" to open the ASCII mode of MACRO,but can't down that sucessfully.

daves and dzrong,

We do not have a TURBO station on hand to facilitate downloading these files, and frankly I'm not excited about using buffered commands (slow, as daves pointed out), and I'm unenthused regarding the limited MACRO support for PowerPMAC.

You might be interested to know what we're trying to get around this. We are using A/B Quadrature encoders with a PowerPMAC CPU Master station and a 16 Axis MACRO CPU with four Acc24E2A cards (sounds very similar to daves setup!). We've found that we can jumper the A+/- and B+/- signals to the T,U,V, and W user flag inputs on the 24E2A Encoder Input, which we can read in the Gate2[i].Macro[j][3] status word. The top four bits correspond to the TUVW flags, with which we can do our own AB-Quad pattern check at our servo update rate. I'm not sure if this is recommended practice, but so far it is working great.
sbondhus, see recent post:

How to retrieve Encoder Loss Bits from MACRO16_Power
(07-23-2014, 09:40 AM)Richard Wrote: sbondhus, see recent post:

How to retrieve Encoder Loss Bits from MACRO16_Power


I saw your post, but it looks like to follow that setup strategy we need to (1) use the latest firmware (not so much an option for our stage of development; we're likely going to stick with for this release), (2) use a Turbo PMAC (not an option), or (3) use the separate compile/download strategy suggested by steve.milici (seems to be more complicated and "disjointed" as daves pointed out). So far I don't see the benefit in any of those options over writing our own pattern check algorithm.

Forum Jump:

Users browsing this thread: 1 Guest(s)