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:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pypilot working on my Nicholson 44
#41
(2020-12-14, 04:58 PM)xfactor99 Wrote:
(2020-12-14, 10:31 AM)Kris Wrote:    //digitalWrite(clutch_pin, LOW);
     analogWrite(clutch_pin, 254);

Could you sailor brothers and sisters share your thoughts on this?

---------------------------

Hi Kris, 

great to hear that you also kept your "old" Neco and drive it through the Pypilot software from Sean.

I also have been thinking in using PWM for the clutch. But at the end I did not, as I dont understand realy what is necessary.  I also drive the series coil through the clutch and I would have to make here changes as well. I already bought a rectifier diode unit for this porpouse and I might start with this.

I guess you need a 100% PWM for a short time to engage the clutch and then mayby 50% to hold it.  I think one has to consider at this point the state of the battery while sailing so it would be a difference if your battary full is at 14V/28V or low 12v/24V so the PWM should be set high to hold the clutch in any state or change the PWM depending on battery state.

So there are some changes to make to motor.ino (or servo.py ??).

If you make any progress on this please let me know.

Save sailing
Andreas

Hello Andreas!

The old Neco units are indestructible and very dependable pieces of equipment for sure! They are very well engineered for the solutions available then and with a little tinkering can be adapted to the Pypilot. Back then I guess permanent magnets were weaker, so having coils build up the static magnetic field had volume and mass advantages over permanent magnet motors.

I am a bit confused by your description. The drive unit has 4 coils, 3 of which are inside the motor. The main coil that is on the rotor shaft is driven through the armature. The series coil and the shunt coil are in the stator. The clutch coil is inside the gearbox.

The easiest option is to drive the series coil in series with your main coil (armature) as per the original setup. So hook your battery positive to the series coil positive, the series coil negative to the positive battery terminal of your motor controller, the negative battery terminal of the motor controller to the battery negative, and finally the motor terminals of the motor controller to the armature. The shunt coil is a very small coil that is only inside of the motor to generate a small magnetic field to start the motor. (It also modifies the motor characteristics a bit.) The easiest method is to drive this coil together with the clutch coil from the clutch pin of the Arduino through a transistor, like Sean's original plans suggest. I believe that your setup is done this way, we just refer to the coils with different terminology. Can you confirm this?

I do not recommend driving the shunt coil with PWM. The shunt coil takes little power. It is best to switch the shunt coil to full power when even a tiny motor movement is needed. I tried driving it by PWM, but it made the motor very very sluggish.

To save power, I installed a second transistor. The gate is connected to both low side pins through diodes and a resistor. The corresponding low side pin come on just before every motor movement. This is the ideal way in my opinion to drive the shunt. Of course rewriting the code and having a dedicated shunt pin would be a more elegant way of solving the problem, but then I would have to touch up Sean's code every time he updates it.

You are right about "you need a 100% PWM for a short time to engage the clutch and then mayby 50% to hold it". Maybe 25-33% is enough as well. In my opinion the battery voltage drop can be neglected though. Just set the lower PWM value to what is needed in case of lower battery voltage, and that's it. It does not make that big of a change.

I did not find a working solution to the problem:
   //digitalWrite(clutch_pin, LOW);
     analogWrite(clutch_pin, 254);

If ever I get so lucky that someone who gets Sean's code gives me a hand with this, that would be a perfect Christmas gift Smile Smile

Everyone be safe!

Kris
Reply
#42
(2020-12-15, 11:59 AM)Kris Wrote:
(2020-12-14, 04:58 PM)xfactor99 Wrote:
(2020-12-14, 10:31 AM)Kris Wrote:    //digitalWrite(clutch_pin, LOW);
     analogWrite(clutch_pin, 254);

Could you sailor brothers and sisters share your thoughts on this?

---------------------------

Hi Kris, 

great to hear that you also kept your "old" Neco and drive it through the Pypilot software from Sean.

I also have been thinking in using PWM for the clutch. But at the end I did not, as I dont understand realy what is necessary.  I also drive the series coil through the clutch and I would have to make here changes as well. I already bought a rectifier diode unit for this porpouse and I might start with this.

I guess you need a 100% PWM for a short time to engage the clutch and then mayby 50% to hold it.  I think one has to consider at this point the state of the battery while sailing so it would be a difference if your battary full is at 14V/28V or low 12v/24V so the PWM should be set high to hold the clutch in any state or change the PWM depending on battery state.

So there are some changes to make to motor.ino (or servo.py ??).

If you make any progress on this please let me know.

Save sailing
Andreas

Hello Andreas!

The old Neco units are indestructible and very dependable pieces of equipment for sure! They are very well engineered for the solutions available then and with a little tinkering can be adapted to the Pypilot. Back then I guess permanent magnets were weaker, so having coils build up the static magnetic field had volume and mass advantages over permanent magnet motors.

I am a bit confused by your description. The drive unit has 4 coils, 3 of which are inside the motor. The main coil that is on the rotor shaft is driven through the armature. The series coil and the shunt coil are in the stator. The clutch coil is inside the gearbox.

