Re: [Machinekit] Re: Strange pulse waves on X,Y,Z direction outputs when axis are static

2017-05-16 Thread michelvanderbreggen21
Hello Charles,
Thank you, that did the trick.

Michel

Op dinsdag 16 mei 2017 12:51:21 UTC+2 schreef Charles Steinkuehler:
>
> On 5/16/2017 2:18 AM, michelvand...@gmail.com  wrote: 
> > Hello Jeff, 
> > I have tried to add the PID loop to my setup. I copied the code from the 
> Xylotek 
> > HAL and Config file. But for some reason when I feed the PID loop output 
> into 
> > the velocity command, the motors don't move at all. When i feed the PID 
> output 
> > into the position command the machine starts moving but completly 
> uncontrolable. 
>
> You need to run the stepgen in velocity mode, not position mode: 
>
> http://www.machinekit.io/docs/man/man9/hal_pru_generic/ 
>
> setp hpg.stepgen.00.control-type 1 
>
> -- 
> Charles Steinkuehler 
> cha...@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] Re: Strange pulse waves on X,Y,Z direction outputs when axis are static

2017-05-16 Thread Charles Steinkuehler
On 5/16/2017 2:18 AM, michelvanderbregge...@gmail.com wrote:
> Hello Jeff,
> I have tried to add the PID loop to my setup. I copied the code from the 
> Xylotek 
> HAL and Config file. But for some reason when I feed the PID loop output into 
> the velocity command, the motors don't move at all. When i feed the PID 
> output 
> into the position command the machine starts moving but completly 
> uncontrolable.

You need to run the stepgen in velocity mode, not position mode:

http://www.machinekit.io/docs/man/man9/hal_pru_generic/

setp hpg.stepgen.00.control-type 1

-- 
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] Re: Strange pulse waves on X,Y,Z direction outputs when axis are static

2017-05-12 Thread Jeff Pollard

Hi,

  I'm saying that the actual steps are generated by the PRU (the orange 
section of the diagram linked to above), while the position generation is 
done on the main processor (the pink section), and still further more work 
is done outside the picture.  The PRU and main processors are separate from 
each other and communicate step and speed information between themselves.

  The real fix would be in the PRU code.
  
  A work around is by adding the PID stuff in the HAL file.

  The dithering DIR line should not affect the actual position of the 
stepper motor.  
  What it can do, depending on the actual hardware, is change the way the 
drive handles recirculating current in the transistors.  This can end up 
making a frequency that can be heard as a ticking or buzzing noise.

Jeff



On Thursday, May 11, 2017 at 11:11:19 AM UTC-7, Nick Collier wrote:
>
> @Jeff Pollard
>
> My machine seems to be working fine, I would like to fix the bug because 
> it is making me feel like I need to understand the system more. 
>
> So I can modify the PID using the stepgen command in the hal config file? 
>
> Are you saying that the stepgen algorithm is using several different 
> processors?
>
>

-- 
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] Re: Strange pulse waves on X,Y,Z direction outputs when axis are static

2017-05-11 Thread 'Nick Collier' via Machinekit
@Jeff Pollard

My machine seems to be working fine, I would like to fix the bug because it is 
making me feel like I need to understand the system more. 

So I can modify the PID using the stepgen command in the hal config file? 

Are you saying that the stepgen algorithm is using several different processors?

-- 
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] Re: Strange pulse waves on X,Y,Z direction outputs when axis are static

2017-05-11 Thread Jeff Pollard

Hi Nick,
 
   As the current system stands, if you want to get rid of the hunting on 
the DIR lines then it seems you need the PID loop.
   or...
   If you want to get rid of the necessity to use the PID code, you can 
modify the PRU code that generates the step pulses.

   The original EMC system MachineKit is based on was not a stepper centric 
system, rather a servo based system that used encoders for position 
feedback.  Later modifications were added to allow steppers and when the 
system migrated to the BBB, the PRU code  (which is run on another 
processor inside the chip) was added to generate step pulses.  The complex 
communication between the several internal processes (running independently 
and at different rates) has lead to a situation where the problem with the 
hunting occurs.  For a diagram of the different processes, look here:

http://www.machinekit.io/docs/hal/rtcomps/#sec:Stepgen

Jeff

On Thursday, May 11, 2017 at 5:08:33 AM UTC-7, Nick Collier wrote:
>
> @Alexander Rössler 
>
> I am new to Machinekit. I don't think I have that Python file. In lib I 
> don't have any python directory. I can't seem to find an fdm directory on 
> my system. 
>
> I just have a fresh install of this image with no modifications. 
>
> https://rcn-ee.com/rootfs/bb.org/testing/2017-02-12/machinekit/bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz
>  
>
> Btw why do I need a PID loop with a stepper motor? Could I not just remove 
> the PID loop? 
>
>

