Re: [Machinekit] Step direction changes when slowing down?

2018-04-05 Thread Eric Keller
On Thu, Apr 5, 2018 at 3:50 AM, Rick Mann  wrote:

> After help from Bas (thank you), I got MachineKit working on a Beaglebone
> Black and driving a ClearPath stepper. Here's a video:
>
> https://www.youtube.com/watch?v=f3kdqH8Miyg
>
> I notice on the oscilloscope (but not visible in the video above) that the
> step direction output changes when I stop jogging and the servo slows down
> from the jog speed it was going at.
>
>
Like the others have said, this looks fairly normal. You can think of the
machinekit controller as a servo drive that has a stepper motor output. So
there will probably be overshoot on any deceleration.  If you have the
computer for it, the Clearpath utility is very nice for capturing data.
Don't forget that the Clearpath motors have their own decel setting, which
they will enforce.  You don't want to hit their decel limit on a multi-axis
move, because the motors will be out of sync until the one that is behind
catches up.

I thought about getting their motors for my mill, but I feel like they skip
over the power rating that I would like.
Eric Keller
Boalsburg, Pennsylvania

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Step direction changes when slowing down?

2018-04-05 Thread Charles Steinkuehler
On 4/5/2018 4:18 AM, Rick Mann wrote:
> Oops, sent to soon, and forgot the list.
> 
> In addition to the responses below, I meant to add: I don't think what I'm 
> seeing is overshoot by the PID loop, at least not entirely, because when I'm 
> not jogging it, it only twiddles the direction output. The step output is 
> steady without pulses. If it were hunting, I'd imagine it would be issuing 
> steps as well as direction changes. Check out the other video: 
> https://www.youtube.com/watch?v=tQkF8TRVVpk

That is the PRU stepgen hunting around the set value.  You don't see
any actual step pulse outputs because the PRU is hunting in a very
small range which isn't large enough to generate a step pulse.

The fix is to either use a HAL PID component and run the PRU stepgen
in velocity mode or assign a non-zero value to the "minvel" (minimum
velocity) pin of the PRU stepgen HAL component.

-- 
Charles Steinkuehler
char...@steinkuehler.net

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Step direction changes when slowing down?

2018-04-05 Thread Bas de Bruijn


