Forum Replies Created
-
AuthorPosts
-
Mark81Member
Here the hex file: https://drive.google.com/open?id=0B3jo58iakjPEWlpQRmhWX2w5Tkk
Mark81MemberOk, so you want the swapped pwm/coolant version, but without the laser mode. I will compile and upload this version for you this evening.
Mark81MemberLong answer: I don’t think a “user over on Ox Forum” might be interested in the SPWM/Coolant swap. And this thread is about the “laser mode” for S commands.
Short answer: no, I compiled the repository for you as is, without any swapping… 🙂
Mark81MemberNo, I just downloaded the Patyork’s fork of TinyG repository and compiled it. Then I uploaded the binary file to Google Drive.
I was suggesting to ask Patyork to keep a pre-compiled hex in his repository to help people who don’t want to compile the code themselves.
Mark81MemberHere it is: https://drive.google.com/open?id=0B3jo58iakjPEVHBtMjFqdGFiekk
Anyway I think it should be worth to ask to the maintainer to leave the compiled hex in the github repository.Mark81MemberDone. But I’m not satisfied with the results. I’m going to use GRBL if neither Synthetos G2 has the ‘laser mode’ feature. It’s a pity because TinyG has a lot of interesting features!
Mark81MemberI answer by myself. Yes, the patyork’s fork seems to do the trick! The S commands don’t lead to a deceleration anymore. The movements are quite smooth, just a little vibration. Anyway it’s a HUGE improvements from the official code! I hope they will merge the changes into the mainstream.
Mark81MemberI swapped the timers in pwm.c:
#define PWM1_CTRLA_CLKSEL TC_CLKSEL_DIV1_gc #define PWM1_CTRLB (3 | TC0_CCBEN_bm) #define PWM1_ISR_vect TCE1_CCB_vect #define PWM1_INTCTRLB 0 #define PWM2_CTRLA_CLKSEL TC_CLKSEL_DIV1_gc #define PWM2_CTRLB 3 //#define PWM2_CTRLB (3 | TC0_CCBEN_bm) #define PWM2_ISR_vect TCD1_CCB_vect #define PWM2_INTCTRLB 0
and also in hardware.h:
#define TIMER_PWM1 TCE1 #define TIMER_PWM2 TCD1
then I swapped the gpio assignments:
#define SPINDLE_PWM 0x01 #define MIST_COOLANT_BIT 0x02 #define FLOOD_COOLANT_BIT 0x02
Mark81MemberI swapped the timers in the code, recompiled and downloaded using avrdude. It works! I have my PWM back 🙂
Mark81MemberI’m not offended at all. I’m quite new to tinyG (yes, tinyG, not G2) and perhaps I might be wrong but as far as I understand the project is opensource. Hence, it should be enough to de-solder the xmega and replace it with a new one (which I have in my drawers) and using AtmelStudio to flash the hex of the bootloader before download the latest firmware. Is it correct?
Yes, the PWM worked a while without any connection on the terminal blocks. I’m pretty sure I accidentally connected the wrong wire (it was too early in the morning, gh…). The spindle pin works fine but I don’t understand your question: it’s on a different port (PA5). It would be more useful to know if other pins of PORTD still work, wouldn’t it? Anyway, they seem to work…
About my question: I’m not talking of spare pins, but “unused” ones in my application. Example, from here: https://github.com/synthetos/TinyG/blob/master/firmware/tinyg/pwm.c#L67 it seems the spindle PWM comes from the CCB of TCD1 (PD5). From the schematic the coolant (PE5) is instead CCB of TCE1.
This one is not used (https://github.com/synthetos/TinyG/blob/master/firmware/tinyg/pwm.c#L71) so swapping timers should do the trick. After a quick look to the code it seems both timers are used only for PWM (though I don’t understand what is the purpose of the secondary PWM).
If you think I’m off-topic I will open an issue on github.
-
AuthorPosts