RE: [Machinekit] BBB and charge pump

2021-04-13 Thread John Dammeyer
Just an update.  I have a 501.9 Hz square wave now coming out DB25-17.  The 
simple answer was that I needed to change to

addf  charge_pump.0   servo-thread

The .0 was the issue.

The next issue, and I'm not sure how to get around this is the servo thread is 
too slow and doing something like this:
loadrt threads name1= fast-thread period1=10

is not allowed. Probably because 
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD 
num_joints=[TRAJ]AXES tp=tp kins=trivkins

loads 'motmod' which does what 'threads' does.  

I can try the standard parallel port generated version like:
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD 
servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

But I'll have to dig deeper to see why that may or may not work.  Unless 
someone has a better suggestion like doing it the way the MESA does with an 
extra step/dir interface.

Next part is I also want 1kHz PWM.  The MESA does this with hardware again. Can 
the BBB can do it with the PRU?  If not it will have to also be done with a 
base thread of about 10KHz.

John



> -Original Message-
> From: machinekit@googlegroups.com [mailto:machinekit@googlegroups.com] On 
> Behalf Of John Dammeyer
> Sent: April-12-21 8:52 PM
> To: 'Machinekit'
> Subject: [Machinekit] BBB and charge pump
> 
> I'm using the Xylotex DB25 cape for the BBB.  I've been trying to add the 
> charge pump component without much luck.
> In the HAL file I can do a
> loadrt charge_pump
> but an
> addf charge_pump
> fails with
> function 'charge_pump' not found.
> 
> If I leave that out and run MachineKit on the Beagle I do see
> charge-pump.0.enable
> charge-pump.0.out
> charge-pump.0.out-2
> charge-pump.0.out-4
> charge-pump.0.func.time
> charge-pump.0.func.tmax
> charge-pump.0.func.tmax-inc
> 
> But since the this HAL file only has a servo thread and no base thread is 
> there a way to get this to work?
> 
> Ultimately I want the ChargePump output on DB25-17 working in the same way I 
> have the PC with MESA 7i92H
> # DB25-10 actvive low ESTOP signal mapped to 7i92 pin 13
> # Pin#  I/O   Pri. funcSec. func   Chan  Pin funcPin Dir
> # 10 13   IOPort   QCount   0Quad-A  (In) 
> estop-external-in (input)
> 
> # MESA 7i92H P2 connections mapped to estop-external-in
> net estop-external-in <= hm2_7i92.0.gpio.013.in_not
> 
> # Stepper #4 is the charge pump on the MESA card and is enabled with the 
> estop-external -in
> net estop-external-in => hm2_7i92.0.stepgen.04.enable
> 
> which is output on DB25-17 from the MESA pin 7.
> # 17  7   IOPort   StepGen  4Step/Table1 (Out)
> Charge Pump frequency (output)
> 
> 
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/machinekit/0a0a01d73018%245f04d6e0%241d0e84a0%24%40autoartisans.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/0a9d01d73085%24e9fe9c00%24bdfbd400%24%40autoartisans.com.


Re: [Machinekit] BBB and charge pump

2021-04-13 Thread justin White
Just a shot here cuz I don't use a BB, or MK much, or charge pumps and I
haven't written a hal file in a year lol..

Anyway if I know the purpose of a watchdog timer and the issue you have is
trying to generate reliable pulses from a hal software component running on
a servo thread? Why not use the PRU pwm or step module to generate pulses
at a frequency to an output pin through your E-Stop circuit and then feed
it back to a PRU encoder pin. You can then arbitrarily use the encoder in
"counter-mode=1" to measure the PWM pin as a velocity and use a software
component like "near" or something to monitor that velocity, near will go
false if the velocity is out of rangei.e., the pulses stopped. This way
the PRU is making pulses, the PRU is counting pulses and the servo-thread
is only limiting the sample rate at which it checks the velocity, you
aren't making or counting pulses in the servo-thread.

Just an idea, not something I've tried

On Tue, Apr 13, 2021 at 12:56 PM John Dammeyer 
wrote:

