[Machinekit] Re: 3 phase pwm drive

2019-04-29 Thread darenschwenke
My application is a direct drive PNP part rotator 
.  AKA... 
basically zero load beyond rotor inertia, and comparatively slow speeds.

The BLDC motor will be used more like a stepper... but a really smooth and 
extremely light one.

I would say there is an 85% chance I'll just be running this open-loop, and 
just following a sine wave for the amplitude (via PWM) of the 3 phases.
Kinda like how microstepping works for a regular stepper for 2 phases 
(ignoring current chopping).. that will be this for 3 phases.
It will work , I just need to generate the 3 
channels of PWM tied to a sine calculation or lookup table, space them 120 
degrees apart, and then tie that to a rotational axis.

This is the minimal implementation and assumes your motor can handle full 
current stalled all day and not overheat.  
A proper implementation would be also PWM one or all of the enable lines.  
Then add a reading on the coil current/back EMF of all 3 phases would give 
you what you need to do field oriented control 
.

Those could happen, just like a Hall effect rotation sensor could happen if 
I'm desperate, but I think I'll be fine with just open-loop.

I could just build it up with the other components, but I'm inherently lazy 
(usually an asset for a programmer actually) and looking for a canned 
solution before I do so.  
Or I could just add it to the existing bldc component but I'll probably 
screw that up for a while..

Thank you.

On Saturday, April 27, 2019 at 5:06:36 PM UTC-4, justin White wrote:
>
> I run a brushless spindle motor with the BLDC component and a Mesa 8i20. 
> The waveform depends on the personality selected and usually only starts in 
> trapezoidal mode if using hall sensors then switches to sinusoidal. I can't 
> much of the gritty details of setting it up and waveform wasn't a huge 
> thing when I configured my mill. I had more of a fun time getting the PID 
> setup than anything, but that's mostly due to the fact that the 8i20 is a 
> torque mode drive rather than a velocity mode drive. I haven't touched the 
> config in a while as my mill just runs now. 
>
> I'm not sure what "resembling microstepping" means for a brushless DC 
> motor. Alot of the BLDC component relies on the feedback. It's best for 
> running servo's where the drive itself can be dumb and the Linuxcnc 
> hardware/software can handle commutation based on feedback. There's a few 
> modes which can run without feedback but the usefullness depends on what 
> you're doing. 
>
> On Saturday, April 27, 2019 at 4:03:59 PM UTC-4, darens...@gmail.com 
> wrote:
>>
>> Got a project where I will be doing pwm of the three phases of a bldc 
>> motor implementing sinesoudial drive for something resembling micro 
>> stepping.  
>> I saw the bldc component but it looks to be a trapezoidal implementation. 
>> Anyone whipped this up before I do?  Basically 3 pwm lines following a 
>> sine wave 120 degrees apart.
>>
>> Thank you.
>>
>

-- 
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: how to configure PRU pins ?

2019-04-29 Thread Jon Elson


On Monday, April 29, 2019 at 2:48:11 PM UTC-5, Charles Steinkuehler wrote:
>
>
> It looks like you are loading both your overlay and the universal 
> overlay, which will conflict with each other.  Just pick one or the 
> other, not both. 
>
>
> Thanks.  So, I removed the line :
enable_uboot_cape_universal=1

from /boot/uEnv.txt, but still do not see the uio_pruss module loaded.  Is 
that what I was supposed to do?
enable_uboot_overlays=1
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
are both still present in the file.

Jon

-- 
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: how to configure PRU pins ?

2019-04-29 Thread Robert Nelson
> bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 
> 2019.01-2-g6de8c74429]:[location: dd MBR]
> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 
> 2016.03-1-gd12d09f]:[location: dd MBR]

There you go, eMMC bootloader is too old, thus blocking everything else..

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=10

and reboot.

Regards,

-- 
Robert Nelson
https://rcn-ee.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] Re: how to configure PRU pins ?

2019-04-29 Thread Charles Steinkuehler
On 4/29/2019 2:07 PM, Jon Elson wrote:
> On Friday, April 26, 2019 at 9:48:47 PM UTC-5, Robert Nelson wrote:
>>
>> Let's see the output of this script: 
>>
>> sudo /opt/scripts/tools/version.sh 
>>
>> Thanks!  So, that command shows :

> kernel:[4.19.31-bone-rt-r31]
> uboot_overlay_options:[enable_uboot_overlays=1]
> uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
> uboot_overlay_options:[enable_uboot_cape_universal=1]
> ...
> 
> So, it looks like it is trying to do the AM335X-PRU-UIO-00A0.dtbo overlay, 
> but I'm guessing it is now failing for some reason?

It looks like you are loading both your overlay and the universal
overlay, which will conflict with each other.  Just pick one or the
other, not both.

-- 
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: how to configure PRU pins ?

2019-04-29 Thread Jon Elson