> On 5 Apr 2018, at 11:18, Rick Mann  wrote:
> 
> Oops, sent to soon, and forgot the list.
> 
> In addition to the responses below, I meant to add: I don't think what I'm 
> seeing is overshoot by the PID loop, at least not entirely, because when I'm 
> not jogging it, it only twiddles the direction output. The step output is 
> steady without pulses. If it were hunting, I'd imagine it would be issuing 
> steps as well as direction changes. Check out the other video: 
> https://www.youtube.com/watch?v=tQkF8TRVVpk
> 
> Thanks!
> 
>> On Apr 5, 2018, at 01:21 , Bas de Bruijn  wrote:
>> 
>> 
>> 
>>> On 5 Apr 2018, at 09:50, Rick Mann  wrote:
>>> 
>>> After help from Bas (thank you), I got MachineKit working on a Beaglebone 
>>> Black and driving a ClearPath stepper. Here's a video:
>>> 
>>>  https://www.youtube.com/watch?v=f3kdqH8Miyg
>>> 
>> 
>> That's a hefty stepper.
> 
> They're really nice servo motors from Teknic. The one in the video is 
> . The ones I'm using 
> on my CNC router are a bit smaller.
> 
>> 
>>> I notice on the oscilloscope (but not visible in the video above) that the 
>>> step direction output changes when I stop jogging and the servo slows down 
>>> from the jog speed it was going at.
>>> 
>>> Can anyone tell me why it does this? Is it in an effort to "apply the 
>>> brakes" to the moving stepper? This is not necessary with the ClearPath 
>>> servo, which will faithfully the number of steps commanded at the commanded 
>>> speed (within limits, of course).
>> 
>> This looks like "hunting" from the Pru stepgen. A solution for this is to 
>> drive the stepgen in velocity mode, and add a PID loop. Have a search thru 
>> the google group posts about this phenomenon.
>> 
>> This configuration can be an example on how to do this.
>> https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/Xylotex/Xylotex.hal
> 
> The ClearPath servos have drivers, encoders, and PID loops all contained on 
> the motor. There is no position feedback from them (only a configurable fault 
> signal). For this reason, I don't think MachineKit should implement any kind 
> of PID loop, right? There's no feedback for it to use. It should just 
> generate pulses for the desired velocity profile and position, and trust the 
> servo to get there (if it can't, it will assert the fault signal).

This is a pru_generic thingy. Because it can't _exactly_ reach the commanded 
value, it will change direction all the time.

So basically you use a PID component to have position values as input, and give 
out velocity commands to the pru_generic component/driver (in velocity mode 
instead of position mode).

You don't need the position from your hardware. That's a closed loop system, 
driven by pulse/dir right?

Basically you still have an open loop system though, because any pulse lost 
between your cape and the motor is not detected.

> 
> In the pru-stepper.hal, there are these lines:
> 
> # position command and feedback
> net emcmot.01.pos-cmd <= axis.1.motor-pos-cmd
> net emcmot.01.pos-cmd => [PRUCONF](DRIVER).stepgen.01.position-cmd
> 
> net motor.01.pos-fb <= [PRUCONF](DRIVER).stepgen.01.position-fb
> net motor.01.pos-fb => axis.1.motor-pos-fb
> 
> I'm guessing "fb" is feedback. Maybe I can remove those to make it open-loop?

the axis.1 is the feedback going into the motion component. If you break that 
you will get following errors.

>> One thing to check are the specs of your driver regarding the timing of the 
>> step and direction signals.
>> 
>> dirsetup dirhold steplen and stepspace.
> 
> I did check these already. Step and dir hold minimum is 1 µs. The only other 
> minimum time specified is the time between direction change and step, 
> specified as 25 ns. Is that "dirsetup?"
> 
>> 
>> These should be at least (but longer would be preferable) as long as the 
>> specs from your driver.
>> 
>>> For reference, the HAL file , and the .ini 
>>> file . Note I've only adjusted the pin 
>>> addresses for axis 0 in the HAL, and the path to the PRU binary in the 
>>> .ini. It's the same as the pru-stepper otherwise.
>>> 
>>> Thanks!
>>> 
>>> -- 
>>> Rick
>>> 
>>> -- 
>>> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
>>> https://github.com/machinekit
>>> --- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Machinekit" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to machinekit+unsubscr...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/machinekit.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> -- 
>> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
>> https://github.com/machinekit
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Machinekit" group.
>> To unsubscribe

Re: [Machinekit] Step direction changes when slowing down?

2018-04-05 Thread Rick Mann
Oops, sent to soon, and forgot the list.

In addition to the responses below, I meant to add: I don't think what I'm 
seeing is overshoot by the PID loop, at least not entirely, because when I'm 
not jogging it, it only twiddles the direction output. The step output is 
steady without pulses. If it were hunting, I'd imagine it would be issuing 
steps as well as direction changes. Check out the other video: 
https://www.youtube.com/watch?v=tQkF8TRVVpk

Thanks!

> On Apr 5, 2018, at 01:21 , Bas de Bruijn  wrote:
> 
> 
> 
> On 5 Apr 2018, at 09:50, Rick Mann  wrote:
> 
>> After help from Bas (thank you), I got MachineKit working on a Beaglebone 
>> Black and driving a ClearPath stepper. Here's a video:
>> 
>>   https://www.youtube.com/watch?v=f3kdqH8Miyg
>> 
> 
> That's a hefty stepper.

They're really nice servo motors from Teknic. The one in the video is 
. The ones I'm using on 
my CNC router are a bit smaller.

> 
>> I notice on the oscilloscope (but not visible in the video above) that the 
>> step direction output changes when I stop jogging and the servo slows down 
>> from the jog speed it was going at.
>> 
>> Can anyone tell me why it does this? Is it in an effort to "apply the 
>> brakes" to the moving stepper? This is not necessary with the ClearPath 
>> servo, which will faithfully the number of steps commanded at the commanded 
>> speed (within limits, of course).
> 
> This looks like "hunting" from the Pru stepgen. A solution for this is to 
> drive the stepgen in velocity mode, and add a PID loop. Have a search thru 
> the google group posts about this phenomenon.
> 
> This configuration can be an example on how to do this.
> https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/Xylotex/Xylotex.hal

The ClearPath servos have drivers, encoders, and PID loops all contained on the 
motor. There is no position feedback from them (only a configurable fault 
signal). For this reason, I don't think MachineKit should implement any kind of 
PID loop, right? There's no feedback for it to use. It should just generate 
pulses for the desired velocity profile and position, and trust the servo to 
get there (if it can't, it will assert the fault signal).

In the pru-stepper.hal, there are these lines:

# position command and feedback
net emcmot.01.pos-cmd <= axis.1.motor-pos-cmd
net emcmot.01.pos-cmd => [PRUCONF](DRIVER).stepgen.01.position-cmd

net motor.01.pos-fb <= [PRUCONF](DRIVER).stepgen.01.position-fb
net motor.01.pos-fb => axis.1.motor-pos-fb

I'm guessing "fb" is feedback. Maybe I can remove those to make it open-loop?

> One thing to check are the specs of your driver regarding the timing of the 
> step and direction signals.
> 
> dirsetup dirhold steplen and stepspace.

I did check these already. Step and dir hold minimum is 1 µs. The only other 
minimum time specified is the time between direction change and step, specified 
as 25 ns. Is that "dirsetup?"

> 
> These should be at least (but longer would be preferable) as long as the 
> specs from your driver.
> 
>> For reference, the HAL file , and the .ini 
>> file . Note I've only adjusted the pin 
>> addresses for axis 0 in the HAL, and the path to the PRU binary in the .ini. 
>> It's the same as the pru-stepper otherwise.
>> 
>> Thanks!
>> 
>> -- 
>> Rick
>> 
>> -- 
>> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
>> https://github.com/machinekit
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Machinekit" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to machinekit+unsubscr...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/machinekit.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
> https://github.com/machinekit
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Machinekit" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to machinekit+unsubscr...@googlegroups.com.
> Visit this group at https://groups.google.com/group/machinekit.
> For more options, visit https://groups.google.com/d/optout.


-- 
Rick Mann
rm...@latencyzero.com


-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Step direction changes when slowing down?

2018-04-05 Thread Bas de Bruijn


> On 5 Apr 2018, at 09:50, Rick Mann  wrote:
> 
> After help from Bas (thank you), I got MachineKit working on a Beaglebone 
> Black and driving a ClearPath stepper. Here's a video:
> 
>https://www.youtube.com/watch?v=f3kdqH8Miyg
> 

That's a hefty stepper.

> I notice on the oscilloscope (but not visible in the video above) that the 
> step direction output changes when I stop jogging and the servo slows down 
> from the jog speed it was going at.
> 
> Can anyone tell me why it does this? Is it in an effort to "apply the brakes" 
> to the moving stepper? This is not necessary with the ClearPath servo, which 
> will faithfully the number of steps commanded at the commanded speed (within 
> limits, of course).

This looks like "hunting" from the Pru stepgen. A solution for this is to drive 
the stepgen in velocity mode, and add a PID loop. Have a search thru the google 
group posts about this phenomenon.

This configuration can be an example on how to do this.
https://github.com/machinekit/machinekit/blob/master/configs/ARM/BeagleBone/Xylotex/Xylotex.hal


One thing to check are the specs of your driver regarding the timing of the 
step and direction signals.

dirsetup dirhold steplen and stepspace.

These should be at least (but longer would be preferable) as long as the specs 
from your driver.

> For reference, the HAL file , and the .ini 
> file . Note I've only adjusted the pin 
> addresses for axis 0 in the HAL, and the path to the PRU binary in the .ini. 
> It's the same as the pru-stepper otherwise.
> 
> Thanks!
> 
> -- 
> Rick
> 
> -- 
> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
> https://github.com/machinekit
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Machinekit" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to machinekit+unsubscr...@googlegroups.com.
> Visit this group at https://groups.google.com/group/machinekit.
> For more options, visit https://groups.google.com/d/optout.

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Step direction changes when slowing down?

2018-04-05 Thread Rick Mann
Oh, it's more interesting than this. It seems the step output is sometimes a 
square wave (with approximately 2ms period). If I jog a bit and stop, it 
sometimes settles down to low, sometimes it has a couple pulses then a longer 
high or low value. It's very curious and odd. Here's video showing what I see 
on the scope:

https://www.youtube.com/watch?v=tQkF8TRVVpk

> On Apr 5, 2018, at 00:50 , Rick Mann  wrote:
> 
> After help from Bas (thank you), I got MachineKit working on a Beaglebone 
> Black and driving a ClearPath stepper. Here's a video:
> 
>   https://www.youtube.com/watch?v=f3kdqH8Miyg
> 
> I notice on the oscilloscope (but not visible in the video above) that the 
> step direction output changes when I stop jogging and the servo slows down 
> from the jog speed it was going at.
> 
> Can anyone tell me why it does this? Is it in an effort to "apply the brakes" 
> to the moving stepper? This is not necessary with the ClearPath servo, which 
> will faithfully the number of steps commanded at the commanded speed (within 
> limits, of course).
> 
> For reference, the HAL file , and the .ini 
> file . Note I've only adjusted the pin 
> addresses for axis 0 in the HAL, and the path to the PRU binary in the .ini. 
> It's the same as the pru-stepper otherwise.
> 
> Thanks!
> 
> -- 
> Rick
> 
> -- 
> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
> https://github.com/machinekit
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Machinekit" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to machinekit+unsubscr...@googlegroups.com.
> Visit this group at https://groups.google.com/group/machinekit.
> For more options, visit https://groups.google.com/d/optout.


-- 
Rick Mann
rm...@latencyzero.com


-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.