OpenMarine

Full Version: Motor controller
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
new pi zero on order with pins pre soldered, and got a micro to mini usb cable on the way as well to try xfactor99's idea

thank you andreas ironman and xfactor for the help so far with troubleshooting,
please let me know if you think of anything else i can try!

also does it matter when logging into the PI zero pypilot wifi via the puTTy that i used the 192.168.14.1 vs the 10.10.10.3 ip address?

also i have not tried the echo code on post #27 should i try that? thanks
(2021-02-05, 05:30 PM)djdsails Wrote: [ -> ]new pi zero  on order with pins pre soldered, and got a micro to mini usb cable on the way as well to try xfactor99's idea

thank you andreas ironman and xfactor for the help so far with troubleshooting,
please let me know if you think of anything else i can try!

also does it matter when logging into the PI zero pypilot wifi via the puTTy that i used the 192.168.14.1 vs the 10.10.10.3 ip address?

also i have not tried the echo code on post #27 should i try that? thanks

Hi djdsails,

some considerations,

for begining and testing keep it as simple as possible:
will say yust use tinypilot and in accespoint mode (Then the IP is 192.168.14.1) after you have loged in with your control device (mobile phone, tabet, pc ,rpi) into the AP "tinypilot".
If you run your TP as client connected to Openplotter on an other device your IP might be 10.10.10.xx,    I would leave that for when the basics are working.

you need: the pi(zero or other, not pi4)) with tinypilot, an imu and an arduino with motor. ino. (I see you have the nokia also working as well). get this working. I started with 3x led connected to the arduino (green/red for Stb andPort and yellow for the clutch). I had an other nano for that LED setup as the motor.ino is not the same than the one for RC control.


The arduino you can connect to the pi rx-tx and tx-rx. 5v and gnd (Common ground is verry important, please doublecheck your drawing posted above for this detail !!!)
Here it is also important that the rx pin of the pi only gets 3,3v so i use a voltage devider, just 2 
simple resistors.(drawing from ironman: https://forum.openmarine.net/showthread....5#pid13665)
I dont use an optocoupler btw. the pi and the nano now for more than 2 years and never had a problem, I yust carry a complete spare setup for incase. I reported here: https://forum.openmarine.net/showthread....31#pid8631

For testing purposes I first used USB connection (instead of 5.5,Gnd,TX,RX) btw. Pi and nano, no code modification.

After you got this working you can start to hook up your drive with an controller attached to the nano. I use an Pololu.
You can ad ruder sensor or en switches, votlage sense ect. but see that as an indipendent step.

Also then you can get your gps/wind data in and control it via OpenCPN / Openplotter.

But first a simple Autopilot to work.

Its good fun and learning.

Greetings Andreas
that 10.10.10.3 address in the examples is my own pypilot; it should be replaced in each example with that other one. If you have a pi4 you could install openplotter, which includes a pypilot, but that can be a whole project on its own and may be you need a break  Tongue. Respect for all your hard graft so far!
Doesn't the reference scheme have galvanic isolation between pi-zero and arduino (a cpc5001)?

If you build both on one board (like Andreas) you might skip the isolation, but if you power them from different sources it might be easier to use an isolated UART than an isolated USB connection.

Of course you could also completely skip isolation, even when using seperate power connections. But then the system will be less robust.
just tried something after noting that someone mentioned having common grounds,
i hooked up pi zero pin 4=5v and pin 6= ground to my 5v power source
i hooked up nano 5v and ground on the analog side of the nano to the same 5v power source
i hooked up the tx from pi zero to the nano rx and with out the load leveler the led lit up very dimly though, but once i hooked up the leveler HV to the 5V positive on the power source and pi zero pin 1=3v3 to the LV on leveler the led on the nano disappeared. still had an error on the nokia screen staying no motor controller through the whole process
Hi,

as mentioned before,

you can try to connect your (maybe broken) Pi Zero via usb to your arduino nano.
Feed your pi via the second usb port with power, so the arduino gets power too.

Try this (only arduino and pi) and look for the leds.

The message "no motorcontroller" is shown cause you have no connection to the arduino.
You can try to get a connection between the pi and arduino. This you can test without the motor-driver (h-bridge, ibt-2 or similar).

Regards

Andreas
the new PI zero board worked!! got communications! the USB communication did not work but the leveler does!
now i got an overcurrent issue, will do some searching on the forum and google... no commands have been sent to the motor driver md10c r3 board through ie through the PWM etc

the exact fault is sync overcurrent_fault

not sure why as nothing is moving on the tiller pilot

i changed some parameters the fault is gone, just need to figure out why the motor driver is not changing directions when i activate the autopilot to hold a course
@CapnKernel
on post #5 regarding modifying motor.io
i see when i click on your link that it brings me directly to a specific post on that thread, and that post has some code in it, where do i insert that code in the motor.io file? thanks
You don't have current measurement, so you might want to tie the arduino's A1/pin 20/shunt to the ground (0V) to force current measurement to 0.
(2021-02-05, 08:52 AM)ironman Wrote: [ -> ]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.

I use a cable like this, then a normal USB A to USB micro-B.

https://www.ebay.com/itm/162104856314
Pages: 1 2 3 4 5 6 7 8