> Just an update.  I have a 501.9 Hz square wave now coming out DB25-17.
> The simple answer was that I needed to change to
>
> addf  charge_pump.0   servo-thread
>
> The .0 was the issue.
>
> The next issue, and I'm not sure how to get around this is the servo
> thread is too slow and doing something like this:
> loadrt threads name1= fast-thread period1=10
>
> is not allowed. Probably because
> loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD
> num_joints=[TRAJ]AXES tp=tp kins=trivkins
>
> loads 'motmod' which does what 'threads' does.
>
> I can try the standard parallel port generated version like:
> loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD
> servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
>
> But I'll have to dig deeper to see why that may or may not work.  Unless
> someone has a better suggestion like doing it the way the MESA does with an
> extra step/dir interface.
>
> Next part is I also want 1kHz PWM.  The MESA does this with hardware
> again. Can the BBB can do it with the PRU?  If not it will have to also be
> done with a base thread of about 10KHz.
>
> John
>
>
>
> > -Original Message-
> > From: machinekit@googlegroups.com [mailto:machinekit@googlegroups.com]
> On Behalf Of John Dammeyer
> > Sent: April-12-21 8:52 PM
> > To: 'Machinekit'
> > Subject: [Machinekit] BBB and charge pump
> >
> > I'm using the Xylotex DB25 cape for the BBB.  I've been trying to add
> the charge pump component without much luck.
> > In the HAL file I can do a
> > loadrt charge_pump
> > but an
> > addf charge_pump
> > fails with
> > function 'charge_pump' not found.
> >
> > If I leave that out and run MachineKit on the Beagle I do see
> > charge-pump.0.enable
> > charge-pump.0.out
> > charge-pump.0.out-2
> > charge-pump.0.out-4
> > charge-pump.0.func.time
> > charge-pump.0.func.tmax
> > charge-pump.0.func.tmax-inc
> >
> > But since the this HAL file only has a servo thread and no base thread
> is there a way to get this to work?
> >
> > Ultimately I want the ChargePump output on DB25-17 working in the same
> way I have the PC with MESA 7i92H
> > # DB25-10 actvive low ESTOP signal mapped to 7i92 pin 13
> > # Pin#  I/O   Pri. funcSec. func   Chan  Pin funcPin
> Dir
> > # 10 13   IOPort   QCount   0Quad-A
> (In) estop-external-in (input)
> >
> > # MESA 7i92H P2 connections mapped to estop-external-in
> > net estop-external-in <= hm2_7i92.0.gpio.013.in_not
> >
> > # Stepper #4 is the charge pump on the MESA card and is enabled with the
> estop-external -in
> > net estop-external-in => hm2_7i92.0.stepgen.04.enable
> >
> > which is output on DB25-17 from the MESA pin 7.
> > # 17  7   IOPort   StepGen  4Step/Table1
>  (Out)Charge Pump frequency (output)
> >
> >
> > --
> > 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.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/machinekit/0a0a01d73018%245f04d6e0%241d0e84a0%24%40autoartisans.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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/machinekit/0a9d01d73085%24e9fe9c00%24bdfbd400%24%40autoartisans.com
> .
>

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received th

RE: [Machinekit] BBB and charge pump

2021-04-13 Thread John Dammeyer
Thanks Justin,
Yes that's the direction I've been going.  For now I've left the charge pump 
output at 500 Hz while I set up the PWM which is done in hardware.  I can have 
two at different frequencies so that will work for both charge pump and PWM for 
the spindle.
The odd thing at the moment is that the spindle PWM on my LinuxCNC system just 
stopped working.  Don't remember if I accidentally edited something or what. 
 
But on the BBB front I'm at the point where everything except the actual output 
appears to be working with one teensy problem.  
 
The AXIS display doesn't show the SPINDLE ON/OFF and +/- buttons to set speed.  
Nor for that matter the coolant flood and mist check boxes.  It does on my 
LinuxCNC setup.  Which is why I was checking there and now suddenly no spindle 
movement even though I have buttons.  
 
If anyone knows why the spindle control buttons have gone missing please let me 
know.  
 
Thanks
John
 
 
From: machinekit@googlegroups.com [mailto:machinekit@googlegroups.com] On 
Behalf Of justin White
Sent: April-13-21 5:52 PM
To: John Dammeyer
Cc: Machinekit
Subject: Re: [Machinekit] BBB and charge pump
 
