News:

New registrations to the forum only by request to admin@underservice.org

Main Menu

Shorting Coil with an Arduino UNOR3 V1 (DDS + Train Pulses)

Started by Vincent, February 17, 2014, 08:49:17 PM

Previous topic - Next topic

Vincent

What it does this sketch ?

With this sketch you have a DDS generator with a train pulse generator. Both adjustable.

What do you need ?

:: One Arduino UNO R3 (MEGA328P ATMEGA16U2 ).
:: One LCD Board Keypad Shield.

Technical Specs (adapted for short a coil).

:: DDS 500hz - 20khz // Duty Cycle 2 % - 99%.
:: Shorting Coil pulses from 1 microseconds (fix).
:: Phase delay : 1 to 600 (adjustable).
:: Pulses by shot : 1 to 30 (adjustable).

Hardware Connections

:: Pin 2 must be connected to Pin 3.
:: Pin 3 Output DDS.
:: Pin 12 Output Short Coil Module.

Software

1. You must have the Arduino environment installed and working.
2. Install the library PWM (attached to this post).
3. Open the Sketch.
4. Before do the upload you must check the main frequency and DDS on this line :

// **************User must enter Frequency in HZ and Duty Cycle********
int32_t frequency_3 = 8000;    //Frequency (Hz) Master Coil Pin 3
int dutyC= 420;               // Duty Cycle 10 (0%) - 1000(100%)
//********************************************************************************
If you want 5500 hz and 50% Duty Cycle :

int32_t frequency_3 = 5500;    //Frequency (Hz) Master Coil Pin 3
int dutyC= 520;               // Duty Cycle 10 (0%) - 1000(100%)

5. Save and upload to your Arduino.

FAQ

1. Why do I need to change the main frequency from the code ?

The arduino is working at full load. More choices from the keyboard means more power. I'm working in a more powerfull version. But this version do the job very well.

2. How do I change Phase and Pulses Quantity ?

Use the LEFT and RIGHT buttons to Phase change (steps 0.5) and UP and Down to Pulse change.

3. Why my LCD blinks at certain combinations ?
See FAQ 1. You will know wich combinations are the best for your setup.

Thank's to kEhYo77 and Romero. His code and explanations helped me to develop this application.

Enjoy,

Vincent.

Romero


thank you Vincent for all your effort. I will give them a first try tomorrow.

Best regards,
Romero

Romero

Hi Vincent,

this module outputs signal only on pin 3 but nothing on pin 12 any idea?

Regards,
Romero

Romero

Working now, it works only with Arduino Uno not with Mega
I like the wide range of Phase, this way I can use the same  code to test shorting BEMF

Vincent


Vincent

For those who encountered problems with the initial setup.

This module only works in an Arduino UNOR3 or Pro-Mini.

:: PIN 3 and 2 must be connected together.

** PIN 3 is the DDS output and PIN 2 is triggering the signal // Driving the main coil.

:: PIN 12 is driving the shorting coil module.

**************************************************************************
Keypads Pins

Starting from the LEFT to Right (Pins on the top).

Pin13. NC
Pin12 - Output to short module.
Pin11. NC
Pin3 - DDS Output.
Pin2 - Trigger connected to Pin3.
Pin1.  NC
Pin0.  NC

**************************************************************************

How to check if your pins are working well ?

1 .First, if you soldered the extra pins, be sure that everything is OK there.
2. Upload the debug_pins routine to your Arduino. Then you will see on your scope :

Pin12 - 1000khz frequency.
Pin3   - 4000khz frequency.
Pin2   - 8000khz frequency.

with 0.10 seconds interval.

**************************************************************************

How to check if the buttons are working OK ?

1. Upload the debug_buttons routine.
2. Open the serial console.

You mast see this values or closer to these numbers when you press a button :

No Button pressed : 1023
UP : 132
Down : 312
Left : 482
Right : 0
Select : 720


Regards.

Vincent

Vincent

Hi,

I'm posting a new version for this module. While I'm doing tests, I did several improvements that could help another people.

Improvements

:: Minimal pulse for short a coil of : 0.1250 us
:: Train pulses frequency : 1.6 Mhz. ( against 320 Khz of Version 1).
:: Bug fixed when phase was 1.
:: Max pulses by shot reachs 40 now.
:: Output PIN Short Coil Module now is 13.


:: Only works in :Arduino UNO R3 (MEGA328P ATMEGA16U2 ).
:: LCD Board Keypad Shield.

Technical Specs (adapted to short a coil).

:: DDS 500hz - 20khz // Duty Cycle 2 % - 99%.
:: Shorting Coil pulses from 0.1250 us (fix).
:: Phase delay : 2 to 600 (adjustable).
:: Pulses by shot : 1 to 40(adjustable).

Hardware Connections

:: Pin 2 must be connected to Pin 3.
:: Pin 3 Output DDS.
:: Pin 13 Output Short Coil Module.

************************************************
Future Improvements for V3 Turbo Reload.

:: Cycle Control for Charge / Discharging Capacitor to a load.

Cheers,

Vincent

Romero

Thank you Vincent!
Another question... you know the code from JL Naudin. Can you make it send train pulses for each sensing from the hall sensor? 4 fast pulses will be enough, also to be able to run 2 independent coils, 2 hall sensors... from one arduino. Down button in that code does not work too.
I have few projects that I am working on and later on this type of code will be super. I am also sure that many other people are appreciating your effort.

Lately I am learning how to to use a CNC Router as I have ordered one and expecting to get it by Monday but I have never used one before. Autocad or Solid Works are not my strenght too... lots of learning.

Regards,
Romero

Vincent

Hi,

