**** BEGIN LOGGING AT Wed Apr 21 03:01:26 2021 Apr 21 03:12:25 good to know! luckily I was able to just connect it to the 12v and ssh into it through wifi Apr 21 03:47:39 you sheared the usb connector off? jeez, what do people do with their beaglebones? :P Apr 21 03:49:19 the micro haha, but the big one Apr 21 03:50:06 i didn't even notice until i tried to plug it in and was like, "ummm where's the micro port?" Apr 21 03:50:14 *not the big one Apr 21 03:55:34 yeah I'm not talking about the host port, I never use that one Apr 21 04:32:06 do the pwm pins default to high Apr 21 04:32:21 when I plug in my motor under the driver it is on Apr 21 04:33:16 P9.22 / spi boot clk 84 fast rx up 3 pwm 0 out A Apr 21 05:37:05 I don't think so? pretty sure it defaults to output-low Apr 21 05:37:44 of course since the pin has default internal pull-up, it will be high after power-on until pinmux is configured Apr 21 05:38:22 these two particular pins that is, the ones in the uio-pwm1 and uio-pwm2 examples have default pull-down Apr 21 05:46:29 hmmm I may switched Apr 21 05:46:41 i may switch Apr 21 05:47:18 it seems my driver board will get stuck on Apr 21 05:47:39 I've said this before, if you need a particular default level immediately after reset, your options are either picking pins that have the desired default, or overriding the default pull with external pull resistors (e.g. 1K or so) Apr 21 05:47:46 are you talking about this stepper driver? Apr 21 05:47:51 this is a different board Apr 21 05:47:58 and no Apr 21 05:48:05 this is regular DC motor Apr 21 05:48:58 https://www.cytron.io/p-13amp-6v-30v-dc-motor-driver Apr 21 05:48:59 I mean, not sure what you mean by "stuck on", the default level will only apply briefly between power-on and the kernel configuring the pinmux in your overlay Apr 21 05:49:35 so I have this wired up plug in and the motor was on Apr 21 05:50:15 you've measured the pwm output pin? Apr 21 05:50:54 i did I wasnt getting anythign Apr 21 05:51:09 ? Apr 21 05:51:14 sorry Apr 21 05:51:18 was getting 0V on the meter Apr 21 05:51:27 checked I was on the right setting using the sys 5V Apr 21 05:51:31 so the meter was right Apr 21 05:51:45 so the pwm is low exactly as expected Apr 21 05:51:54 so whatever your problem is, it has nothing to do with the pwm pin Apr 21 05:52:01 the board also acted appropriately as well Apr 21 05:52:03 yeah Apr 21 05:52:19 graasping at straws i am going to take a look tomorrow Apr 21 05:52:23 but it is pretty simple Apr 21 05:52:28 module Apr 21 05:52:36 i have a 24VDC PSU Apr 21 05:52:48 i connect to motor and I have three leads to the BBB Apr 21 05:52:53 not much I can mess up here Apr 21 05:52:54 lol Apr 21 05:52:57 I agree it should be pretty simple Apr 21 05:53:31 so there is no chance there is like a blip that the board could perceive as high Apr 21 05:53:50 just strange Apr 21 05:53:51 no Apr 21 05:53:55 unless the board is crap Apr 21 05:54:04 i mean it is 15USD or somethign like that Apr 21 05:54:17 10 USD Apr 21 05:54:58 like have you ever encountered failure rates in components like that. This was my back up board as the other one died as well Apr 21 05:55:33 https://www.amazon.com/gp/product/B082VS65BZ Apr 21 05:55:53 this was my original did the same thing motor on when I plugged in and died Apr 21 05:56:06 not sure what it could be since again not much going on here Apr 21 05:56:14 one thing I'd be a little concerned about is grounding, i.e. if both the motor power supply (i.e. not a battery nor a galvanically isolated psu) and the beaglebone (e.g. via usb) are grounded, they must be at the same ground potential Apr 21 05:56:38 and no, I haven't encountered failure rates like that Apr 21 05:56:48 but I also don't generally buy random dodgy boards from amazon Apr 21 05:56:51 lol Apr 21 05:56:54 fair point Apr 21 05:56:59 so for a ground Apr 21 05:57:20 my BBB is powered by the laptop as I have not gone through the trouble of powering via the pins Apr 21 05:57:35 i have a 24VDC to 5VDC module to do that Apr 21 05:57:38 it is a todo Apr 21 05:57:50 but right now I have power coming from my laptop Apr 21 05:58:03 everyhting else is powered by a PSU that plugs into the wall Apr 21 05:58:11 that just moves the question to whether the laptop is grounded (and if so, at the same potential as te psu) Apr 21 05:58:22 same power strip Apr 21 05:58:31 both have three prong plugs Apr 21 05:58:37 so I wanna say yes? Apr 21 05:58:41 presumably Apr 21 05:59:06 i will do some more testing tomorrow Apr 21 05:59:24 you could disconnect the driver from the beaglebone and measure the voltage between the driver module's GND pin and the beaglebone GND pin (i.e. the things you'd normally connect together) to confirm it's 0V Apr 21 05:59:59 ok Apr 21 06:00:33 what is a legit brand for this type of thing Apr 21 06:00:51 no idea, not a field I have any experience with Apr 21 13:37:40 m Apr 21 23:41:40 zmatt: I just checked again Apr 21 23:42:22 so when I plug in the PSU to the motor no issue, if I power the BBB and plug in the motor soon after it runs full bore Apr 21 23:42:58 if I wait a bit plug in the beagle bone then plug in the motor Apr 21 23:44:03 it is fine Apr 21 23:44:36 I think if I power the BBB 2nd I am ok but something about powering the BBB when the power side of the driver is on makes it go Apr 21 23:44:39 i guess bad design Apr 21 23:44:48 i may just buck up for a better module Apr 22 00:45:20 mattb00ne: uhh that sounds really bizarre Apr 22 00:45:33 going to try it a few times Apr 22 00:45:43 but I will probably just buy a better module Apr 22 00:45:50 like, regardless of the order in which you start them you should end up in the same state eventually Apr 22 00:45:51 you get what you pay for as you have said Apr 22 00:45:59 yeah motor stays on Apr 22 00:46:17 no, you said "if I wait a bit plug in the beagle bone then plug in the motor it is fine" Apr 22 00:47:19 like, even if the beaglebone transiently causes the motor to be driven, that should be a temporary condition Apr 22 00:48:13 it's not like the driver has a stateful interface, it's just a simple pwm + direction input Apr 22 00:49:00 so the history of what happened of this pins should have no influence, if the pwm pin is low _right now_ then the motor driver should be disabled _right now_ Apr 22 00:49:08 *on these pins Apr 22 00:50:30 i aggree with all that Apr 22 00:50:32 maybe it is bad Apr 22 00:50:40 bad board Apr 22 00:50:43 it is 10 bucks Apr 22 00:51:32 but if the high level during initialization is a problem, have you tried making sure the pin is low by default? (by either using pins that have default internal pull-down or by adding 1K pulldown resistors) Apr 22 00:51:52 I should say "pin" / "resistor", it's only the pwm pin that matters Apr 22 00:52:54 btw this thing does regenerative braking, so I hope you checked that your PSU is okay with that :P Apr 22 00:56:56 on their forum they do mention for one of their motor driver boards that the pwm input has a weak pull-up, so I'd suggest adding a 1K pulldown Apr 22 00:57:37 still, once pins are configured on the beaglebone (i.e. at some point during early boot) it should drive the pin low and the motor should stop regardless Apr 22 01:10:39 right Apr 22 01:10:45 the fact that it doesnt stop is worrisome Apr 22 01:14:50 just to clarify, then it's in this state what do its led indicators show? does it stop if you disconnect it from the beaglebone? if not, does it stop if (after disconnecting it from the beaglebone) it stop if you connect the three pins of the control interface (GND, PWM, DIR) together? Apr 22 01:15:15 did you do the ground potential measurement I suggested last time? Apr 22 01:16:49 no I need to do the GND check Apr 22 01:16:53 will try that now Apr 22 01:22:56 yeah, ground check first. (or you could be really paranoid and temporarily test with the BBB powered from battery (e.g. a usb power pack) and connected only via Ethernet (using an unshielded cable) and the 3-wire interface to the driver, which completely eliminates any possibility of grounding issues) Apr 22 01:24:21 but measuring the potential should suffice Apr 22 01:24:31 well, measuring it and confirming it's 0V :P Apr 22 01:24:50 then see if 1K pulldown on PWM helps Apr 22 01:26:20 ok Apr 22 01:27:15 also, disable the uio-pwm0 overlay and test your setup first in gpio mode and then with sysfs pwm Apr 22 01:27:34 it's pointless to try to do complicated pwm control from pru until you've validated your hardware setup Apr 22 01:29:33 just did one more check to see if I am crazy and i can reproduce it reliably. I did notice that on the board LED had the MA light on which indicates the following Apr 22 01:29:34 MA LED Indicator – Turns on when the output A is high and output B is low. Indicates the current flows from output A to B. Apr 22 01:30:23 i.e. as if it sees PWM high and DIR low Apr 22 01:30:33 yes Apr 22 01:30:59 only occurs if plug in while BBB is booting Apr 22 01:31:06 let me disable my overlays Apr 22 01:31:25 plug what in exactly? Apr 22 01:31:34 BBB power into my laptop USB Apr 22 01:32:08 so when I turn it on to get the odd behavior I plug in the USB starting my BBB boot process and go to plug in the PSU for the motor Apr 22 01:35:20 note that if you removed the overlay, don't reconfigure the pwm pin, and don't have a pulldown, then it's expected that the pwm pin is high hence motor is running Apr 22 01:36:06 (for P9.21/22 specifically) Apr 22 01:36:18 so was up Apr 22 01:36:25 and motor ran with overlay removal Apr 22 01:36:51 yes Apr 22 01:37:40 so go add that pulldown already and/or use a pin with default internal pulldown (even if it's not a pwm pin, just use a gpio for testing) Apr 22 01:38:27 like, currently I still have no idea if there's actually something wrong with the device or if you're just fumbling Apr 22 01:39:07 i would have to power on via the barrel jack to check the isolation? Apr 22 01:39:50 it needs to be in whatever your normal setup is (with both devices powered), apart from not being connected together Apr 22 01:40:39 like, why are all these tests taking ages... it's literally just disconnecting one cable and measuring a voltage Apr 22 01:40:49 and I touch both GND leads Apr 22 01:41:05 well i got these clunky multi meter terminals Apr 22 01:41:20 yes, the GND of the beaglebone (any ground pin will do) and the GND pin of the control interface of the driver Apr 22 01:44:28 3V Apr 22 01:44:35 when i check the grounds Apr 22 01:44:44 excuse me Apr 22 01:44:59 lol Apr 22 01:45:16 so I have a wire from my GND on my bbb Apr 22 01:45:45 and I have am touching the lead from the GND on the board Apr 22 01:45:48 made sure the pin you're using is actually GND ? Apr 22 01:46:13 according the silk screen Apr 22 01:46:31 on the beaglebone Apr 22 01:47:30 tested by touching 3.3V and the GND Apr 22 01:47:33 and I get 3,3V Apr 22 01:47:46 plus I am using the screw in terminal cape Apr 22 01:47:52 so positive I am correct on the BBB Apr 22 01:47:54 ah Apr 22 01:48:05 what about between BBB ground and the negative lead of the psu ? Apr 22 01:48:22 psu for the motor? Apr 22 01:48:25 yes Apr 22 01:49:15 since now that I think about it, it's possible the digital ground of the driver could float somewhat relative to that perhaps Apr 22 01:50:24 3V Apr 22 01:50:48 what psu is this? Apr 22 01:50:57 amazon jobber one sec Apr 22 01:51:39 https://www.amazon.com/gp/product/B01IOK5FM0 Apr 22 01:52:18 3.08 Apr 22 01:52:26 between the board and BBB Apr 22 01:52:31 and PSU and BBB Apr 22 01:52:34 3.08V Apr 22 01:52:51 should be 0V? Apr 22 01:53:21 I'm wondering if the output might be balanced around ground, or perhaps floating relative to it Apr 22 01:53:51 is that a board design decision Apr 22 01:54:03 wait no, can't be balanced since it's 24V output Apr 22 01:54:08 but maybe floating Apr 22 01:54:15 trying to see if there's anything in its specs Apr 22 01:54:27 you think it is the PSU? Apr 22 01:54:45 well if it's floating then this measurement is not valid Apr 22 01:56:08 of course as usual barely any info let alone a proper datasheet or manual Apr 22 01:57:03 okay let's assume it's isolated Apr 22 01:58:02 so I rechecked the measurements and it is consistent 3.08V Apr 22 01:58:46 happen to have a resistor, like 10K-100K or so to connect between them? Apr 22 01:58:56 the ground of the driver and of the bbb I mean Apr 22 01:59:06 and then measure the voltage across that resistor Apr 22 01:59:22 ok I can do that Apr 22 02:00:14 it's probably just an isolated power supply, like an oversized wall wart ;) Apr 22 02:01:29 ok so I may of messed up when I said the voltage was 3V Apr 22 02:01:37 I still had the PWM wires plugged in Apr 22 02:01:45 I unplugged those and now I have 0V Apr 22 02:01:54 * zmatt sighs deeply Apr 22 02:01:58 sorry Apr 22 02:03:13 do you think it is because I had both lines set to PWM and this board controls it with a logic direction Apr 22 02:03:47 it definitely doesn't make sense to PWM both pins, you should just use a GPIO for DIR Apr 22 02:03:57 but it doesn't matter since you never configured any pwm Apr 22 02:04:02 as in, enabled it Apr 22 02:04:14 right now no since I removed the overlay Apr 22 02:04:19 even before Apr 22 02:04:25 you just did pinmux setup Apr 22 02:04:46 you mean manually set pins Apr 22 02:05:00 no, with the overlay Apr 22 02:05:21 yes applied your thing Apr 22 02:05:22 like, I don't recall you mentioning any attempt to actually configure the pwm outputs Apr 22 02:05:38 yeah, so merely applying the overlay would just result in outputs low Apr 22 02:06:00 right Apr 22 02:06:37 anyway, assume grounding is fine, go do some testing using gpios Apr 22 02:06:44 ok Apr 22 02:07:06 i will probably just order a new more expensive board Apr 22 02:07:11 also, btw, I'm quite certain I've explained this before but leaving devices connected via signal lines but no ground connection is a huuuuuge no-n Apr 22 02:07:15 *no-no Apr 22 02:07:29 ground always needs to be the first thing connected and the last thing disconnected Apr 22 02:07:35 ok Apr 22 02:07:40 you did say that Apr 22 02:07:51 i get sloppy when I am rushing Apr 22 02:08:06 which just ends up wasting more time Apr 22 02:08:10 right Apr 22 02:08:12 be systematic Apr 22 02:08:20 i am just going to have just 1 pwm connected and ground Apr 22 02:08:26 and see if that helps Apr 22 02:08:47 you need to have ground connected and both pins to gpio lines Apr 22 02:09:06 perhaps consider using one that's default-low for pwm :P Apr 22 02:09:14 smart move Apr 22 02:09:28 although it really shouldn't matter once you configure the gpio to output-low Apr 22 02:09:29 to switch to pwm and change the duty cycle how do I do that with command line Apr 22 02:09:51 you're already done testing it with gpio? wow, you're quick :P Apr 22 02:10:05 oh just do high low Apr 22 02:10:18 let me do that Apr 22 02:10:31 yes, remember you were trying to figure out if there was a hardware issue? :P Apr 22 02:10:32 how do I change from high to low from cml Apr 22 02:10:42 which pin? Apr 22 02:11:21 P8_13 Apr 22 02:11:53 actualy P8_19 Apr 22 02:12:00 actually, there's a way that makes using gpios from the commandline a ton easier, I have an udev rule that makes symlinks for gpio by name (e.g. P8_19) Apr 22 02:12:08 unless you already have that rule? does /dev/gpio/ exist? Apr 22 02:12:31 no Apr 22 02:12:56 ok, create a file /etc/udev/rules.d/gpio-symlinks.rules with this content: https://pastebin.com/raw/qZZmQQQg Apr 22 02:13:14 ok Apr 22 02:13:52 then: sudo update-initramfs -u Apr 22 02:13:53 and reboot Apr 22 02:14:48 ok Apr 22 02:16:49 whats a wall wart? Apr 22 02:16:51 lol Apr 22 02:18:02 https://google.com/search?tbm=isch&q=wall+wart Apr 22 02:18:29 lol Apr 22 02:18:32 so I am back up Apr 22 02:18:43 hopefully now you do have /dev/gpio/ ? Apr 22 02:18:59 yes Apr 22 02:19:19 echo low >/dev/gpio/P8_19/direction Apr 22 02:19:26 that changes it to output, initially low Apr 22 02:20:22 and you can change the output level by echo'ing 0 or 1 to /dev/gpio/P8_19/value Apr 22 02:21:37 or echo low or high to /dev/gpio/P8_19/direction though that's primarily intended to change a pin direction from input to output Apr 22 02:21:37 ok that works Apr 22 02:22:04 as in, when pwm is low the motor is off? Apr 22 02:22:21 *the pwm pin Apr 22 02:23:12 yes on when switched to high Apr 22 02:23:18 and I change direction Apr 22 02:24:02 okay, so when you previously said you measured 0V on the pwm pin yet the motor was on, that was presumably a measurement error? :P Apr 22 02:24:17 yes Apr 22 02:24:38 i think becuase I was trying to get the voltage from the screw part of the screw terminal Apr 22 02:24:55 so that leaves the question of why the P9.21/22 pwm pin was not going low once pinmux is configured Apr 22 02:25:17 though it doesn't hugely matter since you should ensure it's low to begin with anyway Apr 22 02:25:36 e.g. with a 1K pulldown Apr 22 02:25:36 should I just go the pwm1 and be done with it ? Apr 22 02:25:43 ok let me get a resistor Apr 22 02:25:56 or use a pwm pin that has default pull-down yeah Apr 22 02:26:13 let me try that as a quick solution Apr 22 02:27:28 P9.14/16 (pwm1) is a better choice for pwm pins anyway, since they have no function other than pwm (and gpio) Apr 22 02:28:47 while P9.21/22 are part of the only pinout of the spi 0 bus, as well as for uart 2, so I wouldn't use those for PWM unless you've run out of better choices for pwm pins Apr 22 02:30:24 bbl Apr 22 02:30:48 ok thanks for the help **** ENDING LOGGING AT Thu Apr 22 02:59:57 2021