CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > OpenSource CNC Design Center > Coding


Coding Post your Coding for opensource projects here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 12-15-2008, 03:46 PM
 
Join Date: Feb 2008
Location: earth
Posts: 501
cnc2 is on a distinguished road
Question Want to import 2D DXF & convert it to 2D step & dir

Hi everybody,

I'm planning to write a program that imports 2D DXF & drives two stepper motors for a kind of simple printer... the printer will have a cylinder that feeds the paper(1st axis) & i need the cylinder to turn in only one direction to feed the paper while the print head (2nd axis) goes from left to right (or right to left, i don't think it matters). Driving the print head will be as easy as to drive a relay.

So, cylinder position + print head position + close the relay, would be the basic program routine.

My problems :

1) I don't know the DXF format so, i have no idea on how to interpret or convert it.
2) I don't know how to implement printing speed, does it need some multi threading programming skills ?
3) I have an idea on how to drive a stepper from LPT port (with ULN2003 & INPOUT32.DLL under WIN XP) , but don't know anything about step/dir, Is it the same concept ?


My questions:

1) Is the DXF format (vector) the right choice for this kind of machine ? (because some told me bitmap would be more apropriate for a cylinder going in only one direction)

2) What programming language should be the more apropriate for such a program ? (i'm a biginner in the C language but have an idea about OOP & JAVA)

3) Do you think i'm all wrong about the way this program should work & Why ?
4) Is it in my reach & how long should it take to dev it ?
5) Did i forget something ?

I'm waiting for your help...

Thanks !

cnc2.
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 12-15-2008, 04:27 PM
Superman's Avatar  
Join Date: Dec 2008
Location: Krypton
Age: 51
Posts: 1,504
Superman is on a distinguished road
Buy me a Beer?

Just to make things more complicated

Have you considered using HPGL format ?
import DXF ===> export HPGL

This is usually a format for plotters ie using vectors, pen up, pen down, pen colour, etc
your 1st axis is bi-directional as well as your 2nd axis

http://www.sxlist.com/techref/langua...l/commands.htm
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 12-15-2008, 05:08 PM
 
Join Date: Feb 2008
Location: earth
Posts: 501
cnc2 is on a distinguished road

Originally Posted by Superman View Post
Just to make things more complicated

Have you considered using HPGL format ?
import DXF ===> export HPGL

This is usually a format for plotters ie using vectors, pen up, pen down, pen colour, etc
your 1st axis is bi-directional as well as your 2nd axis

http://www.sxlist.com/techref/langua...l/commands.htm
Thanks for your reply Superman !

Man i need the 1st axis (the cylinder) to be uni-directional & the second axis to be bi-directional, it's a must for me because i don't need the paper going in&out the printer.

Just imagine the printer's area is only the cylinder (cylinder_width*cylinder_length) so the paper gets printed as it passes the cylinder.

If HPGL makes it possible it will be worth the effort of DXF=>HPGL & i'll still have to convert HPGL to step/dir because i'm planning to use common steppermotor step/dir driver boards.

Thanks !

cnc2.
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 12-15-2008, 05:19 PM
Superman's Avatar  
Join Date: Dec 2008
Location: Krypton
Age: 51
Posts: 1,504
Superman is on a distinguished road
Buy me a Beer?

No probs.

it was just a thought to use a drum type plotter driver

it looks as if you are leaning to a printer type driver
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 12-15-2008, 05:44 PM
 
Join Date: Feb 2008
Location: earth
Posts: 501
cnc2 is on a distinguished road
Thumbs up

Originally Posted by Superman View Post
No probs.

it was just a thought to use a drum type plotter driver

it looks as if you are leaning to a printer type driver
Oh Thanks a lot man !

As english isn't my mother tongue i didn't know the true name of the machine i want to make... & thanks a lot you gave it to me... yea it's a drum plotter that i want to build & control with my own program.