Just a shot here cuz I don't use a BB, or MK much, or charge pumps and I 
haven't written a hal file in a year lol..
 
Anyway if I know the purpose of a watchdog timer and the issue you have is 
trying to generate reliable pulses from a hal software component running on a 
servo thread? Why not use the PRU pwm or step module to generate pulses at a 
frequency to an output pin through your E-Stop circuit and then feed it back to 
a PRU encoder pin. You can then arbitrarily use the encoder in "counter-mode=1" 
to measure the PWM pin as a velocity and use a software component like "near" 
or something to monitor that velocity, near will go false if the velocity is 
out of rangei.e., the pulses stopped. This way the PRU is making pulses, 
the PRU is counting pulses and the servo-thread is only limiting the sample 
rate at which it checks the velocity, you aren't making or counting pulses in 
the servo-thread.
 
Just an idea, not something I've tried
 
On Tue, Apr 13, 2021 at 12:56 PM John Dammeyer  wrote:
Just an update.  I have a 501.9 Hz square wave now coming out DB25-17.  The 
simple answer was that I needed to change to

addf  charge_pump.0   servo-thread

The .0 was the issue.

The next issue, and I'm not sure how to get around this is the servo thread is 
too slow and doing something like this:
loadrt threads name1= fast-thread period1=10

is not allowed. Probably because 
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD 
num_joints=[TRAJ]AXES tp=tp kins=trivkins

loads 'motmod' which does what 'threads' does.  

I can try the standard parallel port generated version like:
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD 
servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

But I'll have to dig deeper to see why that may or may not work.  Unless 
someone has a better suggestion like doing it the way the MESA does with an 
extra step/dir interface.

Next part is I also want 1kHz PWM.  The MESA does this with hardware again. Can 
the BBB can do it with the PRU?  If not it will have to also be done with a 
base thread of about 10KHz.

John



> -Original Message-
> From: machinekit@googlegroups.com [mailto:machinekit@googlegroups.com] On 
> Behalf Of John Dammeyer
> Sent: April-12-21 8:52 PM
> To: 'Machinekit'
> Subject: [Machinekit] BBB and charge pump
> 
> I'm using the Xylotex DB25 cape for the BBB.  I've been trying to add the 
> charge pump component without much luck.
> In the HAL file I can do a
> loadrt charge_pump
> but an
> addf charge_pump
> fails with
> function 'charge_pump' not found.
> 
> If I leave that out and run MachineKit on the Beagle I do see
> charge-pump.0.enable
> charge-pump.0.out
> charge-pump.0.out-2
> charge-pump.0.out-4
> charge-pump.0.func.time
> charge-pump.0.func.tmax
> charge-pump.0.func.tmax-inc
> 
> But since the this HAL file only has a servo thread and no base thread is 
> there a way to get this to work?
> 
> Ultimately I want the ChargePump output on DB25-17 working in the same way I 
> have the PC with MESA 7i92H
> # DB25-10 actvive low ESTOP signal mapped to 7i92 pin 13
> # Pin#  I/O   Pri. funcSec. func   Chan  Pin funcPin Dir
> # 10 13   IOPort   QCount   0Quad-A  (In) 
> estop-external-in (input)
> 
> # MESA 7i92H P2 connections mapped to estop-external-in
> net estop-external-in <= hm2_7i92.0.gpio.013.in_not
> 
> # Stepper #4 is the charge pump on the MESA card and is enabled with the 
> estop-external -in
> net estop-external-in => hm2_7i92.0.stepgen.04.enable
> 
> which is output on DB25-17 from the MESA pin 7.
> # 17  7   IOPort   StepGen  4Step/Table1 (Out)
> Charge Pump frequency (output)
> 
> 
> --
> website: http://www.machinekit.io blog: http://blog.machinekit.io git

Re: [Machinekit] BBB and charge pump

2021-04-13 Thread Charles Steinkuehler
If you just need a charge pump signal, use the PWM function on the PRU 
(alternately, you could use a stepgen instance, but that's more code 
overhead).


On 4/13/2021 11:56 AM, John Dammeyer wrote:

Just an update.  I have a 501.9 Hz square wave now coming out DB25-17.  The 
simple answer was that I needed to change to