The easiest option is to drive the series coil in series with your main coil (armature) as per the original setup. So hook your battery positive to the series coil positive, the series coil negative to the positive battery terminal of your motor controller, the negative battery terminal of the motor controller to the battery negative, and finally the motor terminals of the motor controller to the armature. The shunt coil is a very small coil that is only inside of the motor to generate a small magnetic field to start the motor. (It also modifies the motor characteristics a bit.) The easiest method is to drive this coil together with the clutch coil from the clutch pin of the Arduino through a transistor, like Sean's original plans suggest. I believe that your setup is done this way, we just refer to the coils with different terminology. Can you confirm this?

I do not recommend driving the shunt coil with PWM. The shunt coil takes little power. It is best to switch the shunt coil to full power when even a tiny motor movement is needed. I tried driving it by PWM, but it made the motor very very sluggish.

To save power, I installed a second transistor. The gate is connected to both low side pins through diodes and a resistor. The corresponding low side pin come on just before every motor movement. This is the ideal way in my opinion to drive the shunt. Of course rewriting the code and having a dedicated shunt pin would be a more elegant way of solving the problem, but then I would have to touch up Sean's code every time he updates it.

You are right about "you need a 100% PWM for a short time to engage the clutch and then mayby 50% to hold it". Maybe 25-33% is enough as well. In my opinion the battery voltage drop can be neglected though. Just set the lower PWM value to what is needed in case of lower battery voltage, and that's it. It does not make that big of a change.

I did not find a working solution to the problem:
   //digitalWrite(clutch_pin, LOW);
     analogWrite(clutch_pin, 254);

If ever I get so lucky that someone who gets Sean's code gives me a hand with this, that would be a perfect Christmas gift Smile Smile

Everyone be safe!

Kris
Hi Kris,

you were right I mismach the terminology, it is already some time ago that I was into this.

I guess it is the shunt coil witch I drive through the clutch.

Ther was no Neco electronic left in my drive, just to automotive relays when the Simrad/Robertson AP died ..., the previous owner must have had modyfied the drive before.

Here a basic scrach how it is wired now, except that I´v changed the relay with an SSR-Mosfet later and added end of travel swiches directly to the Pololu dirve.


.pdf   Scratch.pdf (Size: 538.33 KB / Downloads: 260)

Save sailing and merry christmas
Andreas
Reply
#43
Thanks for posting the schematic again. I have seen it in the thread before but did not understand at the time. You have wired it up exactly the way I did with mine, with the little difference of how I drive my clutch and shunt. Don't worry that you do not have the original NECO stuff inside of the box. You really just need the rudder potentiometer with the end switches (although you can get away without them) and the leads to the coils. I have this big mess of wires that make it look complicated, but just so I can switch back to the NECO CU.

With the pololu, you have to use the RC pwm mode that drives the pin at 50% duty cycle for no motor movement. You could try to wake up the part of the motorino code that drives the low side of the Hbridge.

A lazier option would be to order an IBT2 online for 10 euros and try it the way I did on mine, using the H-bridge mode. You will save a bit more than half of the idling current (when the motor does not move but the clutch is engaged). If we ever get the clutch to be driven with PWM, we will massage the idling current down to less than a quarter. My NECO CU takes about 60 watts on idling. Now with pypilot it idles on less than 20 watts, and more savings are to be expected with the clutch.
Reply
#44
(2020-12-15, 02:24 PM)Kris Wrote: Thanks for posting the schematic again. I have seen it in the thread before but did not understand at the time. You have wired it up exactly the way I did with mine, with the little difference of how I drive my clutch and shunt. Don't worry that you do not have the original NECO stuff inside of the box. You really just need the rudder potentiometer with the end switches (although you can get away without them) and the leads to the coils. I have this big mess of wires that make it look complicated, but just so I can switch back to the NECO CU.

With the pololu, you have to use the RC pwm mode that drives the pin at 50% duty cycle for no motor movement. You could try to wake up the part of the motorino code that drives the low side of the Hbridge.

A lazier option would be to order an IBT2 online for 10 euros and try it the way I did on mine, using the H-bridge mode. You will save a bit more than half of the idling current (when the motor does not move but the clutch is engaged). If we ever get the clutch to be driven with PWM, we will massage the idling current down to less than a quarter. My NECO CU takes about 60 watts on idling. Now with pypilot it idles on less than 20 watts, and more savings are to be expected with the clutch.

Hi Kris,

I´m happy with the pololu as I can test the drive and the end switches, start/stop characteristics and I think also break and stall/power settings with the pololu  setup program on my laptopp with a usb cable. This way it was also easy to identify wich cables were wich coil.

The pypilot with the arduino  and the imu (I use an arduino mini pro) are sitting in a separate watertight box and only 3 wires (RC, Clutch and GND) are going to the Neco drive, were the pololu is. So this configuration makes it verry ease to search for foults. I have an extra arduino pro mini with an modified motor.ino and 3 led (clutch,stb,port) exchangeing and testing. As well  I have all componets in spare, just in case.  (I do a lot single haded and don´t want to be without autopilot.)

