From d3dd8913bdf41e38bbc75b1f5dbe7159650ba80b Mon Sep 17 00:00:00 2001 From: manuel Date: Sat, 16 Jan 2021 21:47:38 +0100 Subject: glasslathe: update acceleration curve --- linz/glasslathe/motor_start.tmc | 7 + linz/glasslathe/motor_start_rev.tmc | 8 + linz/glasslathe/scurve/calc.cpp | 25 +- linz/glasslathe/scurve/chart.js | 1646 +++-------------------------------- linz/glasslathe/src/main.cpp | 20 +- 5 files changed, 137 insertions(+), 1569 deletions(-) create mode 100644 linz/glasslathe/motor_start.tmc create mode 100644 linz/glasslathe/motor_start_rev.tmc diff --git a/linz/glasslathe/motor_start.tmc b/linz/glasslathe/motor_start.tmc new file mode 100644 index 0000000..ce6113d --- /dev/null +++ b/linz/glasslathe/motor_start.tmc @@ -0,0 +1,7 @@ +SAP 6 , 0 , 255 // Set run current +SAP 7 , 0 , 8 // Set standby current +SAP 254 , 0 , 1 // Activate step / direction mode +SAP 140 , 0 , 4 // 16 microsteps +SAP 160 , 0 , 1 // Activate step interpolation (only works with 16 microsteps) +SAP 161 , 0 , 1 // Activate double step +STOP // End of this program diff --git a/linz/glasslathe/motor_start_rev.tmc b/linz/glasslathe/motor_start_rev.tmc new file mode 100644 index 0000000..c3fcf65 --- /dev/null +++ b/linz/glasslathe/motor_start_rev.tmc @@ -0,0 +1,8 @@ +SAP 6 , 0 , 255 // Set run current +SAP 7 , 0 , 8 // Set standby current +SAP 254 , 0 , 1 // Activate step / direction mode +SAP 251 , 0 , 1 // Reverse shaft +SAP 140 , 0 , 4 // 16 microsteps +SAP 160 , 0 , 1 // Activate step interpolation (only works with 16 microsteps) +SAP 161 , 0 , 1 // Activate double step +STOP // End of this program diff --git a/linz/glasslathe/scurve/calc.cpp b/linz/glasslathe/scurve/calc.cpp index 1371577..8797e86 100644 --- a/linz/glasslathe/scurve/calc.cpp +++ b/linz/glasslathe/scurve/calc.cpp @@ -12,7 +12,7 @@ const int frequency_max = 6000; int newPotValue; bool timer_enabled = false; -int x = 0; +unsigned long x = 0; bool loop() { const int step_delay = 300; @@ -23,7 +23,7 @@ bool loop() timer_enabled = true; fprintf(stderr, "enable motor\n"); x += step_delay; - printf("[%d, %d],\n", x, 0); + printf("[%lu, %d],\n", x, 0); } /*int step = (current.potValue < 20) ? 1 @@ -32,12 +32,12 @@ bool loop() : (current.potValue < 400) ? 5 : (current.potValue < 500) ? 10 : 20;*/ - int step = (current.frequency > 5000) ? 1 - : (current.frequency > 4500) ? 2 - : (current.frequency > 4000) ? 5 - : (current.frequency > 3000) ? 10 - : (current.frequency > 1000) ? 25 - : 50; + int step = (current.frequency > 5000) ? 100 + : (current.frequency > 4000) ? 100 + : (current.frequency > 3000) ? 150 + : (current.frequency > 2000) ? 150 + : (current.frequency > 1000) ? 120 + : 200; int frequency = (current.direction == target.direction) ? target.frequency : 0; step = std::min(abs(frequency - current.frequency), step); if (frequency < current.frequency) @@ -45,7 +45,7 @@ bool loop() current.frequency += step; x += step_delay; - printf("[%d, %d],\n", x, current.frequency); + printf("[%lu, %d],\n", x, current.frequency); if (current.frequency == 0 && current.direction != target.direction) { @@ -53,7 +53,7 @@ bool loop() current.direction = target.direction; fprintf(stderr, "disable motor. changed direction to %d\n", current.direction); x += step_delay; - printf("[%d, %d],\n", x, 0); + printf("[%lu, %d],\n", x, 0); } } else if (timer_enabled && target.potValue == 0) @@ -61,7 +61,7 @@ bool loop() timer_enabled = false; fprintf(stderr, "disable motor\n"); x += step_delay; - printf("[%d, %d],\n", x, 0); + printf("[%lu, %d],\n", x, 0); } else return false; @@ -74,5 +74,8 @@ int main(int argc, char *argv[]) target.frequency = frequency_max; target.potValue = 1023; while(loop()); + target.frequency = 0; + target.potValue = 0; + while(loop()); return 0; } diff --git a/linz/glasslathe/scurve/chart.js b/linz/glasslathe/scurve/chart.js index 70259af..58f07c5 100644 --- a/linz/glasslathe/scurve/chart.js +++ b/linz/glasslathe/scurve/chart.js @@ -2,6 +2,12 @@ Highcharts.chart('container', { chart: { }, xAxis: { + labels: { + formatter: function () { + //return this.value; + return Highcharts.numberFormat(this.value / 1000, 2); + } + }, title: { text: 'time' } @@ -29,1552 +35,102 @@ Highcharts.chart('container', { series: [{ name: "Winter 2014-2015", data: [ + [300, 0], -[600, 50], -[900, 100], -[1200, 150], -[1500, 200], -[1800, 250], -[2100, 300], -[2400, 350], -[2700, 400], -[3000, 450], -[3300, 500], -[3600, 550], -[3900, 600], -[4200, 650], -[4500, 700], -[4800, 750], -[5100, 800], -[5400, 850], -[5700, 900], -[6000, 950], -[6300, 1000], -[6600, 1050], -[6900, 1075], -[7200, 1100], -[7500, 1125], -[7800, 1150], -[8100, 1175], -[8400, 1200], -[8700, 1225], -[9000, 1250], -[9300, 1275], -[9600, 1300], -[9900, 1325], -[10200, 1350], -[10500, 1375], -[10800, 1400], -[11100, 1425], -[11400, 1450], -[11700, 1475], -[12000, 1500], -[12300, 1525], -[12600, 1550], -[12900, 1575], -[13200, 1600], -[13500, 1625], -[13800, 1650], -[14100, 1675], -[14400, 1700], -[14700, 1725], -[15000, 1750], -[15300, 1775], -[15600, 1800], -[15900, 1825], -[16200, 1850], -[16500, 1875], -[16800, 1900], -[17100, 1925], -[17400, 1950], -[17700, 1975], -[18000, 2000], -[18300, 2025], -[18600, 2050], -[18900, 2075], -[19200, 2100], -[19500, 2125], -[19800, 2150], -[20100, 2175], -[20400, 2200], -[20700, 2225], -[21000, 2250], -[21300, 2275], -[21600, 2300], -[21900, 2325], -[22200, 2350], -[22500, 2375], -[22800, 2400], -[23100, 2425], -[23400, 2450], -[23700, 2475], -[24000, 2500], -[24300, 2525], -[24600, 2550], -[24900, 2575], -[25200, 2600], -[25500, 2625], -[25800, 2650], -[26100, 2675], -[26400, 2700], -[26700, 2725], -[27000, 2750], -[27300, 2775], -[27600, 2800], -[27900, 2825], -[28200, 2850], -[28500, 2875], -[28800, 2900], -[29100, 2925], -[29400, 2950], -[29700, 2975], -[30000, 3000], -[30300, 3025], -[30600, 3035], -[30900, 3045], -[31200, 3055], -[31500, 3065], -[31800, 3075], -[32100, 3085], -[32400, 3095], -[32700, 3105], -[33000, 3115], -[33300, 3125], -[33600, 3135], -[33900, 3145], -[34200, 3155], -[34500, 3165], -[34800, 3175], -[35100, 3185], -[35400, 3195], -[35700, 3205], -[36000, 3215], -[36300, 3225], -[36600, 3235], -[36900, 3245], -[37200, 3255], -[37500, 3265], -[37800, 3275], -[38100, 3285], -[38400, 3295], -[38700, 3305], -[39000, 3315], -[39300, 3325], -[39600, 3335], -[39900, 3345], -[40200, 3355], -[40500, 3365], -[40800, 3375], -[41100, 3385], -[41400, 3395], -[41700, 3405], -[42000, 3415], -[42300, 3425], -[42600, 3435], -[42900, 3445], -[43200, 3455], -[43500, 3465], -[43800, 3475], -[44100, 3485], -[44400, 3495], -[44700, 3505], -[45000, 3515], -[45300, 3525], -[45600, 3535], -[45900, 3545], -[46200, 3555], -[46500, 3565], -[46800, 3575], -[47100, 3585], -[47400, 3595], -[47700, 3605], -[48000, 3615], -[48300, 3625], -[48600, 3635], -[48900, 3645], -[49200, 3655], -[49500, 3665], -[49800, 3675], -[50100, 3685], -[50400, 3695], -[50700, 3705], -[51000, 3715], -[51300, 3725], -[51600, 3735], -[51900, 3745], -[52200, 3755], -[52500, 3765], -[52800, 3775], -[53100, 3785], -[53400, 3795], -[53700, 3805], -[54000, 3815], -[54300, 3825], -[54600, 3835], -[54900, 3845], -[55200, 3855], -[55500, 3865], -[55800, 3875], -[56100, 3885], -[56400, 3895], -[56700, 3905], -[57000, 3915], -[57300, 3925], -[57600, 3935], -[57900, 3945], -[58200, 3955], -[58500, 3965], -[58800, 3975], -[59100, 3985], -[59400, 3995], -[59700, 4005], -[60000, 4010], -[60300, 4015], -[60600, 4020], -[60900, 4025], -[61200, 4030], -[61500, 4035], -[61800, 4040], -[62100, 4045], -[62400, 4050], -[62700, 4055], -[63000, 4060], -[63300, 4065], -[63600, 4070], -[63900, 4075], -[64200, 4080], -[64500, 4085], -[64800, 4090], -[65100, 4095], -[65400, 4100], -[65700, 4105], -[66000, 4110], -[66300, 4115], -[66600, 4120], -[66900, 4125], -[67200, 4130], -[67500, 4135], -[67800, 4140], -[68100, 4145], -[68400, 4150], -[68700, 4155], -[69000, 4160], -[69300, 4165], -[69600, 4170], -[69900, 4175], -[70200, 4180], -[70500, 4185], -[70800, 4190], -[71100, 4195], -[71400, 4200], -[71700, 4205], -[72000, 4210], -[72300, 4215], -[72600, 4220], -[72900, 4225], -[73200, 4230], -[73500, 4235], -[73800, 4240], -[74100, 4245], -[74400, 4250], -[74700, 4255], -[75000, 4260], -[75300, 4265], -[75600, 4270], -[75900, 4275], -[76200, 4280], -[76500, 4285], -[76800, 4290], -[77100, 4295], -[77400, 4300], -[77700, 4305], -[78000, 4310], -[78300, 4315], -[78600, 4320], -[78900, 4325], -[79200, 4330], -[79500, 4335], -[79800, 4340], -[80100, 4345], -[80400, 4350], -[80700, 4355], -[81000, 4360], -[81300, 4365], -[81600, 4370], -[81900, 4375], -[82200, 4380], -[82500, 4385], -[82800, 4390], -[83100, 4395], -[83400, 4400], -[83700, 4405], -[84000, 4410], -[84300, 4415], -[84600, 4420], -[84900, 4425], -[85200, 4430], -[85500, 4435], -[85800, 4440], -[86100, 4445], -[86400, 4450], -[86700, 4455], -[87000, 4460], -[87300, 4465], -[87600, 4470], -[87900, 4475], -[88200, 4480], -[88500, 4485], -[88800, 4490], -[89100, 4495], -[89400, 4500], -[89700, 4505], -[90000, 4507], -[90300, 4509], -[90600, 4511], -[90900, 4513], -[91200, 4515], -[91500, 4517], -[91800, 4519], -[92100, 4521], -[92400, 4523], -[92700, 4525], -[93000, 4527], -[93300, 4529], -[93600, 4531], -[93900, 4533], -[94200, 4535], -[94500, 4537], -[94800, 4539], -[95100, 4541], -[95400, 4543], -[95700, 4545], -[96000, 4547], -[96300, 4549], -[96600, 4551], -[96900, 4553], -[97200, 4555], -[97500, 4557], -[97800, 4559], -[98100, 4561], -[98400, 4563], -[98700, 4565], -[99000, 4567], -[99300, 4569], -[99600, 4571], -[99900, 4573], -[100200, 4575], -[100500, 4577], -[100800, 4579], -[101100, 4581], -[101400, 4583], -[101700, 4585], -[102000, 4587], -[102300, 4589], -[102600, 4591], -[102900, 4593], -[103200, 4595], -[103500, 4597], -[103800, 4599], -[104100, 4601], -[104400, 4603], -[104700, 4605], -[105000, 4607], -[105300, 4609], -[105600, 4611], -[105900, 4613], -[106200, 4615], -[106500, 4617], -[106800, 4619], -[107100, 4621], -[107400, 4623], -[107700, 4625], -[108000, 4627], -[108300, 4629], -[108600, 4631], -[108900, 4633], -[109200, 4635], -[109500, 4637], -[109800, 4639], -[110100, 4641], -[110400, 4643], -[110700, 4645], -[111000, 4647], -[111300, 4649], -[111600, 4651], -[111900, 4653], -[112200, 4655], -[112500, 4657], -[112800, 4659], -[113100, 4661], -[113400, 4663], -[113700, 4665], -[114000, 4667], -[114300, 4669], -[114600, 4671], -[114900, 4673], -[115200, 4675], -[115500, 4677], -[115800, 4679], -[116100, 4681], -[116400, 4683], -[116700, 4685], -[117000, 4687], -[117300, 4689], -[117600, 4691], -[117900, 4693], -[118200, 4695], -[118500, 4697], -[118800, 4699], -[119100, 4701], -[119400, 4703], -[119700, 4705], -[120000, 4707], -[120300, 4709], -[120600, 4711], -[120900, 4713], -[121200, 4715], -[121500, 4717], -[121800, 4719], -[122100, 4721], -[122400, 4723], -[122700, 4725], -[123000, 4727], -[123300, 4729], -[123600, 4731], -[123900, 4733], -[124200, 4735], -[124500, 4737], -[124800, 4739], -[125100, 4741], -[125400, 4743], -[125700, 4745], -[126000, 4747], -[126300, 4749], -[126600, 4751], -[126900, 4753], -[127200, 4755], -[127500, 4757], -[127800, 4759], -[128100, 4761], -[128400, 4763], -[128700, 4765], -[129000, 4767], -[129300, 4769], -[129600, 4771], -[129900, 4773], -[130200, 4775], -[130500, 4777], -[130800, 4779], -[131100, 4781], -[131400, 4783], -[131700, 4785], -[132000, 4787], -[132300, 4789], -[132600, 4791], -[132900, 4793], -[133200, 4795], -[133500, 4797], -[133800, 4799], -[134100, 4801], -[134400, 4803], -[134700, 4805], -[135000, 4807], -[135300, 4809], -[135600, 4811], -[135900, 4813], -[136200, 4815], -[136500, 4817], -[136800, 4819], -[137100, 4821], -[137400, 4823], -[137700, 4825], -[138000, 4827], -[138300, 4829], -[138600, 4831], -[138900, 4833], -[139200, 4835], -[139500, 4837], -[139800, 4839], -[140100, 4841], -[140400, 4843], -[140700, 4845], -[141000, 4847], -[141300, 4849], -[141600, 4851], -[141900, 4853], -[142200, 4855], -[142500, 4857], -[142800, 4859], -[143100, 4861], -[143400, 4863], -[143700, 4865], -[144000, 4867], -[144300, 4869], -[144600, 4871], -[144900, 4873], -[145200, 4875], -[145500, 4877], -[145800, 4879], -[146100, 4881], -[146400, 4883], -[146700, 4885], -[147000, 4887], -[147300, 4889], -[147600, 4891], -[147900, 4893], -[148200, 4895], -[148500, 4897], -[148800, 4899], -[149100, 4901], -[149400, 4903], -[149700, 4905], -[150000, 4907], -[150300, 4909], -[150600, 4911], -[150900, 4913], -[151200, 4915], -[151500, 4917], -[151800, 4919], -[152100, 4921], -[152400, 4923], -[152700, 4925], -[153000, 4927], -[153300, 4929], -[153600, 4931], -[153900, 4933], -[154200, 4935], -[154500, 4937], -[154800, 4939], -[155100, 4941], -[155400, 4943], -[155700, 4945], -[156000, 4947], -[156300, 4949], -[156600, 4951], -[156900, 4953], -[157200, 4955], -[157500, 4957], -[157800, 4959], -[158100, 4961], -[158400, 4963], -[158700, 4965], -[159000, 4967], -[159300, 4969], -[159600, 4971], -[159900, 4973], -[160200, 4975], -[160500, 4977], -[160800, 4979], -[161100, 4981], -[161400, 4983], -[161700, 4985], -[162000, 4987], -[162300, 4989], -[162600, 4991], -[162900, 4993], -[163200, 4995], -[163500, 4997], -[163800, 4999], -[164100, 5001], -[164400, 5002], -[164700, 5003], -[165000, 5004], -[165300, 5005], -[165600, 5006], -[165900, 5007], -[166200, 5008], -[166500, 5009], -[166800, 5010], -[167100, 5011], -[167400, 5012], -[167700, 5013], -[168000, 5014], -[168300, 5015], -[168600, 5016], -[168900, 5017], -[169200, 5018], -[169500, 5019], -[169800, 5020], -[170100, 5021], -[170400, 5022], -[170700, 5023], -[171000, 5024], -[171300, 5025], -[171600, 5026], -[171900, 5027], -[172200, 5028], -[172500, 5029], -[172800, 5030], -[173100, 5031], -[173400, 5032], -[173700, 5033], -[174000, 5034], -[174300, 5035], -[174600, 5036], -[174900, 5037], -[175200, 5038], -[175500, 5039], -[175800, 5040], -[176100, 5041], -[176400, 5042], -[176700, 5043], -[177000, 5044], -[177300, 5045], -[177600, 5046], -[177900, 5047], -[178200, 5048], -[178500, 5049], -[178800, 5050], -[179100, 5051], -[179400, 5052], -[179700, 5053], -[180000, 5054], -[180300, 5055], -[180600, 5056], -[180900, 5057], -[181200, 5058], -[181500, 5059], -[181800, 5060], -[182100, 5061], -[182400, 5062], -[182700, 5063], -[183000, 5064], -[183300, 5065], -[183600, 5066], -[183900, 5067], -[184200, 5068], -[184500, 5069], -[184800, 5070], -[185100, 5071], -[185400, 5072], -[185700, 5073], -[186000, 5074], -[186300, 5075], -[186600, 5076], -[186900, 5077], -[187200, 5078], -[187500, 5079], -[187800, 5080], -[188100, 5081], -[188400, 5082], -[188700, 5083], -[189000, 5084], -[189300, 5085], -[189600, 5086], -[189900, 5087], -[190200, 5088], -[190500, 5089], -[190800, 5090], -[191100, 5091], -[191400, 5092], -[191700, 5093], -[192000, 5094], -[192300, 5095], -[192600, 5096], -[192900, 5097], -[193200, 5098], -[193500, 5099], -[193800, 5100], -[194100, 5101], -[194400, 5102], -[194700, 5103], -[195000, 5104], -[195300, 5105], -[195600, 5106], -[195900, 5107], -[196200, 5108], -[196500, 5109], -[196800, 5110], -[197100, 5111], -[197400, 5112], -[197700, 5113], -[198000, 5114], -[198300, 5115], -[198600, 5116], -[198900, 5117], -[199200, 5118], -[199500, 5119], -[199800, 5120], -[200100, 5121], -[200400, 5122], -[200700, 5123], -[201000, 5124], -[201300, 5125], -[201600, 5126], -[201900, 5127], -[202200, 5128], -[202500, 5129], -[202800, 5130], -[203100, 5131], -[203400, 5132], -[203700, 5133], -[204000, 5134], -[204300, 5135], -[204600, 5136], -[204900, 5137], -[205200, 5138], -[205500, 5139], -[205800, 5140], -[206100, 5141], -[206400, 5142], -[206700, 5143], -[207000, 5144], -[207300, 5145], -[207600, 5146], -[207900, 5147], -[208200, 5148], -[208500, 5149], -[208800, 5150], -[209100, 5151], -[209400, 5152], -[209700, 5153], -[210000, 5154], -[210300, 5155], -[210600, 5156], -[210900, 5157], -[211200, 5158], -[211500, 5159], -[211800, 5160], -[212100, 5161], -[212400, 5162], -[212700, 5163], -[213000, 5164], -[213300, 5165], -[213600, 5166], -[213900, 5167], -[214200, 5168], -[214500, 5169], -[214800, 5170], -[215100, 5171], -[215400, 5172], -[215700, 5173], -[216000, 5174], -[216300, 5175], -[216600, 5176], -[216900, 5177], -[217200, 5178], -[217500, 5179], -[217800, 5180], -[218100, 5181], -[218400, 5182], -[218700, 5183], -[219000, 5184], -[219300, 5185], -[219600, 5186], -[219900, 5187], -[220200, 5188], -[220500, 5189], -[220800, 5190], -[221100, 5191], -[221400, 5192], -[221700, 5193], -[222000, 5194], -[222300, 5195], -[222600, 5196], -[222900, 5197], -[223200, 5198], -[223500, 5199], -[223800, 5200], -[224100, 5201], -[224400, 5202], -[224700, 5203], -[225000, 5204], -[225300, 5205], -[225600, 5206], -[225900, 5207], -[226200, 5208], -[226500, 5209], -[226800, 5210], -[227100, 5211], -[227400, 5212], -[227700, 5213], -[228000, 5214], -[228300, 5215], -[228600, 5216], -[228900, 5217], -[229200, 5218], -[229500, 5219], -[229800, 5220], -[230100, 5221], -[230400, 5222], -[230700, 5223], -[231000, 5224], -[231300, 5225], -[231600, 5226], -[231900, 5227], -[232200, 5228], -[232500, 5229], -[232800, 5230], -[233100, 5231], -[233400, 5232], -[233700, 5233], -[234000, 5234], -[234300, 5235], -[234600, 5236], -[234900, 5237], -[235200, 5238], -[235500, 5239], -[235800, 5240], -[236100, 5241], -[236400, 5242], -[236700, 5243], -[237000, 5244], -[237300, 5245], -[237600, 5246], -[237900, 5247], -[238200, 5248], -[238500, 5249], -[238800, 5250], -[239100, 5251], -[239400, 5252], -[239700, 5253], -[240000, 5254], -[240300, 5255], -[240600, 5256], -[240900, 5257], -[241200, 5258], -[241500, 5259], -[241800, 5260], -[242100, 5261], -[242400, 5262], -[242700, 5263], -[243000, 5264], -[243300, 5265], -[243600, 5266], -[243900, 5267], -[244200, 5268], -[244500, 5269], -[244800, 5270], -[245100, 5271], -[245400, 5272], -[245700, 5273], -[246000, 5274], -[246300, 5275], -[246600, 5276], -[246900, 5277], -[247200, 5278], -[247500, 5279], -[247800, 5280], -[248100, 5281], -[248400, 5282], -[248700, 5283], -[249000, 5284], -[249300, 5285], -[249600, 5286], -[249900, 5287], -[250200, 5288], -[250500, 5289], -[250800, 5290], -[251100, 5291], -[251400, 5292], -[251700, 5293], -[252000, 5294], -[252300, 5295], -[252600, 5296], -[252900, 5297], -[253200, 5298], -[253500, 5299], -[253800, 5300], -[254100, 5301], -[254400, 5302], -[254700, 5303], -[255000, 5304], -[255300, 5305], -[255600, 5306], -[255900, 5307], -[256200, 5308], -[256500, 5309], -[256800, 5310], -[257100, 5311], -[257400, 5312], -[257700, 5313], -[258000, 5314], -[258300, 5315], -[258600, 5316], -[258900, 5317], -[259200, 5318], -[259500, 5319], -[259800, 5320], -[260100, 5321], -[260400, 5322], -[260700, 5323], -[261000, 5324], -[261300, 5325], -[261600, 5326], -[261900, 5327], -[262200, 5328], -[262500, 5329], -[262800, 5330], -[263100, 5331], -[263400, 5332], -[263700, 5333], -[264000, 5334], -[264300, 5335], -[264600, 5336], -[264900, 5337], -[265200, 5338], -[265500, 5339], -[265800, 5340], -[266100, 5341], -[266400, 5342], -[266700, 5343], -[267000, 5344], -[267300, 5345], -[267600, 5346], -[267900, 5347], -[268200, 5348], -[268500, 5349], -[268800, 5350], -[269100, 5351], -[269400, 5352], -[269700, 5353], -[270000, 5354], -[270300, 5355], -[270600, 5356], -[270900, 5357], -[271200, 5358], -[271500, 5359], -[271800, 5360], -[272100, 5361], -[272400, 5362], -[272700, 5363], -[273000, 5364], -[273300, 5365], -[273600, 5366], -[273900, 5367], -[274200, 5368], -[274500, 5369], -[274800, 5370], -[275100, 5371], -[275400, 5372], -[275700, 5373], -[276000, 5374], -[276300, 5375], -[276600, 5376], -[276900, 5377], -[277200, 5378], -[277500, 5379], -[277800, 5380], -[278100, 5381], -[278400, 5382], -[278700, 5383], -[279000, 5384], -[279300, 5385], -[279600, 5386], -[279900, 5387], -[280200, 5388], -[280500, 5389], -[280800, 5390], -[281100, 5391], -[281400, 5392], -[281700, 5393], -[282000, 5394], -[282300, 5395], -[282600, 5396], -[282900, 5397], -[283200, 5398], -[283500, 5399], -[283800, 5400], -[284100, 5401], -[284400, 5402], -[284700, 5403], -[285000, 5404], -[285300, 5405], -[285600, 5406], -[285900, 5407], -[286200, 5408], -[286500, 5409], -[286800, 5410], -[287100, 5411], -[287400, 5412], -[287700, 5413], -[288000, 5414], -[288300, 5415], -[288600, 5416], -[288900, 5417], -[289200, 5418], -[289500, 5419], -[289800, 5420], -[290100, 5421], -[290400, 5422], -[290700, 5423], -[291000, 5424], -[291300, 5425], -[291600, 5426], -[291900, 5427], -[292200, 5428], -[292500, 5429], -[292800, 5430], -[293100, 5431], -[293400, 5432], -[293700, 5433], -[294000, 5434], -[294300, 5435], -[294600, 5436], -[294900, 5437], -[295200, 5438], -[295500, 5439], -[295800, 5440], -[296100, 5441], -[296400, 5442], -[296700, 5443], -[297000, 5444], -[297300, 5445], -[297600, 5446], -[297900, 5447], -[298200, 5448], -[298500, 5449], -[298800, 5450], -[299100, 5451], -[299400, 5452], -[299700, 5453], -[300000, 5454], -[300300, 5455], -[300600, 5456], -[300900, 5457], -[301200, 5458], -[301500, 5459], -[301800, 5460], -[302100, 5461], -[302400, 5462], -[302700, 5463], -[303000, 5464], -[303300, 5465], -[303600, 5466], -[303900, 5467], -[304200, 5468], -[304500, 5469], -[304800, 5470], -[305100, 5471], -[305400, 5472], -[305700, 5473], -[306000, 5474], -[306300, 5475], -[306600, 5476], -[306900, 5477], -[307200, 5478], -[307500, 5479], -[307800, 5480], -[308100, 5481], -[308400, 5482], -[308700, 5483], -[309000, 5484], -[309300, 5485], -[309600, 5486], -[309900, 5487], -[310200, 5488], -[310500, 5489], -[310800, 5490], -[311100, 5491], -[311400, 5492], -[311700, 5493], -[312000, 5494], -[312300, 5495], -[312600, 5496], -[312900, 5497], -[313200, 5498], -[313500, 5499], -[313800, 5500], -[314100, 5501], -[314400, 5502], -[314700, 5503], -[315000, 5504], -[315300, 5505], -[315600, 5506], -[315900, 5507], -[316200, 5508], -[316500, 5509], -[316800, 5510], -[317100, 5511], -[317400, 5512], -[317700, 5513], -[318000, 5514], -[318300, 5515], -[318600, 5516], -[318900, 5517], -[319200, 5518], -[319500, 5519], -[319800, 5520], -[320100, 5521], -[320400, 5522], -[320700, 5523], -[321000, 5524], -[321300, 5525], -[321600, 5526], -[321900, 5527], -[322200, 5528], -[322500, 5529], -[322800, 5530], -[323100, 5531], -[323400, 5532], -[323700, 5533], -[324000, 5534], -[324300, 5535], -[324600, 5536], -[324900, 5537], -[325200, 5538], -[325500, 5539], -[325800, 5540], -[326100, 5541], -[326400, 5542], -[326700, 5543], -[327000, 5544], -[327300, 5545], -[327600, 5546], -[327900, 5547], -[328200, 5548], -[328500, 5549], -[328800, 5550], -[329100, 5551], -[329400, 5552], -[329700, 5553], -[330000, 5554], -[330300, 5555], -[330600, 5556], -[330900, 5557], -[331200, 5558], -[331500, 5559], -[331800, 5560], -[332100, 5561], -[332400, 5562], -[332700, 5563], -[333000, 5564], -[333300, 5565], -[333600, 5566], -[333900, 5567], -[334200, 5568], -[334500, 5569], -[334800, 5570], -[335100, 5571], -[335400, 5572], -[335700, 5573], -[336000, 5574], -[336300, 5575], -[336600, 5576], -[336900, 5577], -[337200, 5578], -[337500, 5579], -[337800, 5580], -[338100, 5581], -[338400, 5582], -[338700, 5583], -[339000, 5584], -[339300, 5585], -[339600, 5586], -[339900, 5587], -[340200, 5588], -[340500, 5589], -[340800, 5590], -[341100, 5591], -[341400, 5592], -[341700, 5593], -[342000, 5594], -[342300, 5595], -[342600, 5596], -[342900, 5597], -[343200, 5598], -[343500, 5599], -[343800, 5600], -[344100, 5601], -[344400, 5602], -[344700, 5603], -[345000, 5604], -[345300, 5605], -[345600, 5606], -[345900, 5607], -[346200, 5608], -[346500, 5609], -[346800, 5610], -[347100, 5611], -[347400, 5612], -[347700, 5613], -[348000, 5614], -[348300, 5615], -[348600, 5616], -[348900, 5617], -[349200, 5618], -[349500, 5619], -[349800, 5620], -[350100, 5621], -[350400, 5622], -[350700, 5623], -[351000, 5624], -[351300, 5625], -[351600, 5626], -[351900, 5627], -[352200, 5628], -[352500, 5629], -[352800, 5630], -[353100, 5631], -[353400, 5632], -[353700, 5633], -[354000, 5634], -[354300, 5635], -[354600, 5636], -[354900, 5637], -[355200, 5638], -[355500, 5639], -[355800, 5640], -[356100, 5641], -[356400, 5642], -[356700, 5643], -[357000, 5644], -[357300, 5645], -[357600, 5646], -[357900, 5647], -[358200, 5648], -[358500, 5649], -[358800, 5650], -[359100, 5651], -[359400, 5652], -[359700, 5653], -[360000, 5654], -[360300, 5655], -[360600, 5656], -[360900, 5657], -[361200, 5658], -[361500, 5659], -[361800, 5660], -[362100, 5661], -[362400, 5662], -[362700, 5663], -[363000, 5664], -[363300, 5665], -[363600, 5666], -[363900, 5667], -[364200, 5668], -[364500, 5669], -[364800, 5670], -[365100, 5671], -[365400, 5672], -[365700, 5673], -[366000, 5674], -[366300, 5675], -[366600, 5676], -[366900, 5677], -[367200, 5678], -[367500, 5679], -[367800, 5680], -[368100, 5681], -[368400, 5682], -[368700, 5683], -[369000, 5684], -[369300, 5685], -[369600, 5686], -[369900, 5687], -[370200, 5688], -[370500, 5689], -[370800, 5690], -[371100, 5691], -[371400, 5692], -[371700, 5693], -[372000, 5694], -[372300, 5695], -[372600, 5696], -[372900, 5697], -[373200, 5698], -[373500, 5699], -[373800, 5700], -[374100, 5701], -[374400, 5702], -[374700, 5703], -[375000, 5704], -[375300, 5705], -[375600, 5706], -[375900, 5707], -[376200, 5708], -[376500, 5709], -[376800, 5710], -[377100, 5711], -[377400, 5712], -[377700, 5713], -[378000, 5714], -[378300, 5715], -[378600, 5716], -[378900, 5717], -[379200, 5718], -[379500, 5719], -[379800, 5720], -[380100, 5721], -[380400, 5722], -[380700, 5723], -[381000, 5724], -[381300, 5725], -[381600, 5726], -[381900, 5727], -[382200, 5728], -[382500, 5729], -[382800, 5730], -[383100, 5731], -[383400, 5732], -[383700, 5733], -[384000, 5734], -[384300, 5735], -[384600, 5736], -[384900, 5737], -[385200, 5738], -[385500, 5739], -[385800, 5740], -[386100, 5741], -[386400, 5742], -[386700, 5743], -[387000, 5744], -[387300, 5745], -[387600, 5746], -[387900, 5747], -[388200, 5748], -[388500, 5749], -[388800, 5750], -[389100, 5751], -[389400, 5752], -[389700, 5753], -[390000, 5754], -[390300, 5755], -[390600, 5756], -[390900, 5757], -[391200, 5758], -[391500, 5759], -[391800, 5760], -[392100, 5761], -[392400, 5762], -[392700, 5763], -[393000, 5764], -[393300, 5765], -[393600, 5766], -[393900, 5767], -[394200, 5768], -[394500, 5769], -[394800, 5770], -[395100, 5771], -[395400, 5772], -[395700, 5773], -[396000, 5774], -[396300, 5775], -[396600, 5776], -[396900, 5777], -[397200, 5778], -[397500, 5779], -[397800, 5780], -[398100, 5781], -[398400, 5782], -[398700, 5783], -[399000, 5784], -[399300, 5785], -[399600, 5786], -[399900, 5787], -[400200, 5788], -[400500, 5789], -[400800, 5790], -[401100, 5791], -[401400, 5792], -[401700, 5793], -[402000, 5794], -[402300, 5795], -[402600, 5796], -[402900, 5797], -[403200, 5798], -[403500, 5799], -[403800, 5800], -[404100, 5801], -[404400, 5802], -[404700, 5803], -[405000, 5804], -[405300, 5805], -[405600, 5806], -[405900, 5807], -[406200, 5808], -[406500, 5809], -[406800, 5810], -[407100, 5811], -[407400, 5812], -[407700, 5813], -[408000, 5814], -[408300, 5815], -[408600, 5816], -[408900, 5817], -[409200, 5818], -[409500, 5819], -[409800, 5820], -[410100, 5821], -[410400, 5822], -[410700, 5823], -[411000, 5824], -[411300, 5825], -[411600, 5826], -[411900, 5827], -[412200, 5828], -[412500, 5829], -[412800, 5830], -[413100, 5831], -[413400, 5832], -[413700, 5833], -[414000, 5834], -[414300, 5835], -[414600, 5836], -[414900, 5837], -[415200, 5838], -[415500, 5839], -[415800, 5840], -[416100, 5841], -[416400, 5842], -[416700, 5843], -[417000, 5844], -[417300, 5845], -[417600, 5846], -[417900, 5847], -[418200, 5848], -[418500, 5849], -[418800, 5850], -[419100, 5851], -[419400, 5852], -[419700, 5853], -[420000, 5854], -[420300, 5855], -[420600, 5856], -[420900, 5857], -[421200, 5858], -[421500, 5859], -[421800, 5860], -[422100, 5861], -[422400, 5862], -[422700, 5863], -[423000, 5864], -[423300, 5865], -[423600, 5866], -[423900, 5867], -[424200, 5868], -[424500, 5869], -[424800, 5870], -[425100, 5871], -[425400, 5872], -[425700, 5873], -[426000, 5874], -[426300, 5875], -[426600, 5876], -[426900, 5877], -[427200, 5878], -[427500, 5879], -[427800, 5880], -[428100, 5881], -[428400, 5882], -[428700, 5883], -[429000, 5884], -[429300, 5885], -[429600, 5886], -[429900, 5887], -[430200, 5888], -[430500, 5889], -[430800, 5890], -[431100, 5891], -[431400, 5892], -[431700, 5893], -[432000, 5894], -[432300, 5895], -[432600, 5896], -[432900, 5897], -[433200, 5898], -[433500, 5899], -[433800, 5900], -[434100, 5901], -[434400, 5902], -[434700, 5903], -[435000, 5904], -[435300, 5905], -[435600, 5906], -[435900, 5907], -[436200, 5908], -[436500, 5909], -[436800, 5910], -[437100, 5911], -[437400, 5912], -[437700, 5913], -[438000, 5914], -[438300, 5915], -[438600, 5916], -[438900, 5917], -[439200, 5918], -[439500, 5919], -[439800, 5920], -[440100, 5921], -[440400, 5922], -[440700, 5923], -[441000, 5924], -[441300, 5925], -[441600, 5926], -[441900, 5927], -[442200, 5928], -[442500, 5929], -[442800, 5930], -[443100, 5931], -[443400, 5932], -[443700, 5933], -[444000, 5934], -[444300, 5935], -[444600, 5936], -[444900, 5937], -[445200, 5938], -[445500, 5939], -[445800, 5940], -[446100, 5941], -[446400, 5942], -[446700, 5943], -[447000, 5944], -[447300, 5945], -[447600, 5946], -[447900, 5947], -[448200, 5948], -[448500, 5949], -[448800, 5950], -[449100, 5951], -[449400, 5952], -[449700, 5953], -[450000, 5954], -[450300, 5955], -[450600, 5956], -[450900, 5957], -[451200, 5958], -[451500, 5959], -[451800, 5960], -[452100, 5961], -[452400, 5962], -[452700, 5963], -[453000, 5964], -[453300, 5965], -[453600, 5966], -[453900, 5967], -[454200, 5968], -[454500, 5969], -[454800, 5970], -[455100, 5971], -[455400, 5972], -[455700, 5973], -[456000, 5974], -[456300, 5975], -[456600, 5976], -[456900, 5977], -[457200, 5978], -[457500, 5979], -[457800, 5980], -[458100, 5981], -[458400, 5982], -[458700, 5983], -[459000, 5984], -[459300, 5985], -[459600, 5986], -[459900, 5987], -[460200, 5988], -[460500, 5989], -[460800, 5990], -[461100, 5991], -[461400, 5992], -[461700, 5993], -[462000, 5994], -[462300, 5995], -[462600, 5996], -[462900, 5997], -[463200, 5998], -[463500, 5999], -[463800, 6000] +[600, 200], +[900, 400], +[1200, 600], +[1500, 800], +[1800, 1000], +[2100, 1200], +[2400, 1320], +[2700, 1440], +[3000, 1560], +[3300, 1680], +[3600, 1800], +[3900, 1920], +[4200, 2040], +[4500, 2190], +[4800, 2340], +[5100, 2490], +[5400, 2640], +[5700, 2790], +[6000, 2940], +[6300, 3090], +[6600, 3240], +[6900, 3390], +[7200, 3540], +[7500, 3690], +[7800, 3840], +[8100, 3990], +[8400, 4140], +[8700, 4240], +[9000, 4340], +[9300, 4440], +[9600, 4540], +[9900, 4640], +[10200, 4740], +[10500, 4840], +[10800, 4940], +[11100, 5040], +[11400, 5140], +[11700, 5240], +[12000, 5340], +[12300, 5440], +[12600, 5540], +[12900, 5640], +[13200, 5740], +[13500, 5840], +[13800, 5940], +[14100, 6000], +[14400, 5900], +[14700, 5800], +[15000, 5700], +[15300, 5600], +[15600, 5500], +[15900, 5400], +[16200, 5300], +[16500, 5200], +[16800, 5100], +[17100, 5000], +[17400, 4900], +[17700, 4800], +[18000, 4700], +[18300, 4600], +[18600, 4500], +[18900, 4400], +[19200, 4300], +[19500, 4200], +[19800, 4100], +[20100, 4000], +[20400, 3850], +[20700, 3700], +[21000, 3550], +[21300, 3400], +[21600, 3250], +[21900, 3100], +[22200, 2950], +[22500, 2800], +[22800, 2650], +[23100, 2500], +[23400, 2350], +[23700, 2200], +[24000, 2050], +[24300, 1900], +[24600, 1780], +[24900, 1660], +[25200, 1540], +[25500, 1420], +[25800, 1300], +[26100, 1180], +[26400, 1060], +[26700, 940], +[27000, 740], +[27300, 540], +[27600, 340], +[27900, 140], +[28200, 0], + ] }], diff --git a/linz/glasslathe/src/main.cpp b/linz/glasslathe/src/main.cpp index ee1e8d4..801d02e 100644 --- a/linz/glasslathe/src/main.cpp +++ b/linz/glasslathe/src/main.cpp @@ -80,7 +80,7 @@ void loop() Serial.println(target.frequency, DEC); } - const int step_delay = 300; + const int step_delay = 200; if (current.frequency != target.frequency || current.direction != target.direction) { if (!timer_enabled && target.frequency != 0) @@ -91,18 +91,12 @@ void loop() delay(step_delay); } - /*int step = (current.potValue < 20) ? 1 - : (current.potValue < 100) ? 2 - : (current.potValue < 300) ? 3 - : (current.potValue < 400) ? 5 - : (current.potValue < 500) ? 10 - : 20;*/ - int step = (current.frequency > 5000) ? 1 - : (current.frequency > 4500) ? 2 - : (current.frequency > 4000) ? 5 - : (current.frequency > 3000) ? 10 - : (current.frequency > 1000) ? 25 - : 50; + int step = (current.frequency > 5000) ? 100 + : (current.frequency > 4000) ? 100 + : (current.frequency > 3000) ? 150 + : (current.frequency > 2000) ? 150 + : (current.frequency > 1000) ? 120 + : 200; int frequency = (current.direction == target.direction) ? target.frequency : 0; step = min(abs(frequency - current.frequency), step); if (frequency < current.frequency) -- cgit v1.2.3