End switches an interrupts

#66

Hi,

did a

odrv0.axis0.requested_state = AXIS_STATE_HOMING

do anything?

Greetings / Zennix

#67

Hi

It doesn’t do anything

Cheers

Carelsbergh Stijn

#68

Hi,
make a crosscheck with the standard firmware to see if your board is fried.
Alternatively you can try my older version:

greetings / Zennix

#69

what does dump_errors(odrv0) say?

#70

Hi

When do I need to type the command?
After trying to go in closed loop control?

Cheers

Carelsbergh Stijn

#71

Hello,

I’m having a problem:
Motor calibration works
Encoder offset calibration works
Closed loop control works
HOMING DOES NOT WORK

Motor says it is homing but it is not moving

What is the problem?

Cheers

Carelsbergh Stijn

#72

Make sure your closed-loop control is properly tuned first. Then try increasing the homing speed, but be aware that it may suddenly start moving a lot faster than you expect, and possibly in the wrong direction.

Also, try manually turning your axis in both directions when it is homing to see if you experience more resistance in one direction than the other. That would indicate your control effort is too low.

#73

Hello guys van you please help me?

Motor startup calib works
Encoder offset startup works
But when I do startup homing and closed loop, it goes immediately into closed loop control without homing, if It ask for the homing state it says 2 or 0

Thanks in advance

Cheers

Carelsbergh Stijn

#74

Hi Stijn,

do your testing without going automatically in closed loop and homing. For testing do it manually.
<axis>.config.startup_closed_loop_control=False
<axis>.config.startup_homing = False>

Are your switches detected correctly?

pressed min_switch
In [28]: odrv0.axis0.min_endstop.endstop_state_
Out[28]: True
released min_switch
In [29]: odrv0.axis0.min_endstop.endstop_state_
Out[29]: False

pressed max_switch
In [30]: odrv0.axis0.max_endstop.endstop_state_
Out[30]: True
released max_switch
In [31]: odrv0.axis0.max_endstop.endstop_state_
Out[31]: False

Greetings / Zennix

#75

Try changing odrv0.axis0.min_endstop.config.is_active_high

#76

Hi

@Zennix
Ik tried it manually, didn’t work
Switches are read correctly
Any other thoughts?

@Riewert
My switches are wired correctly, so no problem there. But thanks for the advise
Any other thoughts?

Cheers

Carelsbergh Stijn

#77

Hi Stijn,

three more questions:

  1. did you erase the config after flashing?
    You have to remove the old settings.

  2. Did you try my older but working version posted before?

  3. Wetmelon released a new version of the endstop branch yesterday.
    Try it.

Greetings / Zennix

#78

Have you tried increasing odrv0.axis1.controller.config.homing_speed? Also, make sure you save-reboot-and check when you change these values.

#79

Hi

Homing is working, but it seems that the current to the motor is not correct, because it doesn’t move easly.

The homing state is defined in the new firmware as 11, as of previous firmware where it was 9. In the enums.py file, it stills says it’s 9, but there is lockspin also defined as 9, I don’t think thats correct.

When homing, the rotation direction was incorrect, therefore I changed the A and B signals off the encoder to turn it around, But now, when in closed loop controll, positive commands give a negative movement, how can I change this so that the homing direction stays the same as it now is?

I want to use my switches in normal closed mode, but when trying this, it seemed that the switches needer to be connected in normal open mode because otherwise the actuator already thought it was in the home position.

Thanks in advance

Cheers

Carelsbergh Stijn

#80

Good to hear it’s working.

I have the same issues with not enough power going to the motors in homing mode. The only solutions I found are:

  1. increase odrv0.axis1.controller.config.homing_speed or
  2. increase odrv0.axis1.motor.config.current_lim, this obviously also affects closed_loop_control

I have no idea what is causing this, but at least you are seeing the same behaviour.

For the direction it might be a better idea to leave your A-B cables normally and configure a odrv0.axis0.max_endstop instead of a odrv0.axis0.min_endstop.

#81

Set your homing speed negative if you want it to drive backwards. Use config.is_active_high to change the default state of your endstops. I will fix the enums.py issue, sorry about that

#82

Hi

@Riewert
My config current was not high enough, thanks

@Wetmelon
Negative homing speed doesn’t work, how is this possible?

Cheers
Carelsbergh Stijn

#83

Hi

When I set ‘is active high = true’ it already thinks it is homed, is this a bug?

Here you can see it, the first eindstop state is not pressed and the second one is pressed:

Cheers

Carelsbergh Stijn

#84

is_active_high means there is voltage on the pin when the switch is pressed. Yours is reversed, so you need to set is_active_high = False

#85

Hi

Yes I get that, but if I do that, it immediately thinks it is homed, so I think the code isn’t changed to look for false when it is configured in my way.

Otherwise I don’t know what I’m doing wrong

Cheers

Carelsbergh Stijn