Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom firmware development
#81
Just got back from a vacation. I will review the patches over the weekend.
Thanks,
Bgm.
Reply
#82
Is that there are still things to fix?
Reply
#83
Quote:Is that there are still things to fix?
Yes.
In the repetier firmware the thermistor use -10 as detect temperature , in case of defect thermistor or broken cable.
But since the table we have in configure.h only list to 20 degree C. If any thermistor happen to broken/disconnect during the print. It might cause a fire/damaged hot-end or heated bed to our 3D printer.
The best the extend the table and make sure when any thermistor is unplugged the repetier will show def on the temperature reading ( right now it show 20 degree on no temperature sensor). To see the thermistor table you have to upload the configure.h to [url=http://www.repetier.com/firmware/v091/[/url].
defect temperature defined in configure.h
#define MIN_DEFECT_TEMPERATURE -10
thermistor table
#define USER_THERMISTORTABLE0
#define USER_THERMISTORTABLE1

Here is the table I have for work around in order to trigger the defect temperature, I add table for -20 degree with fake adc value.
#define USER_THERMISTORTABLE0 {{111,2240},{132,2120},{165,2000},{201,1920},{248,1800},{309,1720},{389,1640},{485,1560},{596,1440},{714,1360},{894,1280},{1083,1160},{1312,1080},{1539,960},{1786,880},{2006,760},{2208,640},{2382,560},{2503,440},{2602,360},{2679,264},{2729,160},{2740,-160}}
#define USER_THERMISTORTABLE1 {{2003,1040},{2058,1000},{2161,960},{2253,920},{2337,880},{2450,840},{2549,800},{2637,760},{2715,720},{2786,680},{2907,640},{3008,600},{3093,560},{3165,520},{3247,480},{3316,440},{3374,400},{3447,360},{3506,320},{3548,280},{3610,240},{3664,200},{3708,160},{3723,-160}}
Please test it and make sure it works with yours. Please add to the pull list if it works for you.
Thanks.
Reply
#84
Hello there
I tested your code and does it work, I'm "Def" on the LCD screen when I unplug the probe from the bed
I just made a pull request

I have not tested the extruder
Reply
#85
The firmware has been updated
-If Read error of a probe, the printer goes into default
-Correction Gain extruder

BGM is what the rest will be added?
Reply
#86
Thank You for your work on mapping the additional pins for the Da Vinci 1.0. I have a Da Vinci 2.0 and the current RepRap firmware doesn't support the second extruder. If I do set the temp on the second extruder the bed heats up also. I am a C# developer so code doesn't scare me. However this isn't C#. I will be looking through the variant.cpp that I pulled from the Davinci branch. Could you give me some pointers on what I should do to try to map the remaining pins that you are not sure about? Just get me started and I will do the work.
Reply
#87
I have given this my best shot. But now I am stuck. The only thing I have managed to accomplish is getting the second extruder to heat. That was already done for me. All I did was verify that someone else's previous work was correct. In the Pinout.csv I have verified this line.

PB12 86 20 Extruder 2 Heater, 1 = ON Out 0

I started with these files. https://github.com/bgm370/dav10

I started out using the Dav10Test.ino. I made some of my own changes to test the Extruders heating. I tried testing several pins to see if they would measure the Heat on the second Extruder with no luck. However, I don't understand enough to be comfortable making any changes to the variant.cpp

Could someone please help me with this? I will take any help I can get. I would like to get the firmware working for the Da Vinci 2.0.
Thank You
Reply
#88
If I do not say stupid things, do not touch Varriant.ccp file. It only says the pins of the microcontroller
We must declare the pins in the repetier firmware in Userpin.h
Reply
#89
The temp sensor has to be on one of the 12 ADC channels AD0-AD12, because AD13 and AD14 are already taken.
I'd just use a simple sketch to try each of them in order. AD0-AD7 and AD10-AD13 are already mapped to Arduino pins 54-65.
To try AD8 and AD9 you will need to add a line to variant.cpp, something like pin 126 which I added for AD14.

Good luck,
Bgm.
Reply
#90
I passed as stock versions for testing and found some differences Repetier:
-The Accelerations are much less abrupt
-The Engine operation is different, there are more noisy

I'll edit the accelerations for the operation of the stock version, I think the printer will be less stress
Reply
#91
Thank You!
I had tried the simple Sketch to test pins 54-65 and didn't have any luck. Thanks for pointing out that AD8 and AD9 were not defined yet. I was able to determine that AD9 is what I wanted so I have done as you suggested and created a line 127 in the variant.cpp.

Now I have two questions.
How can I get my changes uploaded to your Variant.cpp and your pinout.csv on GitHub https://github.com/bgm370/dav10 ? Should I create a fork and upload them myself or just send you the files I have?

My second question is for anyone to answer. Where in the Repetier firmware should I start looking to make changes so it will use Pin 20 for heating Extruder 2 and Pin 127 to monitor the temperature?
Reply
#92
Hi I have a Da vinci 2 and playing with repetier Fw
I also found A9 is the temperature reading and pin 20 the heat on/off by changing values in userspin.h

Sorry I appologize in advance for my stupid question as I am new in arduino but I found A9 is defined already in varian.cpp on github or I read wrongly the comment
// 54 .. 65 - Analog pins
[...]
// 62
{ PIOB, PIO_PB17X1_AD10, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC8, ADC10, NOT_ON_PWM, NOT_ON_TIMER }, // AD8
{ PIOB, PIO_PB18X1_AD11, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC9, ADC11, NOT_ON_PWM, NOT_ON_TIMER }, // AD9
[...]

so I just changed accordingly in userspin.h:
#define HEATER_0_PIN 20
#define TEMP_0_PIN 9 // ADC channel #, not a PIN #


and I got accurate temperature control -
so why need pin 127 ?
(Also need extruder2 motor pins to be found )
Reply
#93
I am also new to Arduino so I could easily be wrong. I used a sketch to test the value of those pins 62 and 63 that you are showing there. 63 did change value as though it was measuring temperature but only when I was also heating Extruder #1. When I only was heating Extruder #2 These Pins did not change value.

However this is how I understand these declaration lines to work.
{
PIOB // I have no clue
, PIO_PB18X1_AD11 // This is some sort of a defined variable I found in some other files called SAM4ae.cpp or something like that. I think the PB18 is a pin address and the AD11 is the channel. I could be wrong but in my sketch this pin only changed values when Extruder 1 was hot not when Extruder 2 was hot.
, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG // I don't know again.
, ADC9 // Not really sure what this does but I did notice that you can change this to any other ADC# and it wouldn't change anything that I saw.
, ADC11 // I think this is where the actual channel is assigned to the pin. Again these are all just my guesses.
, NOT_ON_PWM, NOT_ON_TIMER }, // AD9

I trust BGM when he says AD8 and AD9 are not defined in that variant.cpp file that is how I came to my conclusions. In any case Here is what I changed in the Variant.cpp to get pin 127 to work.

// 125
{ PIOB, PIO_PB24, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 125
{ PIOB, PIO_PB21X1_AD14, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC14, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 126 - PB21 with enabled ADC
{ PIOB, PIO_PB13X1_AD9, ID_PIOB, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC9, NOT_ON_PWM, NOT_ON_TIMER } // PIN 127 - PB13 with enabled ACD AD9
// END
//{ NULL, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT, 0, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }
} ;

I am looking forward to working with you to get the firmware working on the Da Vinci 2.0. By chance do you have a copy of the Stock firmware file?
Reply
#94
Well I will recheck to ensure I only heat extruder 2, I willing to learn and improve.

Unfortunatly I do not have stock fw, I did update wrongly to J version recently , so it make my filament counter reset not working anymore and all printing failed, that is why I jumped to repetier fw, at least can use my printer, even better I should say , thanks to bgm and all others ^_^
Reply
#95
A you tried to reset the cartridge with the new method that increments the serial number of EEPROM?
Reply
#96
Actually I used this method already, I did not try to reset again after FW upgrade and XYZ update, and as I was not be able to check because no stock FW I moved to repetier FW even only one extruder is work today
Anyway as XYZ software is really bad (to stay polite) - I do no regret switched to Repetier/cura Big Grin

Edit : I have pushed extruder left to 220 degres controled by repetier by changing pins values in userspin.h:
#define HEATER_0_PIN 20
#define TEMP_0_PIN 9 // ADC channel #, not a PIN #

I confirm : extruder Left is hot and has 220 degres (I have checked by putting filament on extruder and it melt and also with Infrared thermometer) and extruder right is cold (35 degres)
I cannot extrude because of missing extruder motor pins but it works without changing varian.cpp- so I am confuse
Reply
#97
Quote:Edit : I have pushed extruder left to 220 degres controled by repetier by changing pins values in userspin.h:
#define HEATER_0_PIN 20
#define TEMP_0_PIN 9 // ADC channel #, not a PIN #

I confirm : extruder Left is hot and has 220 degres (I have checked by putting filament on extruder and it melt and also with Infrared thermometer) and extruder right is cold (35 degres)
I cannot extrude because of missing extruder motor pins but it works without changing varian.cpp- so I am confuse

I see what you did and how it works. In the userspins.h the comments show that the AD Channels are not actual pin numbers. So when you changed it to Channel 9 it was talking directly to that channel. If that works then in theory we don't need pin 127 that I defined and could even remove pin 126 definition that BGM created. I don't know if that pin definition is used anywhere else in the firmware. I will remove pins 126 and 127 from my variant.cpp and she what happens when I recompile the firmware and upload it to the Da Vinci. Then I will move forward with adding support for the second extruder. Thanks for your help.
Reply
#98
IUC
Take a look at the zip file I have uploaded here. It contains my changes to the userpins.h file. I have found and included all the standard variable names we need to enable the second extruder. I have commented out the second set of stepper motor pins because I don't know the pin numbers to use yet.

The zip also contains a new Configuration.h file that includes support for the second extruder. I generated this file using the repetier configurator tool. http://www.repetier.com/firmware/v091/

If I am correct then all we need to do is map out these last few pins and then we will be done. https://forum.voltivo.com/images/DaVinci...ration.zip
Reply
#99
Hi reading at pinout.csv and http://arduino.cc/en/uploads/Main/arduin...ematic.pdf and checking the free pins, I found 2 pins for second extruder :
Name Pin Arduino Purpose
PB14 140 53 Motor E2 step (#define ORIG_E1_STEP_PIN 53)
PC28 139 3 Motor E2 dir (#define ORIG_E1_DIR_PIN 3)

Need to inverse motor in Configuration.h (#define EXT1_INVERSE 1)

But again I have a stupid question : how to test the enable pin ?(ORIG_E1_ENABLE_PIN) in test sketch or in repetier, any free pin value is working, (did same for extruder one) I can extrude with any value. Blush
Is there a way to control if pin value is correct ? for step and dir pins it was obvious for me but for enable pin I have no clue -
today I have set 4 as it is free but I wish to set the correct value - could someone help to improve my knowledge ?

Thanks in advance.

Aaryn,
I have noticed your new configuration.h file has differents step value than current one, is that normal ? sorry to ask as I may missed some informations parsing the forum, are these changes done for improvement or due to automated generation ?

Thanks,

Luc
Reply
IUC I think I have it all ready to go.

I have been writing sketches all day to make sure I have all the pins correct. Thank you for finding the first two pins and especially for finding the Inverse direction setting in the Configuration.h file. I was getting frustrated by that moving filament the wrong way until I re-read your post.

The Enable pin was not defined in the variant.cpp at all so I had to add it as Pin Number 128. I have attached another zip file with the files I have had to change to make it work.
The zip includes:
Pins.h -- In order to get the firmware to compile I had to change a single IF statement to define the E1_Pins as well. I am sure you already found and fixed this.
userPins.h -- maps out all of the pins you and I have found including the new pin 128 for the E1 Enabled.
Configuration.h -- The only changes I have made here are the Invert E1 direction and the steps per MM setting you mentioned before. I reverted back to the original number for the steps. To answer your question. The number in my last file was auto generated. This number is what the machine uses to know how many times to step the Z motor to move the bed X number of millimeters. Each printer may vary on this number so it would be a good idea to calibrate our machines individually.
Variant.cpp -- this one has line 127 and 128 that I have added. 127 is not required in the firmware but it is useful when we are writing sketches. Just to make sure other readers know the Variant.cpp goes here "C:\Program Files (x86)\Arduino\hardware\arduino\sam\variants\arduino_due_x\variant.cpp" on a windows machine. It is not included with the rest of the firmware when you compile.

The reason you are able to test extruding with the second Extruder right now is because that enable pin defaults to enabled when the printer starts up. having this pin mapped allows the software to disable the motor so it isn't always actively locked up. After a few hours of that it will get really hot.

I was not able to test all of this before I left my office today so I may have missed something. Please correct me if I did. Soon I will try to get this complete firmware uploaded to BGMs github repository. It will probably need to stay as a separate branch/fork though. This firmware will work on the Da Vinci 1.0 but the LCD display will say Da Vinci 2.0 and it will attempt to display the temperatures for the second extruder.

In addition to calibrating our printers we may need to change the tables values for the extruder temperatures. These may be a little off.

EDIT: I have removed the Zip file because the files had some errors. A new zip file with corrected files is attached to my next post.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)