Looking for "Drum type plotter" on Google i found this picture that looks pretty much like what i want to do

About the driver you're talking about, what will it drive ? will i still have to convert HPGL to step/dir ?

Thanks !

cnc2.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-15-2008, 05:59 PM
Superman's Avatar  
Join Date: Dec 2008
Location: Krypton
Age: 51
Posts: 1,504
Superman is on a distinguished road
Buy me a Beer?

Try "Roland" plotters as a suggestion
I am sure they use a "HPGL" format

These may well only roll the drum in 1 direction
you would have to configure the driver to your application

to use it :-
you would only have to "print/plot" what you have on screen straight to the plotter, same as you would print a drawing ( you would also be able to control the scale of the drawing )

This is about the limit of my knowledge
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 12-15-2008, 06:27 PM
 
Join Date: Feb 2008
Location: earth
Posts: 501
cnc2 is on a distinguished road

Originally Posted by Superman View Post
Try "Roland" plotters as a suggestion
I am sure they use a "HPGL" format

These may well only roll the drum in 1 direction
you would have to configure the driver to your application

to use it :-
you would only have to "print/plot" what you have on screen straight to the plotter, same as you would print a drawing ( you would also be able to control the scale of the drawing )

This is about the limit of my knowledge
the basic principle.

I also found this

When you say try Roland plotters, do you want me to use Roland driver ?
What does the driver do & don't do ? is it a ready made program to configure or it is a code library to use in my program ? (newbie here)

At first i wasn't planning to print the drawing to the screen, i just wanted my program to browse for the file to print & print it or plott it.

Thakns !

cnc2.
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 12-15-2008, 06:48 PM
Dennis Bohlke's Avatar  
Join Date: Jan 2006
Location: us
Age: 57
Posts: 77
Dennis Bohlke is on a distinguished road

The problem of going from DXF or HPGL to step and direction signals at the parallel port is not a trivial task.

Took me a few months to get the HPGL conversion working, it is easier because it works with integers for amounts of movement. But that was in the DOS era.

After fifteen years I think I pretty much got it the way I originally wanted.

The timing part of creating the step signals is very difficult and with an Windows host computer it's almost always subject to being messed with by the operating system.

You should look into the EMC program. It's open source and has a motion engine you could adapt to. It works with Linux.

Dennis
www.super-tech.com
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 12-15-2008, 06:51 PM
Superman's Avatar  
Join Date: Dec 2008
Location: Krypton
Age: 51
Posts: 1,504
Superman is on a distinguished road
Buy me a Beer?

Sorry, from here I am not much help

The "roland" was only a suggestion as a step forward as an example
not knowing what your application is to be used for, drawing size, etc.

I have used "roland" plotters on flat beds and drum in a previous job for accurate plots for customer samples and cutting "ruby" sheets for photographic purposes

I thought it may be of use to you.
My application required the bed and drum to be bi-directional for speed and accuracy of the plot ( ie accuracy to 1/2 the line thickness to overlay onto photo negatives and die-lines to suit the customer requirements )
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 12-15-2008, 08:11 PM
 
Join Date: Feb 2008
Location: earth
Posts: 501
cnc2 is on a distinguished road

Originally Posted by Dennis Bohlke View Post
The problem of going from DXF or HPGL to step and direction signals at the parallel port is not a trivial task.

Took me a few months to get the HPGL conversion working, it is easier because it works with integers for amounts of movement. But that was in the DOS era.

After fifteen years I think I pretty much got it the way I originally wanted.

The timing part of creating the step signals is very difficult and with an Windows host computer it's almost always subject to being messed with by the operating system.

You should look into the EMC program. It's open source and has a motion engine you could adapt to. It works with Linux.

Dennis
www.super-tech.com
Thanks for the reply Dennis !

