Welcome! Log In Create A New Profile

Advanced

New super generic firmware

Posted by ryannining 
New super generic firmware
January 07, 2018 08:15AM
Hi guys, after reading lots of code (repetier, teacup, not-grbl) and try simulate motion controller on freebasic, i develop a new firmware based on my motion controller.

I code it as generic as possible so it can be compiled at many cpu. so far i have tested work on Nano V3 and using my own 3d board NanoNano.
It use a motion loop with micros() to get timing (just like not-grbl)

But it compile success on megacore, esp8266, just not have been tested.

also if you compile using PC Quincy C++ you can see the motion controller simulation graph. Or you can see the old simulation code in freebasic.

[github.com]

Currently implement this:

-Per motor step using float speed ramping acceleration (smooth ) *
-per axis acceleration *
-per axis max feedrate *
-per axis jerk *
-path planner (forward) *
-step per mm for each axis *
-implement motor stepper hardware layer *
-implement GCODE parser and processing *
-implement flow control between motion gcode and non motion gcode *
-4 axis X Y Z E *
-implement endstop reading (xmin xmax , etc)*
-eeprom configuration (step/mm, accel, travel accel, jerk, max axis) *
-heater with PID E0 *
-config files to set pins and parameter *
-G0 and G1 can have different acceleration (travel vs feed/extrude) *

Working on:
backlash for all motor

Maybe not:
backward planner
interrupt timing

[www.youtube.com]

Re: New super generic firmware
January 07, 2018 09:57AM
Thank you for sharing your project. It takes a great deal of work to create something functional and then share it openly.

I can appreciate that.
Re: New super generic firmware
January 07, 2018 10:51AM
If you can, could you explain what the idea behind implementing "flow control between motion gcode and non motion gcode". I'm guessing that you are doing this because code is not using interrupts - is that right?

Edited 1 time(s). Last edit at 01/07/2018 11:06AM by newbob.
Re: New super generic firmware
January 07, 2018 08:41PM
yes its not use interrupt.

also its generic and slow, i am still optimizing the motion loop, i measure it need more than 200us for each loop. so it cant make motor with high step to move fast.
my printer is 175step/mm and i think it only max at 20-30mm/s sad smiley
Re: New super generic firmware
January 09, 2018 07:00AM
I was printing and see there is problem with hole, its not round then i make simulation in PC


Big bug in i dont know where, perhaps the bresenham ? perhaps the gcode parsing ?

i compare preview from repetier and karyacontrollerin PC winBGI graphics.



time to hunt bugs.

FOUND the bugs in parsing value



Edited 1 time(s). Last edit at 01/09/2018 07:21AM by ryannining.
Re: New super generic firmware
January 09, 2018 10:00PM
2hours printing xiro landing on karyacontroller

I have just uploaded these images:

Re: New super generic firmware
January 10, 2018 09:30AM
Nice. How do you compile it for ESP8266?
Re: New super generic firmware
January 10, 2018 12:20PM
Well i am familiar with esp, since i have project some times ago making camera slider and also i have use not-grbl in the past (yes this was super generic cnc firmware too, with no path planner).

I can compile and upload to nodemcu/wemos d1 and then test the gcode , first enable output_enable in config_pins.h to enable debugging text, just like this. Its show the speed ramp up and down, when i send command G0 X5, and also return temp from analog pin (still wrong), still focus on atmega, since i already have the board. For esp, i dont have pcb board, so need to make pcb first.


Re: New super generic firmware
January 10, 2018 12:37PM
Also by enable #timing in INO file, i check that esp8266 can process the core motionloop in less than 5microseconds = 200k steps/sec, thats amazing because nano v3 is need 100us after i optimize the code.
Thats why i add new code, if the gcode processed was G0 (travel) then the delay is not calculated on each step, but after some microseconds (adjusted in motion.h, UPDATE_F_EVERY) so it can move the motor fast. Division in nano v3 is slow, although we just need 1 division on update the delay for each step.

Edited 1 time(s). Last edit at 01/10/2018 12:38PM by ryannining.
Re: New super generic firmware
January 10, 2018 08:58PM
Thanks. I'll try to install it on ESP8266.

EDIT: it compiles just fine on Witty ESP8266

Edited 1 time(s). Last edit at 01/10/2018 11:00PM by newbob.
Re: New super generic firmware
January 11, 2018 09:58AM
Connect the output pin to some A4988 driver / other motor driver grinning smiley

it should work. The endstop must be normally closed.

for esp i think should use shift register to get more output pins
Re: New super generic firmware
January 11, 2018 12:09PM
Next, I'll try compiling it for ESP32.
Re: New super generic firmware
January 12, 2018 02:15AM
Update

config_pins.h have this setting now

-COREXY and XZ
-backlash for all motor
-invert motor direction

need to backup eeprom before upload new because the eeprom layout change. Backup normally using repetier eeprom setting->Export.
Re: New super generic firmware
January 17, 2018 03:27AM


STM32F103 work in progress, make the board and will test.
Re: New super generic firmware
January 18, 2018 11:40AM
Implement SDCARD, optimize ram usage, and able to use SDCARD using SDFAT library, and configured using 8 movebuffer.

On NANO V3 328p:

Sketch uses 28372 bytes (92%) of program storage space. Maximum is 30720 bytes.
Global variables use 1725 bytes (84%) of dynamic memory, leaving 323 bytes for local variables. Maximum is 2048 bytes.


Still got low mmeory warning from compile, but i have test insert sdcard with a file print.gcode, which automatically loaded and run.



Re: New super generic firmware
January 23, 2018 06:17AM



Print using micro sdcard and controlbox.
Re: New super generic firmware
June 06, 2018 10:13PM
Its been long time

our firmware now tested well on STM32, the PCB board for Blue pill also included in the github.

For WemosD1 mini also tested, and pcb included.

We use it for our laser cutting, cnc and mini 3d printer.

now for AVR, STM, ESP8266 are all using TIMER interrupt.

For WEMOS D1, the firmware act also as a web server and websocket server, so can receive gcode from websocket.

Check [github.com] and [github.com]




Re: New super generic firmware
August 30, 2018 11:37PM
Super cute smallest 32bit 3d printer board using wemos d1 mcu, on my corexy machine


Connect wirelessly using TCP/IP on repetier host,


All update can be checked here.
https://github.com/ryannining/karyacontroller

New feature : upload Bitmap data to machine and use the bitmap data as Pulse On and Off on laser engraving process.
Re: New super generic firmware
December 10, 2018 10:03PM


Now its able to store GCODE into internal wemos flash, and start print without pc (by tap limit switch 3 times), the screenshot show simple html javascript app to compress and upload gcodes using wifi.
Sorry, only registered users may post in this forum.

Click here to login