Author Topic: Motion Controller via Arduino  (Read 25580 times)

0 Members and 1 Guest are viewing this topic.

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9935
  • Country: us
Re: Motion Controller via Arduino
« Reply #25 on: April 06, 2022, 03:11:11 pm »
I am sending the same changes that the existing counter is detecting. I had thought of keeping a display counter (which is what I have, but converted to inch position) and a second motor position counter, and then drive the motor to the display position every time rather than move a certain amount. That could eliminate the motor position errors I could occasionally achieve. There is some overhead in that. I tried simple division and yeah I need to do integer math. That might help quite a bit the way things are.

That error method of control is called 'following error control' (the control position is ahead of the motor position and the motor is following along) and was used in early numerical control (and may still be) where the error generates the current that moves the servo valve for the hydraulic motor.  When the error is zero, the valve is closed otherwise flow is linear with current over some range.  As the following error increases so does the motor speed.  This may still be the accepted practice for servo operated machines.  I haven't followed along.

Stepper motor control doesn't often use feedback.  It is assumed that the motor can step against the load and that it never misses steps.  If the motors do lose step and are corrected with encoder feedback, multi-axis cuts may not come out right.
 

Offline metrologistTopic starter

  • Super Contributor
  • ***
  • Posts: 2251
  • Country: 00
Re: Motion Controller via Arduino
« Reply #26 on: April 06, 2022, 05:00:28 pm »
I am sending the same changes that the existing counter is detecting. I had thought of keeping a display counter (which is what I have, but converted to inch position) and a second motor position counter, and then drive the motor to the display position every time rather than move a certain amount. That could eliminate the motor position errors I could occasionally achieve. There is some overhead in that. I tried simple division and yeah I need to do integer math. That might help quite a bit the way things are.

That error method of control is called 'following error control' (the control position is ahead of the motor position and the motor is following along) and was used in early numerical control (and may still be) where the error generates the current that moves the servo valve for the hydraulic motor.  When the error is zero, the valve is closed otherwise flow is linear with current over some range.  As the following error increases so does the motor speed.  This may still be the accepted practice for servo operated machines.  I haven't followed along.

Stepper motor control doesn't often use feedback.  It is assumed that the motor can step against the load and that it never misses steps.  If the motors do lose step and are corrected with encoder feedback, multi-axis cuts may not come out right.

Yeah, no feedback system here. What I meant to describe is that I have a pulse pass-through engine now. The change would be to run two independent counters, one that counts the encoder and feeds the display (pass-through incremental changes), and also feeds the motor drive but the motor drive function does not simply push incremental changes, but rather counts absolute motor position and calculates a new position based on the incremental inputs.

The current encoder library buffers encoder counts, so axis switches must wait until the current axis move completes. Otherwise, the buffered encoder counts will be applied to the new axis when the current motor drive loop completes and the main loop cycles through again. It seems I need a little routine to check if the interrupt counter has some counts left over when I check the status of the hand pendant switches at the beginning of the main loop. I do not know how to do that, if that is actually what is happening.
 

Offline metrologistTopic starter

  • Super Contributor
  • ***
  • Posts: 2251
  • Country: 00
Re: Motion Controller via Arduino
« Reply #27 on: April 08, 2022, 04:18:04 pm »
pic

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf