Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Beckhoff servo control

swa
2015-07-02
2015-07-31
  • swa - 2015-07-02

    Hi!

    I'm trying to control an AX5203 with two servo motors (AM8022) with my pi as a PLC. I'm having a lot of trouble with the servo drive. I have added xml for the device and I can find it when I scan for devices. But when I go online, the drive gets stuck in Pre Op state and then report error 0xF1A1 and 0xF189. Then I lose connection with the pi and have to reboot both the pi and the drive.

    I'm not really sure what is happening here, have anyone used Beckhoff servo drive with the pi? Should it work?

     
  • eschwellinger

    eschwellinger - 2015-07-05

    Hi,
    not so easy:
    -with 3.5SP7 (release mid of July) it will be possible to use a generic SOE device.(See screenshots)
    -using these drives with the raspberry pi does not really work because you need realtime capabilites, which are not realized in the standard Pi SD Image from RaspberryPi.org

    BR
    Edwin

    IMG: AX5203.jpg

     
  • swa - 2015-07-06

    Hi Edwin!

    Thank you for your answer but I don't really understand, will I be able to use them with the new update but not optimaly or do a need a real time kernel (or something) to run them at all?

    If I do need realtime capabilities, do you know if there is a RTOS that works with CODESYS runtime on the pi? Or do you think I need some extra hardware?

    Best regards
    Simon

     
  • eschwellinger

    eschwellinger - 2015-07-06

    Hi Simon,

    you could use these Servos with SoftMotion RTE http://store.codesys.com/systeme/codesy ... te-sl.html
    (realtime capabale plc for windows)
    but you need to wait for 3.5SP7 release (16th July).
    Then additional you need probably an installed Twincat to get the paramterconfiguration of the drives (These you need to export)
    and Import it to CODESYS. That is the procedure.

    For Raspberry Pi you need to use rt_preemt patched realtime kernel on Linux,
    not sure if this works reliable probably not really.

    BR
    Edwin

     
  • swa - 2015-07-06

    Thanks again Edwin!

    I'll look in to rt_preemt patch while I'm waiting for 3.5SP7.

    I already got my parameter list from TwinCAT, but CODESYS wasn't able to import all of them. I think the first 6 parameters was missing. When I added them manually I got error "C0075: Too mant initializers for array". I'm not really sure what's causing that.

     
  • hcvoort - 2015-07-07

    Hi Simon,

    Maybe the RT kernel from emlid works for you:
    http://www.emlid.com/real-time-linux-fo ... -binaries/
    If you install the codesys runtime for raspi as a *.deb in this OS, the performance is great!

    Good luck.

    BR,

    Carsten

     
  • swa - 2015-07-08

    Hi Carsten!

    Thank you, I will try this! Is it just the .deb file from the zip package downloaded from the store?
    You say the performance is great, do you mean real time performance or just in general? Do you know if this will solve my problem with real time and soft motion?

    Edwin: Can you recommend some other drive and motor for testing with the pi?

     
  • hcvoort - 2015-07-08

    Hi Simon,

    I don't know if this will solve your problem, but you should definitely try.
    With performance, I mean the amount of jitter on the sample time which is low.
    I am using the raspberry pi 2 with the most recent emlid kernel and the codesys runtime for RPi 2. The average jitter is around 10 us and the max jitter is 55 us.

    BR,

    Carsten

     
  • swa - 2015-07-08

    Yea I'll definitely try it!
    Thanks again!

    BR
    Simon

     
  • hcvoort - 2015-07-08

    Hi Simon,

    Let me know if it works for you. Indeed, you have to install the *.deb from the zip file once you have the OS from emlid up and running.
    Good luck!

    BR,

    Carsten

     
  • swa - 2015-07-13

    Hi again Carsten!

    I've tested and compared EMLID and the basic raspbian kernel. Jitter is a lot lower, from ~400Β΅s down to <100Β΅s which is really nice.

    I think the basic raspbian has a bit lower overall CPU usage, but I don't really know why. Any ideas?

    I'm really looking forward to this new CODESYS release and to test ELMID with my servos.

     
  • hcvoort - 2015-07-16

    Hi Simon,

    Thanks for the update. I do not know where the increased CPU load comes from.
    I am also waiting for the new release! I think it should come today.

    BR,

    Carsten

     
  • swa - 2015-07-16

    Yea hopefully it will come today! Then I might be able to bring you a new update on the case sometime next week. Would be really nice if it worked with my drive.

    On the bad side: I read (somewhere, no source right now) that SoE needed jitter in ns, so we are not really there yet(with <100Β΅s). But we know nothing until we try.

     
  • hcvoort - 2015-07-16

    I think the jitter constraint mainly depends on the cycle time you want to have with the SoE and the synchronization you want to have between several drives. Distributed clocks is very well suited for adressing the synchronization.
    Nevertheless, low jitter is always a good thing to have but not always necessary.
    Let me know what your experiences are.

    BR,

    Carsten

     
  • swa - 2015-07-20

    Do you think a distributed clock solution will work on the Pi?

    The CODESYS update doesn't seem to be out yet, so no update from my part either.

    BR
    Simon

     
  • swa - 2015-07-27

    Small update: I'v been testing with generic SoE on the Pi (on EMLID) and so far I don't have any real results. I no longer crash in pre-op mode but I'm not able to move past it either (I still got a connection though). It might be a problem when I port my startup parameters from TwinCAT. When i try to add the parameters that isn't imported from the xml file I still get error "C0075: Too mant initializers for array". Not sure how to solve that.

    Is there something special I need to consider when I'm trying to port the TwinCAT parameters?

    BR
    Simon

     
  • swa - 2015-07-31

    Hi again!

    I think my conclusion is that the Pi won't work with my servo drive. Probably because of the missing hard real time features, but I'm not totally sure.

    I solved the parameter problem but I still get stuck in PreOp-mode. If anyone have any thoughts I'd be happy to hear them and test your ideas.

    Thanks for your help
    Simon

     

Log in to post a comment.