addf  charge_pump.0   servo-thread

The .0 was the issue.

The next issue, and I'm not sure how to get around this is the servo thread is 
too slow and doing something like this:
loadrt threads name1= fast-thread period1=10

is not allowed. Probably because
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD 
num_joints=[TRAJ]AXES tp=tp kins=trivkins

loads 'motmod' which does what 'threads' does.

I can try the standard parallel port generated version like:
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD 
servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

But I'll have to dig deeper to see why that may or may not work.  Unless 
someone has a better suggestion like doing it the way the MESA does with an 
extra step/dir interface.

Next part is I also want 1kHz PWM.  The MESA does this with hardware again. Can 
the BBB can do it with the PRU?  If not it will have to also be done with a 
base thread of about 10KHz.

John




-Original Message-
From: machinekit@googlegroups.com [mailto:machinekit@googlegroups.com] On 
Behalf Of John Dammeyer
Sent: April-12-21 8:52 PM
To: 'Machinekit'
Subject: [Machinekit] BBB and charge pump

I'm using the Xylotex DB25 cape for the BBB.  I've been trying to add the 
charge pump component without much luck.
In the HAL file I can do a
loadrt charge_pump
but an
addf charge_pump
fails with
function 'charge_pump' not found.

If I leave that out and run MachineKit on the Beagle I do see
charge-pump.0.enable
charge-pump.0.out
charge-pump.0.out-2
charge-pump.0.out-4
charge-pump.0.func.time
charge-pump.0.func.tmax
charge-pump.0.func.tmax-inc

But since the this HAL file only has a servo thread and no base thread is there 
a way to get this to work?

Ultimately I want the ChargePump output on DB25-17 working in the same way I 
have the PC with MESA 7i92H
# DB25-10 actvive low ESTOP signal mapped to 7i92 pin 13
# Pin#  I/O   Pri. funcSec. func   Chan  Pin funcPin Dir
# 10 13   IOPort   QCount   0Quad-A  (In)   
estop-external-in (input)

# MESA 7i92H P2 connections mapped to estop-external-in
net estop-external-in <= hm2_7i92.0.gpio.013.in_not

# Stepper #4 is the charge pump on the MESA card and is enabled with the 
estop-external -in
net estop-external-in => hm2_7i92.0.stepgen.04.enable

which is output on DB25-17 from the MESA pin 7.
# 17  7   IOPort   StepGen  4Step/Table1 (Out)  
Charge Pump frequency (output)


--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/machinekit/0a0a01d73018%245f04d6e0%241d0e84a0%24%40autoartisans.com.




--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/ed9b13ab-776c-8edf-0e25-6393ff289bd3%40steinkuehler.net.


RE: [Machinekit] BBB and charge pump

2021-04-13 Thread John Dammeyer
That's what I'm trying to get going now.  Actually first the PWM for spindle 
speed and then I'll create the second PWM for charge pump.

Having a lot of trouble with the PWM for the spindle.  I've added what I think 
are the correct motion.spindle- ... but all I can get on the AXIS screen are 
the +/- and STOP button along with the BRAKE checkbox.  And the +/- buttons do 
flip the DB25-16 port pin so that's all working.  

But the set speed button is missing and I can't seem to link to the PWM value.  
Which means I'm missing something.  I'm using my MESA 7i92H as a guide although 
it's complicated by the extra ramping stuff I have in there.

What makes the speed button show up on the screen?
Thanks
John