For the PWM clutch, I would go for a second arduino pro mini (1,8x3,3mm and less then 2€ the clone) programmed to drive the clutch.
Signal in would be the Pin 8 from the other arduino and out the PWM 100% and after an delay the low to hold the clutch. This would be a relatively simple programm and you don´t need to t go into Sean´s motor.ino witch is as far as I understand using interupts and internal timers for time critical operations.

As I stated in some post erlier I have a direct wire to interupt the clutch ... for emergency if the Pypilot starts getting mad ... at the control panel in the cocpit. I would make this into an 3 position switch, off-auto-on. so AUTO would be the pwm driven arduino clutch control, ON would be direct power to the clutch and OFF the erlier on described ermergency cut off.

So far I don´t need the above modification but  I would do for an atlantic crossing or so, the estimated saving would be 10W/h equal to 240W/h a day, do you think that is correct ?

One question, what transistor do you use for driving the clutch from the arduino? I think that my SSR-Mosfet is a little overkill ....

Save sailing
Andreas
Reply
#45
the arduino has limited drive capabilities and should have a 240 ohm resistor on the gate of a mosfet which limits the switching speed but if you use a mosfet with smaller gate charge it can work...

It is already wired to timer2's pwm output so it's a matter of setting a register to get pwm output on the clutch, and it won't affect the operation of the other timer (which uses software pwm to generate deadtime) The mosfet with 20milliohm on resistance should be fine and could drive 3-4 amps, but depending on the current needed you may overheat this, I don't really know what currents the neco drive needs

The only real issue is the timer is set to 4khz so it may make an audible tone with pwm. Maybe you can increase the frequency but it would require other code modifications, and higher frequency may also need different mosfets. I intend to support varying the clutch duty cycle with a servo setting in pypilot but I have not gotten around to testing this and verifying it yet.
Reply
#46
I see that you have updated the motor.ino file a few days ago with the clutch PWM option. How fantastic is that! Do we have to set the 0-255 value in the motor.ino code, and define the time it takes to throttle down between the servo settings in pypilot? Thanks for this option: it can potentially save a lot of juice on long night passages!
Reply
#47
it is another servo setting you can adjust, so far at least from the lcd interface and pypilot clients.

The downside is existing motor controllers use a lower frequency which may make an annoying tone, however it can be filtered out with external components.
Reply
#48
(2021-05-23, 04:22 PM)seandepagnier Wrote: it is another servo setting you can adjust, so far at least from the lcd interface and pypilot clients.

The downside is existing motor controllers use a lower frequency which may make an annoying tone, however it can be filtered out with external components.

How exciting is this! I have just updated openplotter on my raspberry and now looking to upload the new sketch to another arduino nano to find out how it works paired with the Neco autopilot.
There are 2 new servo settings: clutch_pwm and clutch_start_time, right? Clutch_pwm is the pwm value of the clutch and clutch_start_time is the time it takes for the clutch to throttle back?

There is also a new pin used, the clutch_sense_pwm_pin or A5. It is then pulled up, so I guess there should be a normally off switch connected to the clutch solenoid, and this switch is supposed to pull the A5 pin down when the clutch has successfully engaged? This is turn will throttle down the PWM signal of clutch_pin 11, is this right?

Is the clutch sensor needed? Should I just comment out the line where you define the clutch sense pin, and then the clutch will be driven at the lower pwm value after the clutch_start_time has passed?
Reply
#49
rather than being on or off, the clutch output pin switches to pwm after a few hundred milliseconds..

the pwm duty cycle can be adjusted, however the frequency is 2khz because of the 560 ohm gate resistor. This may make noise without an external filter.
future boards will be 16khz with a gate driver chip for the clutch output.

fortunately the software can detect all of this so the same code works on all hardware.
Reply
#50
(2021-05-24, 06:17 PM)seandepagnier Wrote: rather than being on or off, the clutch output pin switches to pwm after a few hundred milliseconds..

the pwm duty cycle can be adjusted, however the frequency is 2khz because of the 560 ohm gate resistor.   This may make noise without an external filter.
future boards will be 16khz with a gate driver chip for the clutch output.

fortunately the software can detect all of this so the same code works on all hardware.

I updated my Raspberry and uploaded the new sketch on the Nano. After updating the Pypilot software, it would not see the IMU anymore. I disconnected the IMU, rebooted, reconnected, and now it works perfectly! It is a fantastic job you are doing with Pypilot! Congratulations! I cannot express how thankful I am!

I only just changed the starboard_pin_fault and port_pin_fault conditions in your code to account for my end switches that work exactly the other way around. Other than that, the code is your stock code.

I have not yet discovered how I can change the two new parameters: the clutch pwm and clutch time. I run the Pypilot code on a Raspberry 3 with a 5 inch touch display. I cannot manage to scroll down to the lower end of the configuration page. I tried accessing the configuration options through the web interface, but that only displays a limited number of options, is that right? Is there a configuration file that I can edit manually to change the two new parameters?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)