-- 
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] Re: Strange pulse waves on X,Y,Z direction outputs when axis are static

2017-05-11 Thread 'Nick Collier' via Machinekit
@Alexander Rössler

I am new to Machinekit. I don't think I have that Python file. In lib I don't 
have any python directory. I can't seem to find an fdm directory on my system.

I just have a fresh install of this image with no modifications.
https://rcn-ee.com/rootfs/bb.org/testing/2017-02-12/machinekit/bone-debian-8.7-machinekit-armhf-2017-02-12-4gb.img.xz

Btw why do I need a PID loop with a stepper motor? Could I not just remove the 
PID loop?

-- 
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] Re: Strange pulse waves on X,Y,Z direction outputs when axis are static

2017-05-10 Thread Jeff Pollard

Hi,

  A PID loop has been added to the Xylotex HAL file in the 
ARM/BeagleBone/Xylotex configs section.
  Take a look there for a way to set up the axes with a PID loop that gets 
rid of the hunting problem.

Jeff


On Wednesday, May 10, 2017 at 7:15:44 AM UTC-7, Alexander Rössler wrote:
>
> This phenomena is known as PRU pin hunting and a result of the internal 
> PRU stepper feedback loop being too "tight" (so the DIR pin toggles all 
> the time). You can fix it by adding a PID loop before the stepper and 
> adding a minimum threshold. Just search for PRU pin hunting in the 
> mailing list. 
>
> Another solution would be to adapt the PRU HAL driver code. However, the 
> PID loop has the additional advantage that it smoothes out RT jitter. 
>
> The solution is also present in the Machinekit fdm Python libraries: 
>
> https://github.com/machinekit/machinekit/blob/master/lib/python/fdm/config/base.py#L61-L75
>  
>
> michelvand...@gmail.com  writes: 
>
> > Hello Nick, 
> > If i am correct this is some form of "hunting" mode which is being done 
> by 
> > the feedback loop in the PRU. I have seen the same behavior on our 
> > machines, but I have no clue what this actually does internally in 
> > machinekit. 
> > 
> > Op woensdag 10 mei 2017 11:14:45 UTC+2 schreef Nick Collier: 
> >> 
> >> I am running Machinekit on a BBB. 
> >> 
> >> When tasting the physical step and direction output pins with an 
> >> oscilloscope, I noticed that there are various rectangle/pulse type 
> waves 
> >> on the direction pins when the respective axis are not moving. Is this 
> >> normal? 
> >> 
> >> As soon I make the axis move, the direction pin goes to either high or 
> low 
> >> depending on the direction. 
> >> 
> >> When the axis are moving, everything looks fine. But I would expect no 
> >> signal when there is no movement. The step outputs produce no signal 
> when 
> >> there is no movement, so I guess the signal from the direction outputs 
> are 
> >> not going to do any harm. 
> >> 
> >> 
>
>
> -- 
> Alexander 
>

-- 
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] Re: Strange pulse waves on X,Y,Z direction outputs when axis are static

2017-05-10 Thread Alexander Rössler
This phenomena is known as PRU pin hunting and a result of the internal
PRU stepper feedback loop being too "tight" (so the DIR pin toggles all
the time). You can fix it by adding a PID loop before the stepper and
adding a minimum threshold. Just search for PRU pin hunting in the
mailing list.

Another solution would be to adapt the PRU HAL driver code. However, the
PID loop has the additional advantage that it smoothes out RT jitter.

The solution is also present in the Machinekit fdm Python libraries:
https://github.com/machinekit/machinekit/blob/master/lib/python/fdm/config/base.py#L61-L75

michelvanderbregge...@gmail.com writes:

> Hello Nick,
> If i am correct this is some form of "hunting" mode which is being done by
> the feedback loop in the PRU. I have seen the same behavior on our
> machines, but I have no clue what this actually does internally in
> machinekit.
>
> Op woensdag 10 mei 2017 11:14:45 UTC+2 schreef Nick Collier:
>>
>> I am running Machinekit on a BBB.
>>
>> When tasting the physical step and direction output pins with an
>> oscilloscope, I noticed that there are various rectangle/pulse type waves
>> on the direction pins when the respective axis are not moving. Is this
>> normal?
>>
>> As soon I make the axis move, the direction pin goes to either high or low
>> depending on the direction.
>>
>> When the axis are moving, everything looks fine. But I would expect no
>> signal when there is no movement. The step outputs produce no signal when
>> there is no movement, so I guess the signal from the direction outputs are
>> not going to do any harm.
>>
>>


--
Alexander

-- 
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.