OpenEtherCATsociety / SOEM

Simple Open Source EtherCAT Master
Other
1.23k stars 653 forks source link

PDO and SDO Testing - Motor pulses only once #820

Closed keithiscool closed 4 weeks ago

keithiscool commented 4 weeks ago

Hello, I have used the simpletest(ec_write/read SDO usage) and ebox(IOMap/PDO usage) tests - the documentation is clear on the SOEM front and I think I might be having an issues with a drive, but not sure how to troubleshoot. I cannot get the drive into operation, but SOEM is in Operation.

I have been writing to a drive with this approximate sequence and I am wondering if there are any troubleshooting steps to pursue. I am not sure if I can post the code here, but would like to see if there are things to investigate. I am not sure if I can post a Wireshark capture either due to company policy.

The motor does pulse (one click) after sending commands to the control register. When reading feedback values from the drive, the drive does not enter operation at any point.

I confirmed SOEM is in operation (state == 8) and use that portion of simpletest (and ebox) after the IOMap() function call - I edit the control register after the "ec_statecheck(0, EC_STATE_OPERATIONAL, EC_TIMEOUTSTATE);"

I have written to the drive using PDO (through IOMap and structs) and also ec_write() with the same results. I have tried using the manufacturer's procedures using the different modes without success.

I can read and write to all registers, along with getting values from the PDO (velocity, position, control word feedback).

The power supply voltage does not drop. The drive boots up in a fault state, but clears when running the procedure. Thank you for any time/assistance.

keithiscool commented 4 weeks ago

I was able to just confirm the brake is not on as well I tried hooking up a limit switch as an input, but the drive is still not changing position after the control word "go" bit is set

keithiscool commented 4 weeks ago

I have a locked rotor now when alternating the "go SP bit" in a while loop. Note the motor seems to be in operation state now I basically have this: Any ideas why a motor would ignore position/velocity commands?

setCntrlRegFunction(int cntlRegValue){ struct->cntlReg = cntlRegValue; printf("debug msg"); ec_send_processdata(); }

bias = 1001; while(1){ setCntrlRegFunction(cntl reg masked "do not engage SP") set position + bias; setCntrlRegFunction(cntl reg masked "engage SP") bias += 10; ec_receive_processdata(EC_TIMEOUTRET); printf("debug msg"); osal_usleep(10); }

ArthurKetels commented 4 weeks ago

If your problem is solved please notify other users how you did it. It is very frustrating when someone posts a question and closes it without any explanation.