You mean it took you fifteen years to achive it ? (wow man, i don't have that time)

I'm thinking about using the inpout32.dll for "talking" to the parallel port under Win Xp & i'm not planning to go over 2000Hz on a 200step motor so i think & hope it'll be ok, what do you think ?

I'm stuck with windows because a lot of people are using it including my "school" & have no linux programming skills (not yet).

My first concept was to represent the paper as an array or matrix of dots (dot/nodot)
and to get the head to print dots on each line. The cylinder feeds(changes) the lines to be printed by the pen, but no turning back, what HPGL doesn't permit(from what i understood a few minuts ago). Anyone has an idea on how to do it & about the aproriate file format to use ?

Thanks !

Superman
Sorry, from here I am not much help

The "roland" was only a suggestion as a step forward as an example
not knowing what your application is to be used for, drawing size, etc.

I have used "roland" plotters on flat beds and drum in a previous job for accurate plots for customer samples and cutting "ruby" sheets for photographic purposes

I thought it may be of use to you.
My application required the bed and drum to be bi-directional for speed and accuracy of the plot ( ie accuracy to 1/2 the line thickness to overlay onto photo negatives and die-lines to suit the customer requirements )
Thanks Superman, thanks to you i know that HPGL doesn't suite my needs & it takes me a step further in my searching.

My machine doesn't need much accuracy, +-1mm would be enough. the paper size is approx 600mm wide by n millimeters long that's why i need the cylinder to turn in only one direction imagine the time it would take to draw a 500mm square with a 400mm dia circle inside the square or a 1000mm*550mm rectangle instead of the square ...etc HPGL provides "high" accuracy & i need "speed".

Thanks !

cnc2.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 12-15-2008, 10:27 PM
Superman's Avatar  
Join Date: Dec 2008
Location: Krypton
Age: 51
Posts: 1,504
Superman is on a distinguished road
Buy me a Beer?

Originally Posted by cnc2 View Post
Thanks Superman, thanks to you i know that HPGL doesn't suite my needs & it takes me a step further in my searching.

My machine doesn't need much accuracy, +-1mm would be enough. the paper size is approx 600mm wide by n millimeters long that's why i need the cylinder to turn in only one direction imagine the time it would take to draw a 500mm square with a 400mm dia circle inside the square or a 1000mm*550mm rectangle instead of the square ...etc HPGL provides "high" accuracy & i need "speed".
My last word for you
do not be surprised about the speed of bi-directional drum plotter

to draw a 1000mm * 500mm rectangle = perimeter is 3000mm

speeds range from 25mm-500mm per second
so to draw a 1000 * 500 rectangle = 6.0 seconds

reference is http://easyaid.en.ecplaza.net/1.asp MODEL:HX720 720mm 630X unlimited length

note! you can use a pen instead of a vinyl cutter

Time to plot uni-directional will be unbeleivable ( 2 dots per across pass @ 500mm apart - to give a dot pitch of 0.25mm then 1000mm= 250 passes * 500mm travel @ 500mm per second = 250 seconds = 4.17 minutes
Time will increase if you want dots closer together if you want a "line or arc"
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 12-15-2008, 10:29 PM
Superman's Avatar  
Join Date: Dec 2008
Location: Krypton
Age: 51
Posts: 1,504
Superman is on a distinguished road
Buy me a Beer?

by the way
Where on "earth" are you?
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help!- Import/Convert DXF or PLT files to Mach3.... Mikael Mach Mill 3 12-25-2008 04:33 AM
Full step and half step hybrid driver? rkremser Stepper Motors and Drives 4 11-20-2008 11:22 AM
Need Help!- How to edit MPFAN post file step by step m_bhui Post Processors for MC 2 10-04-2008 06:42 AM
Convert +- Analog to Step & Direction ??? Argofanatic Servo Motors and Drives 1 01-20-2007 04:47 PM
Convert Step/direction to phase drive jderou Stepper Motors and Drives 18 08-05-2005 09:52 AM




All times are GMT -5. The time now is 04:45 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353