Jump to content
OMRON Forums

maartenvervelde

Members
  • Posts

    44
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

maartenvervelde's Achievements

Enthusiast

Enthusiast (6/14)

  • First Post
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  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.
  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?
  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. The variable you told about only work when you're working with the motion programs. We want to control our motors from the servo loop. Is there a setpoint generator that will override everything and just limit the motor in way it is used?
  11. 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
  12. 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?
  13. 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?
  14. 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.
  15. 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
×
×
  • Create New...