Jump to content
OMRON Forums

maartenvervelde

Members
  • Posts

    44
  • Joined

  • Last visited

Posts posted by maartenvervelde

  1. Hello,

     

    I'm am using a DC brush motor to test some things, and I am using my own

    PID controller made in Simulink. Now I want to use a random number generator to tune the system, but when I add the random number generator in Simulink, the motor starts to move a lot slower with exactly the same setting. The rng is only conencted to an unused P variable so that is not the problem. I checked if the systems misses loops of the control algorithm, but he never misses one. In the taskmanager I see that the servo interrupt does not even use all the time allocated for it. I don't know where it could go wrong.

     

    In the attached photo, you can see the difference in speed. Everything is exactly the same, except for the rng.

    A different problem I notice, is that the gpascii is not as responsive as it should be. I'm using it through SSH, but to change variables used in the control algorithm I have to send the message multiple times before it works.

    245099417_SpeedDifference.thumb.png.39f2b967594325af6c0b5907fc3bbe09.png

  2. Hi,

     

    I'm running my own servo loop with setpoint generator, and because I choose the destination position from the P variable TarPos and not from Motor[1].DesPos, the following error does not work normaly. Now I change Motor[1].MasterPos to the output of my setpoint generator before the PID controller to keep the following error correct. This works when I keep changing the value of Motor[1].DesPos to the value of Motor[1].ActPos.

    Now I have a correctly working following error, but I have a problem.

     

    Sometimes when I run my program and the motor is on the correct position (ActPos == DesPos && ActPos == TarPos), I still get a following error.

    The Power Pmac User Manual says:

    Motor[x].PosError = Following error (DesPos – ActPos)

    But changing MasterPos changes the result in the following error.

    So I would like to know what the calculation is for the following error, so I can check the other values in my program which change the final value.

  3. What I want is to use the analog sensor data with the same offset as preferably motor[0], or the same offset everytime I use it. This is not possible now because Motor[1] uses the position it had before changing the encoders as an offset for the analog encoder.

     

    In pp_startup.txt this happens.

     

    EncTable[41].type = 1
    EncTable[41].pEnc = PowerBrick[0].Chan[0].AdcAmp[2].a
    EncTable[41].pEnc1 = PowerBrick[0].Chan[0].AdcAmp[2].a
    EncTable[41].Index1 = 64
    EncTable[41].Index2 = 166
    EncTable[41].Index4 = 2
    EncTable[41].ScaleFactor = 1/2097152
    
    motor[0].servoctrl=1
    motor[0].phasectrl=0
    motor[0].penc = encTable[41].a
    motor[0].penc2 = encTable[41].a
    

     

    This makes sure that the the encoder is set up properly and that it is being used by motor[0]. I use Motor[0].ActPos to calculate some things and when I change the encoder, I would like to use the same values for Motor[1].

     

    What would help is the possibility to just use the analog value the encoder returns and work with that, or a way to change the current position.

     

     

    I tried the hmz approach and that might be usefull, but the problem I have with that, is that the value in the position window changes, but the value of Motor[1].ActPos doesn't. This results in not being able to use the sensor because I use the Motor[1].ActPos value to calculate the movements.

  4. Hi,

     

    I'm trying to change the encoders of my motor while running my system.

    Changing the encoder works now with the following code:

     

    pshm->Motor[1].pEnc = (void *) ((int)(&pshm->EncTable[41]) - (OffsetSHM << 2));

    pshm->Motor[1].pEnc2 = (void *) ((int)(&pshm->EncTable[41]) - (OffsetSHM << 2));

     

    But the problem is that the abolute encoder continues on the value the incremental encoder left it. So if the encoders are changed when the incremental encoder is at position 1000, the absolute encoder will register the position between 500 and 1500. I want to use the value that the encoder directly gives.

     

    When I try to change the position to the position of motor[0] (because that has the same encoder to check where it should be) like this:

     

    pshm->Motor[1].Pos = pshm->Motor[0].ActPos;

     

    i get a following error. What would be the correct way to change the position of the motor to the position of motor[0].

     

    Maarten

  5. I have figured out what the error was. In the global defenition file I made a global variable named state. This wasn't allowed apparently, so it gave those errors.

     

    I tried the different models of the servo loop in the same project so the global variable remained there. That is also why the old projects worked, but the new project I tried it on didn't, because I copied the list directly.

  6. The problem is that I don't control the motor using the jog commands. I used those commands to test the setpoint generator capabilities and the motor limits. I control the motor from a custom servo loop through the Mptr->ServoOut variable. Is there a way to make a setpoint generator for that?
  7. It doesn't work if I replace #include with #include

     

    The include part of the file is this:

     

    //===========================FOR Power PMAC======================================
    #ifdef __KERNEL__
    #include 
    #else
    #define EXPORT_SYMBOL(x)                                         // x
    #define KERN_ALERT
    #define printk                         printf
    #include 
    #endif
    
    #include                    // Global Rt/Gp Externals and structures
    #include 
    #include "../Include/pp_proj.h"
    
    //================================================================================
    #ifndef RTW_HEADER_Controlloopdt_Analog_h_
    #define RTW_HEADER_Controlloopdt_Analog_h_
    #include 
    #ifndef Controlloopdt_Analog_COMMON_INCLUDES_
    # define Controlloopdt_Analog_COMMON_INCLUDES_
    #include "rtwtypes.h"
    #endif                                 /* Controlloopdt_Analog_COMMON_INCLUDES_ */
    
    #include "Controlloopdt_Analog_types.h"
    

     

    If I build it like that with the #include there, I get 33 errors and 18 warnings.

     

    When I replace #include with #include , I get 136 errors and 564 warnings.

     

    A lot of the errors are in types.h and RtGpShm.h

     

    The files that create only a couple errors are:

    - ethercat.h

    - in.h

    - int-ll64.h

    - ipc.h

    - pthread.h

    - pthreadtypes.h

    - stat.h

    - stdint.h

  8. Hi,

     

    Yesterday when I was working with the Power Brick LV, suddenly my own servo loops wouldn't compile anymore. The errors are in files which I did nothing to, namely: RtGpShm.h and ethercat.h. I don't even use EtherCAT.

     

    I tried to make new servo loop model in Simulink to see if the error was in my model. The model I have now is very simple, as you can see in the attachment.

     

    The errors I get are:

     

    ------ Build started: Project: AnalogSensor2(192.168.0.200:PowerPC,460EX), Configuration: Debug Any CPU ------
    Please wait while uploading Libraries from Power Pmac.
    Libraries Uploaded successfully
    Please wait while Executing Project Script.
    Please wait while mapping Power PMAC variables.
    End of syncing the database.
    PMAC variables are mapped successfully.
    	Build Process For capp1.out has started.
    	Build Process For capp1.out has ended.
    
    	Build Process For libplcc1.so has started.
    	Build Process For libplcc1.so has ended.
    
    	Build Process For usralgo.ko has started.
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(42,0): Warning : in file included from  /usr/local/dtlibs/rtpmac/RtGpShm.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.h(27,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.c(25,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.c
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\ethercat.h(111,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\ethercat.h(112,0): Error :  expected ';' before 'ec_slave_config_t'
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.h(27,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.c(25,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.c
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2201,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2202,0): Error :  expected ';' before 'short'
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2635,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2636,0): Error :  expected ';' before 'enum'
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2653,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2654,0): Error :  expected ';' before 'int'
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2833,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2834,0): Error :  expected ';' before 'unsigned'
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\powerpc-405-linux-gnu\include\string.h(26,0): Warning : in file included from  /usr/local/powerpc-405-linux-gnu/include/string.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.h(34,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.c(25,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.c
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\powerpc-405-linux-gnu\include\features.h(265,0): Warning :  "_FORTIFY_SOURCE" is not defined
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\powerpc-405-linux-gnu\include\string.h(417,0): Warning : in file included from  /usr/local/powerpc-405-linux-gnu/include/string.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.h(34,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.c(25,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.c
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\powerpc-405-linux-gnu\include\bits\string2.h(50,0): Warning :  "_STRING_ARCH_unaligned" is not defined
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.h(34,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.c(25,0): Warning : in file included from  /cygdrive/c/Projects/PMAC_P~1/ANALOG~2/ANALOG~1/CLANGU~1/REALTI~1/test.c
    C:\Projects\PMAC_P~1\ANALOG~2\ANALOG~1\CLANGU~1\REALTI~1\\\usr\local\powerpc-405-linux-gnu\include\string.h(420,0): Warning :  "__USE_FORTIFY_LEVEL" is not defined
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\test.c(137,0): Error :  too few arguments to function 'test_step'
    	Build Process For usralgo.ko has ended.
    
    	Build Process For usralgo.so has started.
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(42,0): Warning : in file included from  /usr/local/dtlibs/rtpmac/RtGpShm.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\libppmac\gplib.h(31,0): Warning : in file included from  /usr/local/dtlibs/libppmac/gplib.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\test.h(24,0): Warning : in file included from  test.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\test.c(25,0): Warning : in file included from  test.c
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\ethercat.h(111,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\ethercat.h(112,0): Error :  expected ';' before 'ec_slave_config_t'
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\libppmac\gplib.h(31,0): Warning : in file included from  /usr/local/dtlibs/libppmac/gplib.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\test.h(24,0): Warning : in file included from  test.h
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\test.c(25,0): Warning : in file included from  test.c
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2201,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2202,0): Error :  expected ';' before 'short'
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2635,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2636,0): Error :  expected ';' before 'enum'
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2653,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2654,0): Error :  expected ';' before 'int'
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2833,0): Error :  expected identifier or '(' before numeric constant
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\\usr\local\dtlibs\rtpmac\RtGpShm.h(2834,0): Error :  expected ';' before 'unsigned'
    C:\Projects\Pmac_Projects\AnalogSensor2\AnalogSensor2\C Language\Realtime Routines\\test.c(137,0): Error :  too few arguments to function 'test_step'
    	Build Process For usralgo.so has ended.
    
    Done building project "AnalogSensor2.ppproj" -- FAILED.
    
    Build FAILED.
    Project Building and Mapping total time = 11.544 sec
    ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
    

     

    I have an old project in which I use the same include and that project builds correctly so the file is not corrupted. What could be the problem?

    Screenshot_1.png.f337df0c1c7183103e827958fefba897.png

  9. We don't use the standard funtionality to run the motor, we set a p variable and in the Simulink model we changed the Motor[x].DesPos to the P variable. This means we are not using motion control programs written in the Delta Tau language. What we want is a setpoint generator who will work whatever the motor is doing.
  10. Hi Charles,

     

    What I'm trying to do is test if I can switch the encoder of the motor to a different one. We will need to do this later on in real projects so I'm trying to figure out how it works.

     

    The motor is a DC brush motor which has a quadrature encoder connected to it. I can run it with the quadrature encoder on it when I'm using a jog command like #1j=1000. Now I want to use the analog encoder to move the motor to a specific location. The analog encoder can only give a distance from itself to the wheel, which will result in a value between about 4000 and 31000. The attached pictures show the set-up of the motor with the analog sensor.

     

    I don't think the direct microstepping is going to work, because it is a DC brush motor.

     

    Is it only possible to move brushless, stepper and AC induction motors without an encoder which directly returns the location of the motor, or are there other ways to do it? This is a crucial part of our implementation, so it would be great if we could use your software for it.

     

     

    Also when I try to use the analog sensor to close the loop, it doesn't hold stil when I enable the closed loop, it starts to run as you can see on the graph. There is a bit of noise on the signal, but I don't think it is enough to cause the motor to go this fast and uncontrolled. What could cause this?

     

    Maarten

    img_20151201_091408.thumb.jpg.3b25dbabbd4f47de38033c4ed9de4652.jpg

    img_20151201_091415.thumb.jpg.40f9b2f3eb4b9aa98266bfce37c3aca1.jpg

    rsz_graph_enable_closed_loop.png.b3d3445e4871b3fb24677e277007281e.png

  11. I have a motor with a wheel on it which isn't centered. I have an analog sensor which can see the distance to the wheel and gives 0-10 V as output. What is the best way to use the sensor, because now i have it set up in the ECT with type 1, Single 32-bit register read. The value I get is is about 5000 - 32000, and it changes with the distance of the wheel to the sensor.

     

    The sensor can't see the direction the wheel is going by only the distance. The value it displays loops between the two values, so I can't use the jog command to go to a specific location. Is there a way to control a motor without a sensor giving a direct location of the motor back, like sending direct voltage to the motor to turn it?

  12. Now I have the jog command working with the setpoint generator so the motor accelerates in an S-Curve, and not in a straight line, by setting the Motor[1].JogSpeed, Motor[1].Jogta and Motor[1].Jogts variables.

     

    Now I want to limit the motor completely because I run my motor from the servo loop and get the value where to go to from a P variable. I can limit the speed of the motor by changing the value of Motor[1].Pwmsf to a lower value, but that does not work good enough, because the load on the motor is not evenly spread, so it can't get past a certain part if it's to low, but when it is high enough to get past it, it goes to fast and the load starts shaking.

     

    Is there a way to limit the acceleration, the jerk and the max speed on the motor for the servo loop, what are the variables I should change?

  13. The motor is a Maxon motor DC brush motor. I don't have any specs on it, they are nowhere to be found so I estimated the values on which it works now. It is connected to the Power Brick LV 1/3A amplifier. The encoder is a simple quadrature encoder also connected to the power brick LV on a standard encoder connector. I use direct PWM to send commands to the motor.

     

    My own servo algorithm is a very simple one, just to try it out. It currently looks like this. http://imgur.com/lomZSJy

     

    With the virtual motor I meant that I created a new motor in the system setup where I set the values lower than needed from the start. I than assigned it to a different motor number, Motor[2]. I ran the same test as Motor[2], but the results were the same.

  14. Hi,

     

    Currently I'm using a DC brush motor which I initialized through the system setup. It is working without a problem. I heard that the IDE should calculate setpoints when the motor is correctly initialized. I tried to check if it was working so I changed the value of nominal RPM from 3000 to 3, and the maximal RPM from 5000 to 5. The results were that the motor changed nothing. I ran the jog command #1j=100000 before the change and after, and the results were identical.

     

    I also tried changing the maximal voltage from 24 to 1, and it still gave the same output. When I normaly put 1V on it, there is no movement.

     

    I also tried to make a new virtual motor with the lower values, but I still got the same result.

     

    Is it because I'm running my own PID controller, some other problem I didn't see, or is it a bug in the system?

     

    Maarten

  15. I tried the thing Charles said, but I didn't see a file anywhere on the file system. When I looked further I saw this on the forum:

     

    Currently the only customer supported usage is:

    gather_csv [-u] [filename]

     

    The “-u” will stream the contents of the most recent data gather to the standard output as in the current SSH, Telnet or serial port connection. The “-u” with a file name will stream it to that file. I would suggest using the “/var/ftp/usrflash/” directory as this is already writable and will allow ftp uploads without any permission changes. For example:

    gather_csv -u /var/ftp/usrflash/steve

     

    This puts the last gathered data in a text file named “steve” in the “/var/ftp/usrflash/” directory where you now have ftp access.

     

    Keep in mind the gather files can be very large.

     

    This is the only thing I could find about how to use the gathered data. This was a while ago so I dont know if there are different way to do this now.

     

    Than I found this tutorial you made to gather data using a capp.

     

    The Gather Buffer is just a series of bytes so to access the Gather Buffer Data from a C App you must know what type of variables you gathered. Then you can access the buffer directly and offset your pointer the correct number of bytes for each element that was gathered.

     

     

    pGatherBuffer = (char *)(pSharedMem->Gather.Buffer);

    samples = pSharedMem->Gather.Index;

    *timeConstant = 0.0;

     

    fpGather = fopen ("/var/ftp/gather/autotune_gather.txt", "w");

     

     

    //--------------------------------------------------------------------------

    // Read in gathered data and compute the following error and min max

    // following error

    //--------------------------------------------------------------------------

    for (i = 0; i < samples; i++)

    {

    memcpy(&t, (unsigned char*)pGatherBuffer, sizeof(unsigned));

    pGatherBuffer += sizeof(unsigned);

    memcpy(&cmdpos,(unsigned char*) pGatherBuffer, sizeof(double));

    pGatherBuffer += sizeof(double);

    memcpy(&actpos, (unsigned char*)pGatherBuffer, sizeof(double));

    pGatherBuffer += sizeof(double);

    memcpy(&dac, (unsigned char*)pGatherBuffer, sizeof(float));

    pGatherBuffer += sizeof(float);

    fprintf(fpGather, "%u %lf %lf %lf\r\n", time, cmdpos, actpos, dac);

    }

    fclose(fpGather);

     

     

    That was why I tried it in a capp.

    If there is a way without it I would be thrilled, but the way Charles explained it, didn't work for me.

  16. Hi,

     

    I'm trying to make a gather function that keeps on running and adding the data to a txt file. The code I have in the background c app is this:

     

    fpGather = fopen("/var/ftp/gather/gather.txt", "w");
    
    while (!done)
    {
    	pGatherBuffer = (char *)(pshm->Gather.Buffer);
    	samples = pshm->Gather.Index;
    
    	if(pshm->P[xsaveValues] == 1)
    	{
    		for (i = 0; i < samples; i++)
    		{
    			memcpy(&time, (unsigned char*)pGatherBuffer, sizeof(int));
    			pGatherBuffer += sizeof(int);
    			fprintf(fpGather, "%d \r\n", time);
    		}
    		pshm->P[xsaveValues] = 0; 
    	}
    }
    

     

    The value pshm->P[xsaveValues] is changed in my servo loop so it is only updated when the loop is used.

     

    the gather values are the following:

    gather.addr[0] = sys.servocount.a
    gather.items = 1
    gather.period = 1
    gather.maxlines = 1048576
    gather.maxsamples = 1048575
    gather.enable = 2
    

     

    The problem I have is that the servo loop runs at 5kHz, so it will update 5000 times a second. I timed the saving of values and in 10 second I got a .txt file of 53 MB with about 5.6 million times the servocount printed, where I excpected 50.000 lines.

     

    The first value I get is 2.453.738 which is normal, and it goes up by one until it reaches 3.373.594 on line 919857. After that, on the next line it starts again at 2.453.738 until it reaches 3381841. This pattern continues until the last line where it ends at the highest value of 3.415.154.

     

    I don't know where it goes wrong, to me it looks correct. Maybe someone has seen this before and knows how to solve it.

  17. Hi,

     

    I'm trying to make a gather function using the buffer of the data gather function, because writing it away takes to much time for the power brick. The problem is I don't know how to access the buffer. I've seen multiple people on this forum use the buffer, but there is never stated how.

  18. Hi,

     

    I was wondering if lookahead only works for motion programs or it also works outside of them. We control everything from the servo loop, and we were wondering if it is possible to use lookahead for limiting the speed and acceleration and such.

  19. Edit: The problem was that I had to restart the cygwin terminal because it gets the paths when you run it as a bash shell and I added the paths in the terminal when cygwin was already running

     

     

     

    I tried this way to get the cross compiler to work for compiling a user servo. When I used cygwin to do te make all command, I still got the error:

     

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

     

    After that I checked the bin folder in compilers, and there wasn't te powerpc-405-linux-gnu-gcc compiler. The search function in explorer can't find the compiler anywhere on my harddisk. Does anyone know where it is located and how I can create a correct path to it to use the makefile?

     

    Go to Environment Variables for windows (Windows 7: Control Panel>System>Advanced system settings>Environment Variables)

    Under System Variables, find DTBUILDPATH variable and copy its value to clipboard. This is required for next step.

     

    Open a command prompt (Start>Accessories>Command Prompt)

    send the following command:

     

    path=C:\DeltaTau\Power PMAC IDE\compilers\bin;C:\DeltaTau\Power PMAC IDE\compilers\usr\local\bin"

    The path value shown above is the save value copied into clipboard from System variable DTBUILDPATH in previous step.

     

    In command prompt, change directory to "C:\usbtmc":

     

    cd c:\usbtmc

     

    execute the following command and the compilers pointed to by the newly defined path system variable will take the default Makefile, which we modified earlier and generate the usbtmc.ko file.

     

    make

×
×
  • Create New...