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.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to drive hydraulic
#11
One more question, how would I know if hydraulic mode works as it should be.
If I add a hardware switch to toggle between normal and hydraulic mode, should I notice some details in behaviour? Or, does the hydraulic motor simply just work, or not.
Reply
#12
hydraulic is not different from any other motor, so I'm not sure what the switch is for? Is this on your own arduino controller? In that case it only reads the pin at startup, and this determines the maximum current and how it computes the current, see source for details.
Reply
#13
(2020-09-30, 07:57 AM)jamos.tan@gmail.com Wrote: One more question, how would I know if hydraulic mode works as it should be.
If I add a hardware switch to toggle between normal and hydraulic mode

To rephrase what Sean is saying, there's no "hydraulic mode".  Rather, you can use pin6 on the controller to choose between driving an ESC using PWM pulses every 20mSec (pin6=0), or driving an H-bridge made of four MOSFETs (pin6=1).  

A third option is to set VNH2SP30 in motor.ino, if you're trying to drive an VNH2SP30 or VNH5019 (they're driven the same):
 
  https://github.com/pypilot/pypilot/blob/...r.ino#L119

As Sean says in the code (and as I've also found out), most VNH2SP30 boards are of very bad quality.  I've used a few VNH5019 boards and had no problem.

As a fourth option, some people (@McNugget) are using the IBT-2 H-bridges .  Code for this isn't in Sean's codebase, but it can be done.

Whether you're using a hydraulic drive or your tiller, you probably want pin6=1 to drive your H-bridge.  

(2020-09-30, 07:57 AM)jamos.tan@gmail.com Wrote: but my current H-bridge can go to 43A

Can you tell us more about this H-bridge?
Reply
#14
Sorry, I didn't understand the first time, but your latest responses clarify it more, but also rises more questions for me. Hope you don't mind.
I am using this one: (Isn't that the IBT-2 as you describe)

- datasheet: https://www.alldatasheet.com/datasheet-p...7960B.html
- module: https://opencircuit.nl/Product/BTS7960-D...Driver-43A

I'll dive into what I need extra so I complete the setup, I guess there would be these subjects:

- Add switch so this part is supported (on boot of the arduino):

digital pin6 determines:
1 - RC pwm:
digital pin9 pwm output standard ESC (1-2 ms pulse every 20 ms)
pin2 esc programming input/output (with arduinousblinker script)
0 - Hbridge
digital pin2 and pin3 for low side, pin9 and pin10 for high side

- Personally I need to look into the difference between ESC and H-bridge, I've found some schematics on Sean's website that are helpful.
Now only I need to determine if my board, or the VNH5019 is better suited for driving it. Advantage of VNH5019 is that it seems to have current sense, which would be great.
Reply
#15
(2020-10-01, 09:29 AM)jamos.tan@gmail.com Wrote: Advantage of VNH5019 is that it seems to have current sense, which would be great.

Your module is an IBT-2 (you can see it on the circuit board).  There's no support for this in Sean's code.  

The BTS7960 does support current sense (section 4.4.4).

I found a schematic for the IBT-2:

  https://elecrow.com/download/IBT-2%20Schematic.pdf

I bought this one:

  https://www.aliexpress.com/item/4001351651925.html

The schematic shows 8 1k pulldown resistors.  However the IBT-2 I bought (see above) has 8 **10k** resistors, but none of them are connected.  So you might want to check this on your module.

(2020-10-01, 09:29 AM)jamos.tan@gmail.com Wrote: determine if my board, or the VNH5019 is better suited for driving it.

If you'd like to try the VNH5019, I have bought several from here:

  https://www.aliexpress.com/item/4000046778315.html

Pictures of my autopilot, using the VNH5019:

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

I found a bug in the VNH5019 support in motor.ino, where voltage detection wasn't done right:

Code:
@@ -115,10 +115,10 @@ PWR+             VIN
 
 
 
-//#define VNH2SP30 // defined if this board is used
+#define VNH2SP30 // defined if this board is used
 //#define DISABLE_TEMP_SENSE    // if no temp sensors avoid errors
 //#define DISABLE_VOLTAGE_SENSE // if no voltage sense
-//#define DISABLE_RUDDER_SENSE  // if no rudder sense
+#define DISABLE_RUDDER_SENSE  // if no rudder sense
 
 
 // run at 4mhz instead of 16mhz to save power,
@@ -405,10 +405,14 @@ void setup()
 #if 1
     // setup adc
     DIDR0 = 0x3f; // disable all digital io on analog pins
+#ifndef VNH2SP30
     if(pwm_style == 2 || ratiometric_mode)
         adcref = _BV(REFS0); // 5v
     else
         adcref = _BV(REFS0)| _BV(REFS1); // 1.1v
+#else
+    adcref = _BV(REFS0)| _BV(REFS1); // 1.1v
+#endif
     ADMUX = adcref | _BV(MUX0);
     ADCSRA = _BV(ADEN) | _BV(ADIE); // enable adc with interrupts
 #if DIV_CLOCK==4

If you'd like to keep using the IBT-2, I suggest you read this, then contact @McNugget for help:

  https://hackaday.io/project/168592-openc...-waypoints

There's a link on that page to his (now old) motor.ino which works with the IBT-2.

Me, I'd measure the current of your hydraulic system under different situations, especially at the end of travel, and with lots of weather helm.  You could measure high current with something like this:

  https://www.aliexpress.com/item/4000776170917.html

Then you can work out whether you need the IBT-2, or whether the VNH5019 will be ok.

(2020-10-01, 09:29 AM)jamos.tan@gmail.com Wrote: I'll dive into what I need extra so I complete the setup
I've found some schematics on Sean's website that are helpful.

If it helps, here's a schematic for an absolute bare-bones autopilot using the VNH5019:

  
.pdf   ozhelm.pdf (Size: 73.99 KB / Downloads: 747)

It works, but there's no fault detection or circuit protection.  It's useful just as a starting point / proof of concept.

(2020-10-01, 09:29 AM)jamos.tan@gmail.com Wrote: also rises more questions for me
Hope you don't mind.

Not at all, happy to help and answer questions!
Reply
#16
I would like to support the IBT-2 more simply with a single ifdef, but I don't have this hardware and mcnugget gutted my code to make it easier to understand (for him at least) which is great and I'm glad to see this, but he made the ADC samples a lot noiser in the process and introduced the use of floating point math which is best avoided if possible because all the time doing these calculations degrades performance.
Reply
#17
(2020-10-01, 06:07 PM)seandepagnier Wrote: I would like to support the IBT-2 more simply with a single ifdef

My changes already did this:

  https://github.com/pypilot/pypilot/pull/42

Adding new drivers would have been easy.  (The cost of this is that it drops the use of pin6 to select between ESC and H-bridge mode at run time).  And I offered to incorporate @McNugget's IBT-2 changes.

If you'd like me to rebase this code to the current motor.ino, please let me know and I'll do it.  Would love your guidance so what I come up with will be something you can accept.
Reply
#18
If it requires recompiling with a different define, then sure you can remap any of the pins to do anything. So my driver would use pin6 for this but yours could use any pin.

If you want to rebase and try again please do, but I don't want to merge anything with floating point math since it's just not needed and it does degrade performance. I don't want to merge anything that negatively affects the current driver on my motor controllers, but you have specific operation in a different driver I don't really mind even if it isn't optimal.
Reply
#19
(2020-09-30, 07:57 AM)jamos.tan@gmail.com Wrote: One more question, how would I know if hydraulic mode works as it should be.
If I add a hardware switch to toggle between normal and hydraulic mode, should I notice some details in behaviour? Or, does the hydraulic motor simply just work, or not.

It simply just works.  The switch is after the motor control between the 2 motors.  Pypilot is not aware of any change.
Reply
#20
CapnKernel and all the rest.... THANK YOU!!!

I already use the IBT-2 for my ST4000 Autohelm tiller, I only needed to select PWM style = 2 ( I think it was 2) and then it just worked fine. There was some high pitch noise with some other tillers, but fixed this with a number of khz settings somewhere in the code.

About the current sense, did not know that the IBT-2 also supports it, great! I have exactly the same board as your link, with the same resistors. I think when I can get this working I'll stick to the IBT-2, it's so easy and it really feels like a robust board with the nice large heatsink.
Do you have any idea of how the current sense can be connected on that board?

I also have some pictures of my set-up, it is far from ideal because it is a metal casing which is absolutely not waterproof and GPS / WiFi signals are low. But, I have started a project which will solve this all. 
[Image: DSC-1239.jpg]
[Image: DSC-1237.jpg]
I just took a mini-itx format PC casing, and lasered the connections on the io shield on the back. 
I am now on another version with another type of casing and material, to take it a step further.

But first, I need to get my hydraulic pilot to work! I wish all a great weekend! (I know I'll be soldering probably haha)

Kind regards,

Jamos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)