Remora - ethernet NVEM / EC300 / EC500 cnc board

More
11 Mar 2023 22:13 - 11 Mar 2023 22:15 #266436 by scotta
Took some digging, but finally found it. 
# load the real-time components

    loadrt remora-eth
    loadrt estop_latch
    loadrt and2


# estop and comms enable and feedback

    net nvem-estop             <= estop-latch.0.fault-in             <= remora.input.4

    net user-enable-in         <= and2.0.out                         => iocontrol.0.emc-enable-in
    net remora-status        <= remora.status                    => and2.0.in0
    net estop-status        <= estop-latch.0.ok-out                => and2.0.in1
    
    net user-enable-out        <= iocontrol.0.user-enable-out        => remora.enable
    net user-enable-out                                             => estop-latch.0.ok-in
    net user-request-enable <= iocontrol.0.user-request-enable    => remora.reset
    net user-request-enable                                     => estop-latch.0.reset


# add the remora and motion functions to threads

    addf remora.read             servo-thread
    addf estop-latch.0             servo-thread
    addf and2.0                    servo-thread
    addf motion-command-handler servo-thread
    addf motion-controller         servo-thread
    addf remora.update-freq     servo-thread
    addf remora.write             servo-thread
Last edit: 11 Mar 2023 22:15 by scotta.

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

More
14 Mar 2023 03:04 #266629 by frayja2002
Hi there

Thanks for that. I managed to get it working. I have attached what I ended up with in case it is useful to someone else.

I do have another question though. I am using a STM32 based NVEM controller on a small 2040 style mill. This is using NEMA 17 motors.

When I jog any of the axis (around 100mm) the axis stops short (about .04 of a mm) and then gradually moves to the commanded position. Just by counting this can take up to 2 sec. for the axis to stop moving.

Is this expected behavior & how do I go about diagnosing this?

Thanks
Alex.
Attachments:

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

More
14 Mar 2023 03:13 #266630 by scotta
There is a deadband in the control loop which by default is deadband = 1 / data->pos_scale. This can be overwritten by a command line setting.

0.04mm must be very close to 1 step, so the control loop is trying to get it as close as possible.

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

More
14 Mar 2023 04:22 #266631 by cakeslob
I have been wondering why more people havent asked about that. I figured they had higher step scales so it went unnoticed. It took me a while to figure out what was going on. I only found reference to it in a couple config files. This config has a deadband example
github.com/scottalford75/Remora/tree/mai...s/remora-closed-loop

1 / data->pos_scale, I dont know the math on that but it seems high because the default gives me unacceptable results. When I set deadband to something like .005mm, or half of 1 step it eliminates the issue.
github.com/cakeslob/upload_things/issues/1

I havent used deadband setting with openloop steppers before, what is the benefit of a higher deadband setting?

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

More
14 Mar 2023 05:05 #266632 by scotta
1 / data->pos_scale should give a deadband of exactly one step

eg, from my 3D printer config. SCALE = 160 (steps/mm) giving a deadband of 0.00625mm

If the deadband is smaller than one step then the loop will hunt as it can never physically achieve the commanded position. This was an issue I ran into with the earlier versions of the Remora component.

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

More
14 Mar 2023 10:56 #266649 by frayja2002
So how would you apply this with a stepper system that doesn't have any feed back?

Thanks
Alex
Attachments:

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

More
14 Mar 2023 20:32 #266699 by scotta
LinuxCNC actually does this with steppers, both the standard stepgen component and the Remora firmware close the loop by feeding back the number of steps outputted. Of course this cannot take into account any physical lost steps.

This is the difference between LinuxCNC and other software like Marlin or Klipper and is why you can get following errors with steppers with LinuxCNC.

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

More
14 Mar 2023 20:46 #266700 by frayja2002
Sorry, you are talking at to much of a high level for me.

How do I put this

1 / data->pos_scale

into my ini file to adjust it.
Should it actually be in the hal file?

Thanks

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

More
14 Mar 2023 20:48 #266701 by scotta
No need to do anything. It's already how the Remora component code is unless overridden by setting a value on the deadband pin.

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

More
14 Mar 2023 23:44 #266715 by cakeslob

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

Time to create page: 0.218 seconds
Powered by Kunena Forum