Menu

Topic-icon Set Encoder Counter to zero

  • Griffin Baker
  • Griffin Baker's Avatar
6 years 9 months ago #29528006 by Griffin Baker
Replied by Griffin Baker on topic Set Encoder Counter to zero
Have you updated to the 120412 firmware release? This is listed as 013113 I believe on the site.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #29528035 by edmodi
Replied by edmodi on topic Set Encoder Counter to zero
I\'ve installed firmware 07/27/2012. I think this version is most recently no? Because inside .zip the dfu file is v12.120412

Thanks

Please Log in or Create an account to join the conversation.

  • Griffin Baker
  • Griffin Baker's Avatar
6 years 9 months ago #29528036 by Griffin Baker
Replied by Griffin Baker on topic Set Encoder Counter to zero
The 120412 is the most recent.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #29528044 by edmodi
Replied by edmodi on topic Set Encoder Counter to zero
I tried it and it works properly. The firmware version was the problem

Thanks

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #29528045 by edmodi
Replied by edmodi on topic Set Encoder Counter to zero
Hi again, now I\'ve a new issue. When I try change mode between count position and open loop for some movement that I need, not run correctly. This is the script:

setConfig(_MMOD, MOTOR1, CLOSED_LOOP_COUNT_MODE)

setCommand(_P, MOTOR1, 1000)
wait(4000)
setCommand(_P, MOTOR1, 0)
wait(4000)

setConfig(_MMOD, MOTOR1, OPEN_LOOP_MODE)

setCommand(_GO, MOTOR1, 300)
wait(2000)


setConfig(_MMOD, MOTOR1, CLOSED_LOOP_COUNT_MODE)

setCommand(_P, MOTOR1, 0) <
wait(1000)

setCommand(_P, MOTOR1, 1000)
wait(4000)
setCommand(_P, MOTOR1, 0)
wait(4000)


The command indicated is not execute unless it is repeated with a wait above 10 ms


Why does this happen?


Thanks

Please Log in or Create an account to join the conversation.

  • Griffin Baker
  • Griffin Baker's Avatar
6 years 9 months ago #29528048 by Griffin Baker
Replied by Griffin Baker on topic Set Encoder Counter to zero
Not sure to be exact.

Try using a print statement to query the transitions from command change and configuration changes. This can be viewed in the console tab when the script is running.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #29528053 by edmodi
Replied by edmodi on topic Set Encoder Counter to zero
I think that the problem is loop error variable (command ?E). According to the documentation, this variable is 0 when mode is open loop but I have found that this is not so.

Checking in cosole tab:

MMOD=3
E=0:-4
MMOD=0
E=0:-4

If I move the motor in open loop and encoder count change, after change to count position mode the error is the same so the controller not execute the command

Has this problem a solution?

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #29528055 by edmodi
Replied by edmodi on topic Set Encoder Counter to zero
Ok, after thinking for a while, I found a \"solution\". This consist in after change to count position mode, send _P command with current encoder value and sometime wait 10ms

setConfig(_MMOD, MOTOR1, 3) \'Close loop count position

setCommand(_P, MOTOR1, GetValue(_ABCNTR, MOTOR1))
wait(10)
setCommand(_P, MOTOR1, 1000) \'Go to 1000 encoder position

What do you think?

Thanks

Please Log in or Create an account to join the conversation.

  • Griffin Baker
  • Griffin Baker's Avatar
6 years 9 months ago #29528058 by Griffin Baker
Replied by Griffin Baker on topic Set Encoder Counter to zero
Okay if I\'m reading this right, this is what I think I\'m seeing you are doing here in this case.

1: Set config for motor 1 to closed loop count position
2: Not sure what is being done in this one other than maybe reading the counter value for motor 1
3: tell motor to go to count position 1000.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #29528059 by edmodi
Replied by edmodi on topic Set Encoder Counter to zero
I replace the last encoder desired position in the controller memory buffer, thus, we replace the memory feedback with 0. Is very simple, replace memory desired position buffer

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.095 seconds
Go to top