PR: Add support for L298N driver#54
PR: Add support for L298N driver#54RuairiSpain wants to merge 3 commits intoAmboVent-1690-108:masterfrom
Conversation
|
Please re-review your changes, it seems that you fixed some conflicts incorrectly |
| # define control_with_pot true // 1 = control with potentiometers 0 = with push butto | ||
| # define FF 10 // motion control feed forward | ||
| # define KP 3 // motion control propportional gain | ||
| #>>>>>>> master |
| pinMode(pin_LED_AMP, OUTPUT); | ||
| pinMode(pin_LED_FREQ, OUTPUT); | ||
| pinMode(pin_LED_Fail, OUTPUT); | ||
| pinMode(pin_USR, OUTPUT); |
There was a problem hiding this comment.
Those aren't supposed to exist anymore
There was a problem hiding this comment.
Nimrod Nimrod
Pin 5 is defined a Alarm reset It cannot be a PWM output .
define pin_RST 5
define pin_FORWARD 5
| // L298N specific | ||
| #define L298N false | ||
| #define pin_SPEED 7 // analog | ||
| #define pin_FORWARD 5 // digital | ||
| #define pin_BACK 3 // digital | ||
|
|
||
| // Talon SR or SPARK controller PWM settings ("angle" for Servo library | ||
| #define PWM_mid 93 // was 93 - mid value for PWM 0 motion - higher pushes up | ||
| #define PWM_max 85 | ||
| #define PWM_min -85 |
There was a problem hiding this comment.
Insert the motor's def to #if statement so the unnecessary definitions won't be compiled
| # define pin_AU 13 // Amp Up - not used when you have potentiometers | ||
| # define curr_sense false // o no current sensor | ||
| # define control_with_pot true // 1 = control with potentiometers 0 = with push buttons | ||
| # define control_with_pot true // 1 = control with potentiometers 0 = with push butto |
|
@RuairiSpain , I've edited the IDE output to be only the last 2 lines. I'll update the PR temlate shortly to make it more clear that's all we are looking for. Please update the information about the build output to indicate your Arduino IDE version and board you chose, as well as the git hash you built which corresponds to that output. |
| PointerAlignment: Left | ||
| RawStringFormats: | ||
| - Delimiter: pb | ||
| - Delimiters: [pb] |
There was a problem hiding this comment.
What does this change do and why was it required?
There was a problem hiding this comment.
Not my change but let me explain the pwm driver used up until now is a 40$ part the LM298N module is is a 2$ part it is not 10amps but even if you use a https://www.cytron.io/p-10amp-5v-30v-dc-motor-driver it is 10$ . To me dropping bom cost by 30$ or 35$ is a good reason.
As this is community Funded you need to Lower the BOM as far as possible.
Using 20$ pcbs for the TI sensor not 60$ Using PWM PCB that are High Volume not made
for REX Robotics for kids
https://www.cytron.io/p-10amp-5v-30v-dc-motor-driver 10$ (My option)
https://www.4project.co.il/product/l298n-module 5$ ( I do not know if 2amp will do)
2$ from Aliexpress type places.
https://www.revrobotics.com/rev-11-1200/ 40$
Note The Two Top option need PWM on 2 pins and care to create dead time . It Saves 30-35$ on the BOM . The Two Top options are far more of the Shelf Items.
Sorry For the Slow reply. Take a good look at this Project and the BOM costs
https://scitechdaily.com/easy-to-build-75-open-source-arduino-ventilator-with-high-quality-performance/ (it is CPAP I doubt the include the mask in 75$)
Note Today the funds to make 20 units stands on 4260$ Just over 200$ .two weeks into the campaign. To save 600$ on the 20 units for me is worth while and also off the mass produced if they get made.
Note 3v Level shift has been added to the pcb

Description:
Add support for L298N driver boards
Checklist:
./run_clang-format.sh(see mainREADME.md for details on how)
build output below
the version number string at the top of "ventilation_machine.ino" and updated the Software Changelog
in the main AmboVent readme.
Arduino IDE build output:
Date and time I performed this build: YYYYMMDD-HHMMhrs
(git hash ???????) (IDE ?.?.??) (Arduino __ ? __)
Sketch uses 18140 bytes (59%) of program storage space. Maximum is 30720 bytes.
Global variables use 1076 bytes (52%) of dynamic memory, leaving 972 bytes for local variables. Maximum is 2048 bytes.