> -Original Message-
> From: machinekit@googlegroups.com [mailto:machinekit@googlegroups.com] On 
> Behalf Of Charles Steinkuehler
> Sent: April-13-21 6:50 PM
> To: machinekit@googlegroups.com
> Subject: Re: [Machinekit] BBB and charge pump
> 
> If you just need a charge pump signal, use the PWM function on the PRU
> (alternately, you could use a stepgen instance, but that's more code
> overhead).
> 
> On 4/13/2021 11:56 AM, John Dammeyer wrote:
> > Just an update.  I have a 501.9 Hz square wave now coming out DB25-17.  The 
> > simple answer was that I needed to change to
> >
> > addf  charge_pump.0   servo-thread
> >
> > The .0 was the issue.
> >
> > The next issue, and I'm not sure how to get around this is the servo thread 
> > is too slow and doing something like this:
> > loadrt threads name1= fast-thread period1=10
> >
> > is not allowed. Probably because
> > loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD 
> > num_joints=[TRAJ]AXES tp=tp kins=trivkins
> >
> > loads 'motmod' which does what 'threads' does.
> >
> > I can try the standard parallel port generated version like:
> > loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD 
> > servo_period_nsec=[EMCMOT]SERVO_PERIOD
> num_joints=[TRAJ]AXES
> >
> > But I'll have to dig deeper to see why that may or may not work.  Unless 
> > someone has a better suggestion like doing it the way the
> MESA does with an extra step/dir interface.
> >
> > Next part is I also want 1kHz PWM.  The MESA does this with hardware again. 
> > Can the BBB can do it with the PRU?  If not it will have
> to also be done with a base thread of about 10KHz.
> >
> > John
> >
> >
> >
> >> -Original Message-
> >> From: machinekit@googlegroups.com [mailto:machinekit@googlegroups.com] On 
> >> Behalf Of John Dammeyer
> >> Sent: April-12-21 8:52 PM
> >> To: 'Machinekit'
> >> Subject: [Machinekit] BBB and charge pump
> >>
> >> I'm using the Xylotex DB25 cape for the BBB.  I've been trying to add the 
> >> charge pump component without much luck.
> >> In the HAL file I can do a
> >> loadrt charge_pump
> >> but an
> >> addf charge_pump
> >> fails with
> >> function 'charge_pump' not found.
> >>
> >> If I leave that out and run MachineKit on the Beagle I do see
> >> charge-pump.0.enable
> >> charge-pump.0.out
> >> charge-pump.0.out-2
> >> charge-pump.0.out-4
> >> charge-pump.0.func.time
> >> charge-pump.0.func.tmax
> >> charge-pump.0.func.tmax-inc
> >>
> >> But since the this HAL file only has a servo thread and no base thread is 
> >> there a way to get this to work?
> >>
> >> Ultimately I want the ChargePump output on DB25-17 working in the same way 
> >> I have the PC with MESA 7i92H
> >> # DB25-10 actvive low ESTOP signal mapped to 7i92 pin 13
> >> # Pin#  I/O   Pri. funcSec. func   Chan  Pin funcPin 
> >> Dir
> >> # 10 13   IOPort   QCount   0Quad-A  (In)  
> >> estop-external-in (input)
> >>
> >> # MESA 7i92H P2 connections mapped to estop-external-in
> >> net estop-external-in <= hm2_7i92.0.gpio.013.in_not
> >>
> >> # Stepper #4 is the charge pump on the MESA card and is enabled with the 
> >> estop-external -in
> >> net estop-external-in => hm2_7i92.0.stepgen.04.enable
> >>
> >> which is output on DB25-17 from the MESA pin 7.
> >> # 17  7   IOPort   StepGen  4Step/Table1 (Out) 
> >> Charge Pump frequency (output)
> >>
> >>
> >> --
> >> 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.
> >> To view this discussion on the web visit
> >> https://groups.google.com/d/msgid/machinekit/0a0a01d73018%245f04d6e0%241d0e84a0%24%40autoartisans.com.
> >
> 
> --
> 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 fro

RE: [Machinekit] BBB and charge pump

2021-04-13 Thread John Dammeyer
Making progress. 
 
Scope shows PWM and DIR on correct pin.  Buttons work.  + button however 
increases speed reported value above 3000 RPM when examined with HAL meter even 
though PWM reached 100% at 3000 RPM.  (50 RPS)
Still missing something.
 
#(JCD) Add PWM Spindle control
#  
# Spindle 
#  
# This output is on DB25-14 
 
setp hpg.pwmgen.00.pwm_period   10 
setp hpg.pwmgen.00.out.00.pin   813 
setp hpg.pwmgen.00.out.00.enable1 
setp hpg.pwmgen.00.out.00.scale 50.0 
setp hpg.pwmgen.00.out.00.value 0 
 
net spindle-enable  <= motion.spindle-on
net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd-rpm <= motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-cw  <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-brake   <= motion.spindle-brake
net spindle-revs=> motion.spindle-revs
 
