Jump to content
OMRON Forums

steveneads

Members
  • Posts

    107
  • Joined

  • Last visited

Everything posted by steveneads

  1. I've had a few occasions recently where PowerPMAC has been behaving very oddly after downloading code and it's been apparent that code is not running correctly. My remedy has been to do a "clean" and re-download and save the code, and then to issue a $$$. On several occasions the reset has not happened and eventually the message "PowerPMAC reset failed" appears. What is happening? The only remedy then seems to be to repower the system - and then things seem to work normally again. Any ideas?
  2. Hi I need to write to specific M variables by number (M100...M105) from my C code. I found a way to do this using the following code: //set characters of the string instring[0] = 'M'; //M variable M100...M105 instring[1] = '1'; //1 instring[2] = '0'; //0 instring[3] = (char) (chan + 48); //write the final number (add the ascii number offset for the character 0) instring[4] = '\0'; //null terminator SetPmacNativeVar(cptr, 1); //set trigger variable for use by script code M100...M105 = 1 It works, but surely there must be a nicer way?
  3. The problem is that your integration mode uses DesVelZero as its trigger - so unless there's a way of giving it a band, I have no choise but to write my own code to toggle the state of the integration mode so that I can enable and disable the integrator depending upon "real" desired velocity.
  4. I have an application where the command to a motor comes from an analogue source. This is heavily filtered to remove noise. I noticed that my motor always had a following error even when the commanded position was constant - the integration mode is 1 - so it should only integrate when the desired velocity is zero. In fact, because the command comes from an analogue input, the desired velocity is never zero - it's very, very small and this is really fooling the integration logic. Is there any way to add a tolerance so that the DesVelZero shows true when below a small threshold instead of exactly zero? I could of course write my own code to change the integration mode on the fly if this is not possible.
  5. Please discount the comments below - except as a memory jogger to other users! I found that the problem was that I was setting Sys.WpKey = $AAAAAAAA too late in my code! Hi I have a pp_Startup.txt file which contains the following lines: UserAlgo.CFunc=1; enable plc 1; //initialise settings and start test control logic //system "/var/ftp/usrflash/Project/C Language/Background Programs/capp1.out" In my PLC 1, I have the line: Gate3[0].Chan[0].EncCtrl = 3; After power up or a $$$ I find repeatably that Gate3[0].Chan[0].EncCtrl = 7. It's not being set this way in my code (I've searched the whole project). I am pretty sure that PLC 1 does run during the startup as other value that it sets are correct. If I manually enable PLC 1 again, the value is set correctly to 3 as expected. It seems to me that something else is being run at startup after PLC 1 runs and this is resetting my value. Is this possible? Any suggesteions as to what to look for? Thanks.
  6. Hi I have a confusion over the correct prototype declaration for a user algo. My function "preProcessFeedback" is running as a "User Servo" for motor 0. It doesn't need to write to a DAC and in fact it's not doing an real motor calculations. I'm running it in the phase cycle with Motor[0].PhaseCtrl = 8, so that it can ruin before the ECT is processed. Originally my prototype for this function was: void preProcessFeedback(struct MotorData *Mptr); EXPORT_SYMBOL(preProcessFeedback); A colleague suggested that it should really be: double preProcessFeedback(struct MotorData *Mptr); EXPORT_SYMBOL(preProcessFeedback); With the latter declaration I added a "return 0" in the function. It seems that in either form the code works - but which is the correct thing to do - or does it matter at all?
  7. Hi Curt Yes, I had come to the conclusion that what you describe must be the case. It's difficult from the documentation to understand how much of the trajectory calculation is done by the axis code and how much is done by the motor code. Anyway, I've managed to do what I want by assigning a phantom motor to the axis. This is running a user written servo with basically no code in it, and all of the faults are disabled as you suggest. Thanks for confirming this.
  8. Hi Curt I would like to get the currently calculated output from a move being executed by a phantom axis, real-time each servo cycle. I tried using the register that you previously suggested: Coord[x].CdPos[j], but I now bevieve from the data that I've recorded that this is not the real-time command output but seems to be the end destination for the currently executing move. Where can I get the actual real-time value from when I don't have a motor attached to the axis? To be sure of my conclusion above, I recorded the Coord[x].CdPos[j] value for another axis which has an attached motor and also recorded the commanded input to the motor. The motor input was nicely blended whereas the axis output showed a sudden step at the start of the move. (I can send you the plot if you wish!). Thanks Steve
  9. Hi Charles Your reply has given me a clue to my misunderstanding. I had not appreciated the difference between running my user code as a "User Phase" with Motor[0].PhaseCtrl=1 or running the same code as a "User Servo" with Motor[0].PhaseCtrl=8. What I want to do is to run my user code in the phase interrupt without PPMAC performing any unnecessary background tasks that I don't need for this code. The code is processing information and inserting it into the ECT - so I want the code to run before the ECT is processed, but it's not controlling motors directly. Curt previously suggested running code in the phase interrupt to do this. Is running my code as a "User Servo" with Motor[0].PhaseCtrl=8 the right thing for me to do? Thanks.
  10. I'm running some code to pre-process data in the phase interrupt using Motor[0]. I have set Motor[0].PhaseCtrl=1 and used the "User servo setup" under "Realtime routines" in the IDE to select the C code that I've written. The code runs, but have I done all that I should do to ensure that unnecessary calculations are not being performed in the background? I don't really understand the meaning of Motor[0].PhaseCtrl when User Phase code has been chosen (for instance if I set Motor[0].PhaseCtrl=8, my code stops running). Can you clarify this please? When user code is set to run in the servo interrupt for Motor[x], the value of Motor[x].Ctrl is reported as UserAlgo.ServoCtrlAddr[x]. Is there an equivalent to this setting when user calculations are run in the phase? in my case with Motor[0] running user code in the phase, and the system reports Motor[0].Ctrl=Sys.ServoCtrl - which rather surprised me. Thanks Steve
  11. No, this does not seem to be the problem. It's not that the output is reversed - it's that there's no output at all. It seems to me that the 0D table no longer picks up the output of the first PID. Is this true?
  12. I'm running an application that uses a 0D compensation table to cascade loops. The first "PID" actually just passes through a position command - so it doesn't do any real loop closure - there is no feedback and all the gains except the proportional term are set to zero. I originally wrote the code to use "Sys.PidCtrl" to minimise unnecessary calculations in this process, and it works as expected. I read in the manual that there was an even simpler possibility for passing through position commands - "Sys.PosCtrl". However, when I change to this, the cascaded loop stops working. Is this to be expected - or have I forgotten something? Thanks Steve
  13. I'm running an application that uses a 0D compensation table to cascade loops. The first "PID" actually just passes through a position command - so it doesn't do any real loop closure - there is no feedback and all the gains except the proportional term are set to zero. I originally wrote the code to use "Sys.PidCtrl" to minimise unnecessary calculations in this process, and it works as expected. I read in the manual that there was an even simpler possibility for passing through position commands - "Sys.PosCtrl". However, when I change to this, the cascaded loop stops working. Is this to be expected - or have I forgotten something? Thanks Steve
  14. If I define a phantom axis for trajectory calculation purposes that has no motors associated with it, where is the trajectory output written to? I'd normally get this from the motor command register - but if there's no motor... Also, on a slightly related topic, does an Axis (phantom or otherwise) create much computational load when moves are not actually being commanded on that axis (ie moves just being sent to other axes in the same coordinate system, and this axis holding position). I can't find much in the manuals on these topics, and I'd like to understand them better in order to make the right design decisions. Thanks Steve
  15. If I define a phantom axis for trajectory calculation purposes that has no motors associated with it, where is the trajectory output written to? I'd normally get this from the motor command register - but if there's no motor... Also, on a slightly related topic, does an Axis (phantom or otherwise) create much computational load when moves are not actually being commanded on that axis (ie moves just being sent to other axes in the same coordinate system, and this axis holding position). I can't find much in the manuals on these topics, and I'd like to understand them better in order to make the right design decisions. Thanks Steve
  16. I too would like a method to reverse the direction of a motor in software. My application is somewhat unusual in that the machine can be installed by the operator in 2 different orientations and it is necessary to change the polarity depending upon the chosen orientation (and it's not possible to change the wiring each time!). Currently in UMAC I do this by changing the decode control from 3 to 7 (or vice versa) and changing the proportional gain to a negative value. This has worked fine in the past for me. However, as I understand it in PPMAC, the proportional gain no longer scales all of the other gains, so simply changing this one term is no longer possible. It seems to me very undesirable to flip all of the gains (there are so many that it would be easy to forget something). Surely there should be some simple way to do this?
  17. Hello I believe that I've come across something that seems rather badly broken! I've been struggling for a day to make the move time correct when running in spline mode. In my code, I start with one move time and then after some moves change to another move time. The trouble is that this does not work as it's described in the manual. //spline (brMoveTime); // set spline mode with standard move time for increased smoothness was (TM 10 in UMAC) spline 1; // set spline mode for increased smoothness with 1 mSec move time for rapid response to trigger brPosition = 0; //wait for start trigger--------------------------------------------------------------------------------------------------------------------- while ((Acc68E[0].DataReg[0].7.1 == 0) || !(brPreProcessingDone)) //;hold here until button 8 is pressed (start button) (and test pre-processing complete) { W (brPosition); brSteps = brSteps - 1; //debug } while (1 > 0) //keep looping { if (brPosition > 1500) { incr = -1; spline (brMoveTime / 2); //move back at double speed // spline (brMoveTime / 2); //move back at double speed // spline (brMoveTime / 2); //move back at double speed } else if (brPosition < 1) { incr = 1; spline (brMoveTime); //move forwards at normal speed // spline (brMoveTime); //move forwards at normal speed // spline (brMoveTime); //move forwards at normal speed } brPosition += incr; W (brPosition); } In the code example above, the motor is held in a while loop doing zero moves with "spline 1" setting until a digital signal is received, at which point it moves to the second while loop. The first time into this loop, the move time is changed by "spline (brMoveTime)". This does not work. When brPosition reaches 1500, the move time is changed again to "spline (brMoveTime/2)". This also does not work. When the command reaches 0, the move time is changed for the third time by "spline (brMoveTime)" - and this time it finally changes the speed of the motor. When we look at Coord[2].T0Spline, Coord[2].T1Spline, Coord[2].T2Spline in the watch window, we can see that each time a new spline command is issued, only one of these takes the new value, and the previous values drop down through the list. The manual states: "The most common use of the spline mode utilizes the declaration of a single spline segment time with the simplest form of this command: spline{data}. In this form, all of the spline segments use the same time value. This case creates a “uniform” B-spline, and is explained in the “Uniform-Time Calculations” section below." This is not happening. If I change my code by uncommenting the repeat "Spline commands" shown above - the motor speed change takes place as expected. In conclusion, either the firmware is broken or the manual is wrong! Please verify and advise.
  18. Hi Curt Thanks for clarifying this - I was beginning to think that we had a big problem - but if we are still able to do what we've done in the past - that's great! Steve
  19. Hi Charles I think that the problem is - there's no DAC fitted! I'm so used to UMAC systems that I didn't realise that you ship Gate3 boards with only 1 DAC per channel. Can you confirm that if my motor is only using DacA, then I can control DacB (if it's fitted) from a PLC by writing to i.io:$900044.0.32, in the same manner that I've done for years with UMAC with a Gate2 board?
  20. Hi In my application I need to use the spare DACs that aren't being used for motors for general purpose analogue outputs. I'm currently working with a DeltaTau simulator rack and am trying to use the second DAC associated with channel 0 (it's a Gate3 Acc24 card). I've generated the following variables: ptr DAC1->i.io:$900040.0.32; //1st DAC ptr DAC1c->i.io:$900044.0.32; //2nd DAC When I close the loop on motor 1, I can see suitable values in DAC1 and measure the voltage on the connector pins. If I write a value to DAC1c from the terminal window, I can see this reported correctly in a watch window - but I can't see any voltage on the connector pin (I think that I have the right one). Am I doing the wrong thing here - or might I have missed something that needs setting up before this will work? Thanks Steve
  21. Hi Curt Thanks for your comments - it's nice to have this clarified, and I'll keep this in mind. Steve
  22. Hi Curt For me the issue is your statement: "In the Script environment, the complexity of the read-modify-write sequence is often hidden from you. If you write to a "partial-word" data structure element or "partial-word" user-defined M-variable, this action automatically incorporates a read-modify-write operation (that is interruptible)." What is a "partial-word" in your terminology in this statement, is a word 32 bits? I presume that PPMAC is a 32 bit processor? Is my time critical code going to run faster if I only define M variables in USHM as 32 bits wherever possible? Where are the 64 bit registers in PPMAC that your user had problems with? - I've only spotted 32 bit addresses. Thanks
×
×
  • Create New...