On Friday, April 26, 2019 at 9:48:47 PM UTC-5, Robert Nelson wrote:
>
>
> Let's see the output of this script: 
>
> sudo /opt/scripts/tools/version.sh 
>
>
> Thanks!  So, that command shows :
git:/opt/scripts/:[9df8deb6b2ae7570c9102ab58f795d3bed592194]
eeprom:[A335BNLT000C1827BBBG0656]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[Machinekit Debian Image 2019-04-14]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 
2019.01-2-g6de8c74429]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 
2016.03-1-gd12d09f]:[location: dd MBR]
kernel:[4.19.31-bone-rt-r31]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade 
]
pkg:[bb-cape-overlays]:[4.4.20190404.0-0rcnee0~stretch+20190404]
pkg:[bb-wl18xx-firmware]:[1.20190227.1-0rcnee0~stretch+20190227]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20180825+dfsg-1rcnee1~stretch+20181217]
groups:[machinekit : machinekit adm kmem dialout cdrom floppy audio dip 
video plugdev users systemd-journal i2c bluetooth netdev gpio pwm eqep 
admin spi tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 
rootwait coherent_pool=1M net.ifnames=0 quiet cape_universal=enable]
dmesg | grep remote
[0.841289] remoteproc remoteproc0: wkup_m3 is available
[1.191734] remoteproc remoteproc0: powering up wkup_m3
[1.191756] remoteproc remoteproc0: Booting fw image 
am335x-pm-firmware.elf, size 217168
[1.193856] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[0.664265] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END
--- end of output --

So, it looks like it is trying to do the AM335X-PRU-UIO-00A0.dtbo overlay, 
but I'm guessing it is now failing for some reason?

Thanks,

Jon

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


[Machinekit] Re: I am really stuck over this, please help!

2019-04-29 Thread mib . holotronic
Last I had joint following error problems I adjusted these settings in the 
associated .ini file to:

FERROR = 800.0 # We need a high FERROR for runtime calibration
MIN_FERROR = 200.0

for each joint.

Best wishes Michael B. 

On Tuesday, 9 April 2019 16:34:09 UTC+2, Bradley Turner wrote:
>
> Hello, I am fairly new to Beagle Bone/Machinekit and I am trying to set up 
> gantry deracking on a small CNC. The machine information can all be found 
> below (and I have posted before if you recognize the posts). I used 
> someones HAL file for gantry deracking for an MPCNC, and changed the 
> settings to accommodate to my motion setup. When I go to move the axes in 
> the GUI (AXIS) I get "joint 1 following error", "joint 2 following error", 
> and "joint 3 following error". Joint 1 (X - Axis) works just fine. I am not 
> sure what these errors mean, or how to fix them, so any information y'all 
> could provide would be greatly appreciated. I will post my .hal file and 
> some accompanying documentation/photos.
>
>
> https://docs.google.com/presentation/d/1a7goIQwWIO0uKRLa-KfeOs9Kg6j0zBQBgmQGL14omLM/edit#slide=id.g5047c009fb_0_5
>

-- 
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] We are really stuck over this and any help anyone could provide would be greatly appreciated!

2019-04-29 Thread Charles Steinkuehler
On 4/27/2019 9:36 PM, Bradley Turner wrote:
> Thank you so much for the help, I am sorry for the late reply, I wasn't 
> able to get back to the lab until now. I'm sure those things seems super 
> obvious, I just don't know what to look for! I did what you said to try and 
> it fixed the issue on the Y (Axis 1) and the A (Axis 3), however I still 
> get the same issue on the Z axis (Axis 2). I tried adjusting the values up 
> and down, but it did not seem to affect the issue on the Z axis.

Your problem with the Z axis is you do not have a feedback path.  Your
HAL code:

# position command and feedback
net emcmot.02.pos-cmd <= axis.2.motor-pos-cmd
#net emcmot.02.pos-cmd => hpg.stepgen.02.position-cmd

#net motor.02.pos-fb <= hpg.stepgen.02.position-fb
net motor.02.pos-fb => axis.2.motor-pos-fb

Creates a position command net (emcmot.02.pos-cmd) that goes nowhere
and a feedback net (motor.02.pos-fb) that is not driven.


> I had removed the homing earlier to try and narrow down what was causing 
> the issue. Once I get the joint following error and other movement errors 
> all cleared up I am intending to try and tackle the auto-homing-deracking 
> as well. Should I add this back in now, or continue with one problem at a 
> time? 

Your HAL file is pretty much a mess.  I would recommend cleaning it up
substantially and enabling the homing you want to use.  You can debug
fundamental issues (like your Z problem, above) using manual jogs with
the axis unhomed.  The next step would be to get homing working as
desired, so you'll need the homing logic in the HAL file.

> Separately I am having an issue where software - wise the axes (other than 
> the Z) all work correctly, however none of the motors spin. I have a 
> feeling that this issue is more related to the CRAMPS board, however I 
> figured I would mention it, as I am not sure what could be causing this. 

Make sure you are supplying power to the proper header on the CRAMPS
board (P201, labeled MOTORS).  There are several different power
supply rails on the CRAMPS board and the most common cause of "nothing
happens" has been the power wasn't connected properly.

Another thing that can cause nothing to happen is a problem with the
ESTOP chain.  When the machine is taken out of ESTOP and powered on,
the red ESTOP LED should be off, and the green ACTIVE LED should be
on.  If the ACTIVE LED (Machine Power) is not lit, the stepper drivers
will be disabled by hardware.

> I really appreciate all the help, I have tried to self educate, however I 
> haven't been able to find alot of information on configuring stuff like 
> this, or errors like this on machinekit, so if there is a repository where 
> I could learn more about it please let me know, I would love to look into 
> all of that. Thank you again, I have posted the (slightly) edited .hal and 
> .ini files.

You seem to be having the most trouble with the HAL file.  This is
basically a plain text netlist file which creates a "wiring diagram"
or schematic of the machine control logic.  As with a real world
schematic, things like unconnected pins or undriven nets will
typically cause problems.  There is a fair amount of documentation
available for HAL, I would recommend you read through at least the
introduction:

http://www.machinekit.io/docs/hal/intro/

You don't need all the details (eg: creating new components with C or
python), but you should be familiar with the concept of components,
pins, signals, and functions.

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