Jump to content
OMRON Forums

maartenvervelde

Members
  • Posts

    44
  • Joined

  • Last visited

Posts posted by maartenvervelde

  1. When I try to use the cygwin terminal to makt the servo loop, I get the error:

    make[1]: powerpc-405-linux-gnu-gcc: Command not found

     

    Do I have to make my own cross compiler or is there a way to link the crosscompiler from Delta Tau to the terminal?

     

    Also, when I try to run the make all command, I get some error because the paths to the files contain spaces. I'm fixing this right now by giving the full path on my C:/, but thats not a usefull option if I want to use it to create programs, is there a way to fix that?

     

    Making your own makefile is not the way most Delta Tau users use the software, so it is up to you if you want to pursue that path or not. I have used my own makefiles for many years, but I also don't use the IDE so I don't have to code in Windows!

     

    I do recall that the IDE regenerates the makefiles during each compile, but I don't know if there is a way to suppress this or add your own includes into the auto-generated makefile via the IDE. Someone who is more familiar with the IDE will have to answer this question.

     

    For now, you could use the auto-generated makefile as a starting place and simply change the include statement to point to the correct folder. To do this you will need to compile (in the IDE), let it fail, then modify the makefile, then manually compile from the cygwin bash shell by issuing 'make all'.

  2. Thank you for your response.

     

    I am trying to make a makefile myself for the power brick to compile it with the correct header.

     

    I also found the makefile used by the IDE, but it is generated every time the program is build. Is there a way to change the code generation to include the other files, or should I just keep on focussing on making my own makefile?

     

    I am using kmalloc in one of my kernel modules, so this definitely can be done. I am #include'ing to get the GFP_KERNEL flag, but I am also compiling with my own makefile outside of the IDE.

     

    All of the errors except the first are caused by the compiler failing to find linux/mmzone.h, which defines the macros that you are missing. It looks like it is grabbing the wrong linux/gfp.h. For the user servo code, you want:

     

    "\opt\eldk-4.2\debian_rootfs\usr\src\\include\linux\gfp.h"

     

    Instead, the IDE is including:

    "\usr\local\powerpc-405-linux-gnu\sys-include\linux\gfp.h"

     

    I don't know if there is a way to fix this other than manually editing the makefile. Perhaps someone else knows?

  3. Hi,

     

    I want to use the kmalloc funtion in my own user servo algorithm but the compiler can't find the flags. When I try to call it like this: (struct variable*)kmalloc(sizeof (struct variables), GFP_KERNEL); the compiler says that GFP_KERNEL undefined is.

     

    It should be defined because it should be included already.

    I tried to include linux/gfp.h but then I got the following errors.

    user_servo.c(28,0): Warning : in file included from user_servo.c
    usr\local\bin\..\lib\gcc\powerpc-405-linux-gnu\4.2.2\..\..\..\..\powerpc-405-linux-gnu\sys-include\linux\gfp.h(4,0): Error :  linux/mmzone.h
    user_servo.c(28,0): Warning : in file included from  user_servo.c
    usr\local\bin\..\lib\gcc\powerpc-405-linux-gnu\4.2.2\..\..\..\..\powerpc-405-linux-gnu\sys-include\linux\gfp.h(89,0): Error :  'MAX_ORDER' undeclared (first use in this function)
    usr\local\bin\..\lib\gcc\powerpc-405-linux-gnu\4.2.2\..\..\..\..\powerpc-405-linux-gnu\sys-include\linux\gfp.h(89,0): Error :  (Each undeclared identifier is reported only once
    usr\local\bin\..\lib\gcc\powerpc-405-linux-gnu\4.2.2\..\..\..\..\powerpc-405-linux-gnu\sys-include\linux\gfp.h(89,0): Error :  for each function it appears in.)
    usr\local\bin\..\lib\gcc\powerpc-405-linux-gnu\4.2.2\..\..\..\..\powerpc-405-linux-gnu\sys-include\linux\gfp.h(93,0): Error :  invalid type argument of '->'
    usr\local\bin\..\lib\gcc\powerpc-405-linux-gnu\4.2.2\..\..\..\..\powerpc-405-linux-gnu\sys-include\linux\gfp.h(93,0): Error :  'GFP_ZONEMASK' undeclared (first use in this function)
    

  4. This is a bit confusing because C++ is a superset of C. Does your existing c++ code make use of a lot of "C++ ONLY" features such as objects/classes and function/operator overloading, passing by reference, etc? If so then you will have to port it to straight C.

     

    The file I was trying it with was using a class in which almost everything happend so I have to rewrite it to C. I just made a struct with all the variables the class had and passed a pointer to that to al the functions so they could use the variables and change them, and the changes would be also changed within the other functions.

     

    In the S function I put the struct pointer in a PWork vector to use it between the update and the output function and so I could save it between steps.

  5. Within the IDE, we only support C code across the board, but you can compile c++ code outside of the IDE for the background C Programs. The user servo algorithms are strictly C, since they are running in kernel space so you can not use c++ for the servo algorithms. we also use Matlab and embedded coder to generate c files for custom servo algorithms. Can you generate c instead of c++?

     

    I have a servo loop in C code, and I have it working. The problem is the S Functions. We already have a lot of code written in C++ which we want to implement in the model. In the generated code the are called as functions which they get from the .c file and the .h file I added to the realtime routine folder.

     

    What you're saying is that you cant use c++ functions in that way?

  6. Hi,

     

    I'm trying to make an HMI in visual studio using ssh. I'm using the ssh.net library but I have a problem using gpascii. Becasue it is a program which keeps running, it wont return a value because its never finished.

     

    What is the best way to use gpascii through C# in the same way you can use it in PuTTY or the IDE?

  7. The “Realtime Routines” folder can have only one “.c” file. You add routines to this file through the IDE. See the section in the IDE manual under “ASSOCIATING MOTORS WITH USER-WRITTEN SERVO AND PHASE ALGORITHMS” starting on page 213 (219 electronic). Basically you will add the code you have in your “.cpp” files to your newly added routines.

    "http://forums.deltatau.com/filedepot/download.php?f=Power PMAC/Manuals/Power PMAC IDE.pdf"

     

    I already have a working user servo algorithm, but the problem is that I want to use S-Functions created from C++ in the servo algorithm. I have done it with C code, and you need to add the C file and the header file to the realtime routines. Is there a different way to use C++ S functions that are not fully inlined?

  8. Hi,

     

    I have a servo loop in which I use S functions. S Functions from C files are no problem, because you can include the .c and .h file in the realtime routines folder.

    Now I have a .cpp file in which I have code. I made a function in the file which is extern "C" so it could be called from the C code of the servo loop. But the problem I have now, is that I can't add the .cpp file to the folder. Is there a way to include the code from cpp file, because the compiler in the ide is a GNU C/C++ crosscompiler and I would suspect it would be possible to compile it?

     

    Maarten

  9. Is it possible to access the data from the nodes from EtherCAT and a MACRO Ring.

    We want to make a program that doesn't rely on any programming in the IDE, only in Simulink. So we wondered if we could reach the data from Simulink like you can access the other motors through the pshm. I checked the RtGpShm.h but I couldn't find anything for Ethercat or Marco ring (I admit I didn't look really long).

     

    What would work the best and why?

  10. I think I found what I did wrong.

    I just checked the serial number of the Power Brick I have, and it says that I only have 1A/3A amplifier, and in the settings I filled in it was 5A/15A.

    I taught it was a 5A/15A amplifier because I looked at the power brick lv user manual and it said on page 24 that an amplifier without a indicator was a 5A/15A amplifier.

    I have no indicator on all of my amplifiers. I had it running for 5 minutes now without an I2t fault, so that was probably it.

  11. I figured out my mistake, I did not pay attention that the unit was 5A/15A. So the numbers all make sense. That being eliminated can you monitor the value in Motor[].PhasePos and see if it ever becomes other than zero.

     

    Motor[1].PhasePos remains 0 the entire time.

    I still get the I2tFault, and even then value doesnt change

     

    Coord[1].AmpFault=1 @ 21-9-2015 13:35:22

    Coord[1].I2tFault=1 @ 21-9-2015 13:35:22

    Motor[1].AmpFault=1 @ 21-9-2015 13:35:22

    Motor[1].I2tFault=1 @ 21-9-2015 13:35:22

  12. In the other post about this subject Richard asked these questions.

     

    I assume that you are referring to the firmware I2T fault. Correct?

    What are the motor's continuous and peak current specifications (RMS)? Is the amp 5/15A?

    What are your I2T settings? These are the PPmac structures.

     

    Motor[x].I2tSet

    Motor[x].I2tTrip

    Motor[x].MaxDac

     

    It would be helpful to get this data from you.

     

    I assume that you are referring to the firmware I2T fault. Correct?

    Yes, the one in the IDE

     

    What are the motor's continuous and peak current specifications (RMS)?

    All I know are the continuous and peak current in Amps, there is no datasheet for the motor so I can't find it.

     

    Is the amp 5/15A?

    Yes, it is

     

    What are your I2T settings? These are the PPmac structures.

    Motor[x].I2tSet = 684.50446

    Motor[x].I2tTrip = 21083212

    Motor[x].MaxDac = 2737.9341

     

    The Max Dac is limited to 2700 in my control loop.

  13. Hi,

     

    I have written a program which moves my motor for 0 mu to 30000 mu and back.

    Nothing else is happening, but when I keep it on for approximately 1-2 minutes, it gets an I2T fault.

    This is what I get.

     

    Coord[1].AmpFault=1 @ 17-9-2015 14:29:58

    Coord[1].I2tFault=1 @ 17-9-2015 14:29:58

    Motor[1].AmpFault=1 @ 17-9-2015 14:29:58

    Motor[1].I2tFault=1 @ 17-9-2015 14:29:58

     

    I watched the power supply when it happend and the amps were while moving about 0.1 amps and on the start of the move about 0.4 amps.

    The specs of my motor are:

    Continuous current: 0.5 amps

    Instantaneous Current: 2 Amps

    Max time allowed: 3 secs

    To me it looks like it shouldn't happen. Is it something within I2t that calculates the max time it is allowed betweens continuous an max amps when it happens more often?

     

    Maarten

  14. Find out what Motor[].Ctrl answers back in the IDE terminal window. If it answer something like UserAlgo.ServoCtrlAddr[] then the text in the IDE is wrong. But if you get Sys.ServoCtrl then you either did not do the setup correctly or have the IDE version with the bug that it does not configure the user servo correctly. So other question is what IDE version do you have?

     

    The error was that I forgot to add 2 more files to the Realtime Routines folder. Those were located in C:\Program Files\MATLAB\R2015a\simulink\include.

    I didn't notice that the build failed but it was indicated so it was my fault.

     

    Thanks for your suggestions

  15. I made a custom servo algorithm in Simulink with the ppmac target library. I generated code and got 4 files:

    PIDController.c

    PIDController.h

    PIDController_private.h

    PIDController_types.h

     

    Following the guide, I added those files in the Realtime routines folder in the Power PMac IDE. Then I chose the user servo in the user servo setup for motor 1, but when I go to the tuning window of the IDE, I still get Servo Algorithm: standard.

    Is the text not updated or am I doing something wrong?

     

    Maarten

  16. Is this a brush motor?

    If you're not able to use the system setup successfully then I suggest following the step by step motor setup in the manual.

     

    Yes it is a brush motor, but when I use the step by step motor setup, I still get an amplifier fault when the motor runs.

     

    If I turn the safety off it works, so I guess the safety turns the amp off in prevention of overheating, but I filled out the values of the motor correctly and it doesn't heat up or anything when I run it for a while without protection

  17. The 7-segment has a solid dot, so The power brick says its working fine. I haven't changed the amp fault polarity, but i haven't jumered the global abort. When I set sys.pAbortAll to 0, I try the detect current sensor detection is fails and says:

     

    The PWM outputs of the amplifier don't match the ADC feedback lines!

    I guess ADC is for analog feedback but this motor doesn't have it, it has an encoder. Can I disable it?

     

    The last test: Measure DAC bias value returns an error with this:

    Motor[1].PhaseCtrl=4 is not supported.

  18. This is my first time working with a power brick LV and when I'm tuning the motor, I immediately get an amp fault and hardware limit whem I accept the hardware interface.

     

    I filled out the specs of the motor with educated guessing because the company doesn't have any documentation on the motors.

     

    What could be the problem?

×
×
  • Create New...