Another question... you know the code from JL Naudin. Can you make it send train pulses for each sensing from the hall sensor? 4 fast pulses will be enough, also to be able to run 2 independent coils, 2 hall sensors... from one arduino. Down button in that code does not work too.

@ I know the code, is well written. The button problem comes from the library. Every Keypad shield have different leaders resistors. There are like 4 versions on the market. Check the version that I fixed and tell me if it's working for you now.

(Thank's to JL Naudin for his code // All credits to him, I updated the library).


:: New Module

I can do the modification that you are proposing, but I need more information.

Hall 1 // Hall 2 // Coil 1 // Coil 2

:: Witch hall is driving  witch coil ?
::  Do you need a delay between the hall pulse and coil activation ?
::  MAX Rotor RPM and how many magnets ?
::  4 fast pulses on every coil ? How fast ?

Also I can modify JL Naudin code to send 4 fast pulses and start from there.

I have few projects that I am working on and later on this type of code will be super. I am also sure that many other people are appreciating your effort.

@ A pleasure to work on it.

Lately I am learning how to to use a CNC Router as I have ordered one and expecting to get it by Monday but I have never used one before. Autocad or Solid Works are not my strenght too... lots of learning.

@ I wish you  the best with a CNC. Autocad and Solid Works are complex, but with patience you will find the key to accomplish good designs. Take a look to google sketchup and G-code. Maybe sketchup can be a good tool to learn too, less complicate and a stepstone to get introduce into this amazing world of 3d, pieces and robots.

Regards,

Vincent.



Romero

Quote from: Vincent on February 21, 2014, 08:26:10 PM
Hi,

Another question... you know the code from JL Naudin. Can you make it send train pulses for each sensing from the hall sensor? 4 fast pulses will be enough, also to be able to run 2 independent coils, 2 hall sensors... from one arduino. Down button in that code does not work too.

@ I know the code, is well written. The button problem comes from the library. Every Keypad shield have different leaders resistors. There are like 4 versions on the market. Check the version that I fixed and tell me if it's working for you now.

(Thank's to JL Naudin for his code // All credits to him, I updated the library).


:: New Module

I can do the modification that you are proposing, but I need more information.

Hall 1 // Hall 2 // Coil 1 // Coil 2

:: Witch hall is driving  witch coil ?
::  Do you need a delay between the hall pulse and coil activation ?
::  MAX Rotor RPM and how many magnets ?
::  4 fast pulses on every coil ? How fast ?

Also I can modify JL Naudin code to send 4 fast pulses and start from there.

I have few projects that I am working on and later on this type of code will be super. I am also sure that many other people are appreciating your effort.

@ A pleasure to work on it.

Lately I am learning how to to use a CNC Router as I have ordered one and expecting to get it by Monday but I have never used one before. Autocad or Solid Works are not my strenght too... lots of learning.

@ I wish you  the best with a CNC. Autocad and Solid Works are complex, but with patience you will find the key to accomplish good designs. Take a look to google sketchup and G-code. Maybe sketchup can be a good tool to learn too, less complicate and a stepstone to get introduce into this amazing world of 3d, pieces and robots.

Regards,

Vincent.
Hi Vincent,
Let's start to modify JL Naudin code and add  4 fast pulses instead of one.
Now  imagine 2 independent arduino, each driving separate coils.
What I wanted was to combine 2 arduino coil controllers into one then when adjustments are made via keypad both coils are receiving the same data, increasing or decreasing value sent to both direction. I am sure this can be done for more than 2 independent coils but for 2 is ok for me.
The number of magnets can be defined manually in the code, that is how is done in Naudin's code already.

I have used Google sketch up for basic design in the past but I find SolidWorks the best, you can also preview CNC operation before to prevent wasting material. I have used Autocad too but never for 3D modeling.
I have a new generator to build and I want to make use of the CNC Router facilities to make it. This is something I always wanted and now its time to learn how to use it. Next is to get a 3D printer and a 3D scanner.

Regards,
Romero

Vincent

Hi Romero,

Let's start to modify JL Naudin code and add  4 fast pulses instead of one.

@ I'm working on it. Adjusting my old rotor but well balanced for the tests. Gives news ASAP.

Now  imagine 2 independent arduino, each driving separate coils.
What I wanted was to combine 2 arduino coil controllers into one then when adjustments are made via keypad both coils are receiving the same data, increasing or decreasing value sent to both direction. I am sure this can be done for more than 2 independent coils but for 2 is ok for me.

@ We can drive more than 2 coils with 1 arduino. I started to do code optimization, writing sentences in C. So low level programming give me more speed and power over the processor.

a+

Vincent
 

Vincent

Update # 26/02

Hi,

I'm working on the JN code and is not stable to do the modifications. I started from the scratch with a more powerful routine, with better handle of external interrupts, LCD refresh and compatibility with a module to manage BEMF // Load // Discharge capacitors.

Coming soon :

:: New module for Magnetic Motors ( timing 99.99% accurate).
:: New version for the shorting coil module.
:: Gauss probe with an Allegro A1324LUA-T. This one is an amazing tool to do tests with coils and see where, when and how are resonating with different kinds of cores (until 18Khz).

Cheers,

Vincent

Vincent

Quote from: Vincent on February 26, 2014, 08:37:31 PM
Update # 26/02

Hi,

I'm working on the JN code and is not stable to do the modifications. I started from the scratch with a more powerful routine, with better handle of external interrupts, LCD refresh and compatibility with a module to manage BEMF // Load // Discharge capacitors.

Coming soon :

:: New module for Magnetic Motors ( timing 99.99% accurate).
:: New version for the shorting coil module.
:: Gauss probe with an Allegro A1324LUA-T. This one is an amazing tool to do tests with coils and see where, when and how are resonating with different kinds of cores (until 18Khz).

Cheers,

Vincent

Tests on going...code soon