OpenMarine
Motor controller - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: Motor controller (/showthread.php?tid=3215)

Pages: 1 2 3 4 5 6 7 8


RE: Motor controller - Andreas29 - 2021-02-04

(2021-02-04, 07:22 PM)ironman Wrote: pretty sure - the -g switch toggles the bcm numbers, and the Tx is GPIO14. I tested it with another GPIO I have attached to an led; to test it with GPIO14 I'd need to open up my machine - which I am about to do.

Because the sad news would be, that if the pin cannot be pulled down to 0V, the output seems to be shot.

I ran this and it made the rx led on the arduino blink:

Code:
sudo sv stop pypilot
sudo gpio -g mode 14 output
while [ 1 == 1 ]; do sudo gpio -g write 14 1; sleep 2; sudo gpio -g write 14 0; sleep 2; done

So if you run this and you don't measure alternating voltages on you GPIO14 / pin 8, I'm afraid your nano is bad. Hate to be the messenger of sad news, hope it's not true.

Hi,

yes if this normally works for the tinycore images I agree. If no reaction seen on the GPIO when enter the commands the output seems to be broken.

Regards

Andreas


RE: Motor controller - djdsails - 2021-02-04

(2021-02-04, 07:22 PM)ironman Wrote: pretty sure - the -g switch toggles the bcm numbers, and the Tx is GPIO14. I tested it with another GPIO I have attached to an led; to test it with GPIO14 I'd need to open up my machine - which I am about to do.

Because the sad news would be, that if the pin cannot be pulled down to 0V, the output seems to be shot.

I ran this and it made the rx led on the arduino blink:

Code:
sudo sv stop pypilot
sudo gpio -g mode 14 output
while [ 1 == 1 ]; do sudo gpio -g write 14 1; sleep 2; sudo gpio -g write 14 0; sleep 2; done


So if you run this and you don't measure alternating voltages on you GPIO14 / pin 8, I'm afraid your nano is bad. Hate to be the messenger of sad news, hope it's not true.

i am sorry do you mean the pi zero is bad not the nano? the arduino nano motor controller should be okay as it is not receiving or talking to the pi zero running pypilot... please confirm that you meant pi zero w and not nano...
connecting to pypilot now to test your code, thanks! will report with news

So I typed in the while statement after I hit enter on the sudo gpio-g mode 14 1 output and the puTTy freezes...

......


RE: Motor controller - ironman - 2021-02-04

Blush of course, indeed I meant the pizero tx output is probaby bad, from what I get from your measurements. Is it possible that you have misconnected it in an earlier prototyping stage?

Yes that statement would hang until 1 no longer equals 1 Tongue , or until you hit ^c


RE: Motor controller - djdsails - 2021-02-04

(2021-02-04, 08:16 PM)ironman Wrote: Blush of course, indeed I meant the pizero tx output is probaby bad, from what I get from your measurements. Is it possible that you have misconnected it in an earlier prototyping stage?
ok thank you for clarifying phiew! since the volt meter did not change during the while statement and putty froze i think i am going to assume that my pi zero is fried or something and will find a new one...
there is defiantly a chance i might have misconnected it before coming to this forum as i had no idea what was being put out on it, the 5volts vs 3.3 volts, etc. there is a chance i might have hooked it up right to a motor controller. though cannot recall right now as this has been a year in the making lol i dropped it over the summer and revisited once covid started ramping up over the holidays again and the temp dropped. there is also a chance i might have accidentally fried it during soldering pins onto the board....
thank you will back in a few days once i get a new board!

(2021-02-04, 08:16 PM)ironman Wrote: Blush of course, indeed I meant the pizero tx output is probaby bad, from what I get from your measurements. Is it possible that you have misconnected it in an earlier prototyping stage?

Yes that statement would hang until 1 no longer equals 1 Tongue , or until you hit ^c

ohh i thought that the done word in the statement ended the line of code, great thank you!

out of curiosity since it will take a few days for an order of a pi zero to come in,
can i try this on the pi 4? so take my memory card from the zero put it in the pi4, and wire it up the same per my sketch? it looks like the pin outs are the same?!?


RE: Motor controller - ironman - 2021-02-04

I've never tried sticking a tinypilot image in a pi4; I'm doubtful but you never know. Otherwise, download an openplotter image and put it in your pi4. It has practically the same pypilot on it.


RE: Motor controller - xfactor99 - 2021-02-04

Why you don't try simply connect the nano to the pi zero via usb ..... no other connections to the nano than usb !
save sailing
Andreas


RE: Motor controller - CapnKernel - 2021-02-05

(2021-02-04, 09:44 PM)xfactor99 Wrote: Why you don't try simply connect the nano to the pi zero via usb ..... no other connections to the nano than usb !

A good idea.  I did this for my first version.

  https://photos.app.goo.gl/kWuzHooS4Fmwunc19

djdsails, I like your schematic.  The only difference between your v1 and my v1 is that your box is cardboard, and my box was a plastic lunchbox from the supermarket :-)

You're close to having this working!


RE: Motor controller - rastam4n - 2021-02-05

(2021-02-04, 09:44 PM)xfactor99 Wrote: Why you don't try simply connect the nano to the pi zero via usb ..... no other connections to the nano than usb !
save sailing
Andreas

I'm curious why this is not the standard or at least more common?

Are there code changes that have to be made for the pi0 to talk to the nano via usb?


RE: Motor controller - Andreas29 - 2021-02-05

(2021-02-05, 12:16 AM)rastam4n Wrote:
(2021-02-04, 09:44 PM)xfactor99 Wrote: Why you don't try simply connect the nano to the pi zero via usb ..... no other connections to the nano than usb !
save sailing
Andreas

I'm curious why this is not the standard or at least more common?

Are there code changes that have to be made for the pi0 to talk to the nano via usb?

Hi,

no code changes. 
When testing with "flying wires" it´s a common way.
When using a pcb imho it´s better to use the connection via the gpio then via usb. The needed connection is printed on the pcb.

Regards

Andreas


RE: Motor controller - ironman - 2021-02-05

(2021-02-05, 12:16 AM)rastam4n Wrote:
(2021-02-04, 09:44 PM)xfactor99 Wrote: Why you don't try simply connect the nano to the pi zero via usb ..... no other connections to the nano than usb !
save sailing
Andreas

I'm curious why this is not the standard or at least more common?

Are there code changes that have to be made for the pi0 to talk to the nano via usb?

Good idea - I never tried it until now (on a pi4) but it simply works out of the box. The nano is enumerated as a serial device and simply discovered by the pypilot probe. Even the tx and rx lights blink.

Code:
servo probe ('/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0', 38400) 216246.002141228
arduino servo found on ['/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0', 38400]
serialprobe success: /home/pi/.pypilot/servodevice ['/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0', 38400]

Pypilot is like a box of chocolates. You gotta have a strong stomach. Djdsails definitely qualifies! To hook it up to the pizero, you'd need a rare micro usb to mini usb cable, but nothing you cannot make with two old cables  Tongue.