net spindle-enable  => hpg.pwmgen.00.out.00.enable
net spindle-vel-cmd-rps => hpg.pwmgen.00.out.00.value
 
# This output is on DB25-16 and is Spindle Direction.
net spindle-ccw  =>  bb_gpio.p8.out-19
 
 
# This output is on DB25-17 
net charge-pump => bb_gpio.p9.out-14
 
 
> -Original Message-
> From: machinekit@googlegroups.com [mailto:machinekit@googlegroups.com] On 
> Behalf Of John Dammeyer
> Sent: April-13-21 7:46 PM
> To: 'Charles Steinkuehler'; machinekit@googlegroups.com
> Subject: RE: [Machinekit] BBB and charge pump
> 
> That's what I'm trying to get going now.  Actually first the PWM for spindle 
> speed and then I'll create the second PWM for charge
> pump.
> 
> Having a lot of trouble with the PWM for the spindle.  I've added what I 
> think are the correct motion.spindle- ... but all I can get on
> the AXIS screen are the +/- and STOP button along with the BRAKE checkbox.  
> And the +/- buttons do flip the DB25-16 port pin so
> that's all working.
> 
> But the set speed button is missing and I can't seem to link to the PWM 
> value.  Which means I'm missing something.  I'm using my
> MESA 7i92H as a guide although it's complicated by the extra ramping stuff I 
> have in there.
> 
> What makes the speed button show up on the screen?
> Thanks
> John
> 
> 
> > -Original Message-
> > From:   machinekit@googlegroups.com [ 
> >  mailto:machinekit@googlegroups.com] On 
> > Behalf Of Charles Steinkuehler
> > Sent: April-13-21 6:50 PM
> > To:   machinekit@googlegroups.com
> > Subject: Re: [Machinekit] BBB and charge pump
> >
> > If you just need a charge pump signal, use the PWM function on the PRU
> > (alternately, you could use a stepgen instance, but that's more code
> > overhead).
> >
> > On 4/13/2021 11:56 AM, John Dammeyer wrote:
> > > Just an update.  I have a 501.9 Hz square wave now coming out DB25-17.  
> > > The simple answer was that I needed to change to
> > >
> > > addf  charge_pump.0   servo-thread
> > >
> > > The .0 was the issue.
> > >
> > > The next issue, and I'm not sure how to get around this is the servo 
> > > thread is too slow and doing something like this:
> > > loadrt threads name1= fast-thread period1=10
> > >
> > > is not allowed. Probably because
> > > loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD 
> > > num_joints=[TRAJ]AXES tp=tp kins=trivkins
> > >
> > > loads 'motmod' which does what 'threads' does.
> > >
> > > I can try the standard parallel port generated version like:
> > > loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD 
> > > servo_period_nsec=[EMCMOT]SERVO_PERIOD
> > num_joints=[TRAJ]AXES
> > >
> > > But I'll have to dig deeper to see why that may or may not work.  Unless 
> > > someone has a better suggestion like doing it the way the
> > MESA does with an extra step/dir interface.
> > >
> > > Next part is I also want 1kHz PWM.  The MESA does this with hardware 
> > > again. Can the BBB can do it with the PRU?  If not it will
> have
> > to also be done with a base thread of about 10KHz.
> > >
> > > John
> > >
> > >
> > >
> > >> -Original Message-
> > >> From:   machinekit@googlegroups.com 
> > >> [  
> > >> mailto:machinekit@googlegroups.com] On Behalf Of John Dammeyer
> > >> Sent: April-12-21 8:52 PM
> > >> To: 'Machinekit'
> > >> Subject: [Machinekit] BBB and charge pump
> > >>
> > >> I'm using the Xylotex DB25 cape for the BBB.  I've been trying to add 
> > >> the charge pump component without much luck.
> > >> In the HAL file I can do a
> > >> loadrt charge_pump
> > >> but an
> > >> addf charge_pump
> > >> fails with
> > >> function 'charge_pump' not found.
> > >>
> > >> If I leave that out and run MachineKit on the Beagle I do see
> > >> charge-pump.0.enable
> > >> charge-pump.0.out
> > >> charge-pump.0.out-2
> > >> charge-pump.0.out-4
>