This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using pi gpio outputs / pins arduino
#11
the arduino is 5v ,, pi is 3.3v take that into consideration before connecting the two together..
mare liberum
  Reply
#12
(09-11-2018, 03:12 PM)jim321 Wrote: the arduino is 5v ,, pi is 3.3v take that into consideration before connecting the two together..

Yep. I changed from trying to use only Raspberry to use the Arduino as motorcontroller, like Sean, thats why i also changed the topic a bit. It has a couple of advantages as allready discussed a couple of times...

So i'm not connecting them together (other than via the normal USB, which obviously works fine).
  Reply
#13
sorry for the delay.

Yes, pulling pin 6 on the arduino low should enable h-bridge mode. Then pins 2,3,9,10 should work to drive the 4 mosfets in a bridge. Otherwise, pin 9 should output rc pwm. So you might want to test pin 9 on your scope, and move in both directions.

There are some other issues as well. If the controller detects over temperature on either the motor or controller it will not drive. You should see this flag in the control program.

If you do not have temperature sensors, you should connect the pins A2 and A3 to vcc (not ground) to give it the lowest possible temperature reading so it won't fault. I should modify the code to detect if there are no temp sensors automatically so you dont need to do this in the future, but have not yet. For now easiest to just wire to vcc, or hack the TakeTemp function and return 0 or something. For 10 cents I use a NTC thermistor.

You may also connect A4 to gnd or vcc to disable rudder feedback. It may float out of range normally but it's better to set it.

If you do not have voltage input, you might also have problems with the latest code. The controller shuts down below 6v or above 18v unless it detects it is a 24v capable controller (pin 12 grounded)

You can also hack the TakeTemp and TakeVolts functions to hard code readings rather than return what is measured to avoid changing the hardware.

Disabling all this detection could potentially damage things. You need a way to detect end of travel, either current sense, end of travel switches, or rudder feedback. Preferably you have more than one of these.

Be sure not to connect pin 7 or 8 to ground. These are end of travel stop switches and will disable movement as well.
  Reply
#14
HI Sean,

Thanks for coming back back on this. I'm builded a lab for testing. I have the temperature readings as well the voltage and current metering in place. It all works fine and the result is promising. It gives the correct temperature, current and voltage in OpenPlotter Autopilot control. The ruddersense also works, if i ground them the display gives them as fault.

So far, so good.

I'm still left with a smal problem: reverse works, fwd not. If i pull the compass to the right it goes in reverse and gives the right signalling etc. If idle and/or pulled left it says FWD_FAULT. (So that's not caused by the ruddersense)

Any idea? (or is this because i don't have a compass installed yet -> is there a way to trick this?)
  Reply
#15
(09-14-2018, 11:46 AM)nvelthuijsen Wrote: HI Sean,

Thanks for coming back back on this. I'm builded a lab for testing. I have the temperature readings as well the voltage and current metering in place. It all works fine and the result is promising. It gives the correct temperature, current and voltage in OpenPlotter Autopilot control. The ruddersense also works, if i ground them the display gives them as fault.

So far, so good.

I'm still left with a smal problem: reverse works, fwd not. If i pull the compass to the right it goes in reverse and gives the right signalling etc. If idle and/or pulled left it says FWD_FAULT. (So that's not caused by the ruddersense)

Any idea? (or is this because i don't have a compass installed yet -> is there a way to trick this?)

Do you use a ruddersensor in your setup? In that case have a look at min and max rudder position settings in client menu. One side positive and the other negative.
  Reply
#16
(09-14-2018, 11:46 AM)nvelthuijsen Wrote: I'm still left with a smal problem: reverse works, fwd not. If i pull the compass to the right it goes in reverse and gives the right signalling etc. If idle and/or pulled left it says FWD_FAULT. (So that's not caused by the ruddersense)

Any idea? (or is this because i don't have a compass installed yet -> is there a way to trick this?)

FWD_FAULT, REV_FAULT - means overcurrent is exceeded Check max current
FWD_FAULTPIN, REV_FAULTPIN - end of travel switch prevents travel in that direction
MIN_RUDDER, MAX_RUDDER - rudder feedback prevents travel


It looks like you are hitting overcurrent. What is the max_current set to? You might set the max_slew_speed to a low value (10 or less) to prevent current spikes at startup. Try plotting the servo.current using the scope. It will react to max_current faster than it can plot it though.
  Reply
#17
(09-15-2018, 09:26 AM)seandepagnier Wrote:
(09-14-2018, 11:46 AM)nvelthuijsen Wrote: I'm still left with a smal problem: reverse works, fwd not. If i pull the compass to the right it goes in reverse and gives the right signalling etc. If idle and/or pulled left it says FWD_FAULT. (So that's not caused by the ruddersense)

Any idea? (or is this because i don't have a compass installed yet -> is there a way to trick this?)

FWD_FAULT, REV_FAULT  -   means overcurrent is exceeded  Check max current
FWD_FAULTPIN, REV_FAULTPIN - end of travel switch prevents travel in that direction
MIN_RUDDER, MAX_RUDDER - rudder feedback prevents travel


It looks like you are hitting overcurrent.   What is the max_current set to?   You might set the max_slew_speed to a low value (10 or less) to prevent current spikes at startup.    Try plotting the servo.current using the scope.   It will react to max_current faster than it can plot it though.

I made a test setup on a breadboard. Current is fixed 4.33A, Voltage fixed 10V.

Reverse works ok, no warnings. In idle and when trying forward servo.flag says sync fwd_fault. Fwd does not work..... I feel I am nearly there..... ideas?
  Reply
#18
what do you mean current is fixed? voltage is fixed? How are they fixed?

If over current is detected, it allows twice the max current in the other direction to correct it. This is because many tiller pilots get stuck at the end and otherwise would trigger a current fault to move back again.

If you see FWD_FAULT, it means that overcurrent was detected moving forward. What is servo.max_current set to?
  Reply
#19
(09-16-2018, 05:36 PM)seandepagnier Wrote: what do you mean current is fixed?  voltage is fixed?   How are they fixed?

If over current is detected, it allows twice the max current in the other direction to correct it.  This is because many tiller pilots get stuck at the end and otherwise would trigger a current fault to move back again.

If you see FWD_FAULT, it means that overcurrent was detected moving forward.   What is servo.max_current set to?

For testing purposes i created a voltage-measurement on ADC pin 0 and current-measurement on ADC pin 1. That gives the readings as mentioned and works fine. servo.max_current is set to 20.

The Arduino UNO lacks ADC pin 6.... (so no rudder sense, might be the problem).... i ordered a couple of nano's instead. I wil post the results.

I included some pictures of the setup.

https://drive.google.com/drive/folders/1...sp=sharing
  Reply
#20
Update: Nano instead of UNO fixed the last issues. In my shared